Changeset 379 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jan 27, 2012, 1:59:18 AM (9 years ago)
Author:
sommeria
Message:

several bugs corrected
set_object.fig rationalized so that read_set_object is replaced by the rgeneral fct read_GUI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r371 r379  
    155155% Properties attached to projection objects (create, menuline, menuplane...):
    156156%    'Tag'='proj_object': for all projection objects
    157 %    ObjectData.Style=...: style of projection object:
     157%    ObjectData.Type=...: style of projection object:
    158158%              .ProjMode
    159159%              .Coord: defines the position of the object
     
    815815end
    816816if ~isempty(XmlData.Time)
    817     nbfield=size(XmlData.Time,1);
    818     nbfield_j=size(XmlData.Time,2);
     817%     nbfield=size(XmlData.Time,1);
     818%     nbfield_j=size(XmlData.Time,2);
    819819    %transform .Time to a column vector if it is a line vector the nomenclature uses a single index
    820820    if isequal(nbfield,1) && ~isequal(nbfield_j,1)% .Time is a line vector
     
    822822        if numel(NomType)>=2 &&(strcmp(NomType,'_i')||strcmp(NomType(1:2),'%0')||strcmp(NomType(1:2),'_%'))
    823823            XmlData.Time=(XmlData.Time)';
    824             nbfield=nbfield_j;
    825             nbfield_j=1;
     824%             nbfield=nbfield_j;
     825%             nbfield_j=1;
    826826        end
    827827    end
     
    21042104    set(handles.FixVelType,'Visible','on')
    21052105    menu=set_veltype_display(ParamOut.CivStage);
    2106     index_menu=strcmp(ParamOut.VelType,menu);
    2107     set(handles.VelType,'Value',find(index_menu,1))
     2106    index_menu=strcmp(ParamOut.VelType,menu);%look for VelType in  the menu
     2107    index_val=find(index_menu,1);
     2108    if isempty(index_val)
     2109        index_val=1;
     2110    end
     2111    set(handles.VelType,'Value',index_val)
    21082112    if ~get(handles.SubField,'value')
    2109     set(handles.VelType,'String',menu)
    2110      set(handles.VelType_1,'Value',1)
    2111      set(handles.VelType_1,'String',[{''};menu])
     2113        set(handles.VelType,'String',menu)
     2114        set(handles.VelType_1,'Value',1)
     2115        set(handles.VelType_1,'String',[{''};menu])
    21122116    end
    21132117else
     
    23322336    if test_set_object% reinitiate the GUI set_object
    23332337        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
    2334         UvData.Object{1}.Style='plane';%main plotting plane
     2338        UvData.Object{1}.Type='plane';%main plotting plane
    23352339        UvData.Object{1}.ProjMode='projection';%main plotting plane
    23362340        UvData.Object{1}.DisplayHandle_uvmat=[]; %plane not visible in uvmat
     
    31543158    edit_vect_Callback(hObject, eventdata, handles)
    31553159    %initiate set_object GUI
    3156     data.TITLE='VOLUME';
     3160    data.Name='VOLUME';
    31573161    if isfield(UvData,'CoordType')
    31583162        data.CoordType=UvData.CoordType;
     
    32403244            end
    32413245            if isfield(ObjectData,'Coord')& isfield(ObjectData,'Style')
    3242                 if isequal(ObjectData.Style,'polygon')
     3246                if isequal(ObjectData.Type,'polygon')
    32433247                    X=ObjectData.Coord(:,1);
    32443248                    Y=ObjectData.Coord(:,2);
     
    32473251                    end
    32483252                    flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside                 
    3249                 elseif isequal(ObjectData.Style,'ellipse')
     3253                elseif isequal(ObjectData.Type,'ellipse')
    32503254                    if testphys
    32513255                        %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
     
    32583262                    distY=(Yi-ObjectData.Coord(1,2));
    32593263                    flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
    3260                 elseif isequal(ObjectData.Style,'rectangle')
     3264                elseif isequal(ObjectData.Type,'rectangle')
    32613265                    if testphys
    32623266                        %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
     
    41784182                end
    41794183                if isfield(ObjectData,'Coord')&& isfield(ObjectData,'Style')
    4180                     if isequal(ObjectData.Style,'polygon')
     4184                    if isequal(ObjectData.Type,'polygon')
    41814185                        X=ObjectData.Coord(:,1);
    41824186                        Y=ObjectData.Coord(:,2);
     
    41854189                        end
    41864190                        flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
    4187                     elseif isequal(ObjectData.Style,'ellipse')
     4191                    elseif isequal(ObjectData.Type,'ellipse')
    41884192                        if testphys
    41894193                            %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
     
    41964200                        distY=(Yi-ObjectData.Coord(1,2));
    41974201                        flagobj=(distX.*distX/X2Max+distY.*distY/Y2Max)>1;
    4198                     elseif isequal(ObjectData.Style,'rectangle')
     4202                    elseif isequal(ObjectData.Type,'rectangle')
    41994203                        if testphys
    42004204                            %[X,Y]=px_XYZ(Calib,X,Y,0);% TODO:create a polygon boundary and transform to phys
     
    43504354function Menupoints_Callback(hObject, eventdata, handles)
    43514355%------------------------------------------------------------------------
    4352 data.Style='points';
     4356data.Type='points';
    43534357data.ProjMode='projection';%default
    43544358create_object(data,handles)
     
    43574361function Menuline_Callback(hObject, eventdata, handles)
    43584362%------------------------------------------------------------------------
    4359 data.Style='line';
     4363data.Type='line';
    43604364data.ProjMode='projection';%default
    43614365create_object(data,handles)
     
    43644368function Menupolyline_Callback(hObject, eventdata, handles)
    43654369%------------------------------------------------------------------------
    4366 data.Style='polyline';
     4370data.Type='polyline';
    43674371data.ProjMode='projection';%default
    43684372create_object(data,handles)
     
    43714375function Menupolygon_Callback(hObject, eventdata, handles)
    43724376%------------------------------------------------------------------------
    4373 data.Style='polygon';
     4377data.Type='polygon';
    43744378data.ProjMode='inside';%default
    43754379create_object(data,handles)
     
    43784382function Menurectangle_Callback(hObject, eventdata, handles)
    43794383%------------------------------------------------------------------------
    4380 data.Style='rectangle';
     4384data.Type='rectangle';
    43814385data.ProjMode='inside';%default
    43824386create_object(data,handles)
     
    43854389function Menuellipse_Callback(hObject, eventdata, handles)
    43864390%------------------------------------------------------------------------
    4387 data.Style='ellipse';
     4391data.Type='ellipse';
    43884392data.ProjMode='inside';%default
    43894393create_object(data,handles)
     
    43924396function MenuMaskObject_Callback(hObject, eventdata, handles)
    43934397%------------------------------------------------------------------------
    4394 data.Style='polygon';
    4395 data.StyleMenu={'polygon'};
     4398data.Type='polygon';
     4399data.TypeMenu={'polygon'};
    43964400data.ProjMode='mask_inside';%default
    43974401data.ProjMenu={'mask_inside';'mask_outside'};
     
    44014405function Menuplane_Callback(hObject, eventdata, handles)
    44024406%------------------------------------------------------------------------
    4403 data.Style='plane';
     4407data.Type='plane';
    44044408data.ProjMode='projection';%default
    44054409
     
    44094413function Menuvolume_Callback(hObject, eventdata, handles)
    44104414%------------------------------------------------------------------------
    4411 data.Style='volume';
     4415data.Type='volume';
    44124416data.ProjMode='interp';%default
    44134417% set(handles.create,'Visible','on')
     
    44304434
    44314435%read the file
    4432 t=xmltree(fileinput);
    4433 data=convert(t);
     4436% t=xmltree(fileinput);
     4437% data=convert(t);
     4438data=xml2struct(fileinput);
    44344439data.enable_plot=1;
    44354440[pp,data.Name]=fileparts(FileName);
     
    44664471val=get(handles.transform_fct,'Value');
    44674472%data.CoordType=transform_list{val};
     4473data.Coord=[0 0]; %default
    44684474if isfield(UvData,'Field')
    44694475    Field=UvData.Field;
     
    44814487        data.DX=max(meshx,meshy);
    44824488    end
    4483     if isfield(Field,'NbDim')
    4484         data.NbDim=Field.NbDim;
     4489    if isfield(Field,'NbDim')&& isequal(Field.NbDim,3)
     4490         data.Coord=[0 0 0]; %default
    44854491    end
    44864492    if isfield(Field,'CoordUnit')
     
    44884494    end
    44894495end
    4490 data.Coord=[0 0 0]; %default
    4491 if isfield(data,'Style') && isequal(data.Style,'line')
    4492     if isfield(data,'DX')
    4493         data.Coord=[[0 0 0];[data.DX 0 0]]; %default
    4494     else
    4495         data.Coord=[[0 0 0];[1 0 0]]; %default
    4496     end
    4497 end
     4496% if isfield(data,'Type') && isequal(data.Type,'line')
     4497%     if isfield(data,'DX')
     4498%         data.Coord=[[0 0 0];[data.DX 0 0]]; %default
     4499%     else
     4500%         data.Coord=[[0 0 0];[1 0 0]]; %default
     4501%     end
     4502% end
    44984503if ishandle(handles.UVMAT_title)
    44994504    delete(handles.UVMAT_title)%delete the initial display of uvmat if no field has been entered
Note: See TracChangeset for help on using the changeset viewer.