source: trunk/src/mouse_down.m @ 421

Last change on this file since 421 was 413, checked in by sommeria, 12 years ago

various bugs corrected and improvement in civ1_TEST

File size: 22.5 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_1,'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        %             if isempty(object_name)
356        %                 list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Type];
357        %                 set(sethandles.Name,'String',list_str{IndexObj})
358        %             else
359        %                list_str{IndexObj}=object_name;
360        %             end
361        %             set(hhuvmat.ListObject,'String',list_str)
362        UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;
363        set(huvmat,'UserData',UvData)
364        PlotData=get(AxeData.CurrentObject,'UserData');
365        PlotData.IndexObj=IndexObj;
366        set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion)
367        AxeData.Drawing='create';% flag for mouse motion
368    end
369end
370
371% create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected
372if ~test_zoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3')
373    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
374    hh_geometry_calib=guidata(h_geometry_calib);
375    h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');
376    if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes)
377        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
378        coord_value=get(hhuvmat.transform_fct,'Value');% set uvmat to pixel coordinates, run it again if not
379        if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys)
380            set(hhuvmat.transform_fct,'Value',1)
381            uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
382            set(hhuvmat.CheckFixedLimits,'Value',0)% put FixedLimits option to 'off'
383            set(hhuvmat.CheckFixedLimits,'BackgroundColor',[0.7 0.7 0.7])
384            return
385        end
386        Coord=get(h_ListCoord,'String');
387        data=read_geometry_calib(Coord);%transform char cell to numbers
388        xlim=get(haxes,'XLim');
389        ind_range_x=abs((xlim(2)-xlim(1))/50);
390        ylim=get(haxes,'YLim');
391        ind_range_y=abs((ylim(2)-ylim(1))/50);
392        ind_range=sqrt(ind_range_x*ind_range_y);
393        test_newpoint=1;
394        if size(data.Coord,2)>=5 %if calibration points already exist
395            XCoord=(data.Coord(:,4));
396            YCoord=(data.Coord(:,5));
397            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
398                          (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse
399            test_newpoint=isempty(index_point);%test for no existing calibration point near the mouse position
400        end
401        val=get(h_ListCoord,'Value');
402        %create a new calib point if we are not close to an existing one
403        if test_newpoint                 
404             strline=[ '    |    '  '    |    '  '    |    ' num2str(xy(1,1),4) '    |    ' num2str(xy(1,2),4)];
405           
406             if length(Coord)>=val
407                 Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point
408             end
409             Coord{val}=strline;
410             set(h_ListCoord,'String',Coord)
411             data=read_geometry_calib(Coord);%transform char cell to numbers
412             XCoord=data.Coord(:,4);
413             YCoord=data.Coord(:,5);
414        end
415        hh=findobj('Tag','calib_points');%look for handle of calibration points           
416        if isempty(hh)
417            hh=line(XCoord,YCoord,'Color','m','Tag','calib_points','LineStyle','.','Marker','+');
418        else
419            set(hh,'XData',XCoord)
420            set(hh,'YData',YCoord)
421        end
422        set(hh,'UserData',val)% flag the points to edit mode
423        hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle)
424        if ~isempty(hhh)
425            set(hhh,'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range])
426        else
427            rectangle('Curvature',[1 1],...
428                  'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',...
429                  'LineStyle','-','Tag','calib_marker');
430           % line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',ind_range);
431        end
432        AxeData.Drawing='calibration';
433    end
434end
435
436% edit vectors
437if test_edit_vect && ~isempty(ivec)
438    %create the error flag FF if it does not exist
439    if ~isfield(Field,'FF')
440        Field.ListVarName=[Field.ListVarName 'FF'];
441        Field.VarDimName=[Field.VarDimName Field.VarDimName{VarType{icell}.coord_x}];
442        nbvar=length(Field.ListVarName);
443        Field.VarAttribute{nbvar}.Role='errorflag';
444        Field.FF=zeros(size(Field.X));
445    end
446    if isequal(Field.FF(ivec),0)
447        Field.FF(ivec)=100; %mark vector #ivec as false
448    else
449        Field.FF(ivec)=0;
450    end
451    PlotParam=read_GUI(hcurrentfig);
452    plot_field(Field,haxes,PlotParam);
453    eval(['FigData.' tagaxes '=Field;'])%record the modified field in FigData
454    set(hcurrentfig,'UserData',FigData);
455end   
456set(haxes,'UserData',AxeData);
457
Note: See TracBrowser for help on using the repository browser.