<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>VTK: dox/Widgets/vtkBoundedPlanePointPlacer.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>dox/Widgets/vtkBoundedPlanePointPlacer.h</h1><a href="a03665.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Visualization Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: vtkBoundedPlanePointPlacer.h,v $</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment"> Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen</span> <a name="l00007"></a>00007 <span class="comment"> All rights reserved.</span> <a name="l00008"></a>00008 <span class="comment"> See Copyright.txt or http://www.kitware.com/Copyright.htm for details.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even</span> <a name="l00011"></a>00011 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span> <a name="l00012"></a>00012 <span class="comment"> PURPOSE. See the above copyright notice for more information.</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment">=========================================================================*/</span> <a name="l00028"></a>00028 <span class="preprocessor">#ifndef __vtkBoundedPlanePointPlacer_h</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define __vtkBoundedPlanePointPlacer_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="a03718.html">vtkPointPlacer.h</a>"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">class </span><a class="code" href="a01224.html" title="perform various plane computations">vtkPlane</a>; <a name="l00034"></a>00034 <span class="keyword">class </span><a class="code" href="a01225.html" title="maintain a list of planes">vtkPlaneCollection</a>; <a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="a01226.html" title="implicit function for convex set of planes">vtkPlanes</a>; <a name="l00036"></a>00036 <span class="keyword">class </span><a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>; <a name="l00037"></a>00037 <a name="l00038"></a>00038 <a name="l00039"></a><a class="code" href="a00193.html">00039</a> <span class="keyword">class </span><a class="code" href="a02170.html#09e5ba6764f54642494e26907662d55f">VTK_WIDGETS_EXPORT</a> <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a> : <span class="keyword">public</span> <a class="code" href="a01249.html" title="Abstract interface to translate 2D display positions to world coordinates.">vtkPointPlacer</a> <a name="l00040"></a>00040 { <a name="l00041"></a>00041 <span class="keyword">public</span>: <a name="l00043"></a>00043 <span class="keyword">static</span> <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a> *<a class="code" href="a01249.html#1e2a099598014d8d0d9e1cd35981d65b">New</a>(); <a name="l00044"></a>00044 <a name="l00046"></a>00046 <a name="l00047"></a><a class="code" href="a00193.html#61907db1b95c8f0838d244ca888e72c5">00047</a> vtkTypeRevisionMacro(<a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>,<a class="code" href="a01249.html" title="Abstract interface to translate 2D display positions to world coordinates.">vtkPointPlacer</a>); <a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="a01249.html#322a5655a300b3a1ec02731aff6f68ee">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00050"></a>00050 <a name="l00052"></a>00052 <a name="l00055"></a>00055 vtkSetClampMacro(ProjectionNormal,<span class="keywordtype">int</span>, <a name="l00056"></a>00056 <a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49a5300c11a539423ec59c499672904b8e">vtkBoundedPlanePointPlacer::XAxis</a>, <a name="l00057"></a>00057 <a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b496c185db83d830f9cd1ef6afcbde0bd15">vtkBoundedPlanePointPlacer::Oblique</a>); <a name="l00058"></a>00058 vtkGetMacro(ProjectionNormal,<span class="keywordtype">int</span>); <a name="l00059"></a><a class="code" href="a00193.html#b33591e36b260b18eb0c290183aa6c22">00059</a> <span class="keywordtype">void</span> SetProjectionNormalToXAxis() <a name="l00060"></a>00060 { this->SetProjectionNormal(<a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49a5300c11a539423ec59c499672904b8e">vtkBoundedPlanePointPlacer::XAxis</a>); } <a name="l00061"></a><a class="code" href="a00193.html#4c545a6aa2a4bc5b59790d73b5824bb7">00061</a> <span class="keywordtype">void</span> SetProjectionNormalToYAxis() <a name="l00062"></a>00062 { this->SetProjectionNormal(<a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49971ce001c6a41011d80b1d3350920ae7">vtkBoundedPlanePointPlacer::YAxis</a>); } <a name="l00063"></a><a class="code" href="a00193.html#5b65b1951ac199cd00471bc27fea0c70">00063</a> <span class="keywordtype">void</span> SetProjectionNormalToZAxis() <a name="l00064"></a>00064 { this->SetProjectionNormal(<a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49a6b9673b49e6f3336eef933fee000882">vtkBoundedPlanePointPlacer::ZAxis</a>); } <a name="l00065"></a><a class="code" href="a00193.html#c93f20d9a06b9ccc8988f28179f2f18b">00065</a> <span class="keywordtype">void</span> SetProjectionNormalToOblique() <a name="l00066"></a>00066 { this->SetProjectionNormal(<a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b496c185db83d830f9cd1ef6afcbde0bd15">vtkBoundedPlanePointPlacer::Oblique</a>); } <a name="l00068"></a>00068 <a name="l00071"></a>00071 <span class="keywordtype">void</span> SetObliquePlane(<a class="code" href="a01224.html" title="perform various plane computations">vtkPlane</a> *); <a name="l00072"></a>00072 <a name="l00074"></a>00074 <a name="l00078"></a>00078 <span class="keywordtype">void</span> SetProjectionPosition(<span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210d43ac71820d660e3c543657c794b3d8c">position</a>); <a name="l00079"></a>00079 vtkGetMacro(ProjectionPosition, <span class="keywordtype">double</span>); <a name="l00081"></a>00081 <a name="l00083"></a>00083 <a name="l00089"></a>00089 <span class="keywordtype">void</span> AddBoundingPlane(<a class="code" href="a01224.html" title="perform various plane computations">vtkPlane</a> *plane); <a name="l00090"></a>00090 <span class="keywordtype">void</span> RemoveBoundingPlane(<a class="code" href="a01224.html" title="perform various plane computations">vtkPlane</a> *plane); <a name="l00091"></a>00091 <span class="keywordtype">void</span> RemoveAllBoundingPlanes(); <a name="l00092"></a>00092 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetBoundingPlanes(<a class="code" href="a01225.html" title="maintain a list of planes">vtkPlaneCollection</a>*); <a name="l00093"></a>00093 vtkGetObjectMacro(BoundingPlanes,<a class="code" href="a01225.html" title="maintain a list of planes">vtkPlaneCollection</a>); <a name="l00094"></a>00094 <span class="keywordtype">void</span> SetBoundingPlanes(<a class="code" href="a01226.html" title="implicit function for convex set of planes">vtkPlanes</a> *planes); <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="comment">//BTX</span> <a name="l00098"></a>00098 <span class="keyword">enum</span> <a name="l00099"></a>00099 { <a name="l00100"></a><a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49a5300c11a539423ec59c499672904b8e">00100</a> XAxis=0, <a name="l00101"></a><a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49971ce001c6a41011d80b1d3350920ae7">00101</a> YAxis, <a name="l00102"></a><a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b49a6b9673b49e6f3336eef933fee000882">00102</a> ZAxis, <a name="l00103"></a><a class="code" href="a00193.html#59054d0034ff8544d4df47ddf7fe3b496c185db83d830f9cd1ef6afcbde0bd15">00103</a> Oblique <a name="l00104"></a>00104 }; <a name="l00105"></a>00105 <span class="comment">//ETX</span> <a name="l00106"></a>00106 <a name="l00108"></a>00108 <a name="l00117"></a>00117 <span class="keywordtype">int</span> <a class="code" href="a01249.html#85c9d4778db93934e4a2177ac47dff3c">ComputeWorldPosition</a>( <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren, <a name="l00118"></a>00118 <span class="keywordtype">double</span> displayPos[2], <a name="l00119"></a>00119 <span class="keywordtype">double</span> worldPos[3], <a name="l00120"></a>00120 <span class="keywordtype">double</span> worldOrient[9] ); <a name="l00122"></a>00122 <a name="l00124"></a>00124 <a name="l00127"></a>00127 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01249.html#85c9d4778db93934e4a2177ac47dff3c">ComputeWorldPosition</a>( <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren, <a name="l00128"></a>00128 <span class="keywordtype">double</span> displayPos[2], <a name="l00129"></a>00129 <span class="keywordtype">double</span> refWorldPos[3], <a name="l00130"></a>00130 <span class="keywordtype">double</span> worldPos[3], <a name="l00131"></a>00131 <span class="keywordtype">double</span> worldOrient[9] ); <a name="l00133"></a>00133 <a name="l00136"></a>00136 <span class="keywordtype">int</span> <a class="code" href="a01249.html#dbda1faa9c534e7de22945e064ecb5c3">ValidateWorldPosition</a>( <span class="keywordtype">double</span> worldPos[3] ); <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="comment">// Descrption:</span> <a name="l00139"></a>00139 <span class="comment">// Orientationation is ignored, and the above method</span> <a name="l00140"></a>00140 <span class="comment">// is called instead.</span> <a name="l00141"></a>00141 <span class="keywordtype">int</span> <a class="code" href="a01249.html#dbda1faa9c534e7de22945e064ecb5c3">ValidateWorldPosition</a>( <span class="keywordtype">double</span> worldPos[3], <a name="l00142"></a>00142 <span class="keywordtype">double</span> worldOrient[9]); <a name="l00143"></a>00143 <a name="l00145"></a>00145 <a name="l00149"></a>00149 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01249.html#be521a12fbf914a7b0b467d85e2c15e0">UpdateWorldPosition</a>( <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren, <a name="l00150"></a>00150 <span class="keywordtype">double</span> worldPos[3], <a name="l00151"></a>00151 <span class="keywordtype">double</span> worldOrient[9] ); <a name="l00153"></a>00153 <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="keyword">protected</span>: <a name="l00156"></a>00156 <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>(); <a name="l00157"></a>00157 ~<a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>(); <a name="l00158"></a>00158 <a name="l00159"></a>00159 <span class="comment">// Indicates the projection normal as lying along the</span> <a name="l00160"></a>00160 <span class="comment">// XAxis, YAxis, ZAxis, or Oblique. For X, Y, and Z axes,</span> <a name="l00161"></a>00161 <span class="comment">// the projection normal is assumed to be anchored at</span> <a name="l00162"></a>00162 <span class="comment">// (0,0,0)</span> <a name="l00163"></a><a class="code" href="a00193.html#d74eeca40c0b71c4f2d3b13d696438a4">00163</a> <span class="keywordtype">int</span> ProjectionNormal; <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="comment">// Indicates a distance from the origin of the projection</span> <a name="l00166"></a>00166 <span class="comment">// normal where the project plane will be placed</span> <a name="l00167"></a><a class="code" href="a00193.html#936c88ebd68467f790fbe9775cf3d755">00167</a> <span class="keywordtype">double</span> ProjectionPosition; <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="comment">// If the ProjectionNormal is oblique, this is the oblique</span> <a name="l00170"></a>00170 <span class="comment">// plane</span> <a name="l00171"></a><a class="code" href="a00193.html#6dd00ba61214c1600dbf25fe4a10e154">00171</a> <a class="code" href="a01224.html" title="perform various plane computations">vtkPlane</a> *ObliquePlane; <a name="l00172"></a>00172 <a name="l00173"></a>00173 <span class="comment">// A collection of planes used to bound the projection</span> <a name="l00174"></a>00174 <span class="comment">// plane</span> <a name="l00175"></a><a class="code" href="a00193.html#f701a6fa9937207b76e70602247bcb46">00175</a> <a class="code" href="a01225.html" title="maintain a list of planes">vtkPlaneCollection</a> *BoundingPlanes; <a name="l00176"></a>00176 <a name="l00177"></a>00177 <span class="comment">// Internal method for getting the project normal as a vector</span> <a name="l00178"></a>00178 <span class="keywordtype">void</span> GetProjectionNormal( <span class="keywordtype">double</span> normal[3] ); <a name="l00179"></a>00179 <a name="l00180"></a>00180 <span class="comment">// Internal method for getting the origin of the </span> <a name="l00181"></a>00181 <span class="comment">// constraining plane as a 3-tuple</span> <a name="l00182"></a>00182 <span class="keywordtype">void</span> GetProjectionOrigin( <span class="keywordtype">double</span> origin[3] ); <a name="l00183"></a>00183 <a name="l00184"></a>00184 <span class="comment">// Internal method for getting the orientation of</span> <a name="l00185"></a>00185 <span class="comment">// the projection plane</span> <a name="l00186"></a>00186 <span class="keywordtype">void</span> GetCurrentOrientation( <span class="keywordtype">double</span> worldOrient[9] ); <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="comment">// Calculate the distance of a point from the Object. Negative </span> <a name="l00189"></a>00189 <span class="comment">// values imply that the point is outside. Positive values imply that it is</span> <a name="l00190"></a>00190 <span class="comment">// inside. The closest point to the object is returned in closestPt. </span> <a name="l00191"></a>00191 <span class="keyword">static</span> <span class="keywordtype">double</span> GetDistanceFromObject( <span class="keywordtype">double</span> pos[3], <a name="l00192"></a>00192 <a class="code" href="a01225.html" title="maintain a list of planes">vtkPlaneCollection</a> * pc, <a name="l00193"></a>00193 <span class="keywordtype">double</span> closestPt[3]); <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="keyword">private</span>: <a name="l00196"></a>00196 <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>(<span class="keyword">const</span> <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>&); <span class="comment">//Not implemented</span> <a name="l00197"></a>00197 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00193.html" title="a placer that constrains a handle to a finite plane">vtkBoundedPlanePointPlacer</a>&); <span class="comment">//Not implemented</span> <a name="l00198"></a>00198 }; <a name="l00199"></a>00199 <a name="l00200"></a>00200 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:52 2009 for VTK by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>