VTK
vtkOctreePointLocatorNode.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOctreePointLocatorNode.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
37 #ifndef vtkOctreePointLocatorNode_h
38 #define vtkOctreePointLocatorNode_h
39 
40 #include "vtkCommonDataModelModule.h" // For export macro
41 #include "vtkObject.h"
42 
43 class vtkCell;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkOctreePointLocatorNode : public vtkObject
47 {
48 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
55 
58  void SetNumberOfPoints(int numberOfPoints)
59  {
60  this->NumberOfPoints = numberOfPoints;
61  }
62  vtkGetMacro(NumberOfPoints, int);
64 
66 
70  void SetBounds(double xMin, double xMax, double yMin,
71  double yMax, double zMin, double zMax);
72  void SetBounds(const double b[6])
73  {
74  this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
75  }
76  void GetBounds(double *b) const;
78 
80 
85  void SetDataBounds(double xMin, double xMax, double yMin,
86  double yMax, double zMin, double zMax);
87  void GetDataBounds(double *b) const;
89 
91 
95  vtkGetMacro(MinBounds, double*);
96  vtkGetMacro(MaxBounds, double*);
98 
100 
103  void SetMinBounds(double minBounds[3])
104  {
105  this->MinBounds[0] = minBounds[0];
106  this->MinBounds[1] = minBounds[1];
107  this->MinBounds[2] = minBounds[2];
108  }
110 
112 
115  void SetMaxBounds(double maxBounds[3])
116  {
117  this->MaxBounds[0] = maxBounds[0];
118  this->MaxBounds[1] = maxBounds[1];
119  this->MaxBounds[2] = maxBounds[2];
120  }
122 
124 
128  vtkGetMacro(MinDataBounds, double*);
129  vtkGetMacro(MaxDataBounds, double*);
131 
133 
137  void SetMinDataBounds(double minDataBounds[3])
138  {
139  this->MinDataBounds[0] = minDataBounds[0];
140  this->MinDataBounds[1] = minDataBounds[1];
141  this->MinDataBounds[2] = minDataBounds[2];
142  }
144 
146 
150  void SetMaxDataBounds(double maxDataBounds[3])
151  {
152  this->MaxDataBounds[0] = maxDataBounds[0];
153  this->MaxDataBounds[1] = maxDataBounds[1];
154  this->MaxDataBounds[2] = maxDataBounds[2];
155  }
157 
159 
163  vtkGetMacro(ID, int);
165 
167 
173  vtkGetMacro(MinID, int);
175 
180 
185 
190 
199  int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds);
200 
206  vtkTypeBool ContainsPoint(double x, double y, double z, int useDataBounds);
207 
213  double GetDistance2ToBoundary(double x, double y, double z,
214  vtkOctreePointLocatorNode* top, int useDataBounds);
215 
221  double GetDistance2ToBoundary(double x, double y, double z,
222  double *boundaryPt, vtkOctreePointLocatorNode* top,
223  int useDataBounds);
224 
231  double GetDistance2ToInnerBoundary(double x, double y, double z,
233 
242  int GetSubOctantIndex(double* point, int CheckContainment);
243 
250  int& NextLeafId, int & NextMinId,
251  float* coordinates);
252 
253 protected:
256 
257 private:
258 
259  double _GetDistance2ToBoundary(
260  double x, double y, double z, double *boundaryPt,
261  int innerBoundaryOnly, vtkOctreePointLocatorNode* top,
262  int useDataBounds);
263 
267  double MinBounds[3];
268 
272  double MaxBounds[3];
273 
278  double MinDataBounds[3];
279 
284  double MaxDataBounds[3];
285 
292  int NumberOfPoints;
293 
297  vtkOctreePointLocatorNode** Children;
298 
302  int ID;
303 
309  int MinID;
310 
312  void operator=(const vtkOctreePointLocatorNode&) = delete;
313 };
314 
315 #endif
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::SetBounds
void SetBounds(const double b[6])
Definition: vtkOctreePointLocatorNode.h:72
vtkOctreePointLocatorNode::ContainsPoint
vtkTypeBool ContainsPoint(double x, double y, double z, int useDataBounds)
Return 1 if this spatial region entirely contains the given point.
vtkOctreePointLocatorNode::CreateChildNodes
void CreateChildNodes()
Add the 8 children.
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::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::SetMinBounds
void SetMinBounds(double minBounds[3])
Set the xmin, ymin and zmin value of the bounds of this region.
Definition: vtkOctreePointLocatorNode.h:103
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkOctreePointLocatorNode::vtkOctreePointLocatorNode
vtkOctreePointLocatorNode()
vtkOctreePointLocatorNode
Octree node that has 8 children each of equal size.
Definition: vtkOctreePointLocatorNode.h:47
vtkX3D::top
@ top
Definition: vtkX3D.h:502
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:56
vtkOctreePointLocatorNode::ComputeOctreeNodeInformation
void ComputeOctreeNodeInformation(vtkOctreePointLocatorNode *Parent, int &NextLeafId, int &NextMinId, float *coordinates)
Recursive function to compute ID, MinVal, MaxVal, and MinID.
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkOctreePointLocatorNode::GetSubOctantIndex
int GetSubOctantIndex(double *point, int CheckContainment)
Return the id of the suboctant that a given point is in.
vtkOctreePointLocatorNode::GetBounds
void GetBounds(double *b) const
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
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::New
static vtkOctreePointLocatorNode * New()
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::SetMinDataBounds
void SetMinDataBounds(double minDataBounds[3])
Set the xmin, ymin and zmin value of the bounds of this data within this region.
Definition: vtkOctreePointLocatorNode.h:137
vtkOctreePointLocatorNode::~vtkOctreePointLocatorNode
~vtkOctreePointLocatorNode() override
vtkObject.h
vtkOctreePointLocatorNode::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOctreePointLocatorNode::SetMaxDataBounds
void SetMaxDataBounds(double maxDataBounds[3])
Set the xmax, ymax and zmax value of the bounds of this data within this region.
Definition: vtkOctreePointLocatorNode.h:150
vtkOctreePointLocatorNode::SetMaxBounds
void SetMaxBounds(double maxBounds[3])
Set the xmax, ymax and zmax value of the bounds of 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:58
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::DeleteChildNodes
void DeleteChildNodes()
Delete the 8 children.
vtkOctreePointLocatorNode::GetChild
vtkOctreePointLocatorNode * GetChild(int i)
Get a pointer to the ith child of this node.
vtkOctreePointLocatorNode::GetDataBounds
void GetDataBounds(double *b) const
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69