Changeset 410 for trunk/src/mouse_down.m
- Timestamp:
- May 6, 2012, 4:06:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r402 r410 245 245 %indicate on the list of the GUI uvmat which object has been selected 246 246 if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field 247 IndexObj_old=get(hhuvmat.ListObject,'Value');248 if IndexObj>IndexObj_old(1)249 IndexObj=[IndexObj_old(1) IndexObj];250 else251 IndexObj=[1 IndexObj];252 end247 % IndexObj=get(hhuvmat.ListObject,'Value'); 248 % if IndexObj>IndexObj_old(1) 249 % IndexObj=[IndexObj_old(1) IndexObj]; 250 % else 251 % IndexObj=[1 IndexObj]; 252 % end 253 253 set(hhuvmat.ListObject,'Value',IndexObj); 254 set(hhuvmat.ListObject,'UserData',IndexObj);254 % set(hhuvmat.ListObject,'UserData',IndexObj); 255 255 else 256 set(hhuvmat.ListObject ,'Value',IndexObj);257 list_str=get(hhuvmat.ListObject ,'String');256 set(hhuvmat.ListObject_1,'Value',IndexObj); 257 list_str=get(hhuvmat.ListObject_1,'String'); 258 258 UvData.Object{IndexObj}.Name=list_str{IndexObj}; 259 259 end … … 290 290 if test_create && ~isempty(xy) && ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create')) 291 291 hset_object=findobj(allchild(0),'tag','set_object'); 292 % activate this option if the GUI set_object is opened 292 293 if ~isempty(hset_object) 293 sethandles=guidata(hset_object); 294 ObjectData=read_GUI(hset_object); %read object features in the GUI set_object294 sethandles=guidata(hset_object);% handles of the elements in set_object 295 ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object 295 296 ObjectData.Coord=[]; %reset previous object coordinates 296 ObjectData.Coord(1,1)=xy(1,1); 297 ObjectData.Coord(1,1)=xy(1,1); % the object first coordinate is set by the mouse position 297 298 ObjectData.Coord(1,2)=xy(1,2); 298 if isfield(AxeData,'ObjectCoord') & size(AxeData.ObjectCoord,2)==3299 if isfield(AxeData,'ObjectCoord') && size(AxeData.ObjectCoord,2)==3 299 300 ObjectData.Coord(1,3)=AxeData.ObjectCoord(1,3); %generaliser au cas avec angle 300 301 end … … 303 304 IndexObj=length(UvData.Object)+1;% add the object as index IndexObj on the list of the interface 304 305 else 305 IndexObj=2; 306 IndexObj=2;% the first object is used for uvmat display or blank 306 307 end 307 308 UvData.Object{IndexObj}=ObjectData; 308 ListObject=get(hhuvmat.ListObject,'String'); 309 IndexObj_old=get(hhuvmat.ListObject,'Value'); 309 ListObject=get(hhuvmat.ListObject_1,'String'); 310 310 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 311 311 ObjectNameNew=ObjectData.Name; … … 313 313 ObjectNameNew=ObjectData.Type; 314 314 end 315 % add an index to the object name if the proposed name already exists 315 316 vers=0;% index of the name 316 317 detectname=1; … … 330 331 ObjectName=ObjectNameNew; 331 332 set(sethandles.Name,'String',ObjectName)% display the default name in set_object 332 IndexObj=numel(ListObject)+1;% append an object to the list in uvmat333 % IndexObj=numel(ListObject)+1;% append an object to the list in uvmat 333 334 set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list 334 set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj]) 335 set(hhuvmat.ListObject_1,'String',[ListObject;{ObjectName}]);%complement the object list 336 %set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj]) 337 set(hhuvmat.ListObject,'Value',IndexObj) 335 338 % if isempty(object_name) 336 339 % list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Type]; … … 344 347 PlotData=get(AxeData.CurrentObject,'UserData'); 345 348 PlotData.IndexObj=IndexObj; 346 set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph 347 AxeData.Drawing='create'; 349 set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion) 350 AxeData.Drawing='create';% flag for mouse motion 348 351 end 349 352 end
Note: See TracChangeset
for help on using the changeset viewer.