VTK: Common/DataModel/vtkOctreePointLocatorNode.h Source File

| VTK 9.3.1

vtkOctreePointLocatorNode.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4
22 #ifndef vtkOctreePointLocatorNode_h
23 #define vtkOctreePointLocatorNode_h
24
25 #include "vtkCommonDataModelModule.h" // For export macro
26 #include "vtkObject.h"
27
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkCell;
30 class vtkPlanesIntersection;
31
32 class VTKCOMMONDATAMODEL_EXPORT vtkOctreePointLocatorNode : public vtkObject
33 {
34 public:
35 vtkTypeMacro(vtkOctreePointLocatorNode, vtkObject);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
38 static vtkOctreePointLocatorNode* New();
39
41
44 void SetNumberOfPoints(int numberOfPoints) { this->NumberOfPoints = numberOfPoints; }
45 vtkGetMacro(NumberOfPoints, int);
47
49
53 void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
54 void SetBounds(const double b[6]) { this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]); }
55 void GetBounds(double* b) const;
57
59
64 void SetDataBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
65 void GetDataBounds(double* b) const;
67
69
73 vtkGetMacro(MinBounds, VTK_FUTURE_CONST double*);
74 vtkGetMacro(MaxBounds, VTK_FUTURE_CONST double*);
76
78
81 void SetMinBounds(double minBounds[3])
82 {
83 this->MinBounds[0] = minBounds[0];
84 this->MinBounds[1] = minBounds[1];
85 this->MinBounds[2] = minBounds[2];
86 }
88
90
93 void SetMaxBounds(double maxBounds[3])
94 {
95 this->MaxBounds[0] = maxBounds[0];
96 this->MaxBounds[1] = maxBounds[1];
97 this->MaxBounds[2] = maxBounds[2];
98 }
100
102
106 vtkGetMacro(MinDataBounds, VTK_FUTURE_CONST double*);
107 vtkGetMacro(MaxDataBounds, VTK_FUTURE_CONST double*);
109
111
115 void SetMinDataBounds(VTK_FUTURE_CONST double minDataBounds[3])
116 {
117 this->MinDataBounds[0] = minDataBounds[0];
118 this->MinDataBounds[1] = minDataBounds[1];
119 this->MinDataBounds[2] = minDataBounds[2];
120 }
122
124
128 void SetMaxDataBounds(VTK_FUTURE_CONST double maxDataBounds[3])
129 {
130 this->MaxDataBounds[0] = maxDataBounds[0];
131 this->MaxDataBounds[1] = maxDataBounds[1];
132 this->MaxDataBounds[2] = maxDataBounds[2];
133 }
135
137
141 vtkGetMacro(ID, int);
143
145
151 vtkGetMacro(MinID, int);
153
157 void CreateChildNodes();
158
162 void DeleteChildNodes();
163
167 vtkOctreePointLocatorNode* GetChild(int i);
168
177 int IntersectsRegion(vtkPlanesIntersection* pi, int useDataBounds);
178
184 vtkTypeBool ContainsPoint(double x, double y, double z, int useDataBounds);
185
191 double GetDistance2ToBoundary(
192 double x, double y, double z, vtkOctreePointLocatorNode* top, int useDataBounds);
193
199 double GetDistance2ToBoundary(double x, double y, double z, double* boundaryPt,
200 vtkOctreePointLocatorNode* top, int useDataBounds);
201
208 double GetDistance2ToInnerBoundary(double x, double y, double z, vtkOctreePointLocatorNode* top);
209
218 int GetSubOctantIndex(double* point, int CheckContainment);
219
225 void ComputeOctreeNodeInformation(
226 vtkOctreePointLocatorNode* Parent, int& NextLeafId, int& NextMinId, float* coordinates);
227
228 protected:
229 vtkOctreePointLocatorNode();
230 ~vtkOctreePointLocatorNode() override;
231
232 private:
233 double GetDistance2ToBoundaryPrivate(double x, double y, double z, double* boundaryPt,
234 int innerBoundaryOnly, vtkOctreePointLocatorNode* top, int useDataBounds);
235
239 double MinBounds[3];
240
244 double MaxBounds[3];
245
250 double MinDataBounds[3];
251
256 double MaxDataBounds[3];
257
264 int NumberOfPoints;
265
269 vtkOctreePointLocatorNode** Children;
270
274 int ID;
275
281 int MinID;
282
283 vtkOctreePointLocatorNode(const vtkOctreePointLocatorNode&) = delete;
284 void operator=(const vtkOctreePointLocatorNode&) = delete;
285 };
286
287 VTK_ABI_NAMESPACE_END
288 #endif
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkOctreePointLocatorNode
Octree node that has 8 children each of equal size.
Definition: vtkOctreePointLocatorNode.h:33
vtkOctreePointLocatorNode::SetMaxDataBounds
void SetMaxDataBounds(VTK_FUTURE_CONST double maxDataBounds[3])
Set the xmax, ymax and zmax value of the bounds of this data within this region.
Definition: vtkOctreePointLocatorNode.h:128
vtkOctreePointLocatorNode::ComputeOctreeNodeInformation
void ComputeOctreeNodeInformation(vtkOctreePointLocatorNode *Parent, int &NextLeafId, int &NextMinId, float *coordinates)
Recursive function to compute ID, MinVal, MaxVal, and MinID.
vtkOctreePointLocatorNode::SetMinBounds
void SetMinBounds(double minBounds[3])
Set the xmin, ymin and zmin value of the bounds of this region.
Definition: vtkOctreePointLocatorNode.h:81
vtkOctreePointLocatorNode::SetBounds
void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
Set/Get the bounds of the spatial region represented by this node.
vtkOctreePointLocatorNode::GetDistance2ToInnerBoundary
double GetDistance2ToInnerBoundary(double x, double y, double z, vtkOctreePointLocatorNode *top)
Calculate the distance from the specified point (which is required to be inside this spatial region) ...
vtkOctreePointLocatorNode::SetMaxBounds
void SetMaxBounds(double maxBounds[3])
Set the xmax, ymax and zmax value of the bounds of this region.
Definition: vtkOctreePointLocatorNode.h:93
vtkOctreePointLocatorNode::GetSubOctantIndex
int GetSubOctantIndex(double *point, int CheckContainment)
Return the id of the suboctant that a given point is in.
vtkOctreePointLocatorNode::GetDistance2ToBoundary
double GetDistance2ToBoundary(double x, double y, double z, vtkOctreePointLocatorNode *top, int useDataBounds)
Calculate the distance squared from any point to the boundary of this region.
vtkOctreePointLocatorNode::GetDataBounds
void GetDataBounds(double *b) const
Set/Get the bounds of the points contained in this spatial region.
vtkOctreePointLocatorNode::SetDataBounds
void SetDataBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
Set/Get the bounds of the points contained in this spatial region.
vtkOctreePointLocatorNode::GetDistance2ToBoundary
double GetDistance2ToBoundary(double x, double y, double z, double *boundaryPt, vtkOctreePointLocatorNode *top, int useDataBounds)
Calculate the distance squared from any point to the boundary of this region.
vtkOctreePointLocatorNode::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOctreePointLocatorNode::New
static vtkOctreePointLocatorNode * New()
vtkOctreePointLocatorNode::IntersectsRegion
int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds)
A vtkPlanesIntersection object represents a convex 3D region bounded by planes, and it is capable of ...
vtkOctreePointLocatorNode::DeleteChildNodes
void DeleteChildNodes()
Delete the 8 children.
vtkOctreePointLocatorNode::ContainsPoint
vtkTypeBool ContainsPoint(double x, double y, double z, int useDataBounds)
Return 1 if this spatial region entirely contains the given point.
vtkOctreePointLocatorNode::~vtkOctreePointLocatorNode
~vtkOctreePointLocatorNode() override
vtkOctreePointLocatorNode::GetBounds
void GetBounds(double *b) const
Set/Get the bounds of the spatial region represented by this node.
vtkOctreePointLocatorNode::SetBounds
void SetBounds(const double b[6])
Set/Get the bounds of the spatial region represented by this node.
Definition: vtkOctreePointLocatorNode.h:54
vtkOctreePointLocatorNode::CreateChildNodes
void CreateChildNodes()
Add the 8 children.
vtkOctreePointLocatorNode::SetMinDataBounds
void SetMinDataBounds(VTK_FUTURE_CONST double minDataBounds[3])
Set the xmin, ymin and zmin value of the bounds of this data within this region.
Definition: vtkOctreePointLocatorNode.h:115
vtkOctreePointLocatorNode::SetNumberOfPoints
void SetNumberOfPoints(int numberOfPoints)
Set/Get the number of points contained in this region.
Definition: vtkOctreePointLocatorNode.h:44
vtkOctreePointLocatorNode::GetChild
vtkOctreePointLocatorNode * GetChild(int i)
Get a pointer to the ith child of this node.
vtkOctreePointLocatorNode::vtkOctreePointLocatorNode
vtkOctreePointLocatorNode()
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:51
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::top
@ top
Definition: vtkX3D.h:502
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkObject.h