source: trunk/src/write_plot_param.m @ 35

Last change on this file since 35 was 19, checked in by gostiaux, 15 years ago

the private files have been moved down to the root folder

File size: 4.3 KB
Line 
1%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
2function write_plot_param(handles,PlotParam)
3
4%scalar or image parameters
5if isfield(PlotParam,'Scalar')
6    set_scal_display(handles,'on')
7    if isfield(PlotParam.Scalar,'MaxA')
8        set(handles.MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
9    end
10    if isfield(PlotParam.Scalar,'MinA')
11        set(handles.MinA,'String',num2str(PlotParam.Scalar.MinA,3));
12    end
13
14    if isfield(PlotParam.Scalar,'IncrA')
15        set(handles.IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
16    end
17else
18    set_scal_display(handles,'off')
19end
20
21% parameter for vector field
22if isfield(PlotParam,'Vectors')
23    set_vect_display(handles,'on')
24    if isfield(PlotParam.Vectors,'VecScale')
25        set(handles.VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
26    end
27    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
28        MinC=PlotParam.Vectors.MinC;
29        MaxC=PlotParam.Vectors.MaxC;
30        set(handles.min_vec,'String', num2str(MinC,3));
31        set(handles.max_vec,'String',num2str(MaxC,3));
32        list=get(handles.color_code,'String');
33        ichoice=get(handles.color_code,'Value');
34        color_option=list{ichoice};
35        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
36        if test3color% need to update color thresholds
37            set(handles.colcode1,'Visible','on')
38            set(handles.colcode2,'Visible','on')
39            set(handles.slider1,'Visible','on')
40            set(handles.slider2,'Visible','on')
41%             slider1=get(handles.slider1,'Value');
42%             slider2=get(handles.slider2,'Value');
43             colcode1=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode1;
44             colcode2=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode2;
45            set(handles.colcode1,'String',num2str(colcode1,3))
46            set(handles.colcode2,'String',num2str(colcode2,3))
47            set(handles.slider1,'Value',PlotParam.Vectors.colcode1)
48            set(handles.slider2,'Value',PlotParam.Vectors.colcode2)
49        else
50            set(handles.colcode1,'Visible','off')
51            set(handles.colcode2,'Visible','off')
52            set(handles.slider1,'Visible','off')
53            set(handles.slider2,'Visible','off')
54        end
55    end
56else
57    set_vect_display(handles,'off')
58    set(handles.edit_vect,'Visible','off')
59end
60
61%------------------------------------------------------------------
62%prepare interface for scalar display: state ='on' or 'off'
63function set_scal_display(handles,state)
64%------------------------------------------------------------------
65set(handles.SCALAR_title,'Visible',state)
66set(handles.MaxA,'Visible',state)
67set(handles.MinA,'Visible',state)
68%set(handles.IncrA,'Visible',state)
69set(handles.AutoScal,'Visible',state)
70set(handles.BW,'Visible',state)
71set(handles.Contours,'Visible',state)
72set(handles.SCALAR_title,'Visible',state)
73set(handles.min_title,'Visible',state)
74set(handles.max_title,'Visible',state)
75set(handles.frame_scal,'Visible',state)
76set(handles.npx,'Visible',state)
77set(handles.npy,'Visible',state)
78set(handles.npx_title,'Visible',state)
79set(handles.npy_title,'Visible',state)
80%set(handles.makemask,'Visible',state)
81
82%---------------------------------------------
83%prepare interface for vector display: state ='on' or 'off'
84function set_vect_display(handles,state)
85%------------------------------------------------------------------
86set(handles.frame_vect,'Visible',state)
87set(handles.VECT_title,'Visible',state)
88set(handles.VecScale,'Visible',state)
89set(handles.AutoVec,'Visible',state)
90set(handles.HideFalse,'Visible',state)
91set(handles.HideWarning,'Visible',state)
92set(handles.record,'Visible',state)
93set(handles.colcode1,'Visible',state)
94set(handles.colcode2,'Visible',state)
95set(handles.min_vec,'Visible',state)
96set(handles.max_vec,'Visible',state)
97set(handles.scale_title,'Visible',state)
98set(handles.slider1,'Visible',state)
99set(handles.slider2,'Visible',state)
100set(handles.col_vec,'Visible',state)
101set(handles.Color_title,'Visible',state)
102set(handles.color_code,'Visible',state)
103set(handles.vec_col_bar,'Visible',state)
104set(handles.record,'Visible',state)
105set(handles.AutoVecColor,'Visible',state)
106set(handles.decimate4,'Visible',state)
107set(handles.min_C_title,'Visible',state)
108set(handles.max_C_title,'Visible',state)
109set(handles.MenuEditVectors,'Enable',state)
Note: See TracBrowser for help on using the repository browser.