39 #ifndef __vtkOctreePointLocator_h
40 #define __vtkOctreePointLocator_h
42 #include "vtkAbstractPointLocator.h"
46 class vtkOctreePointLocatorNode;
54 void PrintSelf(ostream& os,
vtkIndent indent);
60 vtkSetMacro(MaximumPointsPerRegion,
int);
61 vtkGetMacro(MaximumPointsPerRegion,
int);
66 vtkSetMacro(CreateCubicOctants,
int);
67 vtkGetMacro(CreateCubicOctants,
int);
75 vtkGetMacro(FudgeFactor,
double);
76 vtkSetMacro(FudgeFactor,
double);
82 virtual double *GetBounds();
83 virtual void GetBounds(
double *bounds);
88 vtkGetMacro(NumberOfLeafNodes,
int);
92 void GetRegionBounds(
int regionID,
double bounds[6]);
95 void GetRegionDataBounds(
int leafNodeID,
double bounds[6]);
98 int GetRegionContainingPoint(
double x,
double y,
double z);
103 virtual void BuildLocator();
108 virtual vtkIdType FindClosestPoint(
const double x[3]);
109 vtkIdType FindClosestPoint(
double x,
double y,
double z,
double &dist2);
116 virtual vtkIdType FindClosestPointWithinRadius(
117 double radius,
const double x[3],
double& dist2);
124 vtkIdType FindClosestPointInRegion(
int regionId,
double *x,
double &dist2);
125 vtkIdType FindClosestPointInRegion(
int regionId,
double x,
double y,
126 double z,
double &dist2);
132 virtual void FindPointsWithinRadius(
133 double radius,
const double x[3],
vtkIdList *result);
142 void FindClosestNPoints(
int N,
const double x[3],
vtkIdList *result);
148 virtual void FreeSearchStructure();
152 void GenerateRepresentation(
int level, vtkPolyData *pd);
158 void FindPointsInArea(
double* area,
vtkIdTypeArray* ids,
bool clearArray =
true);
165 vtkOctreePointLocatorNode *
Top;
168 void BuildLeafNodeList(vtkOctreePointLocatorNode* node,
int & index);
173 int FindRegion(vtkOctreePointLocatorNode* node,
float x,
float y,
float z);
174 int FindRegion(vtkOctreePointLocatorNode* node,
double x,
double y,
double z);
177 static void SetDataBoundsToSpatialBounds(vtkOctreePointLocatorNode *node);
179 static void DeleteAllDescendants(vtkOctreePointLocatorNode* octant);
186 void FindPointsWithinRadius(vtkOctreePointLocatorNode* node,
double radiusSquared,
191 void AddAllPointsInRegion(vtkOctreePointLocatorNode* node,
vtkIdList* ids);
194 void FindPointsInArea(vtkOctreePointLocatorNode* node,
double* area,
vtkIdTypeArray* ids);
197 void AddAllPointsInRegion(vtkOctreePointLocatorNode* node,
vtkIdTypeArray* ids);
199 void DivideRegion(vtkOctreePointLocatorNode *node,
int* ordering,
int level);
201 int DivideTest(
int size,
int level);
205 void AddPolys(vtkOctreePointLocatorNode *node,
vtkPoints *pts, vtkCellArray *polys);
210 int _FindClosestPointInRegion(
int leafNodeId,
double x,
double y,
211 double z,
double &dist2);
220 int FindClosestPointInSphere(
double x,
double y,
double z,
double radius,
221 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