1 | %'set_object': GUI to edit a projection object |
---|
2 | %------------------------------------------------------------------------ |
---|
3 | % function hset_object= set_object(data, PlotHandles,ZBounds) |
---|
4 | % associated with the GUI set_object.fig |
---|
5 | % |
---|
6 | % OUTPUT: |
---|
7 | % hset_object: handle of the GUI figure |
---|
8 | % |
---|
9 | % INPUT: |
---|
10 | % data: structure describing the object properties |
---|
11 | % .Style=... |
---|
12 | % .ProjMode |
---|
13 | % .CoordType: 'phys' or 'px' |
---|
14 | % .DX,.DY,.DZ : mesh along each dirction |
---|
15 | % .RangeX, RangeY |
---|
16 | % .Coord(j,i), i=1, 2, 3, components x, y, z of j=1...n position(s) characterizing the object components |
---|
17 | % PlotHandles: handles for projection plots NO MORE USED |
---|
18 | % Zbounds: bounds on Z ( 3D case) |
---|
19 | % |
---|
20 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
21 | % Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org. |
---|
22 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
23 | % This file is part of the toolbox UVMAT. |
---|
24 | % |
---|
25 | % UVMAT is free software; you can redistribute it and/or modify |
---|
26 | % it under the terms of the GNU General Public License as published by |
---|
27 | % the Free Software Foundation; either version 2 of the License, or |
---|
28 | % (at your option) any later version. |
---|
29 | % |
---|
30 | % UVMAT is distributed in the hope that it will be useful, |
---|
31 | % but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
32 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
33 | % GNU General Public License (file UVMAT/COPYING.txt) for more details. |
---|
34 | %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
---|
35 | |
---|
36 | function varargout = set_object(varargin) |
---|
37 | |
---|
38 | % Last Modified by GUIDE v2.5 24-Nov-2008 14:29:06 |
---|
39 | |
---|
40 | % Begin initialization code - DO NOT PLOT |
---|
41 | gui_Singleton = 1; |
---|
42 | gui_State = struct('gui_Name', mfilename, ... |
---|
43 | 'gui_Singleton', gui_Singleton, ... |
---|
44 | 'gui_OpeningFcn', @set_object_OpeningFcn, ... |
---|
45 | 'gui_OutputFcn', @set_object_OutputFcn, ... |
---|
46 | 'gui_LayoutFcn', [] , ... |
---|
47 | 'gui_Callback', []); |
---|
48 | if nargin & ischar(varargin{1}) |
---|
49 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
50 | end |
---|
51 | |
---|
52 | if nargout |
---|
53 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
54 | else |
---|
55 | gui_mainfcn(gui_State, varargin{:}); |
---|
56 | end |
---|
57 | % End initialization code - DO NOT PLOT |
---|
58 | %------------------------------------------------------------------------ |
---|
59 | %------------------------------------------------------------------------ |
---|
60 | % --- Executes just before set_object is made visible. |
---|
61 | %INPUT: |
---|
62 | % handles: handles of the set_object interface elements |
---|
63 | %'IndexObj': NON USED ANYMORE (To suppress) index of the object (on the UvData list) that set_object will modify |
---|
64 | % if =[] or absent: index still undefined (create mode in uvmat) |
---|
65 | % if=0; no associated object (used for series), the button 'PLOT' is then unvisible |
---|
66 | %'data': read from an existing object selected in the interface |
---|
67 | % .TITLE : class of object ('POINTS','LINE',....) |
---|
68 | % .DX,DY,DZ; meshes for regular grids |
---|
69 | % .Coord: object position coordinates |
---|
70 | % .ParentButton: handle of the uicontrol object calling the interface |
---|
71 | % PlotHandles: set of handles of the elements contolling the plotting of the projected field: |
---|
72 | % if =[] or absent, no plot (mask mode in uvmat) |
---|
73 | % parameters on the uvmat interface (obtained by 'get_plot_handle.m') |
---|
74 | function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds) |
---|
75 | %------------------------------------------------------------------- |
---|
76 | % Choose default command line output for set_object |
---|
77 | handles.output = hObject; |
---|
78 | % Update handles structure |
---|
79 | guidata(hObject, handles); |
---|
80 | |
---|
81 | %default |
---|
82 | if ~exist('ZBounds','var') |
---|
83 | ZBounds=0; %default |
---|
84 | end |
---|
85 | set(hObject,'KeyPressFcn',{'keyboard_callback',handles})%set keyboard action function (allow action on uvmat when set_object is in front) |
---|
86 | set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function |
---|
87 | enable_plot=0;%default: does not allow plot of object and projection |
---|
88 | |
---|
89 | % fill the interface as set in the input data: |
---|
90 | if exist('data','var') |
---|
91 | if isfield(data,'enable_plot') |
---|
92 | enable_plot=data.enable_plot;%test to desable button PLOT (display mode) |
---|
93 | end |
---|
94 | if isfield(data,'Name') |
---|
95 | set(handles.TITLE,'String',data.Name) |
---|
96 | end |
---|
97 | if ~isfield(data,'NbDim')||~isequal(data.NbDim,3)%2D case |
---|
98 | set(handles.ZObject,'Visible','off') |
---|
99 | set(handles.z_slider,'Visible','off') |
---|
100 | else |
---|
101 | set(handles.ZObject,'Visible','on') |
---|
102 | set(handles.z_slider,'Visible','on') |
---|
103 | if isfield(data,'Coord') && size(data.Coord,2)==3 |
---|
104 | set(handles.ZObject,'String',num2str(data.Coord(1,3),4)) |
---|
105 | end |
---|
106 | end |
---|
107 | if isfield(data,'StyleMenu') |
---|
108 | set(handles.ObjectStyle,'String',data.StyleMenu); |
---|
109 | end |
---|
110 | if isfield(data,'Style') |
---|
111 | menu=get(handles.ObjectStyle,'String'); |
---|
112 | for iline=1:length(menu) |
---|
113 | if isequal(menu{iline},data.Style) |
---|
114 | set(handles.ObjectStyle,'Value',iline) |
---|
115 | break |
---|
116 | end |
---|
117 | end |
---|
118 | end |
---|
119 | ObjectStyle_Callback(hObject, eventdata, handles) |
---|
120 | if isfield(data,'ProjMenu') |
---|
121 | set(handles.ProjMode,'String',data.ProjMenu);%overset the standard menu |
---|
122 | end |
---|
123 | if isfield(data,'ProjMode') |
---|
124 | menu=get(handles.ProjMode,'String'); |
---|
125 | for iline=1:length(menu) |
---|
126 | if isequal(menu{iline},data.ProjMode) |
---|
127 | set(handles.ProjMode,'Value',iline) |
---|
128 | break |
---|
129 | end |
---|
130 | end |
---|
131 | end |
---|
132 | ProjMode_Callback(hObject, eventdata, handles) |
---|
133 | if isfield(data,'Coord') |
---|
134 | if ischar(data.Coord) |
---|
135 | data.Coord=str2num(data.Coord); |
---|
136 | elseif iscell(data.Coord) |
---|
137 | CoordCell=data.Coord; |
---|
138 | data.Coord=zeros(numel(CoordCell),3); |
---|
139 | data.Coord(:,3)=zeros(numel(CoordCell),1); % z component set to 0 by default |
---|
140 | for iline=1:numel(CoordCell) |
---|
141 | line_vec=str2num(CoordCell{iline}); |
---|
142 | if numel(line_vec)==2 |
---|
143 | data.Coord(iline,1:2)=str2num(CoordCell{iline}); |
---|
144 | else |
---|
145 | data.Coord(iline,:)=str2num(CoordCell{iline}); |
---|
146 | end |
---|
147 | end |
---|
148 | end |
---|
149 | if size(data.Coord,2)>=2 |
---|
150 | sizcoord=size(data.Coord); |
---|
151 | for i=1:sizcoord(1) |
---|
152 | XObject{i}=num2str(data.Coord(i,1),4); |
---|
153 | YObject{i}=num2str(data.Coord(i,2),4); |
---|
154 | end |
---|
155 | set(handles.XObject,'String',XObject) |
---|
156 | set(handles.YObject,'String',YObject) |
---|
157 | if sizcoord(2)>3 |
---|
158 | for i=1:sizcoord(1) |
---|
159 | ZObject{i}=num2str(data.Coord(i,3),4); |
---|
160 | end |
---|
161 | set(handles.ZObject,'String',ZObject) |
---|
162 | end |
---|
163 | end |
---|
164 | end |
---|
165 | if isfield(data,'DX') |
---|
166 | if ~ischar(handles.DX) |
---|
167 | data.DX=num2str(data.DX,3); |
---|
168 | end |
---|
169 | set(handles.DX,'String',data.DX) |
---|
170 | end |
---|
171 | if isfield(data,'DY') |
---|
172 | if ~ischar(handles.DY) |
---|
173 | data.DY=num2str(data.DY,3); |
---|
174 | end |
---|
175 | set(handles.DY,'String',data.DX) |
---|
176 | end |
---|
177 | if isfield(data,'RangeZ') && length(ZBounds) >= 2 |
---|
178 | set(handles.ZMax,'String',num2str(max(data.RangeZ),3)) |
---|
179 | DZ=max(data.RangeZ);%slider step |
---|
180 | if ~isnan(ZBounds(1)) && ZBounds(2)~=ZBounds(1) |
---|
181 | rel_step(1)=min(DZ/(ZBounds(2)-ZBounds(1)),0.2);%must be smaller than 1 |
---|
182 | rel_step(2)=0.1; |
---|
183 | set(handles.z_slider,'Visible','on') |
---|
184 | set(handles.z_slider,'Min',ZBounds(1)) |
---|
185 | set(handles.z_slider,'Max',ZBounds(2)) |
---|
186 | set(handles.z_slider,'SliderStep',rel_step) |
---|
187 | set(handles.z_slider,'Value',(ZBounds(1)+ZBounds(2))/2) |
---|
188 | end |
---|
189 | end |
---|
190 | if isfield(data,'RangeX') |
---|
191 | if ischar(data.RangeX) |
---|
192 | data.RangeX=str2num(data.RangeX); |
---|
193 | end |
---|
194 | set(handles.XMax,'String',num2str(max(data.RangeX),3)) |
---|
195 | set(handles.XMin,'String',num2str(min(data.RangeX),3)) |
---|
196 | end |
---|
197 | if isfield(data,'RangeY') |
---|
198 | if ischar(data.RangeY) |
---|
199 | data.RangeY=str2num(data.RangeY); |
---|
200 | end |
---|
201 | set(handles.YMax,'String',num2str(max(data.RangeY),3)) |
---|
202 | set(handles.YMin,'String',num2str(min(data.RangeY),3)) |
---|
203 | end |
---|
204 | if isfield(data,'RangeZ') |
---|
205 | if ischar(data.RangeZ) |
---|
206 | data.RangeZ=str2num(data.RangeZ); |
---|
207 | end |
---|
208 | set(handles.ZMax,'String',num2str(max(data.RangeZ),3)) |
---|
209 | if numel(data.RangeZ)>=2 |
---|
210 | set(handles.ZMin,'String',num2str(min(data.RangeZ),3)) |
---|
211 | end |
---|
212 | end |
---|
213 | if isfield(data,'Angle') && isequal(numel(data.Angle),3) |
---|
214 | set(handles.Phi,'String',num2str(data.Angle(1))) |
---|
215 | set(handles.Theta,'String',num2str(data.Angle(2))) |
---|
216 | set(handles.Psi,'String',num2str(data.Angle(3))) |
---|
217 | end |
---|
218 | if isfield(data,'DZ') |
---|
219 | if ~ischar(handles.DZ) |
---|
220 | data.DY=num2str(data.DZ,3); |
---|
221 | end |
---|
222 | set(handles.DZ,'String',data.DZ) |
---|
223 | end |
---|
224 | if isfield(data,'CoordUnit') |
---|
225 | set(handles.CoordUnit,'String',data.CoordUnit) |
---|
226 | end |
---|
227 | end |
---|
228 | if enable_plot |
---|
229 | set(handles.PLOT,'enable','on') |
---|
230 | else |
---|
231 | set(handles.PLOT,'enable','off') |
---|
232 | end |
---|
233 | huvmat=findobj(allchild(0),'tag','uvmat'); |
---|
234 | UvData=get(huvmat,'UserData'); |
---|
235 | pos_uvmat=get(huvmat,'Position'); |
---|
236 | %position the set_object GUI with respect to uvmat |
---|
237 | if isfield(UvData,'SetObjectOrigin') |
---|
238 | pos_set_object(1:2)=UvData.SetObjectOrigin + pos_uvmat(1:2); |
---|
239 | pos_set_object(3:4)=UvData.SetObjectSize .* pos_uvmat(3:4); |
---|
240 | set(hObject,'Position',pos_set_object) |
---|
241 | end |
---|
242 | |
---|
243 | %------------------------------------------------------------------------ |
---|
244 | % --- Outputs from this function are returned to the command line. |
---|
245 | function varargout = set_object_OutputFcn(hObject, eventdata, handles) |
---|
246 | %------------------------------------------------------------------------ |
---|
247 | % Get default command line output from handles structure |
---|
248 | varargout{1} = handles.output; |
---|
249 | varargout{2}=handles; |
---|
250 | |
---|
251 | %------------------------------------------------------------------------ |
---|
252 | % --- Executes on selection change in ObjectStyle. |
---|
253 | function ObjectStyle_Callback(hObject, eventdata, handles) |
---|
254 | %------------------------------------------------------------------------ |
---|
255 | style_prev=get(handles.ObjectStyle,'UserData');%previous object style |
---|
256 | str=get(handles.ObjectStyle,'String'); |
---|
257 | val=get(handles.ObjectStyle,'Value'); |
---|
258 | style=str{val}; |
---|
259 | % make correspondance between different object styles |
---|
260 | Xcolumn=get(handles.XObject,'String'); |
---|
261 | Ycolumn=get(handles.YObject,'String'); |
---|
262 | if ischar(Xcolumn) |
---|
263 | sizchar=size(Xcolumn); |
---|
264 | for icol=1:sizchar(1) |
---|
265 | Xcolumn_cell{icol}=Xcolumn(icol,:); |
---|
266 | end |
---|
267 | Xcolumn=Xcolumn_cell; |
---|
268 | end |
---|
269 | if ischar(Ycolumn) |
---|
270 | sizchar=size(Ycolumn); |
---|
271 | for icol=1:sizchar(1) |
---|
272 | Ycolumn_cell{icol}=Ycolumn(icol,:); |
---|
273 | end |
---|
274 | Ycolumn=Ycolumn_cell; |
---|
275 | end |
---|
276 | Zcolumn={};%default |
---|
277 | z_new={}; |
---|
278 | if isequal(get(handles.ZObject,'Visible'),'on') |
---|
279 | %data.NbDim=3; %test 3D object |
---|
280 | Zcolumn=get(handles.ZObject,'String'); |
---|
281 | if ischar(Zcolumn) |
---|
282 | Zcolumn={Zcolumn}; |
---|
283 | end |
---|
284 | end |
---|
285 | x_new{1}=Xcolumn{1}; |
---|
286 | y_new{1}=Ycolumn{1}; |
---|
287 | if ~isempty(Zcolumn) |
---|
288 | z_new{1}=Zcolumn{1}; |
---|
289 | end |
---|
290 | if isequal(style,'line') |
---|
291 | if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse') |
---|
292 | XMax=get(handles.XMax,'String'); |
---|
293 | YMax=get(handles.YMax,'String'); |
---|
294 | x_new{2}=num2str(XMax,4); |
---|
295 | y_new{2}=num2str(YMax,4); |
---|
296 | set(handles.XObject,'String',x_new) |
---|
297 | set(handles.YObject,'String',y_new) |
---|
298 | set(handles.ZObject,'String',z_new) |
---|
299 | end |
---|
300 | elseif isequal(style,'polyline') |
---|
301 | elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse') |
---|
302 | set(handles.XObject,'String',x_new) |
---|
303 | set(handles.YObject,'String',y_new) |
---|
304 | set(handles.ZObject,'String',z_new) |
---|
305 | end |
---|
306 | |
---|
307 | switch style |
---|
308 | case {'points','line','polyline','plane'} |
---|
309 | menu_proj={'projection';'interp';'filter';'none'}; |
---|
310 | case {'polygon','rectangle','ellipse'} |
---|
311 | menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; |
---|
312 | case 'volume' |
---|
313 | menu_proj={'interp';'none'}; |
---|
314 | end |
---|
315 | proj_index=get(handles.ProjMode,'Value'); |
---|
316 | if proj_index<numel(menu_proj) |
---|
317 | set(handles.ProjMode,'Value',1);% value index must not exceed the menu length |
---|
318 | end |
---|
319 | set(handles.ProjMode,'String',menu_proj) |
---|
320 | ProjMode_Callback(hObject, eventdata, handles) |
---|
321 | %store the current option |
---|
322 | str=get(handles.ObjectStyle,'String'); |
---|
323 | val=get(handles.ObjectStyle,'Value'); |
---|
324 | set(handles.ObjectStyle,'UserData',style) |
---|
325 | |
---|
326 | %------------------------------------------------------------------------ |
---|
327 | function xObject_Callback(hObject, eventdata, handles) |
---|
328 | |
---|
329 | %------------------------------------------------------------------------ |
---|
330 | function yObject_Callback(hObject, eventdata, handles) |
---|
331 | |
---|
332 | %------------------------------------------------------------------------ |
---|
333 | % --- Executes on selection change in zObject. |
---|
334 | function zObject_Callback(hObject, eventdata, handles) |
---|
335 | %------------------------------------------------------------------------ |
---|
336 | |
---|
337 | %------------------------------------------------------------------------ |
---|
338 | % --- Executes on selection change in ProjMode. |
---|
339 | function ProjMode_Callback(hObject, eventdata, handles) |
---|
340 | menu=get(handles.ProjMode,'String'); |
---|
341 | value=get(handles.ProjMode,'Value'); |
---|
342 | ProjMode=menu{value}; |
---|
343 | menu=get(handles.ObjectStyle,'String'); |
---|
344 | value=get(handles.ObjectStyle,'Value'); |
---|
345 | ObjectStyle=menu{value}; |
---|
346 | test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case |
---|
347 | |
---|
348 | %default setting |
---|
349 | set(handles.Phi,'Visible','off') |
---|
350 | set(handles.Theta,'Visible','off') |
---|
351 | set(handles.Psi,'Visible','off') |
---|
352 | set(handles.XMin,'Visible','off') |
---|
353 | set(handles.XMax,'Visible','off') |
---|
354 | set(handles.YMin,'Visible','off') |
---|
355 | if isequal(ProjMode,'interp') |
---|
356 | set(handles.YMax,'Visible','off') |
---|
357 | else |
---|
358 | set(handles.YMax,'Visible','on') |
---|
359 | end |
---|
360 | if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse') |
---|
361 | set(handles.XMax,'Visible','on') |
---|
362 | else |
---|
363 | set(handles.XMax,'Visible','off') |
---|
364 | end |
---|
365 | set(handles.ZMin,'Visible','off') |
---|
366 | set(handles.ZMax,'Visible','off') |
---|
367 | set(handles.DX,'Visible','off') |
---|
368 | set(handles.DY,'Visible','off') |
---|
369 | set(handles.DZ,'Visible','off') |
---|
370 | |
---|
371 | switch ObjectStyle |
---|
372 | case 'points' |
---|
373 | set(handles.YMax,'TooltipString','YMax: range of averaging around each point') |
---|
374 | set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points') |
---|
375 | set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points') |
---|
376 | set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points') |
---|
377 | case {'line','polyline','polygon'} |
---|
378 | set(handles.YMax,'TooltipString','YMax: range of averaging around the line') |
---|
379 | set(handles.XObject,'TooltipString','XObject: set of x coordinates defining the line') |
---|
380 | set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line') |
---|
381 | set(handles.ZObject,'TooltipString','ZObject: set of z coordinates defining the line') |
---|
382 | if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter') |
---|
383 | set(handles.DX,'Visible','on') |
---|
384 | set(handles.DX,'TooltipString','DX: mesh for the interpolated field along the line') |
---|
385 | end |
---|
386 | case {'rectangle','ellipse'} |
---|
387 | set(handles.XMax,'TooltipString',['XMax: half length of the ' ObjectStyle]) |
---|
388 | set(handles.YMax,'TooltipString',['YMax: half width of the ' ObjectStyle]) |
---|
389 | set(handles.XObject,'TooltipString',['XObject: x coordinate of the ' ObjectStyle ' centre']) |
---|
390 | set(handles.YObject,'TooltipString',['YObject: y coordinate of the ' ObjectStyle ' centre']) |
---|
391 | case {'plane'} |
---|
392 | set(handles.Psi,'Visible','on') |
---|
393 | set(handles.XMin,'Visible','on') |
---|
394 | set(handles.XMax,'Visible','on') |
---|
395 | set(handles.YMin,'Visible','on') |
---|
396 | set(handles.YMax,'Visible','on') |
---|
397 | set(handles.XObject,'TooltipString',['XObject: x coordinate of the axis origin for the ' ObjectStyle]) |
---|
398 | set(handles.YObject,'TooltipString',['YObject: y coordinate of the axis origin for the ' ObjectStyle]) |
---|
399 | set(handles.ZMax,'TooltipString','ZMax: range of projection normal to the plane') |
---|
400 | if test3D |
---|
401 | set(handles.Theta,'Visible','on') |
---|
402 | set(handles.Phi,'Visible','on') |
---|
403 | set(handles.ZMax,'Visible','on') |
---|
404 | end |
---|
405 | if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter') |
---|
406 | set(handles.DX,'Visible','on') |
---|
407 | set(handles.DY,'Visible','on') |
---|
408 | else |
---|
409 | set(handles.DX,'Visible','off') |
---|
410 | set(handles.DY,'Visible','off') |
---|
411 | end |
---|
412 | if isequal(ProjMode,'interp') |
---|
413 | set(handles.DZ,'Visible','on') |
---|
414 | end |
---|
415 | case {'volume'} |
---|
416 | set(handles.XMin,'Visible','on') |
---|
417 | set(handles.XMax,'Visible','on') |
---|
418 | set(handles.YMin,'Visible','on') |
---|
419 | set(handles.YMax,'Visible','on') |
---|
420 | set(handles.XObject,'TooltipString',['XObject: x coordinate of the axis origin for the ' ObjectStyle]) |
---|
421 | set(handles.YObject,'TooltipString',['YObject: y coordinate of the axis origin for the ' ObjectStyle]) |
---|
422 | set(handles.Phi,'Visible','on') |
---|
423 | set(handles.Theta,'Visible','on') |
---|
424 | set(handles.Psi,'Visible','on') |
---|
425 | set(handles.ZMin,'Visible','on') |
---|
426 | set(handles.ZMax,'Visible','on') |
---|
427 | if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter') |
---|
428 | set(handles.DX,'Visible','on') |
---|
429 | set(handles.DY,'Visible','on') |
---|
430 | set(handles.DZ,'Visible','on') |
---|
431 | else |
---|
432 | set(handles.DX,'Visible','off') |
---|
433 | set(handles.DY,'Visible','off') |
---|
434 | set(handles.DZ,'Visible','off') |
---|
435 | end |
---|
436 | end |
---|
437 | %------------------------------------------------------------------------ |
---|
438 | |
---|
439 | %------------------------------------------------------------------------ |
---|
440 | function Phi_Callback(hObject, eventdata, handles) |
---|
441 | update_slider(hObject, eventdata,handles) |
---|
442 | %------------------------------------------------------------------------ |
---|
443 | %------------------------------------------------------------------------ |
---|
444 | function Theta_Callback(hObject, eventdata, handles) |
---|
445 | update_slider(hObject, eventdata,handles) |
---|
446 | %------------------------------------------------------------------------ |
---|
447 | function update_slider(hObject, eventdata,handles) |
---|
448 | %rotation angles |
---|
449 | PlaneAngle(1)=str2num(get(handles.Phi,'String'));%first angle in degrees |
---|
450 | PlaneAngle(2)=str2num(get(handles.Theta,'String'));%second angle in degrees |
---|
451 | PlaneAngle(3)=str2num(get(handles.Psi,'String'));%second angle in degrees |
---|
452 | om=norm(PlaneAngle);%norm of rotation angle in radians |
---|
453 | OmAxis=PlaneAngle/om; %unit vector marking the rotation axis |
---|
454 | cos_om=cos(pi*om/180); |
---|
455 | sin_om=sin(pi*om/180); |
---|
456 | coeff=OmAxis(3)*(1-cos_om); |
---|
457 | %components of the unity vector norm_plane normal to the projection plane |
---|
458 | norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; |
---|
459 | norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; |
---|
460 | norm_plane(3)=OmAxis(3)*coeff+cos_om; |
---|
461 | huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle |
---|
462 | UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface |
---|
463 | if isfield(UvData,'X') & isfield(UvData,'Y') & isfield(UvData,'Z') |
---|
464 | Z=norm_plane(1)*(UvData.X)+norm_plane(2)*(UvData.Y)+norm_plane(3)*(UvData.Z); |
---|
465 | set(handles.z_slider,'Min',min(Z)) |
---|
466 | set(handles.z_slider,'Max',max(Z)) |
---|
467 | ZMax_Callback(hObject, eventdata, handles) |
---|
468 | end |
---|
469 | %------------------------------------------------------------------------ |
---|
470 | function DX_Callback(hObject, eventdata, handles) |
---|
471 | %------------------------------------------------------------------------ |
---|
472 | %------------------------------------------------------------------------ |
---|
473 | function DY_Callback(hObject, eventdata, handles) |
---|
474 | %------------------------------------------------------------------------ |
---|
475 | %------------------------------------------------------------------------ |
---|
476 | function DZ_Callback(hObject, eventdata, handles) |
---|
477 | %------------------------------------------------------------------------ |
---|
478 | |
---|
479 | %------------------------------------------------------------------------ |
---|
480 | %----------------------------------------------------- |
---|
481 | % --- Executes on button press in OPEN: DESACTIVATED use uvmat browser |
---|
482 | function OPEN_Callback(hObject, eventdata, handles) |
---|
483 | %get the object file |
---|
484 | oldfile=' '; |
---|
485 | huvmat=findobj('Tag','uvmat'); |
---|
486 | hchild=get(huvmat,'Children'); |
---|
487 | hrootpath=findobj(hchild,'Tag','RootPath'); |
---|
488 | if ~isempty(hrootpath) |
---|
489 | oldfile=get(hrootpath,'String'); |
---|
490 | if iscell(oldfile) |
---|
491 | oldfile=oldfile{1}; |
---|
492 | end |
---|
493 | end |
---|
494 | [FileName, PathName, filterindex] = uigetfile( ... |
---|
495 | {'*.xml;*.mat', ' (*.xml,*.mat)'; |
---|
496 | '*.xml', '.xml files '; ... |
---|
497 | '*.mat', '.mat matlab files '}, ... |
---|
498 | 'Pick a file',oldfile); |
---|
499 | fileinput=[PathName FileName];%complete file name |
---|
500 | testblank=findstr(fileinput,' ');%look for blanks |
---|
501 | if ~isempty(testblank) |
---|
502 | msgbox_uvmat('ERROR','forbidden input file name: contain blanks') |
---|
503 | return |
---|
504 | end |
---|
505 | sizf=size(fileinput); |
---|
506 | if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end |
---|
507 | |
---|
508 | %read the file |
---|
509 | t=xmltree(fileinput); |
---|
510 | s=convert(t); |
---|
511 | if ~isfield(s,'Style') |
---|
512 | s.Style='points'; |
---|
513 | end |
---|
514 | if ~isfield(s,'ProjMode') |
---|
515 | s.ProjMode='none'; |
---|
516 | end |
---|
517 | teststyle=0; |
---|
518 | |
---|
519 | switch s.Style |
---|
520 | case {'points','line','polyline','plane'} |
---|
521 | menu_proj={'projection';'interp';'filter';'none'}; |
---|
522 | case {'polygon','rectangle','ellipse'} |
---|
523 | menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; |
---|
524 | case 'volume' |
---|
525 | menu_proj={'none'}; |
---|
526 | end |
---|
527 | set(handles.ObjectStyle,'String',menu_proj) |
---|
528 | menu=get(handles.ObjectStyle,'String'); |
---|
529 | for iline=1:length(menu) |
---|
530 | if isequal(menu{iline},s.Style) |
---|
531 | set(handles.ObjectStyle,'Value',iline) |
---|
532 | teststyle=1; |
---|
533 | break |
---|
534 | end |
---|
535 | end |
---|
536 | testmode=0; |
---|
537 | %menu=get(handles.ProjMode,'String'); |
---|
538 | for iline=1:length(menu_proj) |
---|
539 | if isequal(menu_proj{iline},s.ProjMode) |
---|
540 | set(handles.ProjMode,'Value',iline) |
---|
541 | testmode=1; |
---|
542 | break |
---|
543 | end |
---|
544 | end |
---|
545 | |
---|
546 | ProjMode_Callback(hObject, eventdata, handles);%visualize the appropriate edit boxes |
---|
547 | if isfield(s,'XMax') |
---|
548 | set(handles.XMax,'String',s.XMax) |
---|
549 | end |
---|
550 | if isfield(s,'XMin') |
---|
551 | set(handles.XMin,'String',s.XMin) |
---|
552 | end |
---|
553 | if isfield(s,'YMax') |
---|
554 | set(handles.YMax,'String',s.YMax) |
---|
555 | end |
---|
556 | if isfield(s,'YMin') |
---|
557 | set(handles.YMin,'String',s.YMin) |
---|
558 | end |
---|
559 | Range=0; |
---|
560 | if isfield(s,'Range') |
---|
561 | if ischar(s.Range) |
---|
562 | Range=str2num(s.Range); |
---|
563 | else |
---|
564 | Range(1,:)=str2num(s.Range{1}); |
---|
565 | Range(2,:)=str2num(s.Range{2}); |
---|
566 | end |
---|
567 | end |
---|
568 | if size(Range,2)>=3 |
---|
569 | if size(Range,1)>=2 |
---|
570 | set(handles.ZMin,'String',num2str(Range(2,3),3)) |
---|
571 | end |
---|
572 | if size(Range,1)>=2 |
---|
573 | set(handles.ZMax,'String',num2str(Range(1,3),3)) |
---|
574 | end |
---|
575 | end |
---|
576 | if size(Range,2)>=2 |
---|
577 | if size(Range,1)>=2 |
---|
578 | set(handles.YMin,'String',num2str(Range(2,2),3)) |
---|
579 | end |
---|
580 | if size(Range,1)>=2 |
---|
581 | set(handles.YMax,'String',num2str(Range(1,2),3)) |
---|
582 | end |
---|
583 | end |
---|
584 | if size(Range,2)>=1 |
---|
585 | if size(Range,1)>=2 |
---|
586 | set(handles.XMin,'String',num2str(Range(2,1),3)) |
---|
587 | end |
---|
588 | if size(Range,1)>=2 |
---|
589 | set(handles.XMax,'String',num2str(Range(1,1),3)) |
---|
590 | end |
---|
591 | end |
---|
592 | if isfield(s,'RangeX') & ischar(s.RangeX) |
---|
593 | RangeX=str2num(s.RangeX); |
---|
594 | set(handles.XMax,'String',num2str(max(RangeX),3)) |
---|
595 | set(handles.XMin,'String',num2str(min(RangeX),3)) |
---|
596 | end |
---|
597 | |
---|
598 | if isfield(s,'RangeY') |
---|
599 | if ischar(s.RangeY) |
---|
600 | RangeY=str2num(s.RangeY); |
---|
601 | set(handles.YMax,'String',num2str(max(RangeY),3)) |
---|
602 | set(handles.YMin,'String',num2str(min(RangeY),3)) |
---|
603 | end |
---|
604 | end |
---|
605 | if isfield(s,'RangeZ') |
---|
606 | if ischar(s.RangeZ) |
---|
607 | RangeZ=str2num(s.RangeZ); |
---|
608 | set(handles.ZMax,'String',num2str(max(RangeZ),3)) |
---|
609 | set(handles.ZMin,'String',num2str(min(RangeZ),3)) |
---|
610 | end |
---|
611 | end |
---|
612 | if isfield(s,'Phi') |
---|
613 | set(handles.Psi,'String',s.Phi)%old definition |
---|
614 | end |
---|
615 | if isfield(s,'Angle')&& isequal(numel(s.Angle),3) |
---|
616 | set(handles.Phi,'String',s.Angle(1)) |
---|
617 | set(handles.Theta,'String',s.Angle(2)) |
---|
618 | set(handles.Psi,'String',s.Angle(3)) |
---|
619 | end |
---|
620 | % if isfield(s,'Psi') |
---|
621 | % set(handles.Psi,'String',s.Psi) |
---|
622 | % end |
---|
623 | |
---|
624 | if isfield(s,'DX') |
---|
625 | set(handles.DX,'String',s.DX) |
---|
626 | end |
---|
627 | if isfield(s,'DY') |
---|
628 | set(handles.DY,'String',s.DY) |
---|
629 | end |
---|
630 | if ~isfield(s,'Coord') |
---|
631 | XObject='0';%default |
---|
632 | YObject='0'; |
---|
633 | elseif ischar(s.Coord) |
---|
634 | line=str2num(s.Coord); |
---|
635 | XObject=num2str(line(1),4); |
---|
636 | YObject=num2str(line(2),4); |
---|
637 | else |
---|
638 | for i=1:length(s.Coord) |
---|
639 | line=str2num(s.Coord{i}); |
---|
640 | XObject{i}=num2str(line(1),4); |
---|
641 | YObject{i}=num2str(line(2),4); |
---|
642 | end |
---|
643 | end |
---|
644 | set(handles.XObject,'String',XObject) |
---|
645 | set(handles.YObject,'String',YObject) |
---|
646 | |
---|
647 | %METTRA A JOUR ASPECT DE L'INTERFACE (COMME set_object_Opening |
---|
648 | %------------------------------------------------------------------------ |
---|
649 | %---------------------------------------------------- |
---|
650 | % executed when closing: set the parent interface button to value 0 |
---|
651 | function closefcn(gcbo,eventdata,parent_button) |
---|
652 | huvmat=findobj(allchild(0),'Name','uvmat');%find the current uvmat interface handle |
---|
653 | if ~isempty(huvmat) |
---|
654 | hhuvmat=guidata(huvmat); |
---|
655 | set(hhuvmat.edit,'Value',0) |
---|
656 | set(hhuvmat.edit,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree |
---|
657 | end |
---|
658 | hseries=findobj(allchild(0),'Name','series');%find the current series interface handle |
---|
659 | if ~isempty(hseries) |
---|
660 | hhseries=guidata(hseries); |
---|
661 | set(hhseries.GetObject,'Value',0) |
---|
662 | set(hhseries.GetObject,'BackgroundColor',[0 1 0])%put unactivated buttons to green |
---|
663 | end |
---|
664 | |
---|
665 | %------------------------------------------------------------------------ |
---|
666 | % --- Executes on button press in PLOT: PLOT the defined object and its projected field |
---|
667 | function PLOT_Callback(hObject, eventdata, handles) |
---|
668 | |
---|
669 | %% reading the object parameters on the GUI uvmat |
---|
670 | huvmat=findobj('tag','uvmat');%find the current uvmat interface handle |
---|
671 | UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat |
---|
672 | hhuvmat=guidata(huvmat);%handles in the uvmat GUI |
---|
673 | ListObject=get(hhuvmat.ListObject,'String');%position in the objet list |
---|
674 | IndexObj=get(hhuvmat.ListObject,'Value') |
---|
675 | % name of the object |
---|
676 | ObjectName=get(handles.TITLE,'String');%name of the current object defiend in set_object |
---|
677 | ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object |
---|
678 | if isempty(ObjectName) |
---|
679 | if get(hhuvmat.edit_object,'Value')% edit mode |
---|
680 | ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item |
---|
681 | end |
---|
682 | end |
---|
683 | if ~get(hhuvmat.edit_object,'Value') %new object is being created |
---|
684 | detectname=1; |
---|
685 | ObjectNameNew=ObjectName; |
---|
686 | vers=0; |
---|
687 | while detectname==1 |
---|
688 | detectname=find(strcmp(ObjectNameNew,ListObject),1);%test the existence of the proposed name in the list |
---|
689 | if detectname% if the object name already exists |
---|
690 | indstr=regexp(ObjectNameNew,'\D'); |
---|
691 | if indstr(end)<length(ObjectNameNew) %object name ends by a number |
---|
692 | vers=str2double(ObjectNameNew(indstr(end)+1:end))+1; |
---|
693 | ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)]; |
---|
694 | else |
---|
695 | vers=vers+1; |
---|
696 | ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)]; |
---|
697 | end |
---|
698 | end |
---|
699 | end |
---|
700 | ObjectName=ObjectNameNew; |
---|
701 | ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name |
---|
702 | end |
---|
703 | % IndexObj_1=IndexObj(1); |
---|
704 | % % if isequal(get(hhuvmat.list_object_2,'Visible'),'on') |
---|
705 | % % IndexObj_2=get(hhuvmat.list_object_2,'Value'); |
---|
706 | % % List2=get(hhuvmat.list_object_2,'String'); |
---|
707 | % if numel(IndexObj)==2 |
---|
708 | % IndexObj_2=IndexObj(2); |
---|
709 | % else |
---|
710 | % IndexObj_2=[]; |
---|
711 | % end |
---|
712 | testnew=0; |
---|
713 | |
---|
714 | if numel(IndexObj)==1 % if only one object is selected, the projection is in uvmat |
---|
715 | PlotHandles=hhuvmat; |
---|
716 | plotaxes=hhuvmat.axes3;%handle of axes3 in view_field |
---|
717 | else % if a second object is selected, the projection is in view_field, and this second object is selected |
---|
718 | hview_field=findobj(allchild(0),'tag','view_field'); |
---|
719 | if isempty(hview_field) |
---|
720 | hview_field=view_field; |
---|
721 | end |
---|
722 | PlotHandles=guidata(hview_field); |
---|
723 | plotaxes=PlotHandles.axes3;%handle of axes3 in view_field |
---|
724 | end |
---|
725 | |
---|
726 | %% naming the object |
---|
727 | ListObject{IndexObj(end),1}=ObjectName; |
---|
728 | set(hhuvmat.ListObject,'String',ListObject) |
---|
729 | |
---|
730 | %% update the object plot and projection field |
---|
731 | if testnew |
---|
732 | set(hhuvmat.ListObject,'Value',IndexObj) |
---|
733 | ObjectData.DisplayHandle_uvmat=hhuvmat.axes3; |
---|
734 | ObjectData.DisplayHandle_view_field=[]; |
---|
735 | else |
---|
736 | if IndexObj(end)<=length(UvData.Object) && isfield(UvData.Object{IndexObj(end)},'DisplayHandle_uvmat')% save the previous object graph handles |
---|
737 | ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj(end)}.DisplayHandle_uvmat; |
---|
738 | else |
---|
739 | ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;%there is no object handle, than the axes handles is used as input |
---|
740 | end |
---|
741 | if isfield(UvData.Object{IndexObj(end)},'DisplayHandle_view_field')% save the previous object graph handles |
---|
742 | ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj(end)}.DisplayHandle_view_field; |
---|
743 | else |
---|
744 | ObjectData.DisplayHandle_view_field=[]; |
---|
745 | end |
---|
746 | end |
---|
747 | UvData.Object{IndexObj(end)}=ObjectData;%update the current object properties |
---|
748 | if numel(IndexObj)==2 |
---|
749 | UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); |
---|
750 | end |
---|
751 | set(huvmat,'UserData',UvData) |
---|
752 | |
---|
753 | %% plot the field projected on the object and store in the corresponding figue |
---|
754 | [ProjData,errormsg]= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData |
---|
755 | if ~isempty(errormsg) |
---|
756 | msgbox_uvmat('ERROR', errormsg) |
---|
757 | return |
---|
758 | end |
---|
759 | fighandle=get(plotaxes,'parent'); |
---|
760 | PlotParam=read_GUI(fighandle); |
---|
761 | [PlotType,Object_out{IndexObj(end)}.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot |
---|
762 | |
---|
763 | %% update the GUI uvmat |
---|
764 | hhuvmat=guidata(huvmat);%handles of elements in the uvmat GUI |
---|
765 | set(hhuvmat.MenuEditObject,'enable','on') |
---|
766 | set(hhuvmat.edit_object,'Value',1) % set uvmat to object edit mode to allow further object update |
---|
767 | set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow |
---|
768 | |
---|
769 | %------------------------------------------------------------------------ |
---|
770 | % --- Executes on button press in MenuCoord. |
---|
771 | function MenuCoord_Callback(hObject, eventdata, handles) |
---|
772 | %------------------------------------------------------------------------ |
---|
773 | %---------------------------------------------------- |
---|
774 | function YMin_Callback(hObject, eventdata, handles) |
---|
775 | %------------------------------------------------------------------------ |
---|
776 | |
---|
777 | function ZMin_Callback(hObject, eventdata, handles) |
---|
778 | %------------------------------------------------------------------------ |
---|
779 | |
---|
780 | function ZMax_Callback(hObject, eventdata, handles) |
---|
781 | DZ=str2num(get(handles.ZMax,'String')); |
---|
782 | ZMin=get(handles.z_slider,'Min'); |
---|
783 | ZMax=get(handles.z_slider,'Max'); |
---|
784 | if ~isequal(ZMax-ZMin,0) |
---|
785 | rel_step(1)=DZ/(ZMax-ZMin); |
---|
786 | rel_step(2)=0.2; |
---|
787 | set(handles.z_slider,'SliderStep',rel_step) |
---|
788 | end |
---|
789 | %------------------------------------------------------------------------ |
---|
790 | function YMax_Callback(hObject, eventdata, handles) |
---|
791 | %------------------------------------------------------------------------ |
---|
792 | |
---|
793 | function XMin_Callback(hObject, eventdata, handles) |
---|
794 | %------------------------------------------------------------------------ |
---|
795 | |
---|
796 | function XMax_Callback(hObject, eventdata, handles) |
---|
797 | %------------------------------------------------------------------------ |
---|
798 | %------------------------------------------------------------------------ |
---|
799 | function SAVE_Callback(hObject, eventdata, handles) |
---|
800 | % ------------------------------------------------------ |
---|
801 | Object=read_set_object(handles); |
---|
802 | huvmat=findobj('Tag','uvmat'); |
---|
803 | % UvData=get(huvmat,'UserData'); |
---|
804 | if isempty(huvmat) |
---|
805 | huvmat=findobj(allchild(0),'Name','series'); |
---|
806 | end |
---|
807 | hchild=get(huvmat,'Children'); |
---|
808 | hrootpath=findobj(hchild,'Tag','RootPath'); |
---|
809 | if isempty(hrootpath) |
---|
810 | RootPath=''; |
---|
811 | else |
---|
812 | RootPath=get(hrootpath,'String'); |
---|
813 | if iscell(RootPath) |
---|
814 | RootPath=RootPath{1}; |
---|
815 | end |
---|
816 | end |
---|
817 | title={'object name'}; |
---|
818 | dir_save=uigetdir(RootPath); |
---|
819 | ObjectName=get(handles.TITLE,'String'); |
---|
820 | if ~isempty(ObjectName)&&~strcmp(ObjectName,'') |
---|
821 | def={fullfile(dir_save,[ObjectName '.xml'])}; |
---|
822 | else |
---|
823 | def={fullfile(dir_save,[Object.Style '.xml'])}; |
---|
824 | end |
---|
825 | displ_txt='save object as an .xml file';%default display |
---|
826 | menu=get(handles.ProjMode,'String'); |
---|
827 | value=get(handles.ProjMode,'Value'); |
---|
828 | ProjMode=menu{value}; |
---|
829 | if strcmp(ProjMode,'mask_inside')||strcmp(ProjMode,'mask_outside') |
---|
830 | displ_txt='save mask contour as an .xml file: to create a mask image, use save_mask on the GUI uvmat (lower right)'; |
---|
831 | end |
---|
832 | answer=msgbox_uvmat('INPUT_TXT','save object as an .xml file',def); |
---|
833 | if ~isempty(answer) |
---|
834 | t=struct2xml(Object); |
---|
835 | save(t,answer{1}) |
---|
836 | end |
---|
837 | msgbox_uvmat('CONFIRMATION',[answer{1} ' saved']) |
---|
838 | |
---|
839 | %------------------------------------------------------------------------ |
---|
840 | % --- Executes on slider movement. |
---|
841 | function z_slider_Callback(hObject, eventdata, handles) |
---|
842 | %--------------------------------------------------------- |
---|
843 | Z_value=get(handles.z_slider,'Value'); |
---|
844 | %rotation angles |
---|
845 | PlaneAngle=[0 0 0]; |
---|
846 | norm_plane=[0 0 1]; |
---|
847 | cos_om=1; |
---|
848 | sin_om=0; |
---|
849 | |
---|
850 | PlaneAngle(1)=str2double(get(handles.Phi,'String'));%first angle in degrees |
---|
851 | PlaneAngle(2)=str2double(get(handles.Theta,'String'));%second angle in degrees |
---|
852 | PlaneAngle(3)=str2double(get(handles.Psi,'String'));%second angle in degrees |
---|
853 | PlaneAngle=(pi/180)*PlaneAngle; |
---|
854 | om=norm(PlaneAngle);%norm of rotation angle in radians |
---|
855 | if isequal(om,0) |
---|
856 | norm_plane=[0 0 1]; |
---|
857 | else |
---|
858 | OmAxis=PlaneAngle/om; %unit vector marking the rotation axis |
---|
859 | cos_om=cos(om); |
---|
860 | sin_om=sin(om); |
---|
861 | coeff=OmAxis(3)*(1-cos_om); |
---|
862 | %components of the unity vector norm_plane normal to the projection plane |
---|
863 | norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; |
---|
864 | norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; |
---|
865 | norm_plane(3)=OmAxis(3)*coeff+cos_om; |
---|
866 | end |
---|
867 | |
---|
868 | %set new plane position and update graph |
---|
869 | set(handles.XObject,'String',num2str(norm_plane(1)*Z_value,4)) |
---|
870 | set(handles.YObject,'String',num2str(norm_plane(2)*Z_value,4)) |
---|
871 | set(handles.ZObject,'String',num2str(norm_plane(3)*Z_value,4)) |
---|
872 | PLOT_Callback(hObject, eventdata, handles) |
---|
873 | |
---|
874 | %------------------------------------------------------------------------ |
---|
875 | % --- Executes on button press in HELP. |
---|
876 | function HELP_Callback(hObject, eventdata, handles) |
---|
877 | %------------------------------------------------------------------------ |
---|
878 | path_to_uvmat=which ('uvmat');% check the path of uvmat |
---|
879 | pathelp=fileparts(path_to_uvmat); |
---|
880 | helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); |
---|
881 | if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') |
---|
882 | else |
---|
883 | addpath (fullfile(pathelp,'uvmat_doc')) |
---|
884 | web([helpfile '#set_object']) |
---|
885 | end |
---|
886 | %------------------------------------------------------------------------ |
---|
887 | |
---|
888 | |
---|