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));