Changeset 424


Ignore:
Timestamp:
May 16, 2012, 10:15:39 AM (13 years ago)
Author:
sommeria
Message:

improved way of dealing with projection objects

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r413 r424  
    275275                UvData.Object{IndexObj}.Name=list_str{IndexObj};
    276276            end
    277             h_set_object=findobj(allchild(0),'Tag','set_object');
    278             if ~isempty(h_set_object)
    279                 delete(h_set_object)
    280             end
     277%             h_set_object=findobj(allchild(0),'Tag','set_object');
     278%             if ~isempty(h_set_object)
     279%                 delete(h_set_object)
     280%             end
    281281            set_object(UvData.Object{IndexObj})
    282282            axes(hchild);%set back the current axes haxes
  • trunk/src/set_object.m

    r413 r424  
    180180if ~isempty(huvmat)
    181181    hhuvmat=guidata(huvmat);
    182     set(hhuvmat.ViewObject_1,'value',0)% desactivate the two view buttons
     182%     set(hhuvmat.ViewObject_1,'value',0)% desactivate the two view buttons
    183183    set(hhuvmat.ViewObject,'value',0)%
    184184    set(hhuvmat.edit_object,'Value',0)% desactivate the edit option
  • trunk/src/uvmat.m

    r423 r424  
    229229%% set functions for the mouse and keyboard
    230230% set(handles.histo_u,'NextPlot','replacechildren');
    231 set(handles.histo_v,'NextPlot','replacechildren');
     231% set(handles.histo_v,'NextPlot','replacechildren');
    232232set(hObject,'KeyPressFcn',{'keyboard_callback',handles})%set keyboard action function
    233233set(hObject,'WindowButtonMotionFcn',{'mouse_motion',handles})%set mouse action functio
     
    238238%% refresh projection plane
    239239UvData.Object{1}.ProjMode='projection';%main plotting plane
     240set(handles.ListObject,'Value',1)% default: empty projection objectproj_field
     241set(handles.ListObject,'String',{'plane_0'})
    240242set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field
    241 set(handles.ListObject_1,'String',{''})
     243set(handles.ListObject_1,'String',{'plane_0'})
    242244set(handles.Fields,'Value',1)
    243245set(handles.Fields,'string',{''})
     
    799801        set(handles.MenuExportMovie,'Enable','on')
    800802        set(handles.MenuTools,'Enable','on')
    801         set(handles.OBJECT_txt,'Visible','on')
    802         set(handles.edit_object,'Visible','on')
    803          set(handles.ListObject_1,'Visible','on')
    804          set(handles.ViewObject_1,'Visible','on')
    805         set(handles.frame_object,'Visible','on')
     803%         set(handles.OBJECT_txt,'Visible','on')
     804%         set(handles.edit_object,'Visible','on')
     805%          set(handles.ListObject_1,'Visible','on')
     806%          set(handles.ViewObject,'Visible','on')
     807%         set(handles.frame_object,'Visible','on')
    806808       
    807809        % initiate input file series and refresh the current field view:     
     
    24082410    end
    24092411    VarIndex=CellVarIndex{imax}; % list of variable indices
    2410 DimIndex=VarDimIndex{VarIndex(1)}; %list of dim indices for the variable
    2411 nbpoints_x=DimValue(DimIndex(NbDim));
    2412 XMax=nbpoints_x;%default
    2413 XMin=1;%default
     2412    DimIndex=VarDimIndex{VarIndex(1)}; %list of dim indices for the variable
     2413    nbpoints_x=DimValue(DimIndex(NbDim));
     2414    XMax=nbpoints_x;%default
     2415    XMin=1;%default
     2416end
     2417%% object visibility
     2418if NbDim>=2
     2419    set(handles.Objects,'Visible','on')
     2420    set(handles.ListObject_1_title,'Visible','on')
     2421    set(handles.ListObject_1,'Visible','on')
     2422else% usual (x,y) plots: no projection object
     2423    set(handles.Objects,'Visible','off')
     2424    set(handles.ListObject_title,'Visible','off')
     2425    set(handles.ListObject_1,'Visible','off')
    24142426end
    24152427if NbDim==3
     
    26912703%% prepare the menus of histograms and plot them (histogram of the whole volume in 3D case)
    26922704menu_histo=(UvData.Field.ListVarName)';%list of field variables to be displayed for the menu of histogram display
    2693 ind_bad=[];
    2694 nb_histo=1;
    2695 
     2705ind_skip=[];
     2706% nb_histo=1;
     2707Ustring='';
     2708Vstring='';
    26962709% suppress coordinates from the histogram menu
    2697 for ivar=1:numel(menu_histo)%l loop on field variables: 
     2710for ivar=1:numel(menu_histo)%l loop on field variables:
    26982711    if isfield(UvData.Field,'VarAttribute') && numel(UvData.Field.VarAttribute)>=ivar && isfield(UvData.Field.VarAttribute{ivar},'Role')
    26992712        Role=UvData.Field.VarAttribute{ivar}.Role;
    27002713        switch Role
    27012714            case {'coord_x','coord_y','coord_z','dimvar'}
    2702                 ind_bad=[ind_bad ivar];
     2715                ind_skip=[ind_skip ivar];
     2716            case {'vector_x'}
     2717                Ustring=UvData.Field.ListVarName{ivar};
     2718                ind_skip=[ind_skip ivar];
    27032719            case {'vector_y'}
    2704                 nb_histo=nb_histo+1;
     2720                Vstring=UvData.Field.ListVarName{ivar};
     2721                ind_skip=[ind_skip ivar];
    27052722        end
    27062723    end
     
    27132730    end
    27142731    if strcmp(DimName,menu_histo{ivar})
    2715         ind_bad=[ind_bad ivar];
    2716     end
    2717 end
    2718 menu_histo(ind_bad)=[];
     2732        ind_skip=[ind_skip ivar];
     2733    end
     2734end
     2735menu_histo(ind_skip)=[];% remove skipped items
     2736if ~isempty(Ustring)
     2737    menu_histo=[{[Ustring ',' Vstring]};menu_histo];% add U, V at the beginning if they exist
     2738end
    27192739
    27202740%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    27262746    histo1_menu_Callback(handles.histo1_menu, [], handles)% plot first histogram
    27272747    % case of more than one variables (eg vector components)
    2728     if nb_histo > 1
    2729         test_v=1;
    2730         set(handles.histo2_menu,'Visible','on')
    2731         set(handles.histo_v,'Visible','on')
    2732         set(handles.histo2_menu,'String',menu_histo)
    2733         set(handles.histo2_menu,'Value',2)
    2734         histo2_menu_Callback(handles.histo2_menu,[], handles)% plot second histogram
    2735     end
    2736 end
    2737 if ~test_v
    2738     set(handles.histo2_menu,'Visible','off')
    2739     set(handles.histo_v,'Visible','off')
    2740     cla(handles.histo_v)
    2741     set(handles.histo2_menu,'Value',1)
    2742 end
     2748%     if nb_histo > 1
     2749%         test_v=1;
     2750%         set(handles.histo2_menu,'Visible','on')
     2751%         set(handles.histo_v,'Visible','on')
     2752%         set(handles.histo2_menu,'String',menu_histo)
     2753%         set(handles.histo2_menu,'Value',2)
     2754%         histo2_menu_Callback(handles.histo2_menu,[], handles)% plot second histogram
     2755%     end
     2756end
     2757% if ~test_v
     2758%     set(handles.histo2_menu,'Visible','off')
     2759%     set(handles.histo_v,'Visible','off')
     2760%     cla(handles.histo_v)
     2761%     set(handles.histo2_menu,'Value',1)
     2762% end
    27432763%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    2744 
    2745 
    2746 
     2764%------------------------------------------------------------------------
     2765function histo1_menu_Callback(hObject, eventdata, handles)
     2766%--------------------------------------------
     2767%plot first histo
     2768%huvmat=get(handles.histo1_menu,'parent');
     2769histo_menu=get(handles.histo1_menu,'String');
     2770histo_value=get(handles.histo1_menu,'Value');
     2771FieldName=histo_menu{histo_value};
     2772% update_histo(handles.histo_u,handles.uvmat,FieldName)
     2773%
     2774% %------------------------------------------------------------------------
     2775% function histo2_menu_Callback(hObject, eventdata, handles)
     2776% %------------------------------------------------------------------------
     2777% %plot second histo
     2778% %huvmat=get(handles.histo2_menu,'parent');
     2779% histo_menu=get(handles.histo2_menu,'String');
     2780% histo_value=get(handles.histo2_menu,'Value');
     2781% FieldName=histo_menu{histo_value};
     2782% update_histo(handles.histo_v,handles.uvmat,FieldName)
     2783%
     2784% %------------------------------------------------------------------------
     2785% %read the field .Fieldname stored in UvData and plot its histogram
     2786% function update_histo(haxes,huvmat,FieldName)
     2787%------------------------------------------------------------------------
     2788UvData=get(handles.uvmat,'UserData');
     2789Field=UvData.Field;
     2790r=regexp(FieldName,'(?<var1>.*)(?<sep>,)(?<var2>.*)','names');
     2791FieldName_2='';
     2792if ~isempty(r)
     2793    FieldName=r.var1;
     2794    FieldName_2=r.var2;
     2795end
     2796if ~isfield(UvData.Field,FieldName)
     2797    msgbox_uvmat('ERROR',['no field  ' FieldName ' for histogram'])
     2798    return
     2799end
     2800FieldHisto=Field.(FieldName);
     2801if isfield(Field,'FF') && ~isempty(Field.FF) && isequal(size(Field.FF),size(FieldHisto))
     2802    indsel=find(Field.FF==0);%find values marked as false
     2803    if ~isempty(indsel)
     2804        FieldHisto=FieldHisto(indsel);
     2805        if ~isempty(FieldName_2)
     2806            FieldHisto(:,:,2)=Field.(FieldName_2)(indsel);
     2807        end
     2808    end
     2809end
     2810if isempty(Field)
     2811    msgbox_uvmat('ERROR',['empty field ' FieldName])
     2812else
     2813    nxy=size(FieldHisto);
     2814    Amin=double(min(min(min(FieldHisto))));%min of field value
     2815    Amax=double(max(max(max(FieldHisto))));%max of field value
     2816    if isequal(Amin,Amax)
     2817        cla(handles.histo_u)
     2818    else
     2819        Histo.ListVarName={FieldName,'histo'};
     2820        if isfield(Field,'NbDim') && isequal(Field.NbDim,3)
     2821            Histo.VarDimName={FieldName,FieldName}; %dimensions for the histogram
     2822        else
     2823            if numel(nxy)==2
     2824                Histo.VarDimName={FieldName,FieldName}; %dimensions for the histogram
     2825            else
     2826                Histo.VarDimName={FieldName,{FieldName,'component'}}; %dimensions for the histogram
     2827            end
     2828        end
     2829        %unit
     2830        units=[]; %default
     2831        for ivar=1:numel(Field.ListVarName)
     2832            if strcmp(Field.ListVarName{ivar},FieldName)
     2833                if isfield(Field,'VarAttribute') && numel(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'units')
     2834                    units=Field.VarAttribute{ivar}.units;
     2835                    break
     2836                end
     2837            end
     2838        end
     2839        if ~isempty(units)
     2840            Histo.VarAttribute{1}.units=units;
     2841        end
     2842        eval(['Histo.' FieldName '=linspace(Amin,Amax,50);'])%absissa values for histo
     2843        if isfield(Field,'NbDim') && isequal(Field.NbDim,3)
     2844            C=reshape(double(FieldHisto),1,[]);% reshape in a vector
     2845            Histo.histo(:,1)=hist(C, Histo.(FieldName));  %calculate histogram
     2846        else
     2847            for col=1:size(FieldHisto,3)
     2848                B=FieldHisto(:,:,col);
     2849                C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector
     2850                Histo.histo(:,col)=hist(C, Histo.(FieldName));  %calculate histogram
     2851            end
     2852        end
     2853        plot_field(Histo,handles.histo_u);
     2854    end
     2855end
    27472856
    27482857%-------------------------------------------------------------------
     
    34923601run0_Callback(hObject, eventdata, handles)
    34933602
    3494 %------------------------------------------------------------------------
    3495 function histo1_menu_Callback(hObject, eventdata, handles)
    3496 %--------------------------------------------
    3497 %plot first histo
    3498 %huvmat=get(handles.histo1_menu,'parent');
    3499 histo_menu=get(handles.histo1_menu,'String');
    3500 histo_value=get(handles.histo1_menu,'Value');
    3501 FieldName=histo_menu{histo_value};
    3502 update_histo(handles.histo_u,handles.uvmat,FieldName)
    3503 
    3504 %------------------------------------------------------------------------
    3505 function histo2_menu_Callback(hObject, eventdata, handles)
    3506 %------------------------------------------------------------------------
    3507 %plot second histo
    3508 %huvmat=get(handles.histo2_menu,'parent');
    3509 histo_menu=get(handles.histo2_menu,'String');
    3510 histo_value=get(handles.histo2_menu,'Value');
    3511 FieldName=histo_menu{histo_value};
    3512 update_histo(handles.histo_v,handles.uvmat,FieldName)
    3513 
    3514 %------------------------------------------------------------------------
    3515 %read the field .Fieldname stored in UvData and plot its histogram
    3516 function update_histo(haxes,huvmat,FieldName)
    3517 %------------------------------------------------------------------------
    3518 UvData=get(huvmat,'UserData');
    3519 if ~isfield(UvData.Field,FieldName)
    3520     msgbox_uvmat('ERROR',['no field  ' FieldName ' for histogram'])
    3521     return
    3522 end
    3523 Field=UvData.Field;
    3524 FieldHisto=eval(['Field.' FieldName]);
    3525 if isfield(Field,'FF') && ~isempty(Field.FF) && isequal(size(Field.FF),size(FieldHisto))
    3526     indsel=find(Field.FF==0);%find values marked as false
    3527     if ~isempty(indsel)
    3528         FieldHisto=FieldHisto(indsel);
    3529     end
    3530 end
    3531 if isempty(Field)
    3532     msgbox_uvmat('ERROR',['empty field ' FieldName])
    3533 else
    3534     nxy=size(FieldHisto);
    3535     Amin=double(min(min(min(FieldHisto))));%min of image
    3536     Amax=double(max(max(max(FieldHisto))));%max of image
    3537     if isequal(Amin,Amax)
    3538         %msgbox_uvmat('WARNING',['uniform field =' num2str(Amin)]);
    3539         cla(haxes)
    3540     else
    3541         Histo.ListVarName={FieldName,'histo'};
    3542         if isfield(Field,'NbDim') && isequal(Field.NbDim,3)
    3543             Histo.VarDimName={FieldName,FieldName}; %dimensions for the histogram
    3544         else
    3545             if numel(nxy)==2
    3546                 Histo.VarDimName={FieldName,FieldName}; %dimensions for the histogram
    3547             else
    3548                 Histo.VarDimName={FieldName,{FieldName,'rgb'}}; %dimensions for the histogram
    3549             end
    3550         end
    3551         %unit
    3552         units=[]; %default
    3553         for ivar=1:numel(Field.ListVarName)
    3554             if strcmp(Field.ListVarName{ivar},FieldName)
    3555                 if isfield(Field,'VarAttribute') && numel(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'units')
    3556                     units=Field.VarAttribute{ivar}.units;
    3557                     break
    3558                 end
    3559             end
    3560         end
    3561         if ~isempty(units)
    3562             Histo.VarAttribute{1}.units=units;
    3563         end
    3564         eval(['Histo.' FieldName '=linspace(Amin,Amax,50);'])%absissa values for histo
    3565         if isfield(Field,'NbDim') && isequal(Field.NbDim,3)
    3566             C=reshape(double(FieldHisto),1,[]);% reshape in a vector
    3567             eval(['Histo.histo(:,1)=hist(C, Histo.' FieldName ');']);  %calculate histogram
    3568         else
    3569             for col=1:size(FieldHisto,3)
    3570                 B=FieldHisto(:,:,col);
    3571                 C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector
    3572                 eval(['Histo.histo(:,col)=hist(C, Histo.' FieldName ');']);  %calculate histogram
    3573             end
    3574         end
    3575         plot_field(Histo,haxes);
    3576     end
    3577 end
     3603
    35783604
    35793605%------------------------------------------------
     
    39353961    ObjectData.Name=list_str{IndexObj};
    39363962    set_object(ObjectData,[],ZBounds);
    3937     set(handles.ViewObject_1,'Value',1)% show that the selected object in ListObject_1 is currently visualised
     3963    set(handles.ViewObject,'Value',1)% show that the selected object in ListObject_1 is currently visualised
    39383964end
    39393965%  desactivate the edit object mode
     
    39623988    ObjectData.Name=list_str{IndexObj};
    39633989    set_object(ObjectData,[],ZBounds);
    3964     set(handles.ViewObject,'Value',1)% show that the selected object in ListObject is currently visualised
     3990    set(handles.ViewField,'Value',1)% show that the selected object in ListObject is currently visualised
    39653991end
    39663992%  desactivate the edit object mode
     
    40384064
    40394065%------------------------------------------------------------------------
    4040 % --- Executes on button press in ViewObject_1.
    4041 function ViewObject_1_Callback(hObject, eventdata, handles)
    4042 %------------------------------------------------------------------------
    4043 check_view=get(handles.ViewObject_1,'Value');
     4066% --- Executes on button press in ViewObject.
     4067function ViewObject_Callback(hObject, eventdata, handles)
     4068%------------------------------------------------------------------------
     4069check_view=get(handles.ViewObject,'Value');
    40444070
    40454071if check_view %activate set_object   
    4046     set(handles.ViewObject,'Value',0)% deselect ViewObject
    4047     IndexObj=get(handles.ListObject_1,'Value');
    4048     list_object=get(handles.ListObject_1,'String');
     4072    IndexObj=get(handles.ListObject,'Value');
     4073    list_object=get(handles.ListObject,'String');
    40494074    UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    40504075    UvData.Object{IndexObj}.Name=list_object{IndexObj};
     
    40584083        ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    40594084    end
    4060     set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion
     4085%     set(handles.ListObject_1,'Value',IndexObj);%restore ListObject selection after set_object deletion
    40614086    data=UvData.Object{IndexObj};
    40624087    if ~isfield(data,'Type')% default plane
     
    40864111    if get(handles.edit_object,'Value')% edit mode
    40874112        set(hhset_object.PLOT,'Enable','on')
     4113        set(get(hset_object,'children'),'enable','on')
    40884114    else
    40894115        set(hhset_object.PLOT,'Enable','off')
     4116        set(get(hset_object,'children'),'enable','off')
    40904117    end
    40914118else
     
    40964123end
    40974124 
    4098 %------------------------------------------------------------------------
    4099 % --- Executes on button press in ViewObject.
    4100 function ViewObject_Callback(hObject, eventdata, handles)
    4101 %------------------------------------------------------------------------
    4102 check_view=get(handles.ViewObject,'Value');
    4103 
    4104 if check_view
    4105     set(handles.ViewObject_1,'Value',0)% unselect ViewObject_1
    4106     IndexObj=get(handles.ListObject,'Value');
    4107     UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    4108     if numel(UvData.Object)<IndexObj(end);% error in UvData
    4109         msgbox_uvmat('ERROR','invalid object list')
    4110         return
    4111     end
    4112     ZBounds=0; % default
    4113     if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
    4114         ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
    4115         ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    4116     end
    4117     set(handles.ListObject,'Value',IndexObj);%restore ListObject selection after set_object deletion
    4118     if ~isfield(UvData.Object{IndexObj(1)},'Type')% default plane
    4119         UvData.Object{IndexObj(1)}.Type='plane';
    4120     end
    4121     list_object=get(handles.ListObject,'String');
    4122     UvData.Object{IndexObj(end)}.Name=list_object{IndexObj(end)};
    4123     hset_object=set_object(UvData.Object{IndexObj(end)},[],ZBounds);
    4124     hhset_object=guidata(hset_object);
    4125     if get(handles.edit_object,'Value')% edit mode
    4126         set(hhset_object.PLOT,'Enable','on')
    4127     else
    4128         set(hhset_object.PLOT,'Enable','off')
    4129     end
    4130    
    4131     %% show the second plot (on view_field)
    4132     ProjData= proj_field(UvData.Field,UvData.Object{IndexObj});%project the current field on ObjectData
    4133     hview_field=findobj(allchild(0),'tag','view_field');
    4134     if isempty(hview_field)
    4135         hview_field=view_field;
    4136     end
    4137     PlotHandles=guidata(hview_field);
    4138     plot_field(ProjData,PlotHandles.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles);
    4139 else
    4140     hset_object=findobj(allchild(0),'tag','set_object');
    4141     if ~isempty(hset_object)
    4142         delete(hset_object)% delete existing version of set_object
    4143     end
    4144 end
    41454125%-------------------------------------------------------------------
    41464126% --- Executes on selection change in edit_object.
     
    41484128%-------------------------------------------------------------------
    41494129UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     4130hset_object=findobj(allchild(0),'Tag','set_object');
    41504131if get(handles.edit_object,'Value')
    41514132    set(handles.edit_object,'BackgroundColor',[1,1,0]) 
     
    41594140        set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7])
    41604141    end
    4161     hset_object=findobj(allchild(0),'Tag','set_object');
    4162     if isempty(hset_object)% open the GUI set_object with data of the currently selected object
    4163         ViewObject_Callback(hObject, eventdata, handles)
    4164         hset_object=findobj(allchild(0),'Tag','set_object');
    4165     end
    4166     hhset_object=guidata(hset_object);
    4167     set(hhset_object.PLOT,'enable','on');
    4168 else
     4142    set(handles.ViewObject,'value',1)
     4143    ViewObject_Callback(hObject, eventdata, handles)
     4144%     if isempty(hset_object)% open the GUI set_object with data of the currently selected object
     4145%         ViewObject_Callback(hObject, eventdata, handles)
     4146%         %         hset_object=findobj(allchild(0),'Tag','set_object');
     4147%     else
     4148%         hhset_object=guidata(hset_object);
     4149%         set(hhset_object.PLOT,'enable','on');
     4150%         set(get(hset_object,'children'),'enable','on')
     4151%     end
     4152else % desctivate object edit mode
    41694153    set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
    4170     hset_object=findobj(allchild(0),'Tag','set_object');
    41714154    if ~isempty(hset_object)% open the
    41724155        hhset_object=guidata(hset_object);
    41734156        set(hhset_object.PLOT,'enable','off');
    4174     end
    4175 end
     4157        set(get(hset_object,'children'),'enable','inactive')
     4158    end
     4159end
     4160
     4161%------------------------------------------------------------------------
     4162% --- Executes on button press in ViewField.
     4163function ViewField_Callback(hObject, eventdata, handles)
     4164%------------------------------------------------------------------------
     4165check_view=get(handles.ViewField,'Value');
     4166
     4167if check_view
     4168%     set(handles.ViewObject,'Value',0)% unselect ViewObject_1
     4169    IndexObj=get(handles.ListObject,'Value');
     4170    UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
     4171    if numel(UvData.Object)<IndexObj(end);% error in UvData
     4172        msgbox_uvmat('ERROR','invalid object list')
     4173        return
     4174    end
     4175    ZBounds=0; % default
     4176    if isfield(UvData.Field,'ZMin') && isfield(UvData.Field,'ZMax')
     4177        ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
     4178        ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
     4179    end
     4180    set(handles.ListObject,'Value',IndexObj);%restore ListObject selection after set_object deletion
     4181    if ~isfield(UvData.Object{IndexObj(1)},'Type')% default plane
     4182        UvData.Object{IndexObj(1)}.Type='plane';
     4183    end
     4184    list_object=get(handles.ListObject,'String');
     4185    UvData.Object{IndexObj(end)}.Name=list_object{IndexObj(end)};
     4186%     hset_object=set_object(UvData.Object{IndexObj(end)},[],ZBounds);
     4187%     hhset_object=guidata(hset_object);
     4188%     if get(handles.edit_object,'Value')% edit mode
     4189%         set(hhset_object.PLOT,'Enable','on')
     4190%         set(get(hset_object,'children'),'enable','on')
     4191%     else
     4192%         set(hhset_object.PLOT,'Enable','off')
     4193%         set(get(hset_object,'children'),'enable','inactive')
     4194%     end
     4195   
     4196    %% show the second plot (on view_field)
     4197        ProjData= proj_field(UvData.Field,UvData.Object{IndexObj});%project the current field on ObjectData
     4198    hview_field=findobj(allchild(0),'tag','view_field');
     4199    if isempty(hview_field)
     4200        hview_field=view_field;
     4201    end
     4202    PlotHandles=guidata(hview_field);
     4203    plot_field(ProjData,PlotHandles.axes3,read_GUI(hview_field));%read plotting parameters on the uvmat interfacPlotHandles);
     4204else
     4205    hview_field=findobj(allchild(0),'tag','view_field');
     4206    if ~isempty(hview_field)
     4207        delete(hview_field)% delete existing version of set_object
     4208    end
     4209end
     4210
    41764211
    41774212%------------------------------------------------------------------------
     
    44394474end
    44404475set(handles.ListObject,'Visible','on')
    4441 set(handles.ViewObject,'Visible','on')
    4442 set(handles.ViewObject,'Value',1) % indicate that the object selected in ListObject (projection oin view_field) is visualised
    4443 set(handles.ViewObject_1,'Value',0)% then the object selected in ListObject_1 is not visualised
     4476set(handles.ViewField,'Visible','on')
     4477set(handles.ViewField,'Value',1) % indicate that the object selected in ListObject (projection oin view_field) is visualised
     4478set(handles.ViewObject,'Value',0)% then the object selected in ListObject_1 is not visualised
    44444479hset_object=set_object(data,handles);% call the set_object interface
    44454480hhset_object=guidata(hset_object);
     
    47534788% Hints: get(hObject,'Value') returns position of slider
    47544789%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
    4755 
Note: See TracChangeset for help on using the changeset viewer.