59 #ifndef vtkIncrementalOctreeNode_h
60 #define vtkIncrementalOctreeNode_h
62 #include "vtkCommonDataModelModule.h"
80 vtkGetMacro( NumberOfPoints,
int );
87 vtkGetObjectMacro( PointIdSet,
vtkIdList );
93 void DeleteChildNodes();
99 void SetBounds(
double x1,
double x2,
double y1,
100 double y2,
double z1,
double z2 );
106 void GetBounds(
double bounds[6] )
const;
112 vtkGetVector3Macro( MinBounds,
double );
119 vtkGetVector3Macro( MaxBounds,
double );
127 {
return this->NumberOfPoints ? this->MinDataBounds : this->MinBounds; }
134 {
return this->NumberOfPoints ? this->MaxDataBounds : this->MaxBounds; }
139 int IsLeaf() {
return ( this->Children == NULL ) ? 1 : 0; }
146 int GetChildIndex(
const double point[3] );
158 int ContainsPoint(
const double pnt[3] );
164 int ContainsPointByData(
const double pnt[3] );
180 int maxPts,
vtkIdType * pntId,
int ptMode );
187 double GetDistance2ToInnerBoundary(
const double point[3],
195 double GetDistance2ToBoundary(
const double point[3],
203 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
210 void ExportAllPointIdsByInsertion(
vtkIdList * idList );
247 double MinDataBounds[3];
254 double MaxDataBounds[3];
280 virtual
void SetPointIdSet(
vtkIdList * );
300 const
double newPnt[3],
vtkIdType * pntIdx,
int maxPts,
int ptMode );
306 void CreatePointIdSet(
int initSize,
int growSize );
311 void DeletePointIdSet();
318 void UpdateCounterAndDataBounds( const
double point[3] );
329 int UpdateCounterAndDataBounds
330 ( const
double point[3],
int nHits,
int updateData );
342 int UpdateCounterAndDataBoundsRecursively( const
double point[3],
int nHits,
343 int updateData, vtkIncrementalOctreeNode * endNode );
351 int ContainsDuplicatePointsOnly( const
double pnt[3] );
366 void SeperateExactlyDuplicatePointsFromNewInsertion(
vtkPoints * points,
367 vtkIdList * pntIds, const
double newPnt[3],
368 vtkIdType * pntIdx,
int maxPts,
int ptMode );
377 double GetDistance2ToBoundary( const
double point[3],
double closest[3],
378 int innerOnly, vtkIncrementalOctreeNode* rootNode,
int checkData = 0 );
380 vtkIncrementalOctreeNode( const vtkIncrementalOctreeNode & ) VTK_DELETE_FUNCTION;
381 void operator = ( const vtkIncrementalOctreeNode & ) VTK_DELETE_FUNCTION;
386 inline
int vtkIncrementalOctreeNode::GetChildIndex( const
double point[3] )
389 return int( point[0] > this->Children[0]->MaxBounds[0] ) +
390 ( (
int( point[1] > this->Children[0]->MaxBounds[1] ) ) << 1 ) +
391 ( (
int( point[2] > this->Children[0]->MaxBounds[2] ) ) << 2 );
398 ( this->MinBounds[0] < pnt[0] && pnt[0] <= this->MaxBounds[0] &&
399 this->MinBounds[1] < pnt[1] && pnt[1] <= this->MaxBounds[1] &&
400 this->MinBounds[2] < pnt[2] && pnt[2] <= this->MaxBounds[2]
410 ( this->MinDataBounds[0] <= pnt[0] && pnt[0] <= this->MaxDataBounds[0] &&
411 this->MinDataBounds[1] <= pnt[1] && pnt[1] <= this->MaxDataBounds[1] &&
412 this->MinDataBounds[2] <= pnt[2] && pnt[2] <= this->MaxDataBounds[2]
418 inline int vtkIncrementalOctreeNode::ContainsDuplicatePointsOnly
419 (
const double pnt[3] )
423 ( this->MinDataBounds[0] == pnt[0] && pnt[0] == this->MaxDataBounds[0] &&
424 this->MinDataBounds[1] == pnt[1] && pnt[1] == this->MaxDataBounds[1] &&
425 this->MinDataBounds[2] == pnt[2] && pnt[2] == this->MaxDataBounds[2]
431 inline void vtkIncrementalOctreeNode::UpdateCounterAndDataBounds
432 (
const double point[3] )
434 this->NumberOfPoints ++;
436 this->MinDataBounds[0] = ( point[0] < this->MinDataBounds[0] )
437 ? point[0] : this->MinDataBounds[0];
438 this->MinDataBounds[1] = ( point[1] < this->MinDataBounds[1] )
439 ? point[1] : this->MinDataBounds[1];
440 this->MinDataBounds[2] = ( point[2] < this->MinDataBounds[2] )
441 ? point[2] : this->MinDataBounds[2];
442 this->MaxDataBounds[0] = ( point[0] > this->MaxDataBounds[0] )
443 ? point[0] : this->MaxDataBounds[0];
444 this->MaxDataBounds[1] = ( point[1] > this->MaxDataBounds[1] )
445 ? point[1] : this->MaxDataBounds[1];
446 this->MaxDataBounds[2] = ( point[2] > this->MaxDataBounds[2] )
447 ? point[2] : this->MaxDataBounds[2];
451 inline int vtkIncrementalOctreeNode::UpdateCounterAndDataBoundsRecursively
452 (
const double point[3],
int nHits,
int updateData,
455 int updated = this->UpdateCounterAndDataBounds
456 ( point, nHits, updateData );
458 return ( ( this->Parent == endNode )
460 : this->Parent->UpdateCounterAndDataBoundsRecursively
461 ( point, nHits, updated, endNode )
int IsLeaf()
Determine whether or not this node is a leaf.
double * GetMaxDataBounds()
Get access to MaxDataBounds.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ContainsPoint(const double pnt[3])
A point is in a node if and only if MinBounds[i] < p[i] <= MaxBounds[i], which allows a node to be di...
int ContainsPointByData(const double pnt[3])
A point is in a node, in terms of data, if and only if MinDataBounds[i] <= p[i] <= MaxDataBounds[i]...
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)
Get quick access to a child of this node.
double * GetMinDataBounds()
Get access to MinDataBounds.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points