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:u |
---|
10 | % data: structure describing the object properties |
---|
11 | % .Style=... |
---|
12 | % .ProjMode |
---|
13 | % .CoordType: 'phys' or 'px' |
---|
14 | % .num_DX,.num_DY,.num_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 | %======================================================================= |
---|
21 | % Copyright 2008-2014, LEGI UMR 5519 / CNRS UJF G-INP, Grenoble, France |
---|
22 | % http://www.legi.grenoble-inp.fr |
---|
23 | % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr |
---|
24 | % |
---|
25 | % This file is part of the toolbox UVMAT. |
---|
26 | % |
---|
27 | % UVMAT is free software; you can redistribute it and/or modify |
---|
28 | % it under the terms of the GNU General Public License as published |
---|
29 | % by the Free Software Foundation; either version 2 of the license, |
---|
30 | % or (at your option) any later version. |
---|
31 | % |
---|
32 | % UVMAT is distributed in the hope that it will be useful, |
---|
33 | % but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
34 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
35 | % GNU General Public License (see LICENSE.txt) for more details. |
---|
36 | %======================================================================= |
---|
37 | |
---|
38 | function varargout = set_object(varargin) |
---|
39 | |
---|
40 | % Last Modified by GUIDE v2.5 16-Jan-2015 11:03:00 |
---|
41 | |
---|
42 | % Begin initialization code - DO NOT REFRESH |
---|
43 | gui_Singleton = 1; |
---|
44 | gui_State = struct('gui_Name', mfilename, ... |
---|
45 | 'gui_Singleton', gui_Singleton, ... |
---|
46 | 'gui_OpeningFcn', @set_object_OpeningFcn, ... |
---|
47 | 'gui_OutputFcn', @set_object_OutputFcn, ... |
---|
48 | 'gui_LayoutFcn', [] , ... |
---|
49 | 'gui_Callback', []); |
---|
50 | if nargin & ischar(varargin{1}) |
---|
51 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
52 | end |
---|
53 | |
---|
54 | if nargout |
---|
55 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
56 | else |
---|
57 | gui_mainfcn(gui_State, varargin{:}); |
---|
58 | end |
---|
59 | % End initialization code - DO NOT REFRESH |
---|
60 | %------------------------------------------------------------------------ |
---|
61 | %------------------------------------------------------------------------ |
---|
62 | % --- Executes just before set_object is made visible. |
---|
63 | %INPUT: |
---|
64 | % handles: handles of the set_object interface elements |
---|
65 | %'IndexObj': NON USED ANYMORE (To suppress) index of the object (on the UvData list) that set_object will modify |
---|
66 | % if =[] or absent: index still undefined (create mode in uvmat) |
---|
67 | % if=0; no associated object (used for series), the button 'REFRESH' is then unvisible |
---|
68 | %'data': read from an existing object selected in the interface |
---|
69 | % .Name : class of object ('POINTS','LINE',....) |
---|
70 | % .num_DX,num_DY,num_DZ; meshes for regular grids |
---|
71 | % .Coord: object position coordinates |
---|
72 | % .ParentButton: handle of the uicontrol object calling the interface |
---|
73 | % PlotHandles: set of handles of the elements contolling the plotting of the projected field: |
---|
74 | % if =[] or absent, no refresh (mask mode in uvmat) |
---|
75 | % parameters on the uvmat interface (obtained by 'get_plot_handle.m') |
---|
76 | function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds) |
---|
77 | %------------------------------------------------------------------- |
---|
78 | % Choose default command line output for set_object |
---|
79 | handles.output = hObject; |
---|
80 | % Update handles structure |
---|
81 | guidata(hObject, handles); |
---|
82 | |
---|
83 | %% position |
---|
84 | set(0,'Unit','pixels') |
---|
85 | ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right |
---|
86 | PosGUI=get(handles.set_object,'Position');% fig width in pixels |
---|
87 | Width=PosGUI(3);%width of the gui set_object in pixels |
---|
88 | Height=PosGUI(4); |
---|
89 | Left=ScreenSize(3)- Width-40; %right edge close to the right, with margin=40 |
---|
90 | Bottom=ScreenSize(4)-Height-40; %put fig at top right |
---|
91 | set(handles.set_object,'Unit','pixels') |
---|
92 | set(handles.set_object,'Position',[Left Bottom Width Height]) |
---|
93 | |
---|
94 | %default |
---|
95 | if ~exist('ZBounds','var') |
---|
96 | ZBounds=0; %default |
---|
97 | end |
---|
98 | set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function |
---|
99 | set(hObject,'DeleteFcn',{@closefcn}) |
---|
100 | |
---|
101 | % fill the interface as set in the input data: |
---|
102 | if exist('data','var') |
---|
103 | if isfield(data,'Coord') &&size(data.Coord,2)==3 |
---|
104 | set(handles.z_slider,'Visible','on') |
---|
105 | else |
---|
106 | set(handles.z_slider,'Visible','off') |
---|
107 | end |
---|
108 | if isfield(data,'TypeMenu') |
---|
109 | set(handles.Type,'String',data.TypeMenu) |
---|
110 | end |
---|
111 | if isfield(data,'ProjModeMenu') |
---|
112 | set(handles.ProjMode,'UserData',data.ProjModeMenu)% data.ProjModeMenu as default menu (used in Type_Callback) |
---|
113 | end |
---|
114 | errormsg=fill_GUI(data,handles.set_object); |
---|
115 | if ~isempty(errormsg) |
---|
116 | msgbox_uvmat('ERROR','bad data input in set_object') |
---|
117 | return |
---|
118 | end |
---|
119 | Type_Callback(hObject, eventdata, handles)% update the GUI set_object depending on the object type |
---|
120 | set(handles.REFRESH,'BackgroundColor',[1 0 0]) |
---|
121 | if isfield(data,'RangeZ') && length(ZBounds) >= 2 |
---|
122 | set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3)) |
---|
123 | DZ=max(data.RangeZ);%slider step |
---|
124 | if ~isnan(ZBounds(1)) && ZBounds(2)~=ZBounds(1) |
---|
125 | rel_step(1)=min(DZ/(ZBounds(2)-ZBounds(1)),0.2);%must be smaller than 1 |
---|
126 | rel_step(2)=0.1; |
---|
127 | set(handles.z_slider,'Visible','on') |
---|
128 | set(handles.z_slider,'Min',ZBounds(1)) |
---|
129 | set(handles.z_slider,'Max',ZBounds(2)) |
---|
130 | set(handles.z_slider,'SliderStep',rel_step) |
---|
131 | set(handles.z_slider,'Value',(ZBounds(1)+ZBounds(2))/2) |
---|
132 | end |
---|
133 | end |
---|
134 | if isfield(data,'RangeX') |
---|
135 | if ischar(data.RangeX) |
---|
136 | data.RangeX=str2num(data.RangeX); |
---|
137 | end |
---|
138 | set(handles.num_RangeX_2,'String',num2str(max(data.RangeX),3)) |
---|
139 | set(handles.num_RangeX_1,'String',num2str(min(data.RangeX),3)) |
---|
140 | end |
---|
141 | if isfield(data,'RangeY') |
---|
142 | if ischar(data.RangeY) |
---|
143 | data.RangeY=str2num(data.RangeY); |
---|
144 | end |
---|
145 | set(handles.num_RangeY_2,'String',num2str(max(data.RangeY),3)) |
---|
146 | set(handles.num_RangeY_1,'String',num2str(min(data.RangeY),3)) |
---|
147 | end |
---|
148 | if isfield(data,'RangeZ') |
---|
149 | if ischar(data.RangeZ) |
---|
150 | data.RangeZ=str2num(data.RangeZ); |
---|
151 | end |
---|
152 | set(handles.num_RangeZ_2,'String',num2str(max(data.RangeZ),3)) |
---|
153 | if numel(data.RangeZ)>=2 |
---|
154 | set(handles.num_RangeZ_1,'String',num2str(min(data.RangeZ),3)) |
---|
155 | end |
---|
156 | end |
---|
157 | if ~isfield(data,'Angle') |
---|
158 | data.Angle=[0 0 0]; |
---|
159 | end |
---|
160 | % if isfield(data,'Angle') && isequal(numel(data.Angle),3) |
---|
161 | set(handles.num_Angle_1,'String',num2str(data.Angle(1))) |
---|
162 | set(handles.num_Angle_2,'String',num2str(data.Angle(2))) |
---|
163 | set(handles.num_Angle_3,'String',num2str(data.Angle(3))) |
---|
164 | % end |
---|
165 | end |
---|
166 | set(get(handles.set_object,'children'),'enable','off') |
---|
167 | set(handles.SAVE,'enable','on') |
---|
168 | % set(handles.REFRESH,'enable','off') |
---|
169 | |
---|
170 | |
---|
171 | %------------------------------------------------------------------------ |
---|
172 | % --- Outputs from this function are returned to the command line. |
---|
173 | function varargout = set_object_OutputFcn(hObject, eventdata, handles) |
---|
174 | %------------------------------------------------------------------------ |
---|
175 | % Get default command line output from handles structure |
---|
176 | varargout{1} = handles.output; |
---|
177 | varargout{2}=handles; |
---|
178 | |
---|
179 | %------------------------------------------------------------------------ |
---|
180 | % executed when closing the GUI set_object |
---|
181 | function closefcn(gcbo,eventdata) |
---|
182 | %------------------------------------------------------------------------ |
---|
183 | huvmat=findobj(allchild(0),'Tag','uvmat');%find the current uvmat interface handle |
---|
184 | if ~isempty(huvmat) |
---|
185 | hhuvmat=guidata(huvmat); |
---|
186 | set(hhuvmat.CheckViewObject,'value',0)% |
---|
187 | set(hhuvmat.CheckEditObject,'Value',0)% desactivate the edit option |
---|
188 | % deselect the object in ListObject when view_field is closed |
---|
189 | if isempty(findobj(allchild(0),'Tag','view_field')) |
---|
190 | ObjIndex=get(hhuvmat.ListObject,'Value'); |
---|
191 | ObjIndex=ObjIndex(1);%keep only the first object selected |
---|
192 | set(hhuvmat.ListObject,'Value',ObjIndex) |
---|
193 | % draw all object colors in blue (unselected) in uvmat |
---|
194 | hother=[findobj(hhuvmat.PlotAxes,'Tag','proj_object');findobj(hhuvmat.PlotAxes,'Tag','DeformPoint')];%find all the proj object and deform point representations |
---|
195 | for iobj=1:length(hother) |
---|
196 | if isequal(get(hother(iobj),'Type'),'rectangle')||isequal(get(hother(iobj),'Type'),'patch') |
---|
197 | set(hother(iobj),'EdgeColor','b') |
---|
198 | if isequal(get(hother(iobj),'FaceColor'),'m') |
---|
199 | set(hother(iobj),'FaceColor','b') |
---|
200 | end |
---|
201 | elseif isequal(get(hother(iobj),'Type'),'image') |
---|
202 | Acolor=get(hother(iobj),'CData'); |
---|
203 | Acolor(:,:,1)=zeros(size(Acolor,1),size(Acolor,2)); |
---|
204 | set(hother(iobj),'CData',Acolor); |
---|
205 | else |
---|
206 | set(hother(iobj),'Color','b') |
---|
207 | end |
---|
208 | set(hother(iobj),'Selected','off') |
---|
209 | end |
---|
210 | end |
---|
211 | end |
---|
212 | hseries=findobj(allchild(0),'Name','series');%find the current series interface handle |
---|
213 | if ~isempty(hseries) |
---|
214 | hhseries=guidata(hseries); |
---|
215 | set(hhseries.EditObject,'Value',0) |
---|
216 | end |
---|
217 | |
---|
218 | |
---|
219 | %------------------------------------------------------------------------ |
---|
220 | % --- Executes on selection change in Type. |
---|
221 | function Type_Callback(hObject, eventdata, handles) |
---|
222 | %------------------------------------------------------------------------ |
---|
223 | |
---|
224 | ListType=get(handles.Type,'String'); |
---|
225 | Type=ListType{get(handles.Type,'Value')}; |
---|
226 | % make correspondance between different object styles |
---|
227 | Coord=get(handles.Coord,'Data'); |
---|
228 | |
---|
229 | %% set the number of lines in the Coord table depending on object type |
---|
230 | switch Type |
---|
231 | case{'line'} |
---|
232 | if size(Coord,1)<2 |
---|
233 | if isequal(size(Coord,2),3) |
---|
234 | Coord=[Coord; 0 0 0];%add a line for edition (3D case) |
---|
235 | else |
---|
236 | Coord=[Coord; 0 0]; %add a line for edition (2D case) |
---|
237 | end |
---|
238 | else |
---|
239 | Coord=Coord(1:2,:); |
---|
240 | end |
---|
241 | case{'rectangle','ellipse','plane','volume'} |
---|
242 | Coord=Coord(1,:); |
---|
243 | end |
---|
244 | set(handles.Coord,'Data',Coord) |
---|
245 | |
---|
246 | %% set the projection menu and the corresponding options |
---|
247 | if isempty(get(handles.ProjMode,'UserData')) |
---|
248 | switch Type |
---|
249 | case {'points','line','plane'} |
---|
250 | menu_proj={'projection';'interp_lin';'interp_tps';'none'}; |
---|
251 | case 'polyline' |
---|
252 | menu_proj={'interp_lin';'interp_tps';'none'}; |
---|
253 | case {'polygon','rectangle','ellipse'} |
---|
254 | menu_proj={'inside';'outside';'mask_inside';'mask_outside';'interp_lin';'interp_tps';'none'}; |
---|
255 | case 'volume' |
---|
256 | menu_proj={'interp_lin';'none'}; |
---|
257 | otherwise |
---|
258 | menu_proj={'projection';'interp_lin';'interp_tps';'none'};%default |
---|
259 | end |
---|
260 | else |
---|
261 | menu_proj=get(handles.ProjMode,'UserData'); |
---|
262 | end |
---|
263 | ProjModeList=get(handles.ProjMode,'String'); |
---|
264 | menu_index=find(strcmp(ProjModeList{get(handles.ProjMode,'Value')},menu_proj)); |
---|
265 | if isempty(menu_index) |
---|
266 | menu_index=1;% |
---|
267 | end |
---|
268 | set(handles.ProjMode,'Value',menu_index);% value index must not exceed the menu length |
---|
269 | set(handles.ProjMode,'String',menu_proj) |
---|
270 | ProjMode_Callback(hObject, eventdata, handles) |
---|
271 | |
---|
272 | %------------------------------------------------------------------------ |
---|
273 | % --- Executes on selection change in ProjMode. |
---|
274 | %------------------------------------------------------------------------ |
---|
275 | function ProjMode_Callback(hObject, eventdata, handles) |
---|
276 | |
---|
277 | set(handles.REFRESH,'BackgroundColor',[1 0 1]) |
---|
278 | menu=get(handles.ProjMode,'String'); |
---|
279 | value=get(handles.ProjMode,'Value'); |
---|
280 | ProjMode=menu{value}; |
---|
281 | menu=get(handles.Type,'String'); |
---|
282 | value=get(handles.Type,'Value'); |
---|
283 | ObjectStyle=menu{value}; |
---|
284 | %%%%%%%%% TODO |
---|
285 | test3D=0; %TODO: update test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case |
---|
286 | %%%%%%%%% |
---|
287 | %default setting |
---|
288 | set(handles.num_Angle_1,'Visible','off') |
---|
289 | set(handles.num_Angle_2,'Visible','off') |
---|
290 | set(handles.num_Angle_3,'Visible','off') |
---|
291 | set(handles.num_RangeX_1,'Visible','off') |
---|
292 | set(handles.num_RangeX_2,'Visible','off') |
---|
293 | set(handles.num_RangeY_1,'Visible','off') |
---|
294 | if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') |
---|
295 | set(handles.num_RangeY_2,'Visible','off') |
---|
296 | else |
---|
297 | set(handles.num_RangeY_2,'Visible','on') |
---|
298 | end |
---|
299 | if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse') |
---|
300 | set(handles.num_RangeX_2,'Visible','on') |
---|
301 | else |
---|
302 | set(handles.num_RangeX_2,'Visible','off') |
---|
303 | end |
---|
304 | set(handles.num_RangeZ_1,'Visible','off') |
---|
305 | set(handles.num_RangeZ_2,'Visible','off') |
---|
306 | set(handles.num_DX,'Visible','off') |
---|
307 | set(handles.num_DY,'Visible','off') |
---|
308 | set(handles.num_DZ,'Visible','off') |
---|
309 | |
---|
310 | switch ObjectStyle |
---|
311 | case 'points' |
---|
312 | set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around each point') |
---|
313 | % set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points') |
---|
314 | % set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points') |
---|
315 | % set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points') |
---|
316 | case {'line','polyline','polygon'} |
---|
317 | set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around the line') |
---|
318 | set(handles.Coord,'TooltipString','Coord: table of x,y, z coordinates defining the line') |
---|
319 | % set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line') |
---|
320 | % set(handles.ZObject,'TooltipString','ZObject: set of z coordinates defining the line') |
---|
321 | if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') |
---|
322 | set(handles.num_DX,'Visible','on') |
---|
323 | set(handles.num_DX,'TooltipString','num_DX: mesh for the interpolated field along the line') |
---|
324 | end |
---|
325 | case {'rectangle','ellipse'} |
---|
326 | set(handles.num_RangeX_2,'TooltipString',['num_RangeX_2: half length of the ' ObjectStyle]) |
---|
327 | set(handles.num_RangeY_2,'TooltipString',['num_RangeY_2: half width of the ' ObjectStyle]) |
---|
328 | case {'plane'} |
---|
329 | set(handles.num_Angle_3,'Visible','on') |
---|
330 | set(handles.num_RangeX_1,'Visible','on') |
---|
331 | set(handles.num_RangeX_2,'Visible','on') |
---|
332 | set(handles.num_RangeY_1,'Visible','on') |
---|
333 | set(handles.num_RangeY_2,'Visible','on') |
---|
334 | set(handles.num_RangeZ_2,'TooltipString','num_ZMax: range of projection normal to the plane') |
---|
335 | if test3D |
---|
336 | set(handles.num_Angle_2,'Visible','on') |
---|
337 | set(handles.num_Angle_1,'Visible','on') |
---|
338 | set(handles.num_RangeZ_2,'Visible','on') |
---|
339 | end |
---|
340 | if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') |
---|
341 | set(handles.num_DX,'Visible','on') |
---|
342 | set(handles.num_DY,'Visible','on') |
---|
343 | else |
---|
344 | set(handles.num_DX,'Visible','off') |
---|
345 | set(handles.num_DY,'Visible','off') |
---|
346 | end |
---|
347 | if isequal(ProjMode,'interp_lin') |
---|
348 | set(handles.num_DZ,'Visible','on') |
---|
349 | end |
---|
350 | case {'volume'} |
---|
351 | set(handles.num_RangeX_1,'Visible','on') |
---|
352 | set(handles.num_RangeX_2,'Visible','on') |
---|
353 | set(handles.num_RangeY_1,'Visible','on') |
---|
354 | set(handles.num_RangeY_2,'Visible','on') |
---|
355 | set(handles.XObject,'TooltipString',['XObject: x coordinate of the axis origin for the ' ObjectStyle]) |
---|
356 | set(handles.YObject,'TooltipString',['YObject: y coordinate of the axis origin for the ' ObjectStyle]) |
---|
357 | set(handles.num_Angle_1,'Visible','on') |
---|
358 | set(handles.num_Angle_2,'Visible','on') |
---|
359 | set(handles.num_Angle_3,'Visible','on') |
---|
360 | set(handles.num_RangeZ_1,'Visible','on') |
---|
361 | set(handles.num_RangeZ_2,'Visible','on') |
---|
362 | if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') |
---|
363 | set(handles.num_DX,'Visible','on') |
---|
364 | set(handles.num_DY,'Visible','on') |
---|
365 | set(handles.num_DZ,'Visible','on') |
---|
366 | else |
---|
367 | set(handles.num_DX,'Visible','off') |
---|
368 | set(handles.num_DY,'Visible','off') |
---|
369 | set(handles.num_DZ,'Visible','off') |
---|
370 | end |
---|
371 | end |
---|
372 | % set default values read in the plot of uvmat to initiate the mesh |
---|
373 | if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') |
---|
374 | if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String'))); |
---|
375 | huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle |
---|
376 | UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface |
---|
377 | Field=UvData.Field; |
---|
378 | if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) |
---|
379 | set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh)) |
---|
380 | set(handles.num_DY,'String',num2str(UvData.Field.CoordMesh)) |
---|
381 | set(handles.num_RangeX_1,'String',num2str(UvData.Field.XMin)) |
---|
382 | set(handles.num_RangeX_2,'String',num2str(UvData.Field.XMax)) |
---|
383 | set(handles.num_RangeY_1,'String',num2str(UvData.Field.YMin)) |
---|
384 | set(handles.num_RangeY_2,'String',num2str(UvData.Field.YMax)) |
---|
385 | end |
---|
386 | if isempty(get(handles.CoordUnit,'String')) |
---|
387 | set(handles.CoordUnit,'String',Field.CoordUnit) |
---|
388 | end |
---|
389 | end |
---|
390 | end |
---|
391 | |
---|
392 | %------------------------------------------------------------------------ |
---|
393 | |
---|
394 | %------------------------------------------------------------------------ |
---|
395 | function num_Angle_1_Callback(hObject, eventdata, handles) |
---|
396 | update_slider(hObject, eventdata,handles) |
---|
397 | %------------------------------------------------------------------------ |
---|
398 | %------------------------------------------------------------------------ |
---|
399 | function num_Angle_2_Callback(hObject, eventdata, handles) |
---|
400 | update_slider(hObject, eventdata,handles) |
---|
401 | %------------------------------------------------------------------------ |
---|
402 | function update_slider(hObject, eventdata,handles) |
---|
403 | %rotation angles |
---|
404 | PlaneAngle(1)=str2num(get(handles.num_Angle_1,'String'));%first angle in degrees |
---|
405 | PlaneAngle(2)=str2num(get(handles.num_Angle_2,'String'));%second angle in degrees |
---|
406 | PlaneAngle(3)=str2num(get(handles.num_Angle_3,'String'));%second angle in degrees |
---|
407 | om=norm(PlaneAngle);%norm of rotation angle in radians |
---|
408 | OmAxis=PlaneAngle/om; %unit vector marking the rotation axis |
---|
409 | cos_om=cos(pi*om/180); |
---|
410 | sin_om=sin(pi*om/180); |
---|
411 | coeff=OmAxis(3)*(1-cos_om); |
---|
412 | %components of the unity vector norm_plane normal to the projection plane |
---|
413 | norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; |
---|
414 | norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; |
---|
415 | norm_plane(3)=OmAxis(3)*coeff+cos_om; |
---|
416 | huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle |
---|
417 | UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface |
---|
418 | if isfield(UvData,'X') & isfield(UvData,'Y') & isfield(UvData,'Z') |
---|
419 | Z=norm_plane(1)*(UvData.X)+norm_plane(2)*(UvData.Y)+norm_plane(3)*(UvData.Z); |
---|
420 | set(handles.z_slider,'Min',min(Z)) |
---|
421 | set(handles.z_slider,'Max',max(Z)) |
---|
422 | ZMax_Callback(hObject, eventdata, handles) |
---|
423 | end |
---|
424 | %------------------------------------------------------------------------ |
---|
425 | function num_DX_Callback(hObject, eventdata, handles) |
---|
426 | %------------------------------------------------------------------------ |
---|
427 | %------------------------------------------------------------------------ |
---|
428 | function num_DY_Callback(hObject, eventdata, handles) |
---|
429 | %------------------------------------------------------------------------ |
---|
430 | %------------------------------------------------------------------------ |
---|
431 | function num_DZ_Callback(hObject, eventdata, handles) |
---|
432 | %------------------------------------------------------------------------ |
---|
433 | |
---|
434 | |
---|
435 | %------------------------------------------------------------------------ |
---|
436 | % --- Executes on button press in REFRESH: refresh the current object , refresh the object and its projected field |
---|
437 | %------------------------------------------------------------------------ |
---|
438 | function REFRESH_Callback(hObject, eventdata, handles) |
---|
439 | |
---|
440 | set(handles.REFRESH,'BackgroundColor',[1 1 0])% indicate activation of REFRESH |
---|
441 | drawnow |
---|
442 | |
---|
443 | %% update the object in the GUI series if relevant |
---|
444 | if strcmp(get(handles.set_object,'Name'),'edit_object_series') |
---|
445 | hseries=findobj(allchild(0),'Tag','series'); |
---|
446 | if ~isempty(hseries) |
---|
447 | SeriesData=get(hseries,'UserData'); |
---|
448 | SeriesData.ProjObject=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object |
---|
449 | set(hseries,'UserData',SeriesData); |
---|
450 | end |
---|
451 | set(handles.REFRESH,'BackgroundColor',[1 0 0]) |
---|
452 | return |
---|
453 | end |
---|
454 | |
---|
455 | %% read the object parameters in the GUI set_object |
---|
456 | ObjectData=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object |
---|
457 | if isfield(ObjectData,'CoordLine')% remove CoordLine (not used as object feature) |
---|
458 | ObjectData=rmfield(ObjectData,'CoordLine'); |
---|
459 | end |
---|
460 | if iscell(ObjectData.Coord)%check for empty line |
---|
461 | ObjectData.Coord=[0 0 0]; |
---|
462 | hhset_object=guidata(handles.set_object); |
---|
463 | set(hhset_object.Coord,'Data',ObjectData.Coord) |
---|
464 | end |
---|
465 | checknan=isnan(sum(ObjectData.Coord,2));%check for NaN lines |
---|
466 | if ~isempty(checknan) |
---|
467 | ObjectData.Coord(checknan,:)=[];%remove the NaN lines |
---|
468 | end |
---|
469 | ObjectName=ObjectData.Name;%name of the current object defined in set_object |
---|
470 | if isempty(ObjectName) |
---|
471 | ObjectName=ObjectData.Type;% name the object by the object type type by default |
---|
472 | end |
---|
473 | |
---|
474 | %% read the current object selection in the GUI uvmat |
---|
475 | huvmat=findobj('tag','uvmat');%find the current uvmat GUI handle |
---|
476 | UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat |
---|
477 | hhuvmat=guidata(huvmat);%handles of the objects children of the GUI uvmat |
---|
478 | ListObject=get(hhuvmat.ListObject,'String');% list of objects displayed in uvmat |
---|
479 | |
---|
480 | if isequal(get(hhuvmat.CheckEditObject,'Value'),0) %we append a new object |
---|
481 | ListObject=[ListObject;{''}]; |
---|
482 | IndexObj=length(ListObject); |
---|
483 | set(hhuvmat.ListObject,'String',ListObject) |
---|
484 | set(hhuvmat.ListObject,'Value',IndexObj) |
---|
485 | UvData.ProjObject{IndexObj}=[]; %create a new empty object |
---|
486 | UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; % axes for plot_object |
---|
487 | UvData.ProjObject{IndexObj}.DisplayHandle.view_field=[]; %no plot handle before plot_field operation |
---|
488 | else |
---|
489 | IndexObj=get(hhuvmat.ListObject,'Value');% index of the selected object for display in uvmat |
---|
490 | end |
---|
491 | |
---|
492 | %set or modify(edit mode) the name of the currently selected object |
---|
493 | detectname=1; |
---|
494 | ObjectNameNew=ObjectName; |
---|
495 | vers=0;% index of the name |
---|
496 | ListOther=ListObject; |
---|
497 | ListOther(IndexObj)=[]; |
---|
498 | while ~isempty(detectname) |
---|
499 | detectname=find(strcmp(ObjectNameNew,ListOther),1);%test the existence of the proposed name in the list |
---|
500 | if detectname% if the object name already exists |
---|
501 | indstr=regexp(ObjectNameNew,'\D');%indices of non number characters |
---|
502 | if indstr(end)<length(ObjectNameNew) %object name ends by a number |
---|
503 | vers=str2double(ObjectNameNew(indstr(end)+1:end))+1; |
---|
504 | ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)]; |
---|
505 | else |
---|
506 | vers=vers+1; |
---|
507 | ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)]; |
---|
508 | end |
---|
509 | end |
---|
510 | end |
---|
511 | ObjectName=ObjectNameNew; |
---|
512 | set(handles.Name,'String',ObjectName)% display the default name in set_object |
---|
513 | ListObject{IndexObj}=ObjectName; |
---|
514 | set(hhuvmat.ListObject,'String',ListObject);%complement the object list |
---|
515 | set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list |
---|
516 | set(hhuvmat.CheckViewObject,'Value',1)% indicate that the currently selected objected is viewed on set_object |
---|
517 | check_handle=isfield(UvData.ProjObject{IndexObj},'DisplayHandle') && isfield(UvData.ProjObject{IndexObj}.DisplayHandle,'uvmat')... |
---|
518 | && ~isempty(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat) && ishandle(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat); |
---|
519 | if check_handle |
---|
520 | obj_handle=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; |
---|
521 | end |
---|
522 | UvData.ProjObject{IndexObj}=ObjectData;%record the current object properties in uvmat |
---|
523 | if check_handle |
---|
524 | UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=obj_handle; %preserve the object plot handle if valid |
---|
525 | else |
---|
526 | UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=hhuvmat.PlotAxes; %axes taken as object display handle by defualt |
---|
527 | end |
---|
528 | |
---|
529 | %% refresh the field projected on the object |
---|
530 | hview_field=[];%default |
---|
531 | IndexObj_1=get(hhuvmat.ListObject_1,'Value'); |
---|
532 | if strcmp(ObjectData.ProjMode,'mask_inside')||strcmp(ObjectData.ProjMode,'mask_outside')||strcmp(ObjectData.ProjMode,'none') |
---|
533 | PlotType='text'; |
---|
534 | else |
---|
535 | % create tps coeff if needed for ProjMode 'interp_tps' |
---|
536 | if strcmp(ObjectData.ProjMode,'interp_tps')&&~isfield(UvData.Field,'Coord_tps') |
---|
537 | %UvData.Field=calc_tps(UvData.Field,1); |
---|
538 | [UvData.Field,errormsg]=tps_coeff_field(UvData.Field,1); |
---|
539 | if ~isempty(errormsg) |
---|
540 | msgbox_uvmat('ERROR', ['set_object/tps_coeff_field/' errormsg]) |
---|
541 | set(handles.REFRESH,'enable','on') |
---|
542 | return |
---|
543 | end |
---|
544 | end |
---|
545 | [ProjData,errormsg]= proj_field(UvData.Field,ObjectData);%project the current field of uvmat on ObjectData |
---|
546 | if ~isempty(errormsg) |
---|
547 | msgbox_uvmat('ERROR', ['set_object/proj_field/' errormsg]) |
---|
548 | set(handles.REFRESH,'enable','on') |
---|
549 | return |
---|
550 | end |
---|
551 | if isequal(IndexObj_1,IndexObj) % if the projection is in uvmat |
---|
552 | PlotType=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(get(hhuvmat.PlotAxes,'parent')));%update the current uvmat plot |
---|
553 | else % if the projection is in view_field |
---|
554 | hview_field=findobj(allchild(0),'tag','view_field'); |
---|
555 | if isempty(hview_field) |
---|
556 | hview_field=view_field(ProjData); %open the view_field GUI for plot |
---|
557 | else |
---|
558 | hhview_field=guidata(hview_field); |
---|
559 | [PlotType,PlotParam]=plot_field(ProjData,hhview_field.PlotAxes,read_GUI(hview_field));%update an existing plot in view_field |
---|
560 | errormsg=fill_GUI(PlotParam,hview_field); |
---|
561 | if ~isempty(errormsg) |
---|
562 | msgbox_uvmat('ERROR',errormsg) |
---|
563 | return |
---|
564 | end |
---|
565 | % write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object |
---|
566 | end |
---|
567 | haxes=findobj(hview_field,'tag','axes3'); |
---|
568 | Data=get(hview_field,'UserData'); |
---|
569 | if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) |
---|
570 | h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); |
---|
571 | pos_table=get(h_TableDisplay,'Position'); |
---|
572 | pos=get(hview_field,'Position'); |
---|
573 | set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) |
---|
574 | drawnow |
---|
575 | set(hview_field,'UserData',Data);% restore the previously stored GUI position after GUI resizing |
---|
576 | else |
---|
577 | set(hview_field,'Position',Data.GUISize) |
---|
578 | end |
---|
579 | end |
---|
580 | end |
---|
581 | |
---|
582 | %% update the object refresh |
---|
583 | hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; |
---|
584 | % if we are editing the object used for projection in uvmat |
---|
585 | if isequal(IndexObj_1,IndexObj) |
---|
586 | %update the representation of the current object for projection field represented in view_field |
---|
587 | for iobj=1:numel(UvData.ProjObject) |
---|
588 | UvData.ProjObject{iobj}.DisplayHandle.uvmat=... |
---|
589 | plot_object(UvData.ProjObject{iobj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{iobj}.DisplayHandle.uvmat,'b'); |
---|
590 | end |
---|
591 | else % we are editing the object used for projection field represented in view_field |
---|
592 | %update the representation of the current object in uvmat |
---|
593 | UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=... |
---|
594 | plot_object(UvData.ProjObject{IndexObj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'m'); |
---|
595 | %indicate the object index in the user data of the object refresh (needed for further mouse editing) |
---|
596 | ObjectInfo=get(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData'); |
---|
597 | ObjectInfo.IndexObj=IndexObj; |
---|
598 | set(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData',ObjectInfo) |
---|
599 | % update the representation of all objects in view_field |
---|
600 | for iobj=1:numel(UvData.ProjObject) |
---|
601 | if isfield(UvData.ProjObject{iobj},'DisplayHandle') && isfield(UvData.ProjObject{iobj}.DisplayHandle,'view_field') |
---|
602 | UvData.ProjObject{iobj}.DisplayHandle.view_field=... |
---|
603 | plot_object(UvData.ProjObject{iobj},UvData.ProjObject{iobj},UvData.ProjObject{iobj}.DisplayHandle.view_field,'b'); |
---|
604 | end |
---|
605 | end |
---|
606 | end |
---|
607 | set(huvmat,'UserData',UvData) |
---|
608 | |
---|
609 | %% update the GUI uvmat |
---|
610 | set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update |
---|
611 | set(hhuvmat.CheckViewField,'Value',1) |
---|
612 | |
---|
613 | set(handles.REFRESH,'BackgroundColor',[1 0 0]) |
---|
614 | set(handles.num_RangeY_2,'BackgroundColor',[1 1 1]) |
---|
615 | |
---|
616 | % --- Executes on button press in DisplayCoord. |
---|
617 | function DisplayCoord_Callback(hObject, eventdata, handles) |
---|
618 | global Coord |
---|
619 | Coord=get(handles.Coord,'Data'); |
---|
620 | evalin('base','global Coord')%make Coord global in the workspace |
---|
621 | display('object coordinates:') |
---|
622 | evalin('base','Coord') %display Coord in the workspace |
---|
623 | commandwindow; %brings the Matlab command window to the front |
---|
624 | |
---|
625 | %---------------------------------------------------- |
---|
626 | function num_RangeY_1_Callback(hObject, eventdata, handles) |
---|
627 | %------------------------------------------------------------------------ |
---|
628 | |
---|
629 | function num_RangeZ_1_Callback(hObject, eventdata, handles) |
---|
630 | %------------------------------------------------------------------------ |
---|
631 | |
---|
632 | function num_RangeZ_2_Callback(hObject, eventdata, handles) |
---|
633 | DZ=str2num(get(handles.num_RangeZ_2,'String')); |
---|
634 | ZMin=get(handles.z_slider,'Min'); |
---|
635 | ZMax=get(handles.z_slider,'Max'); |
---|
636 | if ~isequal(ZMax-ZMin,0) |
---|
637 | rel_step(1)=DZ/(ZMax-ZMin); |
---|
638 | rel_step(2)=0.2; |
---|
639 | set(handles.z_slider,'SliderStep',rel_step) |
---|
640 | end |
---|
641 | %------------------------------------------------------------------------ |
---|
642 | function num_RangeY_2_Callback(hObject, eventdata, handles) |
---|
643 | %------------------------------------------------------------------------ |
---|
644 | |
---|
645 | function num_RangeX_1_Callback(hObject, eventdata, handles) |
---|
646 | %------------------------------------------------------------------------ |
---|
647 | |
---|
648 | function num_RangeX_2_Callback(hObject, eventdata, handles) |
---|
649 | |
---|
650 | %------------------------------------------------------------------------ |
---|
651 | %------------------------------------------------------------------------ |
---|
652 | function SAVE_Callback(hObject, eventdata, handles) |
---|
653 | % ------------------------------------------------------ |
---|
654 | Object=read_GUI(handles.set_object); |
---|
655 | if isfield(Object,'CoordLine')% remove CoordLine (not used as object feature) |
---|
656 | Object=rmfield(Object,'CoordLine'); |
---|
657 | end |
---|
658 | huvmat=findobj('Tag','uvmat'); |
---|
659 | if isempty(huvmat) |
---|
660 | huvmat=findobj(allchild(0),'Name','series'); |
---|
661 | end |
---|
662 | hchild=get(huvmat,'Children'); |
---|
663 | hrootpath=findobj(hchild,'Tag','RootPath'); |
---|
664 | if isempty(hrootpath) |
---|
665 | RootPath=''; |
---|
666 | else |
---|
667 | RootPath=get(hrootpath,'String'); |
---|
668 | if iscell(RootPath) |
---|
669 | RootPath=RootPath{1}; |
---|
670 | end |
---|
671 | end |
---|
672 | title={'object name'}; |
---|
673 | dir_save=uigetfile_uvmat('select the folder for the new xml object file:',RootPath,'uigetdir'); |
---|
674 | if ~isempty(dir_save) |
---|
675 | ObjectName=get(handles.Name,'String'); |
---|
676 | if ~isempty(ObjectName)&&~strcmp(ObjectName,'') |
---|
677 | def=[ObjectName '.xml']; |
---|
678 | else |
---|
679 | def=[Object.Style '.xml']; |
---|
680 | end |
---|
681 | displ_txt={['save object in' dir_save]; 'with file name (.xml):'};%default display |
---|
682 | menu=get(handles.ProjMode,'String'); |
---|
683 | value=get(handles.ProjMode,'Value'); |
---|
684 | ProjMode=menu{value}; |
---|
685 | if strcmp(ProjMode,'mask_inside')||strcmp(ProjMode,'mask_outside') |
---|
686 | displ_txt=[displ_txt; '(note: to create a mask image, use ''Tools/make mask'' on the upper bar menu of uvmat)']; |
---|
687 | end |
---|
688 | answer=msgbox_uvmat('INPUT_TXT',displ_txt,def); |
---|
689 | if ischar(answer) |
---|
690 | FullName=fullfile(dir_save,answer); |
---|
691 | t=struct2xml(Object); |
---|
692 | t=set(t,1,'name','ProjObject'); |
---|
693 | save(t,FullName) |
---|
694 | msgbox_uvmat('CONFIRMATION',[FullName ' saved']) |
---|
695 | end |
---|
696 | end |
---|
697 | |
---|
698 | %------------------------------------------------------------------------ |
---|
699 | % --- Executes on slider movement. |
---|
700 | function z_slider_Callback(hObject, eventdata, handles) |
---|
701 | %--------------------------------------------------------- |
---|
702 | Z_value=get(handles.z_slider,'Value'); |
---|
703 | %rotation angles |
---|
704 | PlaneAngle=[0 0 0]; |
---|
705 | norm_plane=[0 0 1]; |
---|
706 | cos_om=1; |
---|
707 | sin_om=0; |
---|
708 | |
---|
709 | PlaneAngle(1)=str2double(get(handles.num_Angle_1,'String'));%first angle in degrees |
---|
710 | PlaneAngle(2)=str2double(get(handles.num_Angle_2,'String'));%second angle in degrees |
---|
711 | PlaneAngle(3)=str2double(get(handles.num_Angle_3,'String'));%second angle in degrees |
---|
712 | PlaneAngle=(pi/180)*PlaneAngle; |
---|
713 | om=norm(PlaneAngle);%norm of rotation angle in radians |
---|
714 | if isequal(om,0) |
---|
715 | norm_plane=[0 0 1]; |
---|
716 | else |
---|
717 | OmAxis=PlaneAngle/om; %unit vector marking the rotation axis |
---|
718 | cos_om=cos(om); |
---|
719 | sin_om=sin(om); |
---|
720 | coeff=OmAxis(3)*(1-cos_om); |
---|
721 | %components of the unity vector norm_plane normal to the projection plane |
---|
722 | norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; |
---|
723 | norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; |
---|
724 | norm_plane(3)=OmAxis(3)*coeff+cos_om; |
---|
725 | end |
---|
726 | Coord=get(handles.Coord,'Data'); |
---|
727 | Coord(3)=Z_value; |
---|
728 | set(handles.Coord,'Data',Coord) |
---|
729 | |
---|
730 | % update graph |
---|
731 | REFRESH_Callback(hObject, eventdata, handles) |
---|
732 | |
---|
733 | %------------------------------------------------------------------------ |
---|
734 | % --- Executes on button press in HELP. |
---|
735 | function HELP_Callback(hObject, eventdata, handles) |
---|
736 | %------------------------------------------------------------------------ |
---|
737 | web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#ProjObject') |
---|
738 | |
---|
739 | %------------------------------------------------------------------------ |
---|
740 | % --- Executes when selected cell(s) is changed in ListCoord. |
---|
741 | %------------------------------------------------------------------------ |
---|
742 | function Coord_CellSelectionCallback(hObject, eventdata, handles) |
---|
743 | if ~isempty(eventdata.Indices) |
---|
744 | iline=eventdata.Indices(1);% selected line number |
---|
745 | set(handles.CoordLine,'String',num2str(iline)) |
---|
746 | end |
---|
747 | |
---|
748 | |
---|
749 | function num_Angle_3_Callback(hObject, eventdata, handles) |
---|
750 | |
---|
751 | %------------------------------------------------------------------------ |
---|
752 | % --- Executes on key press with selection of a uicontrol |
---|
753 | %------------------------------------------------------------------------ |
---|
754 | function KeyPressFcn(hObject, eventdata, handles) |
---|
755 | set(handles.REFRESH,'BackgroundColor',[1 0 1])% se REFRESH to magenta color, indicates that refresh needs to be done |
---|
756 | if strcmp(get(hObject,'Tag'),'num_Angle_3') |
---|
757 | set(handles.num_RangeX_1,'String','') |
---|
758 | set(handles.num_RangeX_2,'String','') |
---|
759 | set(handles.num_RangeY_1,'String','') |
---|
760 | set(handles.num_RangeY_2,'String','') |
---|
761 | end |
---|
762 | |
---|
763 | %------------------------------------------------------------------------ |
---|
764 | % --- Executes on key press with focus on Coord and none of its controls. |
---|
765 | %------------------------------------------------------------------------ |
---|
766 | function Coord_KeyPressFcn(hObject, eventdata, handles) |
---|
767 | |
---|
768 | set(handles.REFRESH,'BackgroundColor',[1 0 1]) |
---|
769 | xx=double(get(handles.set_object,'CurrentCharacter')); %get the keyboard character |
---|
770 | if ismember(xx,[127 31])% delete, or downward |
---|
771 | Coord=get(handles.Coord,'Data'); |
---|
772 | iline=str2double(get(handles.CoordLine,'String')); |
---|
773 | if isequal(xx, 31) |
---|
774 | if isequal(iline,size(Coord,1))% arrow downward |
---|
775 | Coord=[Coord;zeros(1,size(Coord,2))]; |
---|
776 | end |
---|
777 | else |
---|
778 | Coord(iline,:)=[];% suppress the current line |
---|
779 | end |
---|
780 | set(handles.Coord,'Data',Coord); |
---|
781 | end |
---|
782 | |
---|
783 | %------------------------------------------------------------------------ |
---|
784 | % --- Executes on button press in clear_line. |
---|
785 | %------------------------------------------------------------------------ |
---|
786 | function clear_line_Callback(hObject, eventdata, handles) |
---|
787 | |
---|
788 | Coord=get(handles.Coord,'Data'); |
---|
789 | iline=str2double(get(handles.CoordLine,'String')); |
---|
790 | if isempty(iline) |
---|
791 | msgbox_uvmat('WARNING','no line suppressed, select a line in the table') |
---|
792 | else |
---|
793 | Coord(iline,:)=[]; |
---|
794 | set(handles.REFRESH,'BackgroundColor',[1 0 1]) |
---|
795 | set(handles.Coord,'Data',Coord); |
---|
796 | set(handles.CoordLine,'String','') |
---|
797 | REFRESH_Callback(hObject,eventdata,handles) |
---|
798 | end |
---|