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