source: trunk/src/write_plot_param.m @ 418

Last change on this file since 418 was 405, checked in by sommeria, 12 years ago

many bugs corrected: composition of 2 input fields, arrow colors from different scalar fields...

File size: 3.5 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%% coordinates
4if isfield(PlotParam,'Coordinates')
5    Coordinates=PlotParam.Coordinates;
6    if isfield(Coordinates,'CheckFixEqual')
7        if Coordinates.CheckFixEqual
8            set(handles.CheckFixEqual,'Value',1)
9            set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
10        else
11            set(handles.CheckFixEqual,'Value',0)
12            set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
13        end
14    end
15    if isfield(Coordinates,'MinX')
16        set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
17        set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4));
18        set(handles.num_MinY,'String',num2str(Coordinates.MinY,4));
19        set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4));
20    else
21        set(handles.num_MinX,'String','');
22        set(handles.num_MaxX,'String','');
23        set(handles.num_MinY,'String','');
24        set(handles.num_MaxY,'String','');
25    end
26end
27
28%% scalar or image parameters
29if isfield(PlotParam,'Scalar')
30    set(handles.Scalar,'Visible','on')
31    if isfield(PlotParam.Scalar,'MaxA')
32        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
33    end
34    if isfield(PlotParam.Scalar,'MinA')
35        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
36    end
37   
38    if isfield(PlotParam.Scalar,'IncrA')
39        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
40    end
41else
42    set(handles.Scalar,'Visible','off')
43end
44
45%% parameter for vector field
46if isfield(PlotParam,'Vectors')
47    set(handles.Vectors,'Visible','on')
48    if isfield(PlotParam.Vectors,'VecScale')
49        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
50    end
51    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
52        MinC=PlotParam.Vectors.MinC;
53        MaxC=PlotParam.Vectors.MaxC;
54        set(handles.num_MinVec,'String', num2str(MinC,3));
55        set(handles.num_MaxVec,'String',num2str(MaxC,3));
56        list=get(handles.ColorCode,'String');
57        ichoice=get(handles.ColorCode,'Value');
58        color_option=list{ichoice};
59        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
60        if test3color% need to update color thresholds
61            set(handles.num_ColCode1,'Visible','on')
62            set(handles.num_ColCode2,'Visible','on')
63            set(handles.Slider1,'Visible','on')
64            set(handles.Slider2,'Visible','on')
65            %ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
66            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
67%             ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
68            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
69            set(handles.num_ColCode1,'String',num2str(PlotParam.Vectors.ColCode1,3))
70            set(handles.num_ColCode2,'String',num2str(PlotParam.Vectors.ColCode2,3))
71            set(handles.Slider1,'Value',(PlotParam.Vectors.ColCode1-MinC)/(MaxC-MinC))
72            set(handles.Slider2,'Value',(PlotParam.Vectors.ColCode2-MinC)/(MaxC-MinC))
73        else
74            set(handles.num_ColCode1,'Visible','off')
75            set(handles.num_ColCode2,'Visible','off')
76            set(handles.Slider1,'Visible','off')
77            set(handles.Slider2,'Visible','off')
78        end
79    end
80else
81    set(handles.Vectors,'Visible','off')
82    if isfield(handles,'edit_vect')
83        set(handles.edit_vect,'Visible','off')
84        set(handles.record,'Visible','off')
85    end
86end
Note: See TracBrowser for help on using the repository browser.