source: trunk/src/mouse_down.m @ 508

Last change on this file since 508 was 497, checked in by sommeria, 12 years ago

cleaning and small bug repair.
pb of histogram for filter data solved
display of uicontrol by right mouse selection improved

File size: 22.7 KB
Line 
1%'mouse_down': function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn'
2%--------------------------------------------------------------
3% xy=mouse_down(hObject,eventdata)
4% activated by the command:
5% set(hObject,'WindowButtonDownFcn',{'mouse_down'}),
6% where hObject is the handle of the figure
7%
8%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
9%  Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
10%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
11%     This file is part of the toolbox UVMAT.
12%
13%     UVMAT is free software; you can redistribute it and/or modify
14%     it under the terms of the GNU General Public License as published by
15%     the Free Software Foundation; either version 2 of the License, or
16%     (at your option) any later version.
17%
18%     UVMAT is distributed in the hope that it will be useful,
19%     but WITHOUT ANY WARRANTY; without even the implied warranty of
20%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21%     GNU General Public License (file UVMAT/COPYING.txt) for more details.
22%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
23
24function xy=mouse_down(hObject,eventdata)
25AxeData=[];%default
26FigData=get(hObject,'UserData');
27if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle
28    hcurrentfig=get(get(FigData,'parent'),'parent');
29else
30    hcurrentfig=hObject;%usual plot
31end
32set(hcurrentfig,'Units','pixels')
33GUI_pos=get(hcurrentfig,'Position');%position of the GUI series (in pixels)
34set(hcurrentfig,'Units','normalized')
35hhcurrentfig=guidata(hcurrentfig);
36if isfield(hhcurrentfig,'CheckZoom')
37    test_zoom=get(hhcurrentfig.CheckZoom,'Value');%test for zoom action, first priority
38else
39    test_zoom=0;
40end
41test_piv=isfield(FigData,'CivHandle');
42
43%% look for parameters set by the GUI uvmat
44test_ruler=0;
45test_edit=0;
46test_create=0;
47huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of  mouse action
48if ~isempty(huvmat)
49    hhuvmat=guidata(huvmat);%handles of elements in uvmat
50    UvData=get(huvmat,'UserData');
51    test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority;
52    test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority
53    test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing,  priority 4
54    %     test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation,  priority 5
55    %     if test_create
56    test_create=0;
57    hset_object=findobj(allchild(0),'tag','set_object');
58
59    if ~isempty(hset_object)
60        hPLOT=findobj(hset_object,'tag','PLOT');
61        test_create=strcmp(get(hPLOT,'enable'),'on') &&~test_edit;% create new object if set_object is in mode enable and uvmat not in mode 'edit_object'
62    end
63   
64    test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration
65    if test_cal% test for calibration popints,  priority 6
66        h_calib=findobj(allchild(0),'tag','geometry_calib');
67        if isempty(h_calib)
68            test_cal=0;
69            set(hhuvmat.MenuCalib,'checked','off');% test for calibration off
70        else
71            hh_calib=guidata(h_calib);
72            test_cal=get(hh_calib.edit_append,'Value');
73        end
74    end
75end
76
77%% determine the currently selected items
78hcurrentobject=gco;% current object handle (selected by the mouse)
79%hcurrentfig=hObject;% current figure handle
80fig_tag=get(hcurrentfig,'Tag');
81tag_obj=get(gco,'Tag');%tag of the currently selected object
82xy=[];%default
83xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo)
84hchildren=get(hObject,'Children');%handles of all objects in the current figure
85haxes=[];
86
87%% loop on all the objects in the current figure (selected by the last mouse click)
88output_str='';
89state_visible=get(hchildren,'Visible');
90check_visible=strcmp('on',state_visible);%=1 if visible='on', =0 otherwise
91hchildren=hchildren(find(check_visible)); %kkep only the visible children
92for ichild=1:length(hchildren)
93    hchild=hchildren(ichild); %handle of the current obj
94    obj_pos=get(hchild,'Position');%position of the object
95    if xy_fig(1) >=obj_pos(1) & xy_fig(2) >= obj_pos(2)& xy_fig(1) <=obj_pos(1)+obj_pos(3) & xy_fig(2) <= obj_pos(2)+obj_pos(4);
96        htype=get(hchild,'Type');%type of object child of the current figure
97        switch htype
98            %if the mouse is over an axis, look at the data
99            case 'axes'
100                y_lim=get(hchild,'YLim');
101                x_lim=get(hchild,'XLim');
102                haxes=hchild;
103                xy=get(hchild,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
104                if xy(1,1)>x_lim(1) && xy(1,1)<x_lim(2) && xy(1,2)>y_lim(1) && xy(1,2)<y_lim(2)
105                    AxeData=get(hchild,'UserData');% data attached to the axis
106                    AxeData.CurrentOrigin=[xy(1,1) xy(1,2)];% The current point set by the mouse becomes the current origin
107                    if test_edit_vect && ~isequal(tag_obj,'proj_object') & ~test_create
108                        ivec=[];
109                        FigData=get(hcurrentfig,'UserData');
110                        tagaxes=get(hchild,'tag');
111                        if isfield(FigData,tagaxes)
112                            eval(['Field=FigData.' tagaxes ';'])
113                            [CellVarIndex,NbDim,VarType]=find_field_indices(Field);%analyse the physical fields contained in Field
114                            for icell=1:numel(CellVarIndex)%look for all physical fields
115                                if NbDim(icell)==2 % select 2D field
116                                    if  isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& ~isempty(VarType{icell}.coord_x) && ~isempty(VarType{icell}.coord_y)%case of unstructured data
117                                        eval(['X=Field.' Field.ListVarName{VarType{icell}.coord_x} ';'])
118                                        eval(['Y=Field.' Field.ListVarName{VarType{icell}.coord_y} ';'])
119                                        flag_vec=(X<(xy(1,1)+Field.Mesh/4) & X>(xy(1,1)-Field.Mesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
120                                            (Y<(xy(1,2)+Field.Mesh/4) & Y>(xy(1,2)-Field.Mesh/4));%f
121                                        ivec=find(flag_vec,1);% search the (first) selected vector index ivec
122                                    end
123                                end
124                            end
125                        end
126                    end
127                else
128                    hchild=[];%mouse out of axes
129                end
130                break
131            %if the mouse is over a uicontrol, duplicate the display  in an editable  zoom window
132            case 'uicontrol'
133                if isequal(get(hObject,'SelectionType'),'alt')  && isequal(get(hchild,'Visible'),'on') && ~isequal(get(hchild,'tag'),'frame_object')&&...
134                        ~isequal(get(hchild,'tag'),'ListObject')
135                    if ~strcmp(get(hchild,'Style'),'frame')%do not visualisaze frames
136                        msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
137                        display_str=get(hchild,'TooltipString');
138                        output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
139                        break
140                    end
141                end
142            case 'uipanel'
143                panel_pos=obj_pos;%position of the panel
144                hhchildren=get(hchild,'Children');%handles of all objects in the current GUI
145                %% loop on all the objects in the current figure (selected by the last mouse click)
146                for iichild=1:length(hhchildren)
147                    hchild=hhchildren(iichild);
148                    rel_pos=get(hchild,'Position');%position of the object relative to the uipanel
149                    obj_pos(1:2)=panel_pos(1:2)+rel_pos(1:2).*panel_pos(3:4);
150                    obj_pos(3:4)=panel_pos(3:4).*rel_pos(3:4);
151                    if numel(obj_pos)>=4 && xy_fig(1) >=obj_pos(1) && xy_fig(2) >= obj_pos(2)&& xy_fig(1) <=obj_pos(1)+obj_pos(3) && xy_fig(2) <= obj_pos(2)+obj_pos(4);
152                        htype=get(hchild,'Type');%type of object child of the current figure
153                        %if the mouse is over a uicontrol, look at the data
154                        if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on')
155                            msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
156                            display_str=get(hchild,'TooltipString');
157                            output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
158                            break
159                        end
160                    end
161                end
162        end
163        if ~isempty(output_str)
164            break   %leave the current loop if a uicontrol has been selected
165        end
166    end
167end
168if ~isempty(output_str)               
169    set(hObject,'Units','pixels')
170    if strcmp(get(hchild,'enable'),'on')
171    set(hchild,'String',output_str)
172    end
173end
174   
175%% desable  object creation and vector editing if NbDim different from 2
176if ~(isfield(AxeData,'NbDim') && isequal(AxeData.NbDim,2))
177    test_create=0;
178    test_edit_vect=0;   
179end
180
181%% delete the current zoom rectangle
182if isfield(AxeData,'CurrentRectZoom') && ishandle(AxeData.CurrentRectZoom)
183    delete(AxeData.CurrentRectZoom)
184    AxeData.CurrentRectZoom=[];
185end   
186
187%% zoom has first priority
188if test_zoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var')
189     AxeData.Drawing='zoom'; %initiate drawing mode
190     AxeData.CurrentObject=[];%unselect objects
191     set(hchild,'UserData',AxeData);
192     return
193end
194if isempty(huvmat)%further options require the uvmat GUI
195    return
196end
197
198%% ruler has second priority
199if test_ruler
200    AxeData.RulerCoord(1,1)=xy(1,1);
201    AxeData.RulerCoord(1,2)=xy(1,2);
202    AxeData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler');
203    AxeData.Drawing='ruler';
204    set(hchild,'UserData',AxeData);
205    return
206end
207
208%% PIV test
209if test_piv
210    figure
211    newaxes=axes;
212    copyobj(AxeData.CurrentCorrImage,newaxes);
213    set(newaxes,'CLim',[0 1])
214    copyobj(AxeData.CurrentVector,newaxes)
215    copyobj(AxeData.TitleHandle,newaxes)
216    colorbar
217end
218
219%% selection of an existing projection object (third priority)
220if  test_edit && (isequal(tag_obj,'proj_object')||isequal(tag_obj,'DeformPoint'))
221    if ~(isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'create'))
222        userdata=get(hcurrentobject,'UserData');
223        if ishandle(userdata)%the selected line depends on a parent line
224            AxeData.CurrentObject=userdata;% the parent object becomes the current one
225        else
226            AxeData.CurrentObject=hcurrentobject;% the selected object becomes the current one
227        end
228        ObjectData=get(AxeData.CurrentObject,'UserData');
229        if test_edit && isfield(ObjectData,'IndexObj')
230            hother=findobj('Tag','proj_object','Type','line');%find all the proj objects
231            set(hother,'Color','b');%reset all the proj objects in 'blue' by default
232            set(hother,'Selected','off')
233            hother=findobj('Tag','proj_object','Type','rectangle');
234            set(hother,'EdgeColor','b');
235            set(hother,'Selected','off');
236            hother=findobj('Tag','proj_object','Type','image');
237            for iobj=1:length(hother)
238                   Acolor=get(hother(iobj),'CData');
239                   Acolor(:,:,1)=zeros(size(Acolor,1),size(Acolor,2));
240                   set(hother(iobj),'CData',Acolor);
241            end
242            hother=findobj('Tag','DeformPoint');
243            set(hother,'Color','b');
244            set(hother,'Selected','off')   
245            if isequal(get(AxeData.CurrentObject,'Type'),'line')
246                set(AxeData.CurrentObject,'Color','m'); %set the selected object to magenta color
247            elseif isequal(get(AxeData.CurrentObject,'Type'),'rectangle')
248                 set(AxeData.CurrentObject,'EdgeColor','m'); %set the selected object to magenta color
249            end
250            if isfield(ObjectData,'SubObject')& ishandle(ObjectData.SubObject)
251                for iobj=1:length(ObjectData.SubObject)
252                    hsub=ObjectData.SubObject(iobj);
253                    if isequal(get(hsub,'Type'),'rectangle')
254                        set(hsub,'EdgeColor','m'); %set the selected object to magenta color
255                    elseif isequal(get(hsub,'Type'),'image')
256                       Acolor=get(hsub,'CData');
257                       Acolor(:,:,1)=Acolor(:,:,3);
258                       set(hsub,'CData',Acolor);
259                    else
260                        set(hsub,'Color','m')
261                    end
262                end
263            end
264            if isequal(tag_obj,'DeformPoint')
265                 set(hcurrentobject,'Color','m'); %set the selected DeformPoint to magenta color
266            end
267            IndexObj=ObjectData.IndexObj;
268                    %indicate on the list of the GUI uvmat which object has been selected
269            if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field
270%                 IndexObj=get(hhuvmat.ListObject,'Value');
271%                 if IndexObj>IndexObj_old(1)
272%                     IndexObj=[IndexObj_old(1) IndexObj];
273%                 else
274%                     IndexObj=[1 IndexObj];
275%                 end
276                set(hhuvmat.ListObject,'Value',IndexObj);
277%                 set(hhuvmat.ListObject,'UserData',IndexObj);
278            else
279                set(hhuvmat.ListObject_1,'Value',IndexObj);
280                list_str=get(hhuvmat.ListObject_1,'String');
281                UvData.Object{IndexObj}.Name=list_str{IndexObj};
282            end
283%             h_set_object=findobj(allchild(0),'Tag','set_object');
284%             if ~isempty(h_set_object)
285%                 delete(h_set_object)
286%             end
287            set_object(UvData.Object{IndexObj})
288            axes(hchild);%set back the current axes haxes
289            testdeform=0;
290            set(gcbo,'Pointer','circle');
291            AxeData.Drawing='deform';
292            if isequal(tag_obj,'DeformPoint')       
293               if isfield(ObjectData,'DeformPoint')
294                   set(hcurrentobject,'Selected','on')
295                   for ipt=1:length(ObjectData.DeformPoint)
296                       if isequal(ObjectData.DeformPoint(ipt),hcurrentobject)
297                            AxeData.CurrentIndex=ipt;
298                            testdeform=1;
299                       end
300                   end
301               end
302            end
303            if testdeform==0
304                AxeData.Drawing='translate';
305                set(AxeData.CurrentObject,'Selected','on')
306                set(gcbo,'Pointer','fleur');
307            end
308        end
309    end
310end
311
312%%  create  projection  object
313if  test_create && ~isempty(xy) %&& ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create'))
314    hset_object=findobj(allchild(0),'tag','set_object');
315    % activate this option if the GUI set_object is opened
316    if ~isempty(hset_object)
317        sethandles=guidata(hset_object);% handles of the elements in the GUI set_object
318        ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object
319        IndexObj=length(UvData.Object);
320        %initiate a new object (no data .Coord yet recorded)
321        if ~isfield(UvData.Object{IndexObj},'Coord');
322            ObjectData.Coord=[];
323            ObjectNameNew=ObjectData.Name;
324            if isempty(ObjectNameNew)
325                ObjectNameNew=ObjectData.Type;
326            end
327            % add an index to the object name if the proposed name already exists         
328            vers=0;% index of the name
329            ListObject=get(hhuvmat.ListObject,'String');
330            detectname=1;
331            while ~isempty(detectname)
332                detectname=find(strcmp(ObjectNameNew,ListObject),1);%test the existence of the proposed name in the list
333                if detectname% if the object name already exists
334                    indstr=regexp(ObjectNameNew,'\D');
335                    if indstr(end)<length(ObjectNameNew) %object name ends by a number
336                        vers=str2double(ObjectNameNew(indstr(end)+1:end))+1;
337                        ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)];
338                    else
339                        vers=vers+1;
340                        ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)];
341                    end
342                end
343            end
344            ObjectName=ObjectNameNew;
345            set(sethandles.Name,'String',ObjectName)% display the default name in set_object
346            ListObject{end}=ObjectName;
347            set(hhuvmat.ListObject,'String',ListObject);%complement the object list
348            set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list
349            set(hhuvmat.ListObject,'Value',IndexObj)
350            set(hhuvmat.ViewObject,'Value',1)
351        end
352        ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
353        hobject=UvData.Object{IndexObj}.DisplayHandle.(fig_tag);
354        if isempty(hobject)
355            hobject=haxes;
356        end
357        ProjObject=UvData.Object{get(hhuvmat.ListObject_1,'Value')};
358        AxeData.CurrentObject=plot_object(ObjectData,ProjObject,hobject,'m');%draw the object and its handle becomes AxeData.CurrentObject
359        UvData.Object{IndexObj}=ObjectData;     
360        UvData.Object{IndexObj}.DisplayHandle.(fig_tag)=AxeData.CurrentObject;% attribute the current plot object handle to the Object     
361        %UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;
362        set(huvmat,'UserData',UvData)
363        PlotData=get(AxeData.CurrentObject,'UserData');
364        PlotData.IndexObj=IndexObj;
365        set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion)
366        AxeData.Drawing='create';% flag for mouse motion
367        %show object coordinates in the GUI set_object
368        h_set_object=findobj(allchild(0),'Tag','set_object');
369        hh_set_object=guidata(h_set_object);
370        set(hh_set_object.Coord,'Data',ObjectData.Coord);
371    end
372end
373
374%% create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected
375if ~test_zoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3')
376    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
377    hh_geometry_calib=guidata(h_geometry_calib);
378    h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');
379    if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes)
380        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
381        coord_value=get(hhuvmat.transform_fct,'Value');% set uvmat to pixel coordinates, run it again if not
382        if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys)
383            set(hhuvmat.transform_fct,'Value',1)
384            uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
385            set(hhuvmat.CheckFixedLimits,'Value',0)% put FixedLimits option to 'off'
386            set(hhuvmat.CheckFixedLimits,'BackgroundColor',[0.7 0.7 0.7])
387            return
388        end
389        Coord=get(h_ListCoord,'String');
390        data=read_geometry_calib(Coord);%transform char cell to numbers
391        xlim=get(haxes,'XLim');
392        ind_range_x=abs((xlim(2)-xlim(1))/50);
393        ylim=get(haxes,'YLim');
394        ind_range_y=abs((ylim(2)-ylim(1))/50);
395        ind_range=sqrt(ind_range_x*ind_range_y);
396        test_newpoint=1;
397        if size(data.Coord,2)>=5 %if calibration points already exist
398            XCoord=(data.Coord(:,4));
399            YCoord=(data.Coord(:,5));
400            index_point=find((XCoord<xy(1,1)+ind_range) & (XCoord>xy(1,1)-ind_range) & ...%flagx=1 for the vectors with x position selected by the mouse
401                          (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse
402            test_newpoint=isempty(index_point);%test for no existing calibration point near the mouse position
403        end
404        val=get(h_ListCoord,'Value');
405        %create a new calib point if we are not close to an existing one
406        if test_newpoint                 
407             strline=[ '    |    '  '    |    '  '    |    ' num2str(xy(1,1),4) '    |    ' num2str(xy(1,2),4)];
408           
409             if length(Coord)>=val
410                 Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point
411             end
412             Coord{val}=strline;
413             set(h_ListCoord,'String',Coord)
414             data=read_geometry_calib(Coord);%transform char cell to numbers
415             XCoord=data.Coord(:,4);
416             YCoord=data.Coord(:,5);
417        end
418        hh=findobj('Tag','calib_points');%look for handle of calibration points           
419        if isempty(hh)
420            hh=line(XCoord,YCoord,'Color','m','Tag','calib_points','LineStyle','.','Marker','+');
421        else
422            set(hh,'XData',XCoord)
423            set(hh,'YData',YCoord)
424        end
425        set(hh,'UserData',val)% flag the points to edit mode
426        hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle)
427        if ~isempty(hhh)
428            set(hhh,'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range])
429        else
430            rectangle('Curvature',[1 1],...
431                  'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',...
432                  'LineStyle','-','Tag','calib_marker');
433           % line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',ind_range);
434        end
435        AxeData.Drawing='calibration';
436    end
437end
438
439%% edit vectors
440if test_edit_vect && ~isempty(ivec)
441    %create the error flag FF if it does not exist
442    if ~isfield(Field,'FF')
443        Field.ListVarName=[Field.ListVarName 'FF'];
444        Field.VarDimName=[Field.VarDimName Field.VarDimName{VarType{icell}.coord_x}];
445        nbvar=length(Field.ListVarName);
446        Field.VarAttribute{nbvar}.Role='errorflag';
447        Field.FF=zeros(size(Field.X));
448    end
449    if isequal(Field.FF(ivec),0)
450        Field.FF(ivec)=100; %mark vector #ivec as false
451    else
452        Field.FF(ivec)=0;
453    end
454    PlotParam=read_GUI(hcurrentfig);
455    plot_field(Field,haxes,PlotParam);
456    eval(['FigData.' tagaxes '=Field;'])%record the modified field in FigData
457    set(hcurrentfig,'UserData',FigData);
458end 
459set(haxes,'UserData',AxeData);
460
Note: See TracBrowser for help on using the repository browser.