source: trunk/src/write_plot_param.m @ 511

Last change on this file since 511 was 511, checked in by sommeria, 9 years ago

cleaning of uvmat and related fcts

File size: 4.3 KB
RevLine 
[429]1%'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation
[204]2function write_plot_param(handles,PlotParam)
[295]3%% coordinates
[429]4if isempty(PlotParam.Coordinates)
5    set(handles.Coordinates,'Visible','off')
[511]6    set(handles.PlotAxes,'Visible','off')
[429]7    set(handles.text_display,'Visible','off')
8    set(handles.TableDisplay,'Visible','on')
9else
10    set(handles.Coordinates,'Visible','on')
[511]11    set(handles.PlotAxes,'Visible','on')
[429]12    set(handles.text_display,'Visible','on')
13    if isfield(handles,'TableDisplay')
14    set(handles.TableDisplay,'Visible','off')
15    end
[295]16    Coordinates=PlotParam.Coordinates;
[428]17    if isfield(Coordinates,'CheckFixAspectRatio')
18        if Coordinates.CheckFixAspectRatio
19            set(handles.CheckFixAspectRatio,'Value',1)
20            set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
[295]21        else
[428]22            set(handles.CheckFixAspectRatio,'Value',0)
23            set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
[295]24        end
25    end
[428]26    if isfield(Coordinates,'AspectRatio')
27        set(handles.num_AspectRatio,'String',num2str(Coordinates.AspectRatio))
[429]28    end
[295]29    if isfield(Coordinates,'MinX')
30        set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
31        set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4));
32        set(handles.num_MinY,'String',num2str(Coordinates.MinY,4));
33        set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4));
[204]34    else
[295]35        set(handles.num_MinX,'String','');
36        set(handles.num_MaxX,'String','');
37        set(handles.num_MinY,'String','');
38        set(handles.num_MaxY,'String','');
[204]39    end
40end
41
[295]42%% scalar or image parameters
[204]43if isfield(PlotParam,'Scalar')
[295]44    set(handles.Scalar,'Visible','on')
[204]45    if isfield(PlotParam.Scalar,'MaxA')
[292]46        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
[204]47    end
48    if isfield(PlotParam.Scalar,'MinA')
[292]49        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
[428]50    end   
[204]51    if isfield(PlotParam.Scalar,'IncrA')
[292]52        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
[204]53    end
[421]54    set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW)
[428]55    if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity')
56        set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity))
57    end
[204]58else
[295]59    set(handles.Scalar,'Visible','off')
[204]60end
61
[295]62%% parameter for vector field
[204]63if isfield(PlotParam,'Vectors')
[295]64    set(handles.Vectors,'Visible','on')
[204]65    if isfield(PlotParam.Vectors,'VecScale')
[292]66        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
[204]67    end
68    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
69        MinC=PlotParam.Vectors.MinC;
70        MaxC=PlotParam.Vectors.MaxC;
[313]71        set(handles.num_MinVec,'String', num2str(MinC,3));
72        set(handles.num_MaxVec,'String',num2str(MaxC,3));
[405]73        list=get(handles.ColorCode,'String');
74        ichoice=get(handles.ColorCode,'Value');
[295]75        color_option=list{ichoice};
[204]76        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
77        if test3color% need to update color thresholds
[313]78            set(handles.num_ColCode1,'Visible','on')
79            set(handles.num_ColCode2,'Visible','on')
80            set(handles.Slider1,'Visible','on')
81            set(handles.Slider2,'Visible','on')
[405]82            %ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
83            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
84%             ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
85            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
86            set(handles.num_ColCode1,'String',num2str(PlotParam.Vectors.ColCode1,3))
87            set(handles.num_ColCode2,'String',num2str(PlotParam.Vectors.ColCode2,3))
88            set(handles.Slider1,'Value',(PlotParam.Vectors.ColCode1-MinC)/(MaxC-MinC))
89            set(handles.Slider2,'Value',(PlotParam.Vectors.ColCode2-MinC)/(MaxC-MinC))
[204]90        else
[313]91            set(handles.num_ColCode1,'Visible','off')
92            set(handles.num_ColCode2,'Visible','off')
93            set(handles.Slider1,'Visible','off')
94            set(handles.Slider2,'Visible','off')
[204]95        end
96    end
97else
[295]98    set(handles.Vectors,'Visible','off')
[204]99    if isfield(handles,'edit_vect')
100        set(handles.edit_vect,'Visible','off')
101        set(handles.record,'Visible','off')
102    end
103end
Note: See TracBrowser for help on using the repository browser.