58 #ifndef vtkIncrementalOctreeNode_h
59 #define vtkIncrementalOctreeNode_h
77 vtkGetMacro( NumberOfPoints,
int );
82 vtkGetObjectMacro( PointIdSet,
vtkIdList );
86 void DeleteChildNodes();
91 void SetBounds(
double x1,
double x2,
double y1,
92 double y2,
double z1,
double z2 );
97 void GetBounds(
double bounds[6] )
const;
101 vtkGetVector3Macro( MinBounds,
double );
106 vtkGetVector3Macro( MaxBounds,
double );
113 {
return this->NumberOfPoints ? this->MinDataBounds : this->MinBounds; }
120 {
return this->NumberOfPoints ? this->MaxDataBounds : this->MaxBounds; }
124 int IsLeaf() {
return ( this->Children == NULL ) ? 1 : 0; }
129 int GetChildIndex(
const double point[3] );
139 int ContainsPoint(
const double pnt[3] );
143 int ContainsPointByData(
const double pnt[3] );
159 int maxPts,
vtkIdType * pntId,
int ptMode );
166 double GetDistance2ToInnerBoundary(
const double point[3],
174 double GetDistance2ToBoundary(
const double point[3],
183 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
190 void ExportAllPointIdsByInsertion(
vtkIdList * idList );
219 double MinDataBounds[3];
225 double MaxDataBounds[3];
241 virtual void SetPointIdSet(
vtkIdList * );
262 const double newPnt[3],
vtkIdType * pntIdx,
int maxPts,
int ptMode );
267 void CreatePointIdSet(
int initSize,
int growSize );
270 void DeletePointIdSet();
275 void UpdateCounterAndDataBounds(
const double point[3] );
286 int UpdateCounterAndDataBounds
287 (
const double point[3],
int nHits,
int updateData );
300 int UpdateCounterAndDataBoundsRecursively(
const double point[3],
int nHits,
308 int ContainsDuplicatePointsOnly(
const double pnt[3] );
323 void SeperateExactlyDuplicatePointsFromNewInsertion(
vtkPoints *
points,
324 vtkIdList * pntIds,
const double newPnt[3],
325 vtkIdType * pntIdx,
int maxPts,
int ptMode );
334 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
347 return int( point[0] > this->Children[0]->MaxBounds[0] ) +
348 ( (
int( point[1] > this->Children[0]->MaxBounds[1] ) ) << 1 ) +
349 ( (
int( point[2] > this->Children[0]->MaxBounds[2] ) ) << 2 );
356 ( this->MinBounds[0] < pnt[0] && pnt[0] <= this->MaxBounds[0] &&
357 this->MinBounds[1] < pnt[1] && pnt[1] <= this->MaxBounds[1] &&
358 this->MinBounds[2] < pnt[2] && pnt[2] <= this->MaxBounds[2]
368 ( this->MinDataBounds[0] <= pnt[0] && pnt[0] <= this->MaxDataBounds[0] &&
369 this->MinDataBounds[1] <= pnt[1] && pnt[1] <= this->MaxDataBounds[1] &&
370 this->MinDataBounds[2] <= pnt[2] && pnt[2] <= this->MaxDataBounds[2]
376 inline int vtkIncrementalOctreeNode::ContainsDuplicatePointsOnly
377 (
const double pnt[3] )
381 ( this->MinDataBounds[0] == pnt[0] && pnt[0] == this->MaxDataBounds[0] &&
382 this->MinDataBounds[1] == pnt[1] && pnt[1] == this->MaxDataBounds[1] &&
383 this->MinDataBounds[2] == pnt[2] && pnt[2] == this->MaxDataBounds[2]
389 inline void vtkIncrementalOctreeNode::UpdateCounterAndDataBounds
390 (
const double point[3] )
392 this->NumberOfPoints ++;
394 this->MinDataBounds[0] = ( point[0] < this->MinDataBounds[0] )
395 ? point[0] : this->MinDataBounds[0];
396 this->MinDataBounds[1] = ( point[1] < this->MinDataBounds[1] )
397 ? point[1] : this->MinDataBounds[1];
398 this->MinDataBounds[2] = ( point[2] < this->MinDataBounds[2] )
399 ? point[2] : this->MinDataBounds[2];
400 this->MaxDataBounds[0] = ( point[0] > this->MaxDataBounds[0] )
401 ? point[0] : this->MaxDataBounds[0];
402 this->MaxDataBounds[1] = ( point[1] > this->MaxDataBounds[1] )
403 ? point[1] : this->MaxDataBounds[1];
404 this->MaxDataBounds[2] = ( point[2] > this->MaxDataBounds[2] )
405 ? point[2] : this->MaxDataBounds[2];
409 inline int vtkIncrementalOctreeNode::UpdateCounterAndDataBoundsRecursively
410 (
const double point[3],
int nHits,
int updateData,
413 int updated = this->UpdateCounterAndDataBounds
414 ( point, nHits, updateData );
416 return ( ( this->Parent == endNode )
418 : this->Parent->UpdateCounterAndDataBoundsRecursively
419 ( point, nHits, updated, endNode )
double * GetMaxDataBounds()
abstract base class for most VTK objects
int ContainsPoint(const double pnt[3])
int ContainsPointByData(const double pnt[3])
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
list of point or cell ids
Octree node constituting incremental octree (in support of both point location and point insertion) ...
vtkIncrementalOctreeNode * GetChild(int i)
double * GetMinDataBounds()
int GetChildIndex(const double point[3])
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points