source: trunk/src/write_plot_param.m @ 279

Last change on this file since 279 was 204, checked in by sommeria, 14 years ago

put back deleted files

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