Changeset 625 for trunk/src/mouse_up.m
- Timestamp:
- May 2, 2013, 7:51:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r623 r625 25 25 26 26 test_ruler=0;%default 27 hcurrentfig=hObject; 28 fig_tag=get(hcurrentfig,'tag'); 29 currentaxes=gca; %store the current axes handle 30 AxeData=get(currentaxes,'UserData'); 27 AxeData=get(gca,'UserData'); 28 if isfield(AxeData,'ParentAxes')% case of a zoom plot as current axis 29 hcurrentaxes=AxeData.ParentAxes; 30 AxeData=get(hcurrentaxes,'UserData'); 31 hcurrentfig=get(hcurrentaxes,'parent');%handles of the GUI parent of the zoom plot 32 testsubplot=1;% mouse selection is on a zoom subplot 33 else 34 hcurrentfig=hObject; 35 hcurrentaxes=gca; %store the current axes handle 36 testsubplot=0; 37 end 31 38 CurrentOrigin=[]; 32 39 if isfield(AxeData,'CurrentOrigin') 33 40 CurrentOrigin=AxeData.CurrentOrigin; 34 41 end 35 if isfield(AxeData,'ParentRect')% case of a zoom plot as current axis 36 parentaxes=get(AxeData.ParentRect,'parent'); 37 AxeData=get(parentaxes,'UserData'); 38 controlGUI=get(parentaxes,'parent');%handles of the GUI parent of the zoom plot 39 hhcurrentfig=guidata(controlGUI); 40 testsubplot=1; 41 else 42 hhcurrentfig=guidata(hcurrentfig);%the current figure is a GUI (uvmat or view_field) 43 testsubplot=0; 44 end 45 test_zoom=get(hhcurrentfig.CheckZoom,'Value'); 46 42 FigTag=get(hcurrentfig,'tag'); 43 hhcurrentfig=guidata(hcurrentfig);%the current figure is a GUI (uvmat or view_field) 44 CheckZoom=get(hhcurrentfig.CheckZoom,'Value'); 45 CheckZoomFig=get(hhcurrentfig.CheckZoomFig,'Value');%exclusive to CheckZoom 47 46 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle 48 47 if ~isempty(huvmat) 49 48 hhuvmat=guidata(huvmat); 50 49 UvData=get(huvmat,'UserData'); 51 test_ruler=~test_zoom && isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority 52 end 53 test_drawing=0;%default 54 55 %% finalize the fabrication or the translation/deformation of an object and plot the corresponding projected field 50 test_ruler=~CheckZoom && isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority 51 end 52 test_drawing=0;%default, =1 to allow drawing by further mouse action 53 xy=get(gca,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 54 55 56 %% proceed with the creation or editing (translation/deformation) of an object 56 57 if ~isempty(huvmat) && isfield(AxeData,'Drawing') && ~isequal(AxeData.Drawing,'off') && isfield(AxeData,'CurrentObject')... 57 58 && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject) 58 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates59 % xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 59 60 PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object 60 61 IndexObj=PlotData.IndexObj; 61 62 ObjectData=UvData.ProjObject{IndexObj}; 62 63 check_multiple=0; 64 65 h_set_object=findobj(allchild(0),'Tag','set_object'); 66 hh_set_object=guidata(h_set_object); 67 ObjectData.Coord=get(hh_set_object.Coord,'Data'); 68 63 69 % ending translation 64 70 if isequal(AxeData.Drawing,'translate') … … 69 75 ObjectData.Coord(:,2)=ObjectData.Coord(:,2)+DY; 70 76 71 %ending object deformation77 %ending object deformation 72 78 elseif isequal(AxeData.Drawing,'deform') 73 79 ind_move=AxeData.CurrentIndex; … … 75 81 ObjectData.Coord(ind_move,2)=xy(1,2); 76 82 77 %creating object83 %creating object 78 84 else 79 85 switch ObjectData.Type … … 85 91 end 86 92 case {'rectangle','ellipse','volume'} 87 % if size(ObjectData.Coord,1)==1 % this is the mouse up for the first point, continue until next click88 % check_multiple=1;89 % else90 ObjectData.Coord=(CurrentOrigin+xy(1,1:2))/2;% keep only the first point coordinate 93 % if size(ObjectData.Coord,1)==1 % this is the mouse up for the first point, continue until next click 94 % check_multiple=1; 95 % else 96 ObjectData.Coord=(CurrentOrigin+xy(1,1:2))/2;% keep only the first point coordinate 91 97 ObjectData.RangeX=abs(ObjectData.Coord(1,1)-xy(1,1));%rectangle width 92 ObjectData.RangeY=abs(ObjectData.Coord(1,2)-xy(1,2));%rectangle height 98 ObjectData.RangeY=abs(ObjectData.Coord(1,2)-xy(1,2));%rectangle height 93 99 if isequal(ObjectData.RangeX,0)||isequal(ObjectData.RangeY,0) 94 100 check_multiple=1;% pass to next mous up if width of height=0 95 101 end 96 % ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate97 % ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2;98 % ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width99 % ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height100 % end102 % ObjectData.Coord(1,1)=(xy(1,1)+XYData(1))/2;%origin rectangle, x coordinate 103 % ObjectData.Coord(1,2)=(xy(1,2)+XYData(2))/2; 104 % ObjectData.RangeX=abs(xy(1,1)-XYData(1))/2;%rectangle width 105 % ObjectData.RangeY=abs(xy(1,2)-XYData(2))/2;%rectangle height 106 % end 101 107 case 'plane' %case of 'plane' 102 108 DX=(xy(1,1)-ObjectData.Coord(1,1)); … … 110 116 end 111 117 otherwise 112 check_multiple=1; 118 check_multiple=1; 113 119 end 114 120 end 115 121 116 122 %show object coordinates in the GUI set_object 117 h_set_object=findobj(allchild(0),'Tag','set_object');118 hh_set_object=guidata(h_set_object);119 set(hh_set_object.Coord,'Data',ObjectData.Coord);123 % h_set_object=findobj(allchild(0),'Tag','set_object'); 124 % hh_set_object=guidata(h_set_object); 125 % set(hh_set_object.Coord,'Data',ObjectData.Coord); 120 126 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 121 127 set(hh_set_object.num_RangeX_2,'String',num2str(ObjectData.RangeX,4)); 122 128 set(hh_set_object.num_RangeY_2,'String',num2str(ObjectData.RangeY,4)); 123 129 end 124 125 % stop drawing and plotprojected field if the object manipulation is finished130 131 %% stop drawing and plot the projected field if the object manipulation is finished 126 132 if check_multiple==0 || isequal(get(hcurrentfig,'SelectionType'),'alt') 127 133 AxeData.CurrentOrigin=[]; %suppress the current origin 128 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.( fig_tag);134 hobject=UvData.ProjObject{IndexObj}.DisplayHandle.(FigTag); 129 135 if ~isempty(hObject) 130 ProjObject=UvData.ProjObject{get(hhuvmat.ListObject_1,'Value')};131 AxeData.CurrentObject=plot_object(ObjectData,ProjObject,hobject,'m');%draw the object and its handle becomes AxeData.CurrentObject136 ProjObject=UvData.ProjObject{get(hhuvmat.ListObject_1,'Value')}; 137 AxeData.CurrentObject=plot_object(ObjectData,ProjObject,hobject,'m');%draw the object and its handle becomes AxeData.CurrentObject 132 138 end 133 139 %% … … 136 142 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 137 143 if ~isempty(ProjData) 138 if strcmp( fig_tag,'uvmat')% uvmat plot selected, projection plot seen in view_field144 if strcmp(FigTag,'uvmat')% uvmat plot selected, projection plot seen in view_field 139 145 hview_field=findobj(allchild(0),'tag','view_field'); 140 146 if isempty(hview_field) … … 159 165 else 160 166 UvData.PlotAxes=ProjData; 161 [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(h huvmat));%update an existing field plot167 [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(huvmat));%update an existing field plot 162 168 errormsg=fill_GUI(PlotParam,huvmat); 163 169 end 164 170 end 165 171 set(hhuvmat.ViewField,'Value',1);% 166 set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow 167 set(hhuvmat.edit_object,'Value',1);% 172 set(hhuvmat.edit_object,'Value',1);% 168 173 set(hhuvmat.edit_object,'Enable','on');% 169 174 set(hhuvmat.MenuEditObject,'Enable','on');% 170 175 set(hhuvmat.MenuEdit,'Enable','on');% 176 set(get(h_set_object,'children'),'Enable','on') 177 end 178 UvData.ProjObject{IndexObj}=ObjectData; 179 if isfield(UvData.ProjObject{IndexObj},'CreateMode') 180 UvData.ProjObject{IndexObj}=rmfield(UvData.ProjObject{IndexObj},'CreateMode');%remove createMode to mark the object as finished 171 181 end 172 182 else 173 %test_drawing=1;%allow continuation of drawing object174 %AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin175 end 176 UvData.ProjObject{IndexObj}=ObjectData;183 test_drawing=1;%allow continuation of drawing object 184 AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin 185 end 186 % UvData.ProjObject{IndexObj}=ObjectData; 177 187 hother=findobj('Tag','deformpoint');%find all the deformpoints 178 188 set(hother,'Color','b');%reset all the deformpoints in 'blue' 179 189 end 180 190 181 %% creation of a new zoom plot 182 if isequal(get(hcurrentfig,'SelectionType'),'normal');%if left button has been pressed 191 %% creation or update of a zoom sub-plot 192 if CheckZoomFig && isequal(get(hcurrentfig,'SelectionType'),'normal')&&...%if left button has been pressed 193 ~isempty(CurrentOrigin) && ~isequal(CurrentOrigin(1),xy(1,1)) && ~isequal(CurrentOrigin(2),xy(1,2))%if mouse moved in x and y since presed down 183 194 hparentfig=hcurrentfig; 184 195 %open or update a new zoom figure if a rectangle has been drawn 185 if ishandle( currentaxes);196 if ishandle(hcurrentaxes); 186 197 if isfield(AxeData,'CurrentRectZoom') && ~isempty(AxeData.CurrentRectZoom) && ishandle(AxeData.CurrentRectZoom) 187 PosRect=get(AxeData.CurrentRectZoom,'Position');198 %PosRect=get(AxeData.CurrentRectZoom,'Position'); 188 199 if isfield(AxeData,'CurrentVec') && ~isempty(AxeData.CurrentVec) && ishandle(AxeData.CurrentVec) 189 200 delete(AxeData.CurrentVec) 190 201 end 191 if ~testsubplot 192 hfig2=figure;%create new figure 193 set(hfig2,'name','zoom') 194 set(0,'Unit','pixels') 195 set(hfig2,'Unit','pixels') 196 FigPos=get(hfig2,'Position'); 197 ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 198 Left=ScreenSize(3)- FigPos(3)-40; %right edge close to the right, with margin=40 199 Bottom=ScreenSize(4)-FigPos(4)-40; %put fig at top right 200 FigPos(1:2)=[Left Bottom]; 201 set(hfig2,'Position',FigPos); 202 map=colormap(currentaxes); 203 colormap(map);%transmit the current colormap to the zoom fig 204 set(hfig2,'KeyPressFcn',{@keyboard_callback,handles})%set keyboard action function 205 set(hfig2,'WindowButtonMotionFcn',{@mouse_motion,handles})%set mouse action function 206 set(hfig2,'WindowButtonDownFcn',{@mouse_down})%set mouse click action function 207 set(hfig2,'WindowButtonUpFcn',{@mouse_up,handles}) 208 set(hfig2,'DeleteFcn',{@close_fig,AxeData.CurrentRectZoom,'zoom'}) 209 set(hfig2,'UserData',AxeData.CurrentRectZoom)% record the parent object (zoom rectangle) in the new fig 210 AxeData.ZoomAxes=copyobj(currentaxes,hfig2); %copy the current graph axes to the zoom figure 202 if ~testsubplot% if we are not already on a zoom plot 203 hfig2=findobj(allchild(0),'Tag','zoom_fig'); 204 if isempty(hfig2)% create zoom sub plot if absent 205 hfig2=figure('name',['zoom_' FigTag],'tag','zoom_fig');%create new figure (unit='pixels' by default) 206 set(0,'Unit','pixels') 207 FigPos=get(hfig2,'Position');%get the standard width and height of the fig 208 ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right 209 Left=ScreenSize(3)- FigPos(3)-40; %right edge close to the right, with margin=40 210 Bottom=ScreenSize(4)-FigPos(4)-40; %put fig at top right 211 FigPos(1:2)=[Left Bottom]; 212 set(hfig2,'Position',FigPos);% put the zoom fig close to the upper right of the screen 213 map=colormap(hcurrentaxes); 214 colormap(map);%transmit the current colormap to the zoom fig 215 set(hfig2,'KeyPressFcn',{@keyboard_callback,handles})%set keyboard action function 216 set(hfig2,'WindowButtonMotionFcn',{@mouse_motion,handles})%set mouse action function 217 set(hfig2,'WindowButtonDownFcn',{@mouse_down})%set mouse click action function 218 set(hfig2,'WindowButtonUpFcn',{@mouse_up,handles}) 219 else 220 zoom_axes=findobj(hfig2,'Type','axes');%delete existing axes 221 axes(zoom_axes);%make the zoom axes apparent 222 delete(zoom_axes) 223 end 224 set(hfig2,'DeleteFcn',{@close_fig,AxeData.CurrentRectZoom}) 225 set(hfig2,'UserData',AxeData.CurrentRectZoom)% record the parent object (zoom rectangle) in the new fig 226 AxeData.ZoomAxes=copyobj(hcurrentaxes,hfig2); %copy the current graph axes to the zoom figure 211 227 hrect_zoom=findobj(AxeData.ZoomAxes,'Tag','rect_zoom');%find and delete the copy of the rect_zoom rectangle 212 228 delete(hrect_zoom) 213 ChildAxeData=get(AxeData.ZoomAxes,'UserData');214 if isfield(ChildAxeData,'ParentGUI')215 ChildAxeData=rmfield(ChildAxeData,'ParentGUI');%no parent GUI, e.g. uvmat, for the new plot216 end217 set(AxeData.ZoomAxes,'Position',[0.1300 0.1100 0.7750 0.8150])% standard axes position on a figure218 229 hcol=findobj(hparentfig,'Tag','Colorbar'); %look for colorbar axes 219 230 if ~isempty(hcol) … … 228 239 set(hcol_new,'Yticklabel',YTicklabel); 229 240 end 230 end 241 ChildAxeData=get(AxeData.ZoomAxes,'UserData'); 242 end 243 ChildAxeData.CurrentOrigin=[];% forget the current origin 231 244 ChildAxeData.CurrentRectZoom=[]; % no rect zoom in the new window 232 245 ChildAxeData.Drawing='off'; 233 ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle as a 'parent' associated to the new axe 234 PosRect=CurrentOrigin; 235 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 236 set(AxeData.ZoomAxes,'Xlim',[PosRect(1) xy(1,1)]) 237 set(AxeData.ZoomAxes,'Ylim',[PosRect(2) xy(1,2)]) 246 ChildAxeData.ParentAxes=hcurrentaxes; 247 ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle drawing as a 'parent' associated to the new axe 248 %PosRect=CurrentOrigin; 249 % xy=get(hcurrentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 250 if xy(1,1)>CurrentOrigin(1) 251 set(AxeData.ZoomAxes,'Xlim',[CurrentOrigin(1) xy(1,1)]) 252 else 253 set(AxeData.ZoomAxes,'Xlim',[xy(1,1) CurrentOrigin(1)]) 254 end 255 if xy(1,2)>CurrentOrigin(2) 256 set(AxeData.ZoomAxes,'Ylim',[CurrentOrigin(2) xy(1,2)]) 257 else 258 set(AxeData.ZoomAxes,'Ylim',[xy(1,2) CurrentOrigin(2)]) 259 end 238 260 set(AxeData.ZoomAxes,'UserData',ChildAxeData);%update the AxeData of the new axes 239 261 end … … 242 264 243 265 %% zoom in or out by a factor 2 if no new figure is created 244 if test_zoom 245 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 246 xlim=get(currentaxes,'XLim'); 247 ylim=get(currentaxes,'YLim'); 266 if CheckZoom 267 if testsubplot 268 haxes=gca;% zoom on a zoom sub-plot 269 else 270 haxes=hcurrentaxes;% zoom on the main plot 271 end 272 % xy=get(haxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 273 xlim=get(haxes,'XLim'); 274 ylim=get(haxes,'YLim'); 248 275 % if left mouse button has been pressed, zoom in by a factor of 2 249 if isequal(get( hcurrentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2250 PlotBoxAspectRatio=get( currentaxes,'PlotBoxAspectRatio');276 if isequal(get(gcf,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2 277 PlotBoxAspectRatio=get(haxes,'PlotBoxAspectRatio'); 251 278 yoverx=PlotBoxAspectRatio(2)/PlotBoxAspectRatio(1); 252 279 if yoverx <2 253 280 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); 254 281 xlim(2)=0.5*xy(1,1)+0.5*xlim(2);%double the field whith the middle at the selected points 255 set( currentaxes,'XLim',xlim)282 set(haxes,'XLim',xlim) 256 283 end 257 284 if yoverx >0.5 258 285 ylim(2)=0.5*xy(1,2)+0.5*ylim(2); 259 286 ylim(1)=0.5*xy(1,2)+0.5*ylim(1); 260 set( currentaxes,'YLim',ylim)287 set(haxes,'YLim',ylim) 261 288 end 262 289 … … 267 294 ylim(1)=2*ylim(1)-xy(1,2); 268 295 ylim(2)=2*ylim(2)-xy(1,2); 269 if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY') 296 % adjust the zoom out to the available field 297 if ~testsubplot && isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY') 270 298 xlim(1)=max(AxeData.RangeX(1),xlim(1)); 271 299 xlim(2)=min(AxeData.RangeX(2),xlim(2)); … … 279 307 if isequal(xlim,AxeData.RangeX) && isequal(ylim,AxeData.RangeY) 280 308 set(hhuvmat.CheckZoom,'Value',0) 281 set(hhuvmat.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])309 % set(hhuvmat.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 282 310 set(hhuvmat.CheckFixLimits,'Value',0) 283 set(hhuvmat.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])284 end 285 end 286 set( currentaxes,'XLim',xlim)287 set( currentaxes,'YLim',ylim)311 % set(hhuvmat.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 312 end 313 end 314 set(haxes,'XLim',xlim) 315 set(haxes,'YLim',ylim) 288 316 %test whther zoom out is operating (to inactivate AxedAta 289 317 if ~isfield(AxeData,'CurrentXLim')|| ~isequal(xlim,AxeData.CurrentXLim) … … 291 319 end 292 320 end 293 if isfield(AxeData,'LimEditBox')&& AxeData.LimEditBox% update display of the GUI containing the axis (uvmat or view_field) 321 %if isfield(AxeData,'LimEditBox')&& AxeData.LimEditBox% update display of the GUI containing the axis (uvmat or view_field) 322 if testsubplot 323 set(AxeData.CurrentRectZoom,'Position',[xlim(1) ylim(1) xlim(2)-xlim(1) ylim(2)-ylim(1)]) 324 else 294 325 set(hhcurrentfig.num_MinX,'String',num2str(xlim(1))) 295 326 set(hhcurrentfig.num_MaxX,'String',num2str(xlim(2))) … … 300 331 301 332 %% editing calibration point 302 if ~ test_zoom && isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'calibration')333 if ~CheckZoom && isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'calibration') 303 334 h_geometry_calib=findobj(allchild(0),'tag','geometry_calib'); %find the geomterty_calib GUI 304 335 if ~isempty(h_geometry_calib) 305 336 hh_geometry_calib=guidata(h_geometry_calib); 306 337 edit_test=get(hh_geometry_calib.edit_append,'Value'); 307 hh=findobj( currentaxes,'tag','calib_points');%look for handle of calibration points338 hh=findobj(hcurrentaxes,'tag','calib_points');%look for handle of calibration points 308 339 if ~isempty(hh) && edit_test 309 340 index_point=get(hh,'UserData'); … … 313 344 data=read_geometry_calib(Coord); 314 345 % val=get(h_ListCoord,'Value'); 315 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates346 % xy=get(hcurrentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 316 347 data.Coord(index_point,4)=xy(1,1); 317 348 data.Coord(index_point,5)=xy(1,2); … … 331 362 332 363 %% finalising ruler 333 if test_ruler 364 if test_ruler && ~isempty(xy) 334 365 set(hhuvmat.MenuRuler,'checked','off')%desable the ruler option in uvmat 335 xy=get( currentaxes,'CurrentPoint');% get the current mouse coordinates366 xy=get(hcurrentaxes,'CurrentPoint');% get the current mouse coordinates 336 367 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)];% append the recorded ruler origin to the current mouse coordinates 337 368 RulerCoord=diff(RulerCoord,1);% coordiante difference between segment end and beginning … … 346 377 347 378 %% display the data of the current object selected with the mouse right click 348 if isequal(get(hcurrentfig,'SelectionType'),'alt') && ~ test_zoom && (~isfield(AxeData,'Drawing')||~isequal(AxeData.Drawing,'create'))379 if isequal(get(hcurrentfig,'SelectionType'),'alt') && ~CheckZoom && (~isfield(AxeData,'Drawing')||~isequal(AxeData.Drawing,'create')) 349 380 hother=findobj('Tag','proj_object');%find all the proj objects 350 381 nbselect=0; … … 384 415 AxeData.Drawing='off';%stop current drawing action 385 416 end 386 set( currentaxes,'UserData',AxeData);417 set(hcurrentaxes,'UserData',AxeData); 387 418 if ~isempty(huvmat) 388 419 set(huvmat,'UserData',UvData); 389 420 end 390 421 391 392 422 %------------------------------------------------------------------------ 423 % --- 'close_fig': function activated when a zoom figure is closed 424 %------------------------------------------------------------------------ 425 function close_fig(ggg,eventdata,hparent) 426 427 hfig=get(get(hparent,'parent'),'parent'); 428 hbutton=findobj(hfig,'Tag','CheckZoomFig'); 429 if ~isempty(hbutton) 430 set(hbutton,'Value',0)% desactivate the zoom fig option 431 end 432 delete(hparent) % delete the rectangle showing the zoom graph in the parent fig 433
Note: See TracChangeset
for help on using the changeset viewer.