50 #ifndef vtkIncrementalOctreeNode_h
51 #define vtkIncrementalOctreeNode_h
53 #include "vtkCommonDataModelModule.h"
56 VTK_ABI_NAMESPACE_BEGIN
72 vtkGetMacro(NumberOfPoints,
int);
85 void DeleteChildNodes();
91 void SetBounds(
double x1,
double x2,
double y1,
double y2,
double z1,
double z2);
103 vtkGetVector3Macro(MinBounds,
double);
110 vtkGetVector3Macro(MaxBounds,
double);
119 return this->NumberOfPoints ? this->MinDataBounds : this->MinBounds;
128 return this->NumberOfPoints ? this->MaxDataBounds : this->MaxBounds;
134 int IsLeaf() {
return (this->Children ==
nullptr) ? 1 : 0; }
141 int GetChildIndex(
const double point[3]);
159 vtkTypeBool ContainsPointByData(
const double pnt[3]);
180 int ptMode,
int& numberOfNodes);
195 double GetDistance2ToBoundary(
203 double GetDistance2ToBoundary(
210 void ExportAllPointIdsByInsertion(
vtkIdList* idList);
225 int GetNumberOfLevels()
const;
231 int GetID()
const {
return this->ID; }
259 double MinDataBounds[3];
266 double MaxDataBounds[3];
320 vtkIdType* pntIdx,
int maxPts,
int ptMode,
int& numberOfNodes);
326 void CreatePointIdSet(
int initSize,
int growSize);
331 void DeletePointIdSet();
338 void UpdateCounterAndDataBounds(
const double point[3]);
349 int UpdateCounterAndDataBounds(
const double point[3],
int nHits,
int updateData);
361 int UpdateCounterAndDataBoundsRecursively(
370 int ContainsDuplicatePointsOnly(
const double pnt[3]);
386 const double newPnt[3],
vtkIdType* pntIdx,
int maxPts,
int ptMode);
395 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
int innerOnly,
406 return int(point[0] > this->Children[0]->MaxBounds[0]) +
407 ((int(point[1] > this->Children[0]->MaxBounds[1])) << 1) +
408 ((int(point[2] > this->Children[0]->MaxBounds[2])) << 2);
415 (this->MinBounds[0] < pnt[0] && pnt[0] <= this->MaxBounds[0] && this->MinBounds[1] < pnt[1] &&
416 pnt[1] <= this->MaxBounds[1] && this->MinBounds[2] < pnt[2] && pnt[2] <= this->MaxBounds[2])
424 return ((this->MinDataBounds[0] <= pnt[0] && pnt[0] <= this->MaxDataBounds[0] &&
425 this->MinDataBounds[1] <= pnt[1] && pnt[1] <= this->MaxDataBounds[1] &&
426 this->MinDataBounds[2] <= pnt[2] && pnt[2] <= this->MaxDataBounds[2])
432 inline int vtkIncrementalOctreeNode::ContainsDuplicatePointsOnly(
const double pnt[3])
434 return ((this->MinDataBounds[0] == pnt[0] && pnt[0] == this->MaxDataBounds[0] &&
435 this->MinDataBounds[1] == pnt[1] && pnt[1] == this->MaxDataBounds[1] &&
436 this->MinDataBounds[2] == pnt[2] && pnt[2] == this->MaxDataBounds[2])
442 inline void vtkIncrementalOctreeNode::UpdateCounterAndDataBounds(
const double point[3])
444 this->NumberOfPoints++;
446 this->MinDataBounds[0] = (point[0] < this->MinDataBounds[0]) ? point[0] : this->MinDataBounds[0];
447 this->MinDataBounds[1] = (point[1] < this->MinDataBounds[1]) ? point[1] : this->MinDataBounds[1];
448 this->MinDataBounds[2] = (point[2] < this->MinDataBounds[2]) ? point[2] : this->MinDataBounds[2];
449 this->MaxDataBounds[0] = (point[0] > this->MaxDataBounds[0]) ? point[0] : this->MaxDataBounds[0];
450 this->MaxDataBounds[1] = (point[1] > this->MaxDataBounds[1]) ? point[1] : this->MaxDataBounds[1];
451 this->MaxDataBounds[2] = (point[2] > this->MaxDataBounds[2]) ? point[2] : this->MaxDataBounds[2];
455 inline int vtkIncrementalOctreeNode::UpdateCounterAndDataBoundsRecursively(
458 int updated = this->UpdateCounterAndDataBounds(point, nHits, updateData);
460 return ((this->Parent == endNode)
462 : this->Parent->UpdateCounterAndDataBoundsRecursively(point, nHits, updated, endNode));
464 VTK_ABI_NAMESPACE_END
int IsLeaf()
Determine whether or not this node is a leaf.
double * GetMaxDataBounds()
Get access to MaxDataBounds.
void GetBounds(T a, double bds[6])
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.
vtkTypeBool 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...
a simple class to control print indentation
vtkIdList * GetPointIds() const
list of point or cell ids
Octree node constituting incremental octree (in support of both point location and point insertion) ...
vtkTypeBool 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]...
int GetID() const
Returns the ID of this node which is the index of the node in the octree.
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...
int GetChildIndex(const double point[3])
Determine which specific child / octant contains a given point.
represent and manipulate 3D points