<!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/Filtering/vtkPointLocator.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/Filtering/vtkPointLocator.h</h1><a href="a02324.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: vtkPointLocator.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="l00041"></a>00041 <span class="preprocessor">#ifndef __vtkPointLocator_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define __vtkPointLocator_h</span> <a name="l00043"></a>00043 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="a02185.html">vtkAbstractPointLocator.h</a>"</span> <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="a00242.html" title="object to represent cell connectivity">vtkCellArray</a>; <a name="l00047"></a>00047 <span class="keyword">class </span><a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a>; <a name="l00048"></a>00048 <span class="keyword">class </span>vtkNeighborPoints; <a name="l00049"></a>00049 <span class="keyword">class </span><a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a>; <a name="l00050"></a>00050 <a name="l00051"></a><a class="code" href="a01247.html">00051</a> <span class="keyword">class </span><a class="code" href="a02170.html#95ced7977a6b6b1bf9f38bf04e3835b6">VTK_FILTERING_EXPORT</a> <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a> : <span class="keyword">public</span> <a class="code" href="a00087.html" title="abstract class to quickly locate points in 3-space">vtkAbstractPointLocator</a> <a name="l00052"></a>00052 { <a name="l00053"></a>00053 <span class="keyword">public</span>: <a name="l00056"></a>00056 <span class="keyword">static</span> <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>(); <a name="l00057"></a>00057 <a name="l00058"></a><a class="code" href="a01247.html#547e7f59bc00c62dc61be99aa0a710ff">00058</a> vtkTypeRevisionMacro(<a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>,<a class="code" href="a00087.html" title="abstract class to quickly locate points in 3-space">vtkAbstractPointLocator</a>); <a name="l00059"></a>00059 <span class="keywordtype">void</span> <a class="code" href="a00087.html#281b6a47c7c5671911802720c80685e9">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00060"></a>00060 <a name="l00062"></a>00062 <a name="l00063"></a>00063 vtkSetVector3Macro(Divisions,<span class="keywordtype">int</span>); <a name="l00064"></a>00064 vtkGetVectorMacro(Divisions,<span class="keywordtype">int</span>,3); <a name="l00066"></a>00066 <a name="l00068"></a>00068 <a name="l00069"></a>00069 vtkSetClampMacro(NumberOfPointsPerBucket,<span class="keywordtype">int</span>,1,<a class="code" href="a02149.html#804f55a35836c1770f9176f3a01c4d5e">VTK_LARGE_INTEGER</a>); <a name="l00070"></a>00070 vtkGetMacro(NumberOfPointsPerBucket,<span class="keywordtype">int</span>); <a name="l00072"></a>00072 <a name="l00077"></a>00077 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <a class="code" href="a00087.html#379e63c0546837fb1dbc07aac5ddfd74">FindClosestPoint</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3]); <a name="l00078"></a>00078 <a name="l00080"></a>00080 <a name="l00084"></a>00084 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <a class="code" href="a00087.html#d7ceec8d619ade7ae82fadd6d4fc0679">FindClosestPointWithinRadius</a>( <a name="l00085"></a>00085 <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c88c373494669189048f82ee86af5852">radius</a>, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keywordtype">double</span>& dist2); <a name="l00086"></a>00086 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> <a class="code" href="a00087.html#d7ceec8d619ade7ae82fadd6d4fc0679">FindClosestPointWithinRadius</a>(<span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210c88c373494669189048f82ee86af5852">radius</a>, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <a name="l00087"></a>00087 <span class="keywordtype">double</span> inputDataLength, <span class="keywordtype">double</span>& dist2); <a name="l00089"></a>00089 <a name="l00094"></a>00094 <span class="keyword">virtual</span> <span class="keywordtype">int</span> InitPointInsertion(<a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *newPts, <span class="keyword">const</span> <span class="keywordtype">double</span> bounds[6]); <a name="l00095"></a>00095 <a name="l00097"></a>00097 <a name="l00101"></a>00101 <span class="keyword">virtual</span> <span class="keywordtype">int</span> InitPointInsertion(<a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *newPts, <span class="keyword">const</span> <span class="keywordtype">double</span> bounds[6], <a name="l00102"></a>00102 <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> estSize); <a name="l00104"></a>00104 <a name="l00112"></a>00112 <span class="keyword">virtual</span> <span class="keywordtype">void</span> InsertPoint(<a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> ptId, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3]); <a name="l00113"></a>00113 <a name="l00121"></a>00121 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> InsertNextPoint(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3]); <a name="l00122"></a>00122 <a name="l00124"></a>00124 <a name="l00127"></a><a class="code" href="a01247.html#dc8072151efa15d296295a162b8d8166">00127</a> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> IsInsertedPoint(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z) <a name="l00128"></a>00128 { <a name="l00129"></a>00129 <span class="keywordtype">double</span> xyz[3]; <a name="l00130"></a>00130 xyz[0] = x; xyz[1] = y; xyz[2] = z; <a name="l00131"></a>00131 <span class="keywordflow">return</span> this->IsInsertedPoint (xyz); <a name="l00132"></a>00132 }; <a name="l00133"></a>00133 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> IsInsertedPoint(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3]); <a name="l00135"></a>00135 <a name="l00143"></a>00143 <span class="keyword">virtual</span> <span class="keywordtype">int</span> InsertUniquePoint(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> &ptId); <a name="l00144"></a>00144 <a name="l00150"></a>00150 <span class="keyword">virtual</span> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> FindClosestInsertedPoint(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3]); <a name="l00151"></a>00151 <a name="l00158"></a>00158 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00087.html#984d6b3248e998a266a8684dd8ac4d03">FindClosestNPoints</a>(<span class="keywordtype">int</span> N, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> *result); <a name="l00159"></a>00159 <a name="l00161"></a>00161 <a name="l00166"></a>00166 <span class="keyword">virtual</span> <span class="keywordtype">void</span> FindDistributedPoints(<span class="keywordtype">int</span> N, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <a name="l00167"></a>00167 <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> *result, <span class="keywordtype">int</span> M); <a name="l00168"></a>00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> FindDistributedPoints(<span class="keywordtype">int</span> N, <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <a name="l00169"></a>00169 <span class="keywordtype">double</span> z, <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> *result, <span class="keywordtype">int</span> M); <a name="l00171"></a>00171 <a name="l00173"></a>00173 <a name="l00177"></a>00177 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00087.html#2ee2b169421cbdbd984567a7f00d4949">FindPointsWithinRadius</a>(<span class="keywordtype">double</span> R, <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <a name="l00178"></a>00178 <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> *result); <a name="l00180"></a>00180 <a name="l00185"></a>00185 <span class="keyword">virtual</span> <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> *GetPointsInBucket(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keywordtype">int</span> ijk[3]); <a name="l00186"></a>00186 <a name="l00188"></a>00188 <a name="l00189"></a>00189 vtkGetObjectMacro(Points, <a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a>); <a name="l00191"></a>00191 <a name="l00193"></a>00193 <a name="l00195"></a>00195 <span class="keywordtype">void</span> <a class="code" href="a00971.html#4795cb07864cdbe38577a6a1a31737c5">Initialize</a>(); <a name="l00196"></a>00196 <span class="keywordtype">void</span> <a class="code" href="a00087.html#4267a11f7dc7cbb96946157b9f05d859">FreeSearchStructure</a>(); <a name="l00197"></a>00197 <span class="keywordtype">void</span> <a class="code" href="a00087.html#bfab2e38a52592a0ad6adfef59b4caf4">BuildLocator</a>(); <a name="l00198"></a>00198 <span class="keywordtype">void</span> <a class="code" href="a00087.html#d08a93a5f991787478471d6d796c8f4b">GenerateRepresentation</a>(<span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2103f20abad13593a5879a08c3e64355835">level</a>, <a class="code" href="a01260.html" title="concrete dataset represents vertices, lines, polygons, and triangle strips">vtkPolyData</a> *pd); <a name="l00200"></a>00200 <a name="l00201"></a>00201 <span class="keyword">protected</span>: <a name="l00202"></a>00202 <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>(); <a name="l00203"></a>00203 <span class="keyword">virtual</span> ~<a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>(); <a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="comment">// place points in appropriate buckets</span> <a name="l00206"></a>00206 <span class="keywordtype">void</span> GetBucketNeighbors(vtkNeighborPoints* buckets, <a name="l00207"></a>00207 <span class="keyword">const</span> <span class="keywordtype">int</span> ijk[3], <span class="keyword">const</span> <span class="keywordtype">int</span> ndivs[3], <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2103f20abad13593a5879a08c3e64355835">level</a>); <a name="l00208"></a>00208 <span class="keywordtype">void</span> GetOverlappingBuckets(vtkNeighborPoints* buckets, <a name="l00209"></a>00209 <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keyword">const</span> <span class="keywordtype">int</span> ijk[3], <span class="keywordtype">double</span> dist, <a name="l00210"></a>00210 <span class="keywordtype">int</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2103f20abad13593a5879a08c3e64355835">level</a>); <a name="l00211"></a>00211 <span class="keywordtype">void</span> GetOverlappingBuckets(vtkNeighborPoints* buckets, <a name="l00212"></a>00212 <span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keywordtype">double</span> dist, <a name="l00213"></a>00213 <span class="keywordtype">int</span> prevMinLevel[3], <a name="l00214"></a>00214 <span class="keywordtype">int</span> prevMaxLevel[3]); <a name="l00215"></a>00215 <span class="keywordtype">void</span> GenerateFace(<span class="keywordtype">int</span> <a class="code" href="a00012.html">face</a>, <span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k, <a name="l00216"></a>00216 <a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *pts, <a class="code" href="a00242.html" title="object to represent cell connectivity">vtkCellArray</a> *polys); <a name="l00217"></a>00217 <span class="keywordtype">double</span> Distance2ToBucket(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keyword">const</span> <span class="keywordtype">int</span> nei[3]); <a name="l00218"></a>00218 <span class="keywordtype">double</span> Distance2ToBounds(<span class="keyword">const</span> <span class="keywordtype">double</span> x[3], <span class="keyword">const</span> <span class="keywordtype">double</span> bounds[6]); <a name="l00219"></a>00219 <a name="l00220"></a><a class="code" href="a01247.html#c6b2b27a09638a903c9c2c79b908739f">00220</a> <a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *Points; <span class="comment">// Used for merging points</span> <a name="l00221"></a><a class="code" href="a01247.html#df94a3d4738c0aedc7b83e23b9a7d10b">00221</a> <span class="keywordtype">int</span> Divisions[3]; <span class="comment">// Number of sub-divisions in x-y-z directions</span> <a name="l00222"></a><a class="code" href="a01247.html#28f6d838031e62efbf71804aef326953">00222</a> <span class="keywordtype">int</span> NumberOfPointsPerBucket; <span class="comment">//Used with previous boolean to control subdivide</span> <a name="l00223"></a><a class="code" href="a01247.html#6ae56780e01682873f6d08b93c6807eb">00223</a> <a class="code" href="a00720.html" title="list of point or cell ids">vtkIdList</a> **HashTable; <span class="comment">// lists of point ids in buckets</span> <a name="l00224"></a><a class="code" href="a01247.html#444309bac9e1b437911733390509f880">00224</a> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> NumberOfBuckets; <span class="comment">// total size of hash table</span> <a name="l00225"></a><a class="code" href="a01247.html#5e1b99693e2362ed88a0ca8cf6bed848">00225</a> <span class="keywordtype">double</span> H[3]; <span class="comment">// width of each bucket in x-y-z directions</span> <a name="l00226"></a>00226 <a name="l00227"></a><a class="code" href="a01247.html#48383051688d16f1651265a8b6b4d239">00227</a> <span class="keywordtype">double</span> InsertionTol2; <a name="l00228"></a><a class="code" href="a01247.html#b91ff2749b4344d8da0161aeefd6ae2a">00228</a> <a class="code" href="a02149.html#20bd6b6dedfe1bbb096c50354d52cc7e">vtkIdType</a> InsertionPointId; <a name="l00229"></a>00229 <a name="l00230"></a><a class="code" href="a01247.html#246893cc4466b6ddac52f55efffcfaea">00230</a> <span class="keywordtype">double</span> InsertionLevel; <a name="l00231"></a>00231 <span class="keyword">private</span>: <a name="l00232"></a>00232 <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>(<span class="keyword">const</span> <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>&); <span class="comment">// Not implemented.</span> <a name="l00233"></a>00233 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01247.html" title="quickly locate points in 3-space">vtkPointLocator</a>&); <span class="comment">// Not implemented.</span> <a name="l00234"></a>00234 }; <a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="preprocessor">#endif</span> <a name="l00237"></a>00237 <span class="preprocessor"></span> <a name="l00238"></a>00238 </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:17 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>