62 #ifndef vtkIncrementalOctreeNode_h
63 #define vtkIncrementalOctreeNode_h
65 #include "vtkCommonDataModelModule.h"
84 vtkGetMacro(NumberOfPoints,
int);
97 void DeleteChildNodes();
103 void SetBounds(
double x1,
double x2,
double y1,
double y2,
double z1,
double z2);
115 vtkGetVector3Macro(MinBounds,
double);
122 vtkGetVector3Macro(MaxBounds,
double);
131 return this->NumberOfPoints ? this->MinDataBounds : this->MinBounds;
140 return this->NumberOfPoints ? this->MaxDataBounds : this->MaxBounds;
146 int IsLeaf() {
return (this->Children ==
nullptr) ? 1 : 0; }
153 int GetChildIndex(
const double point[3]);
171 vtkTypeBool ContainsPointByData(
const double pnt[3]);
194 int InsertPoint(
vtkPoints* points, const
double newPnt[3],
int maxPts,
vtkIdType* pntId,
195 int ptMode,
int& numberOfNodes);
210 double GetDistance2ToBoundary(
218 double GetDistance2ToBoundary(
225 void ExportAllPointIdsByInsertion(
vtkIdList* idList);
240 int GetNumberOfLevels() const;
246 int GetID()
const {
return this->ID; }
274 double MinDataBounds[3];
281 double MaxDataBounds[3];
335 vtkIdType* pntIdx,
int maxPts,
int ptMode,
int& numberOfNodes);
341 void CreatePointIdSet(
int initSize,
int growSize);
346 void DeletePointIdSet();
353 void UpdateCounterAndDataBounds(
const double point[3]);
364 int UpdateCounterAndDataBounds(
const double point[3],
int nHits,
int updateData);
376 int UpdateCounterAndDataBoundsRecursively(
385 int ContainsDuplicatePointsOnly(
const double pnt[3]);
401 const double newPnt[3],
vtkIdType* pntIdx,
int maxPts,
int ptMode);
410 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
int innerOnly,
421 return int(point[0] > this->Children[0]->MaxBounds[0]) +
422 ((int(point[1] > this->Children[0]->MaxBounds[1])) << 1) +
423 ((int(point[2] > this->Children[0]->MaxBounds[2])) << 2);
430 (this->MinBounds[0] < pnt[0] && pnt[0] <= this->MaxBounds[0] && this->MinBounds[1] < pnt[1] &&
431 pnt[1] <= this->MaxBounds[1] && this->MinBounds[2] < pnt[2] && pnt[2] <= this->MaxBounds[2])
439 return ((this->MinDataBounds[0] <= pnt[0] && pnt[0] <= this->MaxDataBounds[0] &&
440 this->MinDataBounds[1] <= pnt[1] && pnt[1] <= this->MaxDataBounds[1] &&
441 this->MinDataBounds[2] <= pnt[2] && pnt[2] <= this->MaxDataBounds[2])
447 inline int vtkIncrementalOctreeNode::ContainsDuplicatePointsOnly(
const double pnt[3])
449 return ((this->MinDataBounds[0] == pnt[0] && pnt[0] == this->MaxDataBounds[0] &&
450 this->MinDataBounds[1] == pnt[1] && pnt[1] == this->MaxDataBounds[1] &&
451 this->MinDataBounds[2] == pnt[2] && pnt[2] == this->MaxDataBounds[2])
457 inline void vtkIncrementalOctreeNode::UpdateCounterAndDataBounds(
const double point[3])
459 this->NumberOfPoints++;
461 this->MinDataBounds[0] = (point[0] < this->MinDataBounds[0]) ? point[0] : this->MinDataBounds[0];
462 this->MinDataBounds[1] = (point[1] < this->MinDataBounds[1]) ? point[1] : this->MinDataBounds[1];
463 this->MinDataBounds[2] = (point[2] < this->MinDataBounds[2]) ? point[2] : this->MinDataBounds[2];
464 this->MaxDataBounds[0] = (point[0] > this->MaxDataBounds[0]) ? point[0] : this->MaxDataBounds[0];
465 this->MaxDataBounds[1] = (point[1] > this->MaxDataBounds[1]) ? point[1] : this->MaxDataBounds[1];
466 this->MaxDataBounds[2] = (point[2] > this->MaxDataBounds[2]) ? point[2] : this->MaxDataBounds[2];
470 inline int vtkIncrementalOctreeNode::UpdateCounterAndDataBoundsRecursively(
473 int updated = this->UpdateCounterAndDataBounds(point, nHits, updateData);
475 return ((this->Parent == endNode)
477 : this->Parent->UpdateCounterAndDataBoundsRecursively(point, nHits, updated, endNode));
int IsLeaf()
Determine whether or not this node is a leaf.
double * GetMaxDataBounds()
Get access to MaxDataBounds.
#define VTK_DEPRECATED_IN_9_1_0(reason)
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]...
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