Changeset 302
- Timestamp:
- Nov 26, 2011, 4:31:48 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/delete_object.m
r227 r302 11 11 huvmat=findobj('tag','uvmat');%handles of the uvmat interface 12 12 UvData=get(huvmat,'UserData'); 13 hlist_object=findobj(huvmat,'Tag',' list_object_1');%handles of the object liçst in the uvmat interface13 hlist_object=findobj(huvmat,'Tag','ListObject');%handles of the object liçst in the uvmat interface 14 14 list_str=get(hlist_object,'String');%objet list 15 15 ObjectData=[];%default -
trunk/src/mouse_down.m
r296 r302 118 118 case 'uicontrol' %if the mouse is over a uicontrol, duplicate the display in an editable zoom window 119 119 if isequal(get(hObject,'SelectionType'),'alt') && isequal(get(hchild,'Visible'),'on') && ~isequal(get(hchild,'tag'),'frame_object')&&... 120 ~isequal(get(hchild,'tag'),' list_object_2') && ~isequal(get(hchild,'tag'),'list_object_1')120 ~isequal(get(hchild,'tag'),'ListObject') 121 121 if strcmp(get(hchild,'Visible'),'on') 122 122 msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4); … … 236 236 %indicate on the list of the GUI uvmat which object has been selected 237 237 if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field 238 set(hhuvmat.list_object_2,'Value',IndexObj); 239 list_str=get(hhuvmat.list_object_2,'String'); 240 UvData.Object{IndexObj}.Name=list_str{IndexObj}; 238 IndexObj_old=get(hhuvmat.ListObject,'Value'); 239 if IndexObj>IndexObj_old(1) 240 IndexObj=[IndexObj_old(1) IndexObj]; 241 else 242 IndexObj=[1 IndexObj]; 243 end 244 set(hhuvmat.ListObject,'Value',IndexObj); 245 set(hhuvmat.ListObject,'UserData',IndexObj); 246 % list_str=get(hhuvmat.list_object_2,'String'); 247 % UvData.Object{IndexObj(2)}.Name=list_str{IndexObj}; 241 248 else 242 set(hhuvmat. list_object_1,'Value',IndexObj);243 list_str=get(hhuvmat. list_object_1,'String');249 set(hhuvmat.ListObject,'Value',IndexObj); 250 list_str=get(hhuvmat.ListObject,'String'); 244 251 UvData.Object{IndexObj}.Name=list_str{IndexObj}; 245 252 end … … 293 300 end 294 301 UvData.Object{IndexObj}=ObjectData; 295 list_str=get(hhuvmat.list_object_1,'String'); 302 list_str=get(hhuvmat.ListObject,'String'); 303 IndexObj_old=get(hhuvmat.ListObject,'Value'); 304 set(hhuvmat.ListObject,'Value',[IndexObj_old(1) IndexObj] ); 305 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 296 306 object_name=get(sethandles.TITLE,'String'); 297 307 if isempty(object_name)|| strcmp(object_name,'') … … 301 311 list_str{IndexObj}=object_name; 302 312 end 303 set(hhuvmat.list_object_1,'String',list_str) 313 set(hhuvmat.ListObject,'String',list_str) 314 UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject; 304 315 %list_str{end+1}='...'; 305 set(hhuvmat.list_object_2,'String',list_str)306 if strcmp(fig_tag,'view_field')%we are in view_field plot307 set(hhuvmat.list_object_1,'Value',IndexObj)% the projection field will be plotted in uvmat frame308 UvData.Object{IndexObj}.DisplayHandle_uvmat=[];309 UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;310 else%we are in uvmat plot311 set(hhuvmat.list_object_2,'Value',IndexObj)312 UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject;313 UvData.Object{IndexObj}.DisplayHandle_view_field=[];314 end316 % set(hhuvmat.list_object_2,'String',list_str) 317 % if strcmp(fig_tag,'view_field')%we are in view_field plot 318 % set(hhuvmat.list_object_1,'Value',IndexObj)% the projection field will be plotted in uvmat frame 319 % UvData.Object{IndexObj}.DisplayHandle_uvmat=[]; 320 % UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject; 321 % else%we are in uvmat plot 322 % set(hhuvmat.list_object_2,'Value',IndexObj) 323 % UvData.Object{IndexObj}.DisplayHandle_uvmat=AxeData.CurrentObject; 324 % UvData.Object{IndexObj}.DisplayHandle_view_field=[]; 325 % end 315 326 set(huvmat,'UserData',UvData) 316 327 PlotData=get(AxeData.CurrentObject,'UserData'); -
trunk/src/mouse_up.m
r292 r302 144 144 UvData.Object{IndexObj}=ObjectData;%update the current object properties 145 145 hhuvmat=guidata(huvmat); 146 IndexObj_1=get(hhuvmat.list_object_1,'Value'); 147 IndexObj_2=get(hhuvmat.list_object_2,'Value'); 146 IndexObj=get(hhuvmat.ListObject,'Value'); 147 IndexObj_1=IndexObj(1); 148 IndexObj_2=IndexObj(2); 149 %IndexObj_2=get(hhuvmat.list_object_2,'Value'); 148 150 UvData.Object=update_obj(UvData,IndexObj_1,IndexObj_2); 149 151 -
trunk/src/update_obj.m
r183 r302 1 1 %'update_obj': update the object graph representation and its projection field, record it in the uvmat interface 2 2 %------------------------------------------------------------------- 3 %Object_out=update_obj(UvData,IndexObj ,ObjectData,PlotHandles);3 %Object_out=update_obj(UvData,IndexObj_1,IndexObj_2); 4 4 5 5 %OUTPUT: … … 12 12 % .Object{IndexObj}.DisplayHandle_uvmat: handles of the object plot on uvmat, =[] if it does not exist 13 13 % .Object{IndexObj}.DisplayHandle_view_field: handles of the object plot on view_field, =[] if it does not exist 14 %IndexObj_1: index of the object used for the uvmat plot15 %IndexObj_2: index of the object used for the view_field plot14 %IndexObj_1: index of the object whose projection is plotted in the GUI uvmat 15 %IndexObj_2: index of the object whose projection is plotted in te GUI view_field 16 16 %------------------------------------- 17 17 … … 30 30 end 31 31 Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation of Object_out{iobj} on Object_out{IndexObj_1} 32 Object_out{iobj}.DisplayHandle_uvmat 32 33 end 33 34 % plot view_field -
trunk/src/uvmat.m
r299 r302 236 236 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 237 237 set(hObject,'DeleteFcn',{@closefcn})% 238 set(handles.list_object_1,'ButtonDownFcn',{@list_object_1_Callback,handles})% allows activation of lis_object_1_callback with right mouse click239 set(handles.list_object_2,'ButtonDownFcn',{@list_object_2_Callback,handles})238 %set(handles.ListObject,'ButtonDownFcn',{@list_object_1_Callback,handles})% allows activation of lis_object_1_callback with right mouse click 239 %set(handles.list_object_2,'ButtonDownFcn',{@list_object_2_Callback,handles}) 240 240 241 241 %% refresh projection plane … … 366 366 set(handles.OBJECT_txt,'Visible','on') 367 367 set(handles.edit_object,'Visible','on') 368 set(handles. list_object_1,'Visible','on')368 set(handles.ListObject,'Visible','on') 369 369 set(handles.frame_object,'Visible','on') 370 370 if ~isempty(errormsg) … … 559 559 set(handles.OBJECT_txt,'Visible','on') 560 560 set(handles.edit_object,'Visible','on') 561 set(handles. list_object_1,'Visible','on')561 set(handles.ListObject,'Visible','on') 562 562 set(handles.frame_object,'Visible','on') 563 563 %%%%%% initiate input file: … … 864 864 865 865 %% update list of recent files in the menubar 866 MenuFile=[{FileName};get(handles.MenuFile_1,'Label');get(handles.MenuFile_2,'Label');... 867 get(handles.MenuFile_3,'Label');get(handles.MenuFile_4,'Label');get(handles.MenuFile_5,'Label')]; 868 866 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};... 867 {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}]; 868 str_find=strcmp(FileName,MenuFile); 869 if isempty(find(str_find,1)) 870 MenuFile=[{FileName};MenuFile];%insert the current file if not already in the list 871 end 869 872 for ifile=1:min(length(MenuFile),5) 870 873 eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});']) … … 2475 2478 end 2476 2479 if test_set_object% reinitiate the GUI set_object 2477 delete_object(1);% delete the current projection object in the list UvData.Object, delete its graphic representations and update the list displayed in handles. list_object_1and 22480 delete_object(1);% delete the current projection object in the list UvData.Object, delete its graphic representations and update the list displayed in handles.ListObject and 2 2478 2481 UvData.Object{1}.Style='plane';%main plotting plane 2479 2482 UvData.Object{1}.ProjMode='projection';%main plotting plane … … 2490 2493 UvData.Object{1}.enable_plot=1; 2491 2494 set_object(UvData.Object{1},handles,ZBounds); 2492 set(handles. list_object_1,'Value',1);2493 set(handles. list_object_1,'String',{'1-PLANE'});2495 set(handles.ListObject,'Value',1); 2496 set(handles.ListObject,'String',{'1-PLANE'}); 2494 2497 set(handles.edit_object,'Value',1)% put the plane in edit mode to enable the z cursor 2495 2498 edit_object_Callback([],[], handles) … … 2514 2517 UvData.Object{1}.ProjMode='projection';%main plotting plane 2515 2518 UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat 2516 set(handles. list_object_1,'Value',1);2517 list_object=get(handles. list_object_1,'String');2519 set(handles.ListObject,'Value',1); 2520 list_object=get(handles.ListObject,'String'); 2518 2521 if isempty(list_object) 2519 2522 list_object={''}; … … 2521 2524 list_object=[{''};list_object]; 2522 2525 end 2523 set(handles. list_object_1,'String',list_object);2524 set(handles.list_object_2,'String',list_object);2526 set(handles.ListObject,'String',list_object); 2527 % set(handles.list_object_2,'String',list_object); 2525 2528 end 2526 2529 testnewseries=UvData.NewSeries; … … 2536 2539 %% Plot the projections on the selected projection objects 2537 2540 % main projection object (uvmat display) 2538 list_object=get(handles. list_object_1,'String');2541 list_object=get(handles.ListObject,'String'); 2539 2542 if isequal(list_object,{''})%refresh list of objects if the menu is empty 2540 2543 UvData.Object={[]}; 2541 set(handles. list_object_1,'Value',1)2542 set(handles.list_object_2,'Value',1)2543 set(handles.list_object_2,'String',{''})2544 set(handles.list_object_2,'Visible','off')2545 end 2546 IndexObj (1)=get(handles.list_object_1,'Value');%selected projection object for main view2544 set(handles.ListObject,'Value',1) 2545 % set(handles.list_object_2,'Value',1) 2546 % set(handles.list_object_2,'String',{''}) 2547 % set(handles.list_object_2,'Visible','off') 2548 end 2549 IndexObj=get(handles.ListObject,'Value');%selected projection object for main view 2547 2550 if IndexObj(1)> numel(UvData.Object) 2548 2551 IndexObj(1)=1;%select the first object if the selected one does not exist 2549 set(handles. list_object_1,'Value',1)2552 set(handles.ListObject,'Value',1) 2550 2553 end 2551 2554 plot_handles{1}=handles; … … 2561 2564 2562 2565 % second projection object (view_field display) 2563 IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view 2564 if IndexObj_2==0 2565 IndexObj_2=1; 2566 end 2567 if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2}) 2568 IndexObj(2)=IndexObj_2; 2566 % IndexObj_2=get(handles.list_object_2,'Value');%selected projection object for the second view 2567 % if IndexObj_2==0 2568 % IndexObj_2=1; 2569 % end 2570 %if isequal(get(handles.list_object_2,'Visible'),'on') && IndexObj_2 <= numel(UvData.Object)&& ~isempty(UvData.Object{IndexObj_2}) 2571 if length( IndexObj)>=2 2572 % IndexObj(2)=IndexObj_2; 2569 2573 view_field_handle=findobj(allchild(0),'tag','view_field');%handles of the view_field GUI 2570 2574 if ~isempty(view_field_handle) … … 3846 3850 UvData.Object=UvData.Object(1); 3847 3851 end 3848 list_object=get(handles. list_object_1,'String');3849 set(handles. list_object_1,'Value',1)3850 set(handles. list_object_1,'String',{''})3851 set(handles.list_object_2,'Value',1)3852 set(handles.list_object_2,'String',{''})3853 list_object_2_Callback(hObject, eventdata, handles)3852 list_object=get(handles.ListObject,'String'); 3853 set(handles.ListObject,'Value',1) 3854 set(handles.ListObject,'String',{''}) 3855 %set(handles.list_object_2,'Value',1) 3856 %set(handles.list_object_2,'String',{''}) 3857 %list_object_2_Callback(hObject, eventdata, handles) 3854 3858 3855 3859 %delete mask if it is displayed … … 4181 4185 %suppress the other options 4182 4186 set(handles.CheckZoom,'Value',0) 4183 zoom_Callback(hObject, eventdata, handles)4187 CheckZoom_Callback(hObject, eventdata, handles) 4184 4188 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib'); 4185 4189 if ishandle(hgeometry_calib) … … 4191 4195 UvData.MouseAction='none'; 4192 4196 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4193 hset_object=findobj(allchild(0),'tag','set_object');% look for the set_object GUI4194 if ~isempty(hset_object)4195 delete(hset_object)% delete the current GUI set_object4196 end4197 % hset_object=findobj(allchild(0),'tag','set_object');% look for the set_object GUI 4198 % if ~isempty(hset_object) 4199 % delete(hset_object)% delete the current GUI set_object 4200 % end 4197 4201 end 4198 4202 set(handles.uvmat,'UserData',UvData); … … 4208 4212 4209 4213 %------------------------------------------------------------------------ 4210 % --- Executes on selection change in list_object_1. 4211 function list_object_1_Callback(hObject, eventdata, handles) 4212 %------------------------------------------------------------------------ 4213 list_str=get(handles.list_object_1,'String'); 4214 IndexObj=get(handles.list_object_1,'Value'); 4215 %IndexObj(2)=get(handles.list_object_2,'Value'); 4216 update_object(handles,IndexObj,1,list_str{IndexObj}) 4217 4218 %------------------------------------------------------------------------ 4219 % --- Executes on selection change in list_object_1. 4220 function list_object_2_Callback(hObject, eventdata, handles) 4221 %------------------------------------------------------------------------ 4222 list_str=get(handles.list_object_2,'String'); 4223 IndexObj=get(handles.list_object_2,'Value'); 4224 %IndexObj(2)=get(handles.list_object_2,'Value')-1; 4225 % if no projection object is selected, close view_field 4226 if ischar(list_str) || isempty(list_str{IndexObj}) 4227 hview_field=findobj(allchild(0),'Tag','view_field'); 4228 if ~isempty(hview_field) 4229 delete(hview_field) 4230 end 4231 hset_object=findobj(allchild(0),'Tag','set_object'); 4232 if ~isempty(hset_object) 4233 delete(hset_object) 4234 end 4235 else 4236 if isequal(get(handles.uvmat,'SelectionType'),'alt') 4237 option=4;%will show object properties on the GUI set_object 4214 % --- Executes on selection change in ListObject. 4215 function ListObject_Callback(hObject, eventdata, handles) 4216 %------------------------------------------------------------------------ 4217 4218 list_str=get(handles.ListObject,'String'); 4219 IndexObj_old=get(handles.ListObject,'UserData');%retrieve previous selection 4220 IndexObj=get(handles.ListObject,'Value'); 4221 if length(IndexObj)>2 4222 IndexObj=[IndexObj(end-1) IndexObj(end)];%keeps only the last two selected items at most 4223 end 4224 if length(IndexObj)==1 4225 if length(IndexObj_old)>=2 && isequal(IndexObj_old(1),IndexObj) 4226 IndexObj=IndexObj_old(2); 4227 elseif length(IndexObj_old)>=2 && isequal(IndexObj_old(2),IndexObj) 4228 IndexObj=IndexObj_old(1); 4238 4229 else 4239 option=2; % just update the projection4240 end 4241 update_object(handles,IndexObj,option,list_str{IndexObj}) 4242 end 4243 4244 %------------------------------------------------------------------------ 4245 function update_object(handles,IndexObj,option,ObjectName)4246 %------------------------------------------------------------------------ 4230 IndexObj=[IndexObj_old(1) IndexObj]; 4231 end 4232 end 4233 set(handles.ListObject,'Value',IndexObj); %keeps only the two first selected objects 4234 set(handles.ListObject,'UserData',IndexObj) 4235 %desactivate the edit object mode 4236 set(handles.edit_object,'Value',0) 4237 edit_object_Callback(hObject, eventdata, handles) 4247 4238 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4248 4239 if numel(UvData.Object)<max(IndexObj); 4240 msgbox_uvmat('ERROR','invalid object list') 4249 4241 return 4250 4242 end 4251 % if option==1 ||option==3 4243 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); 4244 set(handles.uvmat,'UserData',UvData) 4245 4246 %project on the selected object and update the corresponding plot 4247 hview_field=findobj(allchild(0),'tag','view_field'); 4248 ViewObjectAxes=[];%default 4249 if ~isequal(IndexObj(1),IndexObj_old(1)) 4250 update_object(handles,IndexObj(1),handles.axes3,list_str{IndexObj(1)})%plot the projection in uvmat 4251 end 4252 if length(IndexObj)==2 && (length(IndexObj_old)==1 || ~isequal(IndexObj(2),IndexObj_old(2))) 4253 hview_field=findobj(allchild(0),'tag','view_field'); 4254 if isempty(hview_field) 4255 hview_field=view_field; 4256 end 4257 PlotHandles=guidata(hview_field); 4258 update_object(handles,IndexObj(2),PlotHandles.axes3,list_str{IndexObj(2)})%plot the projection in view_field 4259 end 4260 update_object_color(handles.axes3,PlotHandles.axes3,UvData.Object{IndexObj(2)}.DisplayHandle_uvmat) 4261 4262 %------------------------------------------------------------------------ 4263 function update_object(handles,IndexObj,ViewObjectAxes,ObjectName) 4264 %------------------------------------------------------------------------ 4265 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4252 4266 ObjectData=UvData.Object{IndexObj}; 4253 % else4254 % ObjectData=UvData.Object{IndexObj};4255 % end4256 4267 ObjectData.Name=ObjectName; 4257 4268 if isequal(get(handles.edit_object,'Value'),1) … … 4266 4277 if ~isempty(hset_object) 4267 4278 delete(hset_object)% delete existing version of set_object 4279 hset_object=set_object(ObjectData,[],ZBounds); 4268 4280 end 4269 4281 edit_test=get(handles.edit_object,'Value'); … … 4276 4288 end 4277 4289 4278 if option==3 ||option==4% right mouse selection, show the GUI set_object: 4279 hset_object=set_object(ObjectData,[],ZBounds); 4280 end 4281 4282 %project on the selected object and update the corresponding plot 4283 hview_field=findobj(allchild(0),'tag','view_field'); 4284 % PlotHandles=guidata(hview_field); 4285 if option==1 || option==3%length(UvData.Object)>= IndexObj && isfield(UvData.Object{IndexObj},'plotaxes')&& ishandle(UvData.Object{IndexObj}.plotaxes) 4286 PlotHandles=handles; 4287 else 4288 if isempty(hview_field) 4289 hview_field=view_field; 4290 end 4291 PlotHandles=guidata(hview_field); 4292 end 4293 if option==1 ||option==2% lefet mouse selection, peroject the field: 4294 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4295 %plot_field(ProjData,PlotHandles.axes3,read_plot_param(PlotHandles));%read plotting parameters on the uvmat interfacPlotHandles); 4296 plot_field(ProjData,PlotHandles.axes3,read_GUI(get(PlotHandles.axes3,'Parent')));%read plotting parameters on the uvmat interfacPlotHandles); 4297 UvData.Object=update_obj(UvData,IndexObj,[]); 4298 set(handles.uvmat,'UserData',UvData) 4299 end 4300 4301 4290 uistack(ViewObjectAxes,'top')% display the plotting axes at the top 4291 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4292 plot_field(ProjData,ViewObjectAxes,read_GUI(get(ViewObjectAxes,'Parent')));%read plotting parameters on the uvmat interfacPlotHandles); 4293 % 4294 % UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); 4302 4295 % set(handles.uvmat,'UserData',UvData) 4303 hother=[findobj(handles.axes3,'Tag','proj_object') ;findobj(PlotHandles.axes3,'Tag','proj_object')] ;%find all the proj objects 4304 hother=[hother ;findobj(handles.axes3,'Tag','DeformPoint'); findobj(PlotHandles.axes3,'Tag','DeformPoint')]; 4296 4297 %------------------------------------------------------------------------ 4298 %--- update the representation of objects 4299 function update_object_color(axes_uvmat,axes_view_field,DisplayHandle) 4300 %------------------------------------------------------------------------ 4301 hother=[findobj(axes_uvmat,'Tag','proj_object') ;findobj(axes_view_field,'Tag','proj_object')] ;%find all the proj objects 4302 hother=[hother ;findobj(axes_uvmat,'Tag','DeformPoint'); findobj(axes_view_field,'Tag','DeformPoint')]; 4305 4303 for iobj=1:length(hother) 4306 4304 if isequal(get(hother(iobj),'Type'),'rectangle')||isequal(get(hother(iobj),'Type'),'patch') … … 4318 4316 set(hother(iobj),'Selected','off') 4319 4317 end 4320 if isfield(ObjectData,'DisplayHandle_uvmat') 4321 if ishandle(ObjectData.DisplayHandle_uvmat) 4322 uistack(ObjectData.DisplayHandle_uvmat,'top') 4323 linetype=get(ObjectData.DisplayHandle_uvmat,'Type'); 4324 if isequal(linetype,'line') 4325 set(ObjectData.DisplayHandle_uvmat,'Color','m'); %set the selected object to magenta color 4326 elseif isequal(linetype,'rectangle') 4327 set(ObjectData.DisplayHandle_uvmat,'EdgeColor','m'); %set the selected object to magenta color 4328 elseif isequal(linetype,'patch') 4329 set(ObjectData.DisplayHandle_uvmat,'FaceColor','m'); %set the selected object to magenta color 4330 end 4331 SubObjectData=get(ObjectData.DisplayHandle_uvmat,'UserData'); 4332 if isfield(SubObjectData,'SubObject') & ishandle(SubObjectData.SubObject) 4333 uistack(SubObjectData.SubObject,'top') 4334 for iobj=1:length(SubObjectData.SubObject) 4335 hsub=SubObjectData.SubObject(iobj); 4336 if isequal(get(hsub,'Type'),'rectangle') 4337 set(hsub,'EdgeColor','m'); %set the selected object to magenta color 4338 elseif isequal(get(hsub,'Type'),'image') 4339 Acolor=get(hsub,'CData'); 4340 Acolor(:,:,1)=Acolor(:,:,3); 4341 set(hsub,'CData',Acolor); 4342 else 4343 set(hsub,'Color','m') 4344 end 4345 end 4346 end 4347 if isfield(SubObjectData,'DeformPoint') & ishandle(SubObjectData.DeformPoint) 4348 set(SubObjectData.DeformPoint,'Color','m') 4349 end 4350 end 4351 end 4318 linetype=get(DisplayHandle,'Type'); 4319 if isequal(linetype,'line') 4320 set(DisplayHandle,'Color','m'); %set the selected object to magenta color 4321 elseif isequal(linetype,'rectangle') 4322 set(DisplayHandle,'EdgeColor','m'); %set the selected object to magenta color 4323 elseif isequal(linetype,'patch') 4324 set(DisplayHandle,'FaceColor','m'); %set the selected object to magenta color 4325 end 4326 SubObjectData=get(DisplayHandle,'UserData'); 4327 if isfield(SubObjectData,'SubObject') & ishandle(SubObjectData.SubObject) 4328 for iobj=1:length(SubObjectData.SubObject) 4329 hsub=SubObjectData.SubObject(iobj); 4330 if isequal(get(hsub,'Type'),'rectangle') 4331 set(hsub,'EdgeColor','m'); %set the selected object to magenta color 4332 elseif isequal(get(hsub,'Type'),'image') 4333 Acolor=get(hsub,'CData'); 4334 Acolor(:,:,1)=Acolor(:,:,3); 4335 set(hsub,'CData',Acolor); 4336 else 4337 set(hsub,'Color','m') 4338 end 4339 end 4340 end 4341 if isfield(SubObjectData,'DeformPoint') & ishandle(SubObjectData.DeformPoint) 4342 set(SubObjectData.DeformPoint,'Color','m') 4343 end 4344 4345 % SubObjectData=get(ObjectData.DisplayHandle_uvmat,'UserData'); 4346 4347 4348 4349 4350 4351 4352 4352 4353 4353 %------------------------------------------------------ … … 4487 4487 set(handles.CheckZoom,'Value',0) 4488 4488 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 4489 set(handles. list_object_1,'Value',1)4489 set(handles.ListObject,'Value',1) 4490 4490 % initiate display of GUI geometry_calib 4491 4491 data=[]; %default … … 4524 4524 return 4525 4525 else 4526 set(handles. list_object_1,'Max',2);%allow multiple selection4527 set(handles. list_object_1,'Value',val);4526 set(handles.ListObject,'Max',2);%allow multiple selection 4527 set(handles.ListObject,'Value',val); 4528 4528 flag=1; 4529 4529 npx=size(UvData.Field.A,2); … … 4609 4609 imwrite(imflag,answer,'BitDepth',8); 4610 4610 end 4611 set(handles. list_object_1,'Value',1)4612 set(handles. list_object_1,'Max',1)4611 set(handles.ListObject,'Value',1) 4612 set(handles.ListObject,'Max',1) 4613 4613 end 4614 4614 … … 4621 4621 edit_vect_Callback(hObject, eventdata, handles) 4622 4622 set(handles.edit_object,'BackgroundColor',[0.7 0.7 0.7]) 4623 set(handles. list_object_1,'Value',1)4623 set(handles.ListObject,'Value',1) 4624 4624 4625 4625 %prepare display of the set_grid GUI … … 4915 4915 CheckZoom_Callback(handles.uvmat, [], handles) 4916 4916 set(handles.delete_object,'Visible','on') 4917 set(handles.uvmat_title,'Visible','on')4918 set(handles.view_field_title,'Visible','on')4917 % set(handles._title,'Visible','on') 4918 % set(handles.view_field_title,'Visible','on') 4919 4919 4920 4920 %------------------------------------------------------------------------ … … 4951 4951 function delete_object_Callback(hObject, eventdata, handles) 4952 4952 %------------------------------------------------------------------------ 4953 IndexObj=get(handles. list_object_2,'Value');4954 if IndexObj >14955 delete_object(IndexObj )4953 IndexObj=get(handles.ListObject,'Value'); 4954 if IndexObj(end)>1 4955 delete_object(IndexObj(end)) 4956 4956 end 4957 4957 … … 4964 4964 4965 4965 4966 % --- Executes on button press in ViewObject. 4967 function ViewObject_Callback(hObject, eventdata, handles) 4968 IndexObj=get(handles.ListObject,'Value'); 4969 IndexObj=IndexObj(end); %keeps only the secodn value 4970 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 4971 if numel(UvData.Object)<IndexObj;% error in UvData 4972 msgbox_uvmat('ERROR','invalid object list') 4973 return 4974 end 4975 ObjectData=UvData.Object{IndexObj}; 4976 ZBounds=0; % default 4977 if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax') 4978 ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider 4979 ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider 4980 end 4981 hset_object=findobj(allchild(0),'tag','set_object'); 4982 if ~isempty(hset_object) 4983 delete(hset_object)% delete existing version of set_object 4984 end 4985 hset_object=set_object(ObjectData,[],ZBounds); -
trunk/src/view_field.m
r295 r302 73 73 if ~isempty(huvmat) 74 74 hhuvmat=guidata(huvmat); 75 set(hhuvmat.list_object_2,'Visible','on')76 set(hhuvmat.view_field_title,'Visible','on')75 % set(hhuvmat.list_object_2,'Visible','on') 76 % set(hhuvmat.view_field_title,'Visible','on') 77 77 % handles_mouse.create=hhuvmat.create; 78 78 handles_mouse.edit=hhuvmat.edit_object; … … 739 739 if ~isempty(huvmat) 740 740 hhuvmat=guidata(huvmat); 741 list_object_2=get(hhuvmat.list_object_2,'String');742 set(hhuvmat.list_object_2,'Value',1)%select the last value ('...')741 % list_object_2=get(hhuvmat.list_object_2,'String'); 742 % set(hhuvmat.list_object_2,'Value',1)%select the last value ('...') 743 743 end 744 744 delete(hObject)
Note: See TracChangeset
for help on using the changeset viewer.