Changeset 159 for trunk/src/set_object.m


Ignore:
Timestamp:
Dec 23, 2010, 8:09:20 AM (10 years ago)
Author:
sommeria
Message:

bug in civ corrected: civ2 was not lauched for Windows system
various bugs corrections and cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r158 r159  
    4646                   'gui_LayoutFcn',  [] , ...
    4747                   'gui_Callback',   []);
    48 if nargin & isstr(varargin{1})
     48if nargin & ischar(varargin{1})
    4949    gui_State.gui_Callback = str2func(varargin{1});
    5050end
     
    318318end
    319319if isequal(style,'line')
    320     if isequal(style_prev,'rectangle')|isequal(style_prev,'ellipse')
     320    if strcmp(style_prev,'rectangle')||strcmp(style_prev,'ellipse')
    321321        XMax=get(handles.XMax,'String');
    322322        YMax=get(handles.YMax,'String');
     
    328328    end
    329329elseif isequal(style,'polyline')
    330 elseif isequal(style,'rectangle')| isequal(style,'ellipse')
     330elseif strcmp(style,'rectangle')|| strcmp(style,'ellipse')
    331331     set(handles.XObject,'String',x_new)
    332332     set(handles.YObject,'String',y_new)
     
    387387    set(handles.YMax,'Visible','on')
    388388end
    389 if isequal(ObjectStyle,'rectangle')|isequal(ObjectStyle,'ellipse')
     389if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse')
    390390    set(handles.XMax,'Visible','on')
    391391else
     
    731731ListObject=get(hhuvmat.list_object_1,'String');%position in the objet list
    732732IndexObj_1=get(hhuvmat.list_object_1,'Value');
    733 IndexObj_2=get(hhuvmat.list_object_2,'Value');
     733if isequal(get(hhuvmat.list_object_2,'Visible'),'on')
     734    IndexObj_2=get(hhuvmat.list_object_2,'Value');
     735else
     736    IndexObj_2=[];
     737end
    734738testnew=0;
    735739PlotHandles=get_plot_handles(hhuvmat);
     
    741745    projview='uvmat';
    742746     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    
     747elseif ~isempty(IndexObj_2) && IndexObj_2<=numel(ListObject)&& strcmp(ListObject{IndexObj_2},ObjectName)% we are editing the object whose projection is viewed in view_field 
    745748    IndexObj=IndexObj_2;
    746749%     projview='view_field';
     
    756759end
    757760if strcmp(projview,'view_field')
    758     hview_field=findobj(allchild(0),'tag','view_field')
     761    hview_field=findobj(allchild(0),'tag','view_field');
    759762    if isempty(hview_field)
    760         hview_field=view_field
     763        hview_field=view_field;
    761764    end
    762765    PlotHandles=guidata(hview_field);
     
    792795
    793796%% update the object plot and projection field
    794 if testnew
     797if testnew 
    795798    set(hhuvmat.list_object_2,'Value',IndexObj)
    796799    ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;
    797800    ObjectData.DisplayHandle_view_field=[];
    798 else % save the previous object graph handles
     801elseif ~isfield(UvData.Object{IndexObj},'DisplayHandle_uvmat')% save the previous object graph handles
    799802    ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj}.DisplayHandle_uvmat;
    800803    ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj}.DisplayHandle_view_field;
     804else
     805    ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;
     806    ObjectData.DisplayHandle_view_field=[];
    801807end
    802808UvData.Object{IndexObj}=ObjectData;%update the current object properties
    803 IndexObj
    804 ObjectData
    805809UvData.Object=update_obj(UvData,IndexObj_1,IndexObj_2);
    806810
    807811%% plot the field projected on the object and store it the corresponding figue
    808812get(plotaxes,'tag')
    809 ProjData= proj_field(UvData.Field,ObjectData)%project the current interface field on ObjectData
     813ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData
    810814[PlotType,Object_out{IndexObj}.PlotParam,plotaxes]=plot_field(ProjData,plotaxes,PlotHandles);%update an existing field plot
    811815if strcmp(projview,'view_field')
     
    880884    def={fullfile(dir_save,[Object.Style '.xml'])};
    881885end
    882 options.Resize='on';
    883886displ_txt='save object as an .xml file';%default display
    884887menu=get(handles.ProjMode,'String');
     
    889892end
    890893answer=msgbox_uvmat('INPUT_TXT','save object as an .xml file',def);
    891 %answer=inputdlg('','save object in a new .xml file',1,def,'on');
    892894if ~isempty(answer)
    893895    t=struct2xml(Object);
Note: See TracChangeset for help on using the changeset viewer.