39 #ifndef __vtkOctreePointLocator_h
40 #define __vtkOctreePointLocator_h
42 #include "vtkCommonDataModelModule.h"
43 #include "vtkAbstractPointLocator.h"
47 class vtkOctreePointLocatorNode;
55 void PrintSelf(ostream& os,
vtkIndent indent);
61 vtkSetMacro(MaximumPointsPerRegion,
int);
62 vtkGetMacro(MaximumPointsPerRegion,
int);
67 vtkSetMacro(CreateCubicOctants,
int);
68 vtkGetMacro(CreateCubicOctants,
int);
76 vtkGetMacro(FudgeFactor,
double);
77 vtkSetMacro(FudgeFactor,
double);
83 virtual double *GetBounds();
84 virtual void GetBounds(
double *bounds);
89 vtkGetMacro(NumberOfLeafNodes,
int);
93 void GetRegionBounds(
int regionID,
double bounds[6]);
96 void GetRegionDataBounds(
int leafNodeID,
double bounds[6]);
99 int GetRegionContainingPoint(
double x,
double y,
double z);
104 virtual void BuildLocator();
109 virtual vtkIdType FindClosestPoint(
const double x[3]);
110 vtkIdType FindClosestPoint(
double x,
double y,
double z,
double &dist2);
117 virtual vtkIdType FindClosestPointWithinRadius(
118 double radius,
const double x[3],
double& dist2);
125 vtkIdType FindClosestPointInRegion(
int regionId,
double *x,
double &dist2);
126 vtkIdType FindClosestPointInRegion(
int regionId,
double x,
double y,
127 double z,
double &dist2);
133 virtual void FindPointsWithinRadius(
134 double radius,
const double x[3],
vtkIdList *result);
143 void FindClosestNPoints(
int N,
const double x[3],
vtkIdList *result);
149 virtual void FreeSearchStructure();
153 void GenerateRepresentation(
int level, vtkPolyData *pd);
159 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray =
true);
166 vtkOctreePointLocatorNode *
Top;
169 void BuildLeafNodeList(vtkOctreePointLocatorNode* node,
int & index);
174 int FindRegion(vtkOctreePointLocatorNode* node,
float x,
float y,
float z);
175 int FindRegion(vtkOctreePointLocatorNode* node,
double x,
double y,
double z);
178 static void SetDataBoundsToSpatialBounds(vtkOctreePointLocatorNode *node);
180 static void DeleteAllDescendants(vtkOctreePointLocatorNode* octant);
187 void FindPointsWithinRadius(vtkOctreePointLocatorNode* node,
double radiusSquared,
192 void AddAllPointsInRegion(vtkOctreePointLocatorNode* node,
vtkIdList* ids);
195 void FindPointsInArea(vtkOctreePointLocatorNode* node,
double* area,
vtkIdTypeArray* ids);
198 void AddAllPointsInRegion(vtkOctreePointLocatorNode* node,
vtkIdTypeArray* ids);
200 void DivideRegion(vtkOctreePointLocatorNode *node,
int* ordering,
int level);
202 int DivideTest(
int size,
int level);
206 void AddPolys(vtkOctreePointLocatorNode *node,
vtkPoints *pts, vtkCellArray *polys);
211 int _FindClosestPointInRegion(
int leafNodeId,
double x,
double y,
212 double z,
double &dist2);
221 int FindClosestPointInSphere(
double x,
double y,
double z,
double radius,
222 int skipRegion,
double &dist2);
a octree spatial decomposition of a set of points
int NumberOfLocatorPoints
int MaximumPointsPerRegion
dynamic, self-adjusting array of vtkIdType
vtkOctreePointLocatorNode ** LeafNodeList
a simple class to control print indentation
list of point or cell ids
vtkOctreePointLocatorNode * Top
represent and manipulate 3D points