Changeset 102 for trunk/src/mouse_up.m
- Timestamp:
- Jun 13, 2010, 11:32:05 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r89 r102 28 28 handles=get(gcbo,'UserData'); 29 29 end 30 huvmat=findobj(allchild(0),' Name','uvmat');%find the uvmat interface handle30 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle 31 31 if ~isempty(huvmat) 32 32 hhuvmat=guidata(huvmat); … … 62 62 ObjectData.Coord(ind_move,2)=xy(1,2); 63 63 else %creating object 64 if isequal(ObjectData.Style,'line')||isequal(ObjectData.Style,'polyline')||...65 isequal(ObjectData.Style,'polygon')||isequal(ObjectData.Style,'points')64 if strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||... 65 strcmp(ObjectData.Style,'polygon')||strcmp(ObjectData.Style,'points') 66 66 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 67 67 xy(1,3)=AxeData.ObjectCoord(1,3); % z coordinate of the mouse: to generalise ... … … 91 91 end 92 92 %set(AxeData.CurrentObject,'UserData',ObjectData); %update the object properties 93 if isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')93 if strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse') 94 94 NbDefPoint=1; 95 elseif isequal(ObjectData.Style,'line')|| isequal(ObjectData.Style,'plane');95 elseif strcmp(ObjectData.Style,'line')|| strcmp(ObjectData.Style,'plane'); 96 96 NbDefPoint=2; 97 97 else … … 100 100 101 101 %show object coordinates in the GUI set_object 102 h_set_object=findobj(allchild(0),'Name','set_object'); 103 h_XObject=findobj(h_set_object,'Tag','XObject'); 104 h_YObject=findobj(h_set_object,'Tag','YObject'); 105 h_ZObject=findobj(h_set_object,'Tag','ZObject'); 106 set(h_XObject,'String',num2str(ObjectData.Coord(:,1),4)); 107 set(h_YObject,'String',num2str(ObjectData.Coord(:,2),4)); 108 set(h_ZObject,'String',num2str(ObjectData.Coord(:,3),4)); 102 h_set_object=findobj(allchild(0),'Tag','set_object'); 103 hh_set_object=guidata(h_set_object); 104 set(hh_set_object.XObject,'String',num2str(ObjectData.Coord(:,1),4)); 105 set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4)); 106 set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4)); 109 107 if NbDefPoint<=2 || isequal(get(currentfig,'SelectionType'),'alt') ||... 110 isequal(AxeData.Drawing,'translate') || isequal(AxeData.Drawing,'deform');%stop drawing108 strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing 111 109 AxeData.CurrentOrigin=[]; %suppress the current origin 112 110 if isequal(ObjectData.Style,'line') && size(ObjectData.Coord,1)<=1 … … 126 124 PlotHandles=get_plot_handles(handles);%get the handles of the graphic objects setting the plotting parameters 127 125 end 128 AxeData.hset_object=set_object(ObjectData,PlotHandles);% call the set_object interface ,*129 126 UvData.Object{IndexObj}=update_obj(UvData,IndexObj,ObjectData,PlotHandles); 130 %ObjectData=update_obj(UvData,IndexObj,ObjectData,PlotHandles);131 127 if isfield(UvData.Object{IndexObj},'PlotParam') 132 128 write_plot_param(PlotHandles,UvData.Object{IndexObj}.PlotParam); %update the display of plotting parameters for the current object 133 end 134 % set(hhuvmat.create,'Value',0);% set to 'off' the button for object creation 135 % set(hhuvmat.create,'BackgroundColor',[0 1 0]);% paint the creation button in green 129 end 136 130 set(hhuvmat.edit,'BackgroundColor',[1 1 0]);% paint the edit text in yellow 137 131 set(hhuvmat.edit,'Value',1);% … … 139 133 set(hhuvmat.MenuEditObject,'Enable','on');% 140 134 set(hhuvmat.MenuEdit,'Enable','on');% 141 % set(hhuvmat.MenuObject,'Enable','on');%142 135 UvData.MouseAction='edit_object'; % set the edit button to 'on' 143 136 end … … 152 145 test_drawing=0; 153 146 end 154 155 147 %creation of a new zoom plot 156 148 test_replot=0; … … 235 227 %zoom out by a factor of 2 out when the right mouse button has been used 236 228 elseif isequal(get(currentfig,'SelectionType'),'alt'); %if right button has been pressed 237 alpha=2; %zoom factor (zoom out by a factor 2)229 % alpha=2; %zoom factor (zoom out by a factor 2) 238 230 xlim=get(currentaxes,'XLim'); 239 231 xlim_new(1)=2*xlim(1)-xy(1,1); … … 344 336 end 345 337 if ((nbselect==0) && isequal(get(currentobj,'Type'),'axes')) || isequal(currentobj,huvmat) 346 global Data_uvmat347 Data_uvmat=get(currentobj,'UserData');348 %plot_text(CurData)349 %get_field([],CurData);350 evalin('base', 'global Data_uvmat')%make CurData global in the workspace338 currentfig=get(currentobj,'parent'); 339 figname=get(currentfig,'name'); 340 eval(['global Data_' figname]) 341 eval(['Data_' figname '=get(currentobj,''UserData'')']); 342 evalin('base',['global Data_' figname])%make CurData global in the workspace 351 343 objtype=get(currentobj,'Type'); 352 344 display(['UserData of ' objtype ':']) 353 evalin('base', 'Data_uvmat') %display CurData in the workspace345 evalin('base',['Data_' figname]) %display CurData in the workspace 354 346 commandwindow %brings the Matlab command window to the front 355 347 end
Note: See TracChangeset
for help on using the changeset viewer.