Changeset 444 for trunk/src/mouse_up.m
- Timestamp:
- Jun 7, 2012, 9:56:19 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r432 r444 55 55 %% finalize the fabrication or the translation/deformation of an object and plot the corresponding projected field 56 56 if ~isempty(huvmat) && isfield(AxeData,'Drawing') && ~isequal(AxeData.Drawing,'off') && isfield(AxeData,'CurrentObject')... 57 57 && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject) 58 58 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 59 PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object 59 PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object 60 60 IndexObj=PlotData.IndexObj; 61 ObjectData=UvData.Object{IndexObj}; 62 % ObjectData.enable_plot=1; 63 if strcmp(ObjectData.Type,'rectangle')||strcmp(ObjectData.Type,'ellipse') 64 NbDefPoint=1; 65 elseif strcmp(ObjectData.Type,'line')|| strcmp(ObjectData.Type,'plane'); 66 NbDefPoint=2; 67 else 68 NbDefPoint=3; 69 end 61 ObjectData=UvData.Object{IndexObj}; 62 check_multiple=0; 70 63 % ending translation 71 64 if isequal(AxeData.Drawing,'translate') … … 82 75 ObjectData.Coord(ind_move,2)=xy(1,2); 83 76 84 %creating object 85 else 77 %creating object 78 else 86 79 switch ObjectData.Type 87 80 case {'line'} … … 91 84 xy(1,3)=0; % z coordinate set to 0 by default 92 85 end 93 % if ~isequal(ObjectData.Coord,xy(1,:))94 86 % if ~isequal(ObjectData.Coord,xy(1,:)) 87 if ~isequal(ObjectData.Coord(end,1:2),xy(1,1:2)) 95 88 ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the second point of the line if different from the first one 96 97 % end89 end 90 % end 98 91 case {'rectangle','ellipse','volume'} 99 92 XYData=AxeData.CurrentOrigin; … … 112 105 end 113 106 end 107 otherwise 108 check_multiple=1; 114 109 end 115 110 end … … 123 118 set(hh_set_object.num_RangeY_2,'String',num2str(ObjectData.RangeY,4)); 124 119 end 125 if NbDefPoint<=2 || isequal(get(currentfig,'SelectionType'),'alt') ||... 126 strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing 120 121 %stop drawing and plot projected field if the object manipulation is finished 122 if check_multiple==0 || isequal(get(currentfig,'SelectionType'),'alt') 127 123 AxeData.CurrentOrigin=[]; %suppress the current origin 128 if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)>=2 129 AxeData.Drawing='off'; 130 set(currentaxes,'UserData',AxeData); 131 % return % line needs at leqst two points 132 end 133 if ~isempty(ObjectData) 134 % testmask=0; 135 % hmask=findobj(huvmat,'Tag','makemask'); 136 % if ~isempty(hmask) 137 % testmask=get(hmask,'Value'); 138 % end 139 140 %% update the object representation 141 % ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj}.DisplayHandle_uvmat; 142 % ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj}.DisplayHandle_view_field; 143 % UvData.Object{IndexObj}=ObjectData;%update the current object properties 144 % hhuvmat=guidata(huvmat); 145 % IndexObj_1=get(hhuvmat.ListObject_1,'Value'); 146 % IndexObj_2=get(hhuvmat.ListObject,'Value'); 147 % UvData.Object=update_obj(UvData,IndexObj_1,IndexObj_2); 148 149 %% plot the field projected on the object 124 % if isequal(ObjectData.Type,'line') && size(ObjectData.Coord,1)>=2 125 % % AxeData.Drawing='off'; 126 % % set(currentaxes,'UserData',AxeData); 127 % 128 % end 129 if ~isempty(ObjectData) 130 % testmask=0; 131 % hmask=findobj(huvmat,'Tag','makemask'); 132 % if ~isempty(hmask) 133 % testmask=get(hmask,'Value'); 134 % end 135 136 % plot the field projected on the object 150 137 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 151 138 if ~isempty(ProjData) 152 139 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen in view_field 153 140 hview_field=findobj(allchild(0),'tag','view_field'); 154 141 if isempty(hview_field) 155 142 hview_field=view_field(ProjData); %open the view_field GUI for plot … … 160 147 end 161 148 ViewFieldData=get(hview_field,'UserData'); 162 % ViewFieldData.axes3=ProjData;149 % ViewFieldData.axes3=ProjData; 163 150 haxes=findobj(hview_field,'tag','axes3'); 164 151 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) … … 172 159 set(hview_field,'Position',ViewFieldData.GUISize) 173 160 end 174 175 % Data=get(hview_field,'UserData');176 % if isempty(hview_field)177 % hview_field=view_field(ProjData);178 % else179 % hhview_field=guidata(hview_field);180 % [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot181 % write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object182 % end183 % ViewFieldData=get(hview_field,'UserData');184 % ViewFieldData.axes3=ProjData;185 % set(hview_field,'UserData',ViewFieldData)186 161 else 187 162 UvData.axes3=ProjData; … … 189 164 write_plot_param(hhuvmat,PlotParam); %update the display of plotting parameters for the current object 190 165 end 191 %[PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_plot_param(hh_plotfield));%update an existing field plot192 193 166 end 194 167 set(hhuvmat.ViewField,'Value',1);% … … 199 172 set(hhuvmat.MenuEdit,'Enable','on');% 200 173 end 201 e nd202 AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the new current origin203 test_drawing=1;%allow continuation of drawing object204 UvData.Object{IndexObj}=ObjectData;205 % end 174 else 175 test_drawing=1;%allow continuation of drawing object 176 AxeData.CurrentOrigin=[xy(1,1) xy(1,2)]; %the current point becomes the next current origin 177 end 178 UvData.Object{IndexObj}=ObjectData; 206 179 hother=findobj('Tag','deformpoint');%find all the deformpoints 207 set(hother,'Color','b');%reset all the deformpoints in 'blue' 208 else 209 test_drawing=0; 180 set(hother,'Color','b');%reset all the deformpoints in 'blue' 210 181 end 211 182
Note: See TracChangeset
for help on using the changeset viewer.