VTK  9.0.1
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) { this->NumberOfPoints = numberOfPoints; }
59  vtkGetMacro(NumberOfPoints, int);
61 
63 
67  void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
68  void SetBounds(const double b[6]) { this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]); }
69  void GetBounds(double* b) const;
71 
73 
78  void SetDataBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
79  void GetDataBounds(double* b) const;
81 
83 
87  vtkGetMacro(MinBounds, double*);
88  vtkGetMacro(MaxBounds, double*);
90 
92 
95  void SetMinBounds(double minBounds[3])
96  {
97  this->MinBounds[0] = minBounds[0];
98  this->MinBounds[1] = minBounds[1];
99  this->MinBounds[2] = minBounds[2];
100  }
102 
104 
107  void SetMaxBounds(double maxBounds[3])
108  {
109  this->MaxBounds[0] = maxBounds[0];
110  this->MaxBounds[1] = maxBounds[1];
111  this->MaxBounds[2] = maxBounds[2];
112  }
114 
116 
120  vtkGetMacro(MinDataBounds, double*);
121  vtkGetMacro(MaxDataBounds, double*);
123 
125 
129  void SetMinDataBounds(double minDataBounds[3])
130  {
131  this->MinDataBounds[0] = minDataBounds[0];
132  this->MinDataBounds[1] = minDataBounds[1];
133  this->MinDataBounds[2] = minDataBounds[2];
134  }
136 
138 
142  void SetMaxDataBounds(double maxDataBounds[3])
143  {
144  this->MaxDataBounds[0] = maxDataBounds[0];
145  this->MaxDataBounds[1] = maxDataBounds[1];
146  this->MaxDataBounds[2] = maxDataBounds[2];
147  }
149 
151 
155  vtkGetMacro(ID, int);
157 
159 
165  vtkGetMacro(MinID, int);
167 
171  void CreateChildNodes();
172 
176  void DeleteChildNodes();
177 
181  vtkOctreePointLocatorNode* GetChild(int i);
182 
191  int IntersectsRegion(vtkPlanesIntersection* pi, int useDataBounds);
192 
198  vtkTypeBool ContainsPoint(double x, double y, double z, int useDataBounds);
199 
205  double GetDistance2ToBoundary(
206  double x, double y, double z, vtkOctreePointLocatorNode* top, int useDataBounds);
207 
213  double GetDistance2ToBoundary(double x, double y, double z, double* boundaryPt,
214  vtkOctreePointLocatorNode* top, int useDataBounds);
215 
222  double GetDistance2ToInnerBoundary(double x, double y, double z, vtkOctreePointLocatorNode* top);
223 
232  int GetSubOctantIndex(double* point, int CheckContainment);
233 
239  void ComputeOctreeNodeInformation(
240  vtkOctreePointLocatorNode* Parent, int& NextLeafId, int& NextMinId, float* coordinates);
241 
242 protected:
244  ~vtkOctreePointLocatorNode() override;
245 
246 private:
247  double _GetDistance2ToBoundary(double x, double y, double z, double* boundaryPt,
248  int innerBoundaryOnly, vtkOctreePointLocatorNode* top, int useDataBounds);
249 
253  double MinBounds[3];
254 
258  double MaxBounds[3];
259 
264  double MinDataBounds[3];
265 
270  double MaxDataBounds[3];
271 
278  int NumberOfPoints;
279 
283  vtkOctreePointLocatorNode** Children;
284 
288  int ID;
289 
295  int MinID;
296 
298  void operator=(const vtkOctreePointLocatorNode&) = delete;
299 };
300 
301 #endif
vtkOctreePointLocatorNode::SetBounds
void SetBounds(const double b[6])
Definition: vtkOctreePointLocatorNode.h:68
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkOctreePointLocatorNode::SetMinBounds
void SetMinBounds(double minBounds[3])
Set the xmin, ymin and zmin value of the bounds of this region.
Definition: vtkOctreePointLocatorNode.h:95
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkOctreePointLocatorNode
Octree node that has 8 children each of equal size.
Definition: vtkOctreePointLocatorNode.h:46
vtkX3D::top
@ top
Definition: vtkX3D.h:508
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:52
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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:129
vtkObject.h
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:142
vtkOctreePointLocatorNode::SetMaxBounds
void SetMaxBounds(double maxBounds[3])
Set the xmax, ymax and zmax value of the bounds of this region.
Definition: vtkOctreePointLocatorNode.h:107
vtkOctreePointLocatorNode::SetNumberOfPoints
void SetNumberOfPoints(int numberOfPoints)
Set/Get the number of points contained in this region.
Definition: vtkOctreePointLocatorNode.h:58
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69