59 #ifndef vtkIncrementalOctreeNode_h 60 #define vtkIncrementalOctreeNode_h 62 #include "vtkCommonDataModelModule.h" 80 vtkGetMacro(NumberOfPoints,
int);
93 void DeleteChildNodes();
99 void SetBounds(
double x1,
double x2,
double y1,
double y2,
double z1,
double z2);
105 void GetBounds(
double bounds[6])
const;
111 vtkGetVector3Macro(MinBounds,
double);
118 vtkGetVector3Macro(MaxBounds,
double);
127 return this->NumberOfPoints ? this->MinDataBounds : this->MinBounds;
136 return this->NumberOfPoints ? this->MaxDataBounds : this->MaxBounds;
142 int IsLeaf() {
return (this->Children ==
nullptr) ? 1 : 0; }
149 int GetChildIndex(
const double point[3]);
167 vtkTypeBool ContainsPointByData(
const double pnt[3]);
197 double GetDistance2ToBoundary(
205 double GetDistance2ToBoundary(
212 void ExportAllPointIdsByInsertion(
vtkIdList* idList);
247 double MinDataBounds[3];
254 double MaxDataBounds[3];
300 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(
const double point[3],
int nHits,
int updateData);
341 int UpdateCounterAndDataBoundsRecursively(
350 int ContainsDuplicatePointsOnly(
const double pnt[3]);
366 const double newPnt[3],
vtkIdType* pntIdx,
int maxPts,
int ptMode);
375 double GetDistance2ToBoundary(
const double point[3],
double closest[3],
int innerOnly,
386 return int(
point[0] > this->Children[0]->MaxBounds[0]) +
387 ((int(
point[1] > this->Children[0]->MaxBounds[1])) << 1) +
388 ((int(
point[2] > this->Children[0]->MaxBounds[2])) << 2);
395 (this->MinBounds[0] < pnt[0] && pnt[0] <= this->MaxBounds[0] && this->MinBounds[1] < pnt[1] &&
396 pnt[1] <= this->MaxBounds[1] && this->MinBounds[2] < pnt[2] && pnt[2] <= this->MaxBounds[2])
404 return ((this->MinDataBounds[0] <= pnt[0] && pnt[0] <= this->MaxDataBounds[0] &&
405 this->MinDataBounds[1] <= pnt[1] && pnt[1] <= this->MaxDataBounds[1] &&
406 this->MinDataBounds[2] <= pnt[2] && pnt[2] <= this->MaxDataBounds[2])
412 inline int vtkIncrementalOctreeNode::ContainsDuplicatePointsOnly(
const double pnt[3])
414 return ((this->MinDataBounds[0] == pnt[0] && pnt[0] == this->MaxDataBounds[0] &&
415 this->MinDataBounds[1] == pnt[1] && pnt[1] == this->MaxDataBounds[1] &&
416 this->MinDataBounds[2] == pnt[2] && pnt[2] == this->MaxDataBounds[2])
422 inline void vtkIncrementalOctreeNode::UpdateCounterAndDataBounds(
const double point[3])
424 this->NumberOfPoints++;
426 this->MinDataBounds[0] = (
point[0] < this->MinDataBounds[0]) ?
point[0] : this->MinDataBounds[0];
427 this->MinDataBounds[1] = (
point[1] < this->MinDataBounds[1]) ?
point[1] : this->MinDataBounds[1];
428 this->MinDataBounds[2] = (
point[2] < this->MinDataBounds[2]) ?
point[2] : this->MinDataBounds[2];
429 this->MaxDataBounds[0] = (
point[0] > this->MaxDataBounds[0]) ?
point[0] : this->MaxDataBounds[0];
430 this->MaxDataBounds[1] = (
point[1] > this->MaxDataBounds[1]) ?
point[1] : this->MaxDataBounds[1];
431 this->MaxDataBounds[2] = (
point[2] > this->MaxDataBounds[2]) ?
point[2] : this->MaxDataBounds[2];
435 inline int vtkIncrementalOctreeNode::UpdateCounterAndDataBoundsRecursively(
438 int updated = this->UpdateCounterAndDataBounds(
point, nHits, updateData);
440 return ((this->Parent == endNode)
442 : this->Parent->UpdateCounterAndDataBoundsRecursively(
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.
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
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