Changeset 429 for trunk/src/uvmat.m
- Timestamp:
- May 22, 2012, 1:07:40 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r428 r429 239 239 UvData.Object{1}.ProjMode='projection';%main plotting plane 240 240 set(handles.ListObject,'Value',1)% default: empty projection objectproj_field 241 set(handles.ListObject,'String',{'plane _0'})241 set(handles.ListObject,'String',{'plane'}) 242 242 set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field 243 set(handles.ListObject_1,'String',{'plane _0'})243 set(handles.ListObject_1,'String',{'plane'}) 244 244 set(handles.Fields,'Value',1) 245 245 set(handles.Fields,'string',{''}) … … 3546 3546 3547 3547 %------------------------------------------------------------------ 3548 3549 3550 3551 3548 %------------------------------------------------------------- 3552 3549 % --- Executes on selection change in transform_fct. … … 3600 3597 end 3601 3598 3602 % check the current path to the selected function3599 %% check the current path to the selected function 3603 3600 if isa(list_transform{ind_coord},'function_handle') 3604 3601 func=functions(list_transform{ind_coord}); … … 3611 3608 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 3612 3609 3613 % delete drawn objects3610 %% delete drawn objects 3614 3611 hother=findobj('Tag','proj_object');%find all the proj objects 3615 3612 for iobj=1:length(hother) … … 3632 3629 end 3633 3630 set(handles.ListObject,'Value',1) 3634 set(handles.ListObject,'String',{''}) 3631 set(handles.ListObject,'String',{'plane'}) 3632 set(handles.ListObject_1,'Value',1) 3633 set(handles.ListObject_1,'String',{'plane'}) 3635 3634 3636 3635 %delete mask if it is displayed … … 4031 4030 set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised 4032 4031 end 4033 % desactivate the edit object mode 4032 4033 %% desactivate the edit object mode 4034 4034 set(handles.edit_object,'Value',0) 4035 4035 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4036 4036 4037 %% update the second plot (on view_field) if view_field is already openened 4038 axes_view_field=[];%default 4039 if length(IndexObj)==2 && (length(IndexObj_old)==1 || ~isequal(IndexObj(2),IndexObj_old(2))) 4040 hview_field=findobj(allchild(0),'tag','view_field'); 4041 if ~isempty(hview_field) 4042 PlotHandles=guidata(hview_field); 4043 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4044 axes_view_field=PlotHandles.axes3; 4045 plot_field(ProjData,axes_view_field,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles); 4037 %% update the plot on view_field if view_field is already openened 4038 hview_field=findobj(allchild(0),'tag','view_field'); 4039 if isempty(hview_field) 4040 hhview_field.axes3=[]; 4041 else 4042 Data=get(hview_field,'UserData'); 4043 hhview_field=guidata(hview_field); 4044 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 4045 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfachhview_fiel 4046 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 4047 haxes=findobj(hview_field,'tag','axes3'); 4048 pos=get(hview_field,'Position'); 4049 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 4050 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4051 pos_table=get(h_TableDisplay,'Position'); 4052 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 4053 drawnow% needed to change position before the next command 4054 set(hview_field,'UserData',Data);% restore the previously stored GUI position after GUI resizing 4055 else 4056 set(hview_field,'Position',Data.GUISize)% return to the previously stored GUI position and size 4046 4057 end 4047 4058 end 4048 4059 4049 4060 %% update the color of the graphic object representation: the selected object in magenta, others in blue 4050 update_object_color(handles.axes3,axes_view_field,UvData.Object{IndexObj(end)}.DisplayHandle_uvmat) 4061 update_object_color(handles.axes3,hhview_field.axes3,UvData.Object{IndexObj(end)}.DisplayHandle_uvmat) 4062 hview_field=findobj(allchild(0),'tag','view_field'); 4051 4063 4052 4064 %------------------------------------------------------------------------ … … 4228 4240 UvData.Object{IndexObj(end)}.Name=list_object{IndexObj(end)}; 4229 4241 4230 %% show the second plot (on view_field)4231 4242 %% show the projection of the selected object on view_field 4243 ProjData= proj_field(UvData.Field,UvData.Object{IndexObj});%project the current field on ObjectData 4232 4244 hview_field=findobj(allchild(0),'tag','view_field'); 4233 4245 if isempty(hview_field) 4234 4246 hview_field=view_field; 4235 4247 end 4236 PlotHandles=guidata(hview_field); 4237 plot_field(ProjData,PlotHandles.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles); 4248 hhview_field=guidata(hview_field); 4249 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%read plotting parameters on the GUI view_field); 4250 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 4251 haxes=findobj(hview_field,'tag','axes3'); 4252 pos=get(hview_field,'Position'); 4253 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Coordinates)% case of no plot display (pure text table) 4254 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4255 pos_table=get(h_TableDisplay,'Position'); 4256 set(hview_field,'Position',[pos(1)+pos(3)-pos_table(3) pos(2)+pos(4)-pos_table(4) pos_table(3) pos_table(4)]) 4257 else 4258 Data=get(hview_field,'UserData'); 4259 set(hview_field,'Position',Data.GUISize) 4260 end 4238 4261 else 4239 4262 hview_field=findobj(allchild(0),'tag','view_field'); … … 4481 4504 set(handles.edit_object,'Value',0); %suppress the object edit mode 4482 4505 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4506 ListObject=get(handles.ListObject,'String'); 4507 if ~strcmp(ListObject{end},'') 4508 ListObject=[ListObject;{''}]; %append a blank to the list (if nort already done) to indicate the creation of a new object 4509 set(handles.ListObject,'String',ListObject) 4510 end 4511 IndexObj=length(ListObject); 4512 set(handles.ListObject,'Value',IndexObj) 4483 4513 UvData=get(handles.uvmat,'UserData'); 4514 UvData.Object{IndexObj}=[]; %create a new empty object 4484 4515 data.Name=data.Type;% default name=type 4485 4516 data.Coord=[0 0]; %default … … 4506 4537 delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered 4507 4538 end 4508 4509 %set(handles.ViewField,'Value',1) % indicate that the object selected in ListObject (projection oin view_field) is visualised4510 %set(handles.ViewObject,'Value',1)% then the object selected in ListObject_1 is not visualised4511 4539 hset_object=set_object(data,handles);% call the set_object interface 4512 4540 hhset_object=guidata(hset_object); 4513 4541 hchild=get(hset_object,'children'); 4514 4542 set(hchild,'enable','on') 4515 %set(hhset_object.PLOT,'enable','on')% activate the refresh button4516 %set(handles.MenuObject,'checked','on')4517 4543 set(handles.uvmat,'UserData',UvData) 4518 4544 set(handles.CheckZoom,'Value',0) %desactivate the zoom for object creation by the mouse 4519 4545 CheckZoom_Callback(handles.uvmat, [], handles) 4520 4546 set(handles.delete_object,'Visible','on') 4521 4522 4547 4523 4548 %------------------------------------------------------------------------ … … 4536 4561 %read the file 4537 4562 data=xml2struct(fileinput); 4538 % data.enable_plot=1; 4563 4539 4564 [tild,data.Name]=fileparts(FileName);% object name set as file name 4540 % hset_object=findobj(allchild(0),'tag','set_object'); 4541 % if ~isempty(hset_object) 4542 % delete(hset_object)% delete existing version of set_object 4543 % end 4565 ListObject=get(handles.ListObject,'String'); 4566 if ~strcmp(ListObject{end},'') 4567 ListObject=[ListObject;{''}]; %append a blank to the list (if not already done) to indicate the creation of a new object 4568 set(handles.ListObject,'String',ListObject) 4569 end 4570 set(handles.ListObject,'Value',length(ListObject)) 4544 4571 hset_object=set_object(data);% call the set_object interface 4545 4572 set(get(hset_object,'children'),'enable','on')% enable edit action on elements on GUI set_object
Note: See TracChangeset
for help on using the changeset viewer.