source: trunk/src/mouse_down.m @ 434

Last change on this file since 434 was 432, checked in by sommeria, 12 years ago

system of projection object manipulation with uvmat improved.

File size: 22.4 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            case 'uicontrol'  %if the mouse is over a uicontrol, duplicate the display  in an editable  zoom window
132                if isequal(get(hObject,'SelectionType'),'alt')  && isequal(get(hchild,'Visible'),'on') && ~isequal(get(hchild,'tag'),'frame_object')&&...
133                        ~isequal(get(hchild,'tag'),'ListObject')
134%                     if strcmp(get(hchild,'Visible'),'on')
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                        output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
138                        break
139                    end
140                end
141            case 'uipanel'
142                panel_pos=obj_pos;%position of the panel
143                hhchildren=get(hchild,'Children');%handles of all objects in the current GUI
144                %% loop on all the objects in the current figure (selected by the last mouse click)
145                for iichild=1:length(hhchildren)
146                    hchild=hhchildren(iichild);
147                    rel_pos=get(hchild,'Position');%position of the object relative to the uipanel
148                    obj_pos(1:2)=panel_pos(1:2)+rel_pos(1:2).*panel_pos(3:4);
149                    obj_pos(3:4)=panel_pos(3:4).*rel_pos(3:4);
150                    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);
151                        htype=get(hchild,'Type');%type of object child of the current figure
152                        %if the mouse is over a uicontrol, look at the data
153                        if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on')
154                            msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
155                            output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
156                            break
157                        end
158                    end
159                end
160        end
161    end
162end
163if ~isempty(output_str)               
164    set(hObject,'Units','pixels')
165    set(hchild,'String',output_str)
166end
167   
168%% desable  object creation and vector editing if NbDim different from 2
169if ~(isfield(AxeData,'NbDim') && isequal(AxeData.NbDim,2))
170    test_create=0;
171    test_edit_vect=0;   
172end
173
174%% delete the current zoom rectangle
175if isfield(AxeData,'CurrentRectZoom') && ishandle(AxeData.CurrentRectZoom)
176    delete(AxeData.CurrentRectZoom)
177    AxeData.CurrentRectZoom=[];
178end   
179
180%% zoom has first priority
181if test_zoom %&& ~test_create && ~test_edit && ~test_edit_vect && exist('xy','var')
182     AxeData.Drawing='zoom'; %initiate drawing mode
183     AxeData.CurrentObject=[];%unselect objects
184     set(hchild,'UserData',AxeData);
185     return
186end
187if isempty(huvmat)%further options require the uvmat GUI
188    return
189end
190
191%% ruler has second priority
192if test_ruler
193    AxeData.RulerCoord(1,1)=xy(1,1);
194    AxeData.RulerCoord(1,2)=xy(1,2);
195    AxeData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','ruler');
196    AxeData.Drawing='ruler';
197    set(hchild,'UserData',AxeData);
198    return
199end
200
201%% PIV test
202if test_piv
203    figure
204    newaxes=axes;
205    copyobj(AxeData.CurrentCorrImage,newaxes);
206    set(newaxes,'CLim',[0 1])
207    copyobj(AxeData.CurrentVector,newaxes)
208    copyobj(AxeData.TitleHandle,newaxes)
209    colorbar
210end
211
212%% selection of an existing projection object (third priority)
213if  test_edit && (isequal(tag_obj,'proj_object')||isequal(tag_obj,'DeformPoint'))
214    if ~(isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'create'))
215        userdata=get(hcurrentobject,'UserData');
216        if ishandle(userdata)%the selected line depends on a parent line
217            AxeData.CurrentObject=userdata;% the parent object becomes the current one
218        else
219            AxeData.CurrentObject=hcurrentobject;% the selected object becomes the current one
220        end
221        ObjectData=get(AxeData.CurrentObject,'UserData');
222        if test_edit && isfield(ObjectData,'IndexObj')
223            hother=findobj('Tag','proj_object','Type','line');%find all the proj objects
224            set(hother,'Color','b');%reset all the proj objects in 'blue' by default
225            set(hother,'Selected','off')
226            hother=findobj('Tag','proj_object','Type','rectangle');
227            set(hother,'EdgeColor','b');
228            set(hother,'Selected','off');
229            hother=findobj('Tag','proj_object','Type','image');
230            for iobj=1:length(hother)
231                   Acolor=get(hother(iobj),'CData');
232                   Acolor(:,:,1)=zeros(size(Acolor,1),size(Acolor,2));
233                   set(hother(iobj),'CData',Acolor);
234            end
235            hother=findobj('Tag','DeformPoint');
236            set(hother,'Color','b');
237            set(hother,'Selected','off')   
238            if isequal(get(AxeData.CurrentObject,'Type'),'line')
239                set(AxeData.CurrentObject,'Color','m'); %set the selected object to magenta color
240            elseif isequal(get(AxeData.CurrentObject,'Type'),'rectangle')
241                 set(AxeData.CurrentObject,'EdgeColor','m'); %set the selected object to magenta color
242            end
243            if isfield(ObjectData,'SubObject')& ishandle(ObjectData.SubObject)
244                for iobj=1:length(ObjectData.SubObject)
245                    hsub=ObjectData.SubObject(iobj);
246                    if isequal(get(hsub,'Type'),'rectangle')
247                        set(hsub,'EdgeColor','m'); %set the selected object to magenta color
248                    elseif isequal(get(hsub,'Type'),'image')
249                       Acolor=get(hsub,'CData');
250                       Acolor(:,:,1)=Acolor(:,:,3);
251                       set(hsub,'CData',Acolor);
252                    else
253                        set(hsub,'Color','m')
254                    end
255                end
256            end
257            if isequal(tag_obj,'DeformPoint')
258                 set(hcurrentobject,'Color','m'); %set the selected DeformPoint to magenta color
259            end
260            IndexObj=ObjectData.IndexObj;
261                    %indicate on the list of the GUI uvmat which object has been selected
262            if strcmp(get(hcurrentfig,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field
263%                 IndexObj=get(hhuvmat.ListObject,'Value');
264%                 if IndexObj>IndexObj_old(1)
265%                     IndexObj=[IndexObj_old(1) IndexObj];
266%                 else
267%                     IndexObj=[1 IndexObj];
268%                 end
269                set(hhuvmat.ListObject,'Value',IndexObj);
270%                 set(hhuvmat.ListObject,'UserData',IndexObj);
271            else
272                set(hhuvmat.ListObject_1,'Value',IndexObj);
273                list_str=get(hhuvmat.ListObject_1,'String');
274                UvData.Object{IndexObj}.Name=list_str{IndexObj};
275            end
276%             h_set_object=findobj(allchild(0),'Tag','set_object');
277%             if ~isempty(h_set_object)
278%                 delete(h_set_object)
279%             end
280            set_object(UvData.Object{IndexObj})
281            axes(hchild);%set back the current axes haxes
282            testdeform=0;
283            set(gcbo,'Pointer','circle');
284            AxeData.Drawing='deform';
285            if isequal(tag_obj,'DeformPoint')       
286               if isfield(ObjectData,'DeformPoint')
287                   set(hcurrentobject,'Selected','on')
288                   for ipt=1:length(ObjectData.DeformPoint)
289                       if isequal(ObjectData.DeformPoint(ipt),hcurrentobject)
290                            AxeData.CurrentIndex=ipt;
291                            testdeform=1;
292                       end
293                   end
294               end
295            end
296            if testdeform==0
297                AxeData.Drawing='translate';
298                set(AxeData.CurrentObject,'Selected','on')
299                set(gcbo,'Pointer','fleur');
300            end
301        end
302    end
303end
304
305%%  create  projection  object
306if  test_create && ~isempty(xy) %&& ~(isfield(AxeData,'Drawing')&& isequal(AxeData.Drawing,'create'))
307    hset_object=findobj(allchild(0),'tag','set_object');
308    % activate this option if the GUI set_object is opened
309    if ~isempty(hset_object)
310        sethandles=guidata(hset_object);% handles of the elements in the GUI set_object
311        ObjectData=read_GUI(hset_object); %read object parameters in the GUI set_object
312        IndexObj=length(UvData.Object);
313        %initiate a new object (no data .Coord yet recorded)
314        if ~isfield(UvData.Object{IndexObj},'Coord');
315            ObjectData.Coord=[];
316            ObjectNameNew=ObjectData.Name;
317            if isempty(ObjectNameNew)
318                ObjectNameNew=ObjectData.Type;
319            end
320            % add an index to the object name if the proposed name already exists         
321            vers=0;% index of the name
322            ListObject=get(hhuvmat.ListObject,'String');
323            detectname=1;
324            while ~isempty(detectname)
325                detectname=find(strcmp(ObjectNameNew,ListObject),1);%test the existence of the proposed name in the list
326                if detectname% if the object name already exists
327                    indstr=regexp(ObjectNameNew,'\D');
328                    if indstr(end)<length(ObjectNameNew) %object name ends by a number
329                        vers=str2double(ObjectNameNew(indstr(end)+1:end))+1;
330                        ObjectNameNew=[ObjectNameNew(1:indstr(end)) num2str(vers)];
331                    else
332                        vers=vers+1;
333                        ObjectNameNew=[ObjectNameNew(1:indstr(end)) '_' num2str(vers)];
334                    end
335                end
336            end
337            ObjectName=ObjectNameNew;
338            set(sethandles.Name,'String',ObjectName)% display the default name in set_object
339            ListObject{end}=ObjectName;
340            set(hhuvmat.ListObject,'String',ListObject);%complement the object list
341            set(hhuvmat.ListObject_1,'String',ListObject);%complement the object list
342            set(hhuvmat.ListObject,'Value',IndexObj)
343            set(hhuvmat.ViewObject,'Value',1)
344        end
345        ObjectData.Coord=[ObjectData.Coord ;xy(1,1:2)];% append the coordinates marked by the mouse to the object
346        hobject=UvData.Object{IndexObj}.DisplayHandle.(fig_tag);
347        if isempty(hobject)
348            hobject=haxes;
349        end
350        ProjObject=UvData.Object{get(hhuvmat.ListObject_1,'Value')};
351        AxeData.CurrentObject=plot_object(ObjectData,ProjObject,hobject,'m');%draw the object and its handle becomes AxeData.CurrentObject
352        UvData.Object{IndexObj}=ObjectData;     
353        UvData.Object{IndexObj}.DisplayHandle.(fig_tag)=AxeData.CurrentObject;% attribute the current plot object handle to the Object     
354        %UvData.Object{IndexObj}.DisplayHandle_view_field=AxeData.CurrentObject;
355        set(huvmat,'UserData',UvData)
356        PlotData=get(AxeData.CurrentObject,'UserData');
357        PlotData.IndexObj=IndexObj;
358        set(AxeData.CurrentObject,'UserData',PlotData); %record the object index in the graph (memory used for mouse motion)
359        AxeData.Drawing='create';% flag for mouse motion
360        %show object coordinates in the GUI set_object
361        h_set_object=findobj(allchild(0),'Tag','set_object');
362        hh_set_object=guidata(h_set_object);
363        set(hh_set_object.Coord,'Data',ObjectData.Coord);
364    end
365end
366
367%% create calibration points if the GUI geometry_calib is opened, if the main axes axes3 of uvmat has ben selected
368if ~test_zoom && test_cal && ~isempty(haxes) && strcmp(get(haxes,'tag'),'axes3')
369    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
370    hh_geometry_calib=guidata(h_geometry_calib);
371    h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');
372    if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes)
373        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
374        coord_value=get(hhuvmat.transform_fct,'Value');% set uvmat to pixel coordinates, run it again if not
375        if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys)
376            set(hhuvmat.transform_fct,'Value',1)
377            uvmat('transform_fct_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
378            set(hhuvmat.CheckFixedLimits,'Value',0)% put FixedLimits option to 'off'
379            set(hhuvmat.CheckFixedLimits,'BackgroundColor',[0.7 0.7 0.7])
380            return
381        end
382        Coord=get(h_ListCoord,'String');
383        data=read_geometry_calib(Coord);%transform char cell to numbers
384        xlim=get(haxes,'XLim');
385        ind_range_x=abs((xlim(2)-xlim(1))/50);
386        ylim=get(haxes,'YLim');
387        ind_range_y=abs((ylim(2)-ylim(1))/50);
388        ind_range=sqrt(ind_range_x*ind_range_y);
389        test_newpoint=1;
390        if size(data.Coord,2)>=5 %if calibration points already exist
391            XCoord=(data.Coord(:,4));
392            YCoord=(data.Coord(:,5));
393            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
394                          (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse
395            test_newpoint=isempty(index_point);%test for no existing calibration point near the mouse position
396        end
397        val=get(h_ListCoord,'Value');
398        %create a new calib point if we are not close to an existing one
399        if test_newpoint                 
400             strline=[ '    |    '  '    |    '  '    |    ' num2str(xy(1,1),4) '    |    ' num2str(xy(1,2),4)];
401           
402             if length(Coord)>=val
403                 Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point
404             end
405             Coord{val}=strline;
406             set(h_ListCoord,'String',Coord)
407             data=read_geometry_calib(Coord);%transform char cell to numbers
408             XCoord=data.Coord(:,4);
409             YCoord=data.Coord(:,5);
410        end
411        hh=findobj('Tag','calib_points');%look for handle of calibration points           
412        if isempty(hh)
413            hh=line(XCoord,YCoord,'Color','m','Tag','calib_points','LineStyle','.','Marker','+');
414        else
415            set(hh,'XData',XCoord)
416            set(hh,'YData',YCoord)
417        end
418        set(hh,'UserData',val)% flag the points to edit mode
419        hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle)
420        if ~isempty(hhh)
421            set(hhh,'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range])
422        else
423            rectangle('Curvature',[1 1],...
424                  'Position',[xy(1,1)-ind_range/2 xy(1,2)-ind_range/2 ind_range ind_range],'EdgeColor','m',...
425                  'LineStyle','-','Tag','calib_marker');
426           % line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','calib_marker','LineStyle','.','Marker','o','MarkerSize',ind_range);
427        end
428        AxeData.Drawing='calibration';
429    end
430end
431
432%% edit vectors
433if test_edit_vect && ~isempty(ivec)
434    %create the error flag FF if it does not exist
435    if ~isfield(Field,'FF')
436        Field.ListVarName=[Field.ListVarName 'FF'];
437        Field.VarDimName=[Field.VarDimName Field.VarDimName{VarType{icell}.coord_x}];
438        nbvar=length(Field.ListVarName);
439        Field.VarAttribute{nbvar}.Role='errorflag';
440        Field.FF=zeros(size(Field.X));
441    end
442    if isequal(Field.FF(ivec),0)
443        Field.FF(ivec)=100; %mark vector #ivec as false
444    else
445        Field.FF(ivec)=0;
446    end
447    PlotParam=read_GUI(hcurrentfig);
448    plot_field(Field,haxes,PlotParam);
449    eval(['FigData.' tagaxes '=Field;'])%record the modified field in FigData
450    set(hcurrentfig,'UserData',FigData);
451end 
452set(haxes,'UserData',AxeData);
453
Note: See TracBrowser for help on using the repository browser.