Changeset 159 for trunk/src/set_object.m
- Timestamp:
- Dec 23, 2010, 8:09:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/set_object.m
r158 r159 46 46 'gui_LayoutFcn', [] , ... 47 47 'gui_Callback', []); 48 if nargin & is str(varargin{1})48 if nargin & ischar(varargin{1}) 49 49 gui_State.gui_Callback = str2func(varargin{1}); 50 50 end … … 318 318 end 319 319 if isequal(style,'line') 320 if isequal(style_prev,'rectangle')|isequal(style_prev,'ellipse')320 if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse') 321 321 XMax=get(handles.XMax,'String'); 322 322 YMax=get(handles.YMax,'String'); … … 328 328 end 329 329 elseif isequal(style,'polyline') 330 elseif isequal(style,'rectangle')| isequal(style,'ellipse')330 elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse') 331 331 set(handles.XObject,'String',x_new) 332 332 set(handles.YObject,'String',y_new) … … 387 387 set(handles.YMax,'Visible','on') 388 388 end 389 if isequal(ObjectStyle,'rectangle')|isequal(ObjectStyle,'ellipse')389 if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse') 390 390 set(handles.XMax,'Visible','on') 391 391 else … … 731 731 ListObject=get(hhuvmat.list_object_1,'String');%position in the objet list 732 732 IndexObj_1=get(hhuvmat.list_object_1,'Value'); 733 IndexObj_2=get(hhuvmat.list_object_2,'Value'); 733 if isequal(get(hhuvmat.list_object_2,'Visible'),'on') 734 IndexObj_2=get(hhuvmat.list_object_2,'Value'); 735 else 736 IndexObj_2=[]; 737 end 734 738 testnew=0; 735 739 PlotHandles=get_plot_handles(hhuvmat); … … 741 745 projview='uvmat'; 742 746 plotaxes=hhuvmat.axes3;%handle of axes3 in view_field 743 elseif IndexObj_2<=numel(ListObject)&& strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field 744 747 elseif ~isempty(IndexObj_2) && IndexObj_2<=numel(ListObject)&& strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field 745 748 IndexObj=IndexObj_2; 746 749 % projview='view_field'; … … 756 759 end 757 760 if strcmp(projview,'view_field') 758 hview_field=findobj(allchild(0),'tag','view_field') 761 hview_field=findobj(allchild(0),'tag','view_field'); 759 762 if isempty(hview_field) 760 hview_field=view_field 763 hview_field=view_field; 761 764 end 762 765 PlotHandles=guidata(hview_field); … … 792 795 793 796 %% update the object plot and projection field 794 if testnew 797 if testnew 795 798 set(hhuvmat.list_object_2,'Value',IndexObj) 796 799 ObjectData.DisplayHandle_uvmat=hhuvmat.axes3; 797 800 ObjectData.DisplayHandle_view_field=[]; 798 else 801 elseif ~isfield(UvData.Object{IndexObj},'DisplayHandle_uvmat')% save the previous object graph handles 799 802 ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj}.DisplayHandle_uvmat; 800 803 ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj}.DisplayHandle_view_field; 804 else 805 ObjectData.DisplayHandle_uvmat=hhuvmat.axes3; 806 ObjectData.DisplayHandle_view_field=[]; 801 807 end 802 808 UvData.Object{IndexObj}=ObjectData;%update the current object properties 803 IndexObj804 ObjectData805 809 UvData.Object=update_obj(UvData,IndexObj_1,IndexObj_2); 806 810 807 811 %% plot the field projected on the object and store it the corresponding figue 808 812 get(plotaxes,'tag') 809 ProjData= proj_field(UvData.Field,ObjectData) %project the current interface field on ObjectData813 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 810 814 [PlotType,Object_out{IndexObj}.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotHandles);%update an existing field plot 811 815 if strcmp(projview,'view_field') … … 880 884 def={fullfile(dir_save,[Object.Style '.xml'])}; 881 885 end 882 options.Resize='on';883 886 displ_txt='save object as an .xml file';%default display 884 887 menu=get(handles.ProjMode,'String'); … … 889 892 end 890 893 answer=msgbox_uvmat('INPUT_TXT','save object as an .xml file',def); 891 %answer=inputdlg('','save object in a new .xml file',1,def,'on');892 894 if ~isempty(answer) 893 895 t=struct2xml(Object);
Note: See TracChangeset
for help on using the changeset viewer.