source: trunk/src/mouse_down.m @ 425

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

improvement of object management

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