[37] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
| 2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
| 3 | <html> |
---|
| 4 | <head> |
---|
| 5 | <title>Description of update_obj</title> |
---|
| 6 | <meta name="keywords" content="update_obj"> |
---|
| 7 | <meta name="description" content="'update_obj': update the object graph representation and its projection field, record it in the uvmat interface"> |
---|
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
| 9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
| 10 | <meta name="robots" content="index, follow"> |
---|
| 11 | <link type="text/css" rel="stylesheet" href="../m2html.css"> |
---|
| 12 | </head> |
---|
| 13 | <body> |
---|
| 14 | <a name="_top"></a> |
---|
| 15 | <div><a href="../index.html">Home</a> > <a href="index.html">.</a> > update_obj.m</div> |
---|
| 16 | |
---|
| 17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
| 18 | <td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
| 19 | |
---|
| 20 | <h1>update_obj |
---|
| 21 | </h1> |
---|
| 22 | |
---|
| 23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 24 | <div class="box"><strong>'update_obj': update the object graph representation and its projection field, record it in the uvmat interface</strong></div> |
---|
| 25 | |
---|
| 26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 27 | <div class="box"><strong>function Object_out=update_obj(UvData,IndexObj,ObjectData,PlotHandles) </strong></div> |
---|
| 28 | |
---|
| 29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 30 | <div class="fragment"><pre class="comment">'update_obj': update the object graph representation and its projection field, record it in the uvmat interface |
---|
| 31 | ------------------------------------------------------------------- |
---|
| 32 | Object=update_obj(UvData,IndexObj,ObjectData,PlotHandles); |
---|
| 33 | |
---|
| 34 | OUTPUT: |
---|
| 35 | UvData: data to be stored as 'Userdata' on the uvmat interface |
---|
| 36 | IndexObj: object index for a new object added to the list in UvData |
---|
| 37 | the function updates UvData.Object{IndexObj}, and possibly adds a new plot (UvData.Plane or Line) in the list atached to the interface |
---|
| 38 | |
---|
| 39 | INPUT: |
---|
| 40 | UvIn: structure stored as 'Userdata' on the uvmat interface |
---|
| 41 | IndexObjIn: object index for an existing objects stored in UvData |
---|
| 42 | ObjectData: structure containing the input object properties |
---|
| 43 | PlotHandles: structure containing the handles of the plotting parameter buttons on the uvmat interface (obtained by get_plot_handles.m) |
---|
| 44 | -------------------------------------</pre></div> |
---|
| 45 | |
---|
| 46 | <!-- crossreference --> |
---|
| 47 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 48 | This function calls: |
---|
| 49 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
| 50 | <li><a href="plot_field.html" class="code" title="function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,KeepLim,PosColorbar)">plot_field</a> 'plot_field': plot any field with the structure defined in the uvmat package</li><li><a href="plot_object.html" class="code" title="function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col)">plot_object</a> 'plot_object': draws a projection object (points, line, plane...)</li><li><a href="proj_field.html" class="code" title="function [ProjData,errormsg]=proj_field(FieldData,ObjectData,IndexObj)">proj_field</a> 'proj_field': projects the field on a projection object</li><li><a href="set_title.html" class="code" title="function TITLE=set_title(Style,ProjMode)">set_title</a> 'set_title': defines the 'TITLE' of a projection object</li></ul> |
---|
| 51 | This function is called by: |
---|
| 52 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
| 53 | <li><a href="mouse_up.html" class="code" title="function mouse_up(ggg,eventdata,handles)">mouse_up</a> 'mouse_up': function activated when the mouse button is released</li><li><a href="set_grid.html" class="code" title="function varargout = set_grid(varargin)">set_grid</a> 'set_grid':produce grid for PIV with one or two images (stereo case)</li><li><a href="set_object.html" class="code" title="function varargout = set_object(varargin)">set_object</a> 'set_object': GUI to edit a projection object</li></ul> |
---|
| 54 | <!-- crossreference --> |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 58 | <div class="fragment"><pre>0001 <span class="comment">%'update_obj': update the object graph representation and its projection field, record it in the uvmat interface</span> |
---|
| 59 | 0002 <span class="comment">%-------------------------------------------------------------------</span> |
---|
| 60 | 0003 <span class="comment">%Object=update_obj(UvData,IndexObj,ObjectData,PlotHandles);</span> |
---|
| 61 | 0004 <span class="comment">%</span> |
---|
| 62 | 0005 <span class="comment">%OUTPUT:</span> |
---|
| 63 | 0006 <span class="comment">%UvData: data to be stored as 'Userdata' on the uvmat interface</span> |
---|
| 64 | 0007 <span class="comment">%IndexObj: object index for a new object added to the list in UvData</span> |
---|
| 65 | 0008 <span class="comment">% the function updates UvData.Object{IndexObj}, and possibly adds a new plot (UvData.Plane or Line) in the list atached to the interface</span> |
---|
| 66 | 0009 <span class="comment">%</span> |
---|
| 67 | 0010 <span class="comment">%INPUT:</span> |
---|
| 68 | 0011 <span class="comment">%UvIn: structure stored as 'Userdata' on the uvmat interface</span> |
---|
| 69 | 0012 <span class="comment">%IndexObjIn: object index for an existing objects stored in UvData</span> |
---|
| 70 | 0013 <span class="comment">%ObjectData: structure containing the input object properties</span> |
---|
| 71 | 0014 <span class="comment">%PlotHandles: structure containing the handles of the plotting parameter buttons on the uvmat interface (obtained by get_plot_handles.m)</span> |
---|
| 72 | 0015 <span class="comment">%-------------------------------------</span> |
---|
| 73 | 0016 |
---|
| 74 | 0017 <a name="_sub0" href="#_subfunctions" class="code">function Object_out=update_obj(UvData,IndexObj,ObjectData,PlotHandles)</a> |
---|
| 75 | 0018 |
---|
| 76 | 0019 <span class="comment">%default input and output</span> |
---|
| 77 | 0020 Object_out=ObjectData;<span class="comment">%default</span> |
---|
| 78 | 0021 <span class="keyword">if</span> isfield(UvData,<span class="string">'Object'</span>) |
---|
| 79 | 0022 Object_set=UvData.Object; |
---|
| 80 | 0023 <span class="keyword">else</span> |
---|
| 81 | 0024 Object_set={};<span class="comment">%create the object</span> |
---|
| 82 | 0025 <span class="keyword">end</span> |
---|
| 83 | 0026 |
---|
| 84 | 0027 <span class="comment">% object representation in the different projected field plots</span> |
---|
| 85 | 0028 <span class="keyword">for</span> iview=1:length(Object_set) <span class="comment">%loop on projection planes iview</span> |
---|
| 86 | 0029 <span class="keyword">if</span> isfield(Object_set{iview},<span class="string">'plotaxes'</span>) |
---|
| 87 | 0030 haxes=Object_set{iview}.plotaxes;<span class="comment">% axes for the field plot</span> |
---|
| 88 | 0031 <span class="keyword">if</span> ishandle(haxes) & isequal(get(haxes,<span class="string">'Type'</span>),<span class="string">'axes'</span>)<span class="comment">% update the representation of the object IndexObj on this axes if it exists</span> |
---|
| 89 | 0032 testupdate=0; |
---|
| 90 | 0033 HandlesDisplay=[];<span class="comment">%default</span> |
---|
| 91 | 0034 <span class="keyword">if</span> length(Object_set)>= IndexObj && isfield(Object_set{IndexObj},<span class="string">'HandlesDisplay'</span>) |
---|
| 92 | 0035 HandlesDisplay=Object_set{IndexObj}.HandlesDisplay;<span class="comment">%list of handles of object representations</span> |
---|
| 93 | 0036 <span class="keyword">end</span> |
---|
| 94 | 0037 hplot_list=findobj(haxes,<span class="string">'Tag'</span>,<span class="string">'proj_object'</span>); |
---|
| 95 | 0038 <span class="keyword">for</span> ih=1:length(HandlesDisplay) |
---|
| 96 | 0039 plot_detect=find(hplot_list==HandlesDisplay(ih)); |
---|
| 97 | 0040 <span class="keyword">if</span> ~isempty(plot_detect) |
---|
| 98 | 0041 Object_out.HandlesDisplay(ih)=<a href="plot_object.html" class="code" title="function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col)">plot_object</a>(ObjectData,Object_set{iview},HandlesDisplay(ih),<span class="string">'m'</span>);<span class="comment">%update the the object representation</span> |
---|
| 99 | 0042 testupdate=1; |
---|
| 100 | 0043 <span class="keyword">break</span> |
---|
| 101 | 0044 <span class="keyword">end</span> |
---|
| 102 | 0045 <span class="keyword">end</span> |
---|
| 103 | 0046 <span class="keyword">if</span> ~testupdate<span class="comment">% draw new object plot</span> |
---|
| 104 | 0047 hh=<a href="plot_object.html" class="code" title="function [hh]=plot_object(ObjectDataIn,ProjObject,hplot,col)">plot_object</a>(ObjectData,Object_set{iview},haxes,<span class="string">'m'</span>);<span class="comment">%draw the object with the new object data</span> |
---|
| 105 | 0048 Object_out.HandlesDisplay=[Object_out.HandlesDisplay hh]; |
---|
| 106 | 0049 PlotData=get(hh,<span class="string">'UserData'</span>); |
---|
| 107 | 0050 PlotData.IndexObj=IndexObj; |
---|
| 108 | 0051 set(hh,<span class="string">'UserData'</span>,PlotData); <span class="comment">%record the object index in the graph</span> |
---|
| 109 | 0052 <span class="keyword">end</span> |
---|
| 110 | 0053 <span class="keyword">end</span> |
---|
| 111 | 0054 <span class="keyword">end</span> |
---|
| 112 | 0055 <span class="keyword">end</span> |
---|
| 113 | 0056 |
---|
| 114 | 0057 <span class="comment">% plot the field projected on the object</span> |
---|
| 115 | 0058 <span class="keyword">if</span> ~isempty(PlotHandles) <span class="comment">%&& ~testmask</span> |
---|
| 116 | 0059 ProjData= <a href="proj_field.html" class="code" title="function [ProjData,errormsg]=proj_field(FieldData,ObjectData,IndexObj)">proj_field</a>(UvData.Field,ObjectData,IndexObj);<span class="comment">%project the current interface field on ObjectData</span> |
---|
| 117 | 0060 <span class="keyword">if</span> ~isempty(ProjData) |
---|
| 118 | 0061 plotaxes=[];<span class="comment">%default</span> |
---|
| 119 | 0062 <span class="keyword">if</span> length(Object_set)>= IndexObj && isfield(Object_set{IndexObj},<span class="string">'plotaxes'</span>) |
---|
| 120 | 0063 plotaxes=Object_set{IndexObj}.plotaxes; |
---|
| 121 | 0064 <span class="keyword">end</span> |
---|
| 122 | 0065 [PlotType,Object_out.PlotParam,plotaxes]=<a href="plot_field.html" class="code" title="function [PlotType,PlotParamOut,haxes]= plot_field(Data,haxes,PlotParam,KeepLim,PosColorbar)">plot_field</a>(ProjData,plotaxes,PlotHandles); |
---|
| 123 | 0066 Object_out.plotaxes=plotaxes; |
---|
| 124 | 0067 plotfig=get(plotaxes,<span class="string">'parent'</span>); |
---|
| 125 | 0068 name_str=get(plotfig,<span class="string">'Name'</span>); |
---|
| 126 | 0069 <span class="keyword">if</span> ~isequal(name_str,<span class="string">'uvmat'</span>) |
---|
| 127 | 0070 set(plotfig,<span class="string">'Name'</span>,[<span class="string">'Projection on'</span> num2str(IndexObj) <span class="string">'-'</span> <a href="set_title.html" class="code" title="function TITLE=set_title(Style,ProjMode)">set_title</a>(ObjectData.Style,ObjectData.ProjMode)]); |
---|
| 128 | 0071 <span class="keyword">end</span> |
---|
| 129 | 0072 <span class="keyword">end</span> |
---|
| 130 | 0073 <span class="keyword">end</span> |
---|
| 131 | 0074 |
---|
| 132 | 0075</pre></div> |
---|
| 133 | <hr><address>Generated on Fri 13-Nov-2009 11:17:03 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
| 134 | </body> |
---|
| 135 | </html> |
---|