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 
36 #ifndef vtkOctreePointLocatorNode_h
37 #define vtkOctreePointLocatorNode_h
38 
39 #include "vtkCommonDataModelModule.h" // For export macro
40 #include "vtkObject.h"
41 
42 class vtkCell;
44 
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
54 
55  void SetNumberOfPoints(int numberOfPoints)
56  {
57  this->NumberOfPoints = numberOfPoints;
58  }
59  vtkGetMacro(NumberOfPoints, int);
61 
63 
65  void SetBounds(double xMin, double xMax, double yMin,
66  double yMax, double zMin, double zMax);
67  void SetBounds(const double b[6])
68  {
69  this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
70  }
71  void GetBounds(double *b) const;
73 
75 
78  void SetDataBounds(double xMin, double xMax, double yMin,
79  double yMax, double zMin, double zMax);
80  void GetDataBounds(double *b) const;
82 
83 //BTX
85 
87  vtkGetMacro(MinBounds, double*);
88  vtkGetMacro(MaxBounds, double*);
89 //ETX
91 
93 
94  void SetMinBounds(double minBounds[3])
95  {
96  this->MinBounds[0] = minBounds[0];
97  this->MinBounds[1] = minBounds[1];
98  this->MinBounds[2] = minBounds[2];
99  }
101 
103 
104  void SetMaxBounds(double maxBounds[3])
105  {
106  this->MaxBounds[0] = maxBounds[0];
107  this->MaxBounds[1] = maxBounds[1];
108  this->MaxBounds[2] = maxBounds[2];
109  }
111 
112 //BTX
114 
116  vtkGetMacro(MinDataBounds, double*);
117  vtkGetMacro(MaxDataBounds, double*);
118 //ETX
120 
122 
124  void SetMinDataBounds(double minDataBounds[3])
125  {
126  this->MinDataBounds[0] = minDataBounds[0];
127  this->MinDataBounds[1] = minDataBounds[1];
128  this->MinDataBounds[2] = minDataBounds[2];
129  }
131 
133 
135  void SetMaxDataBounds(double maxDataBounds[3])
136  {
137  this->MaxDataBounds[0] = maxDataBounds[0];
138  this->MaxDataBounds[1] = maxDataBounds[1];
139  this->MaxDataBounds[2] = maxDataBounds[2];
140  }
142 
144 
146  vtkGetMacro(ID, int);
148 
150 
154  vtkGetMacro(MinID, int);
156 
158  void CreateChildNodes();
159 
161  void DeleteChildNodes();
162 
164  vtkOctreePointLocatorNode* GetChild(int i);
165 
172  int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds);
173 
177  int ContainsPoint(double x, double y, double z, int useDataBounds);
178 
180 
183  double GetDistance2ToBoundary(double x, double y, double z,
184  vtkOctreePointLocatorNode* top, int useDataBounds);
186 
188 
192  double GetDistance2ToBoundary(double x, double y, double z,
193  double *boundaryPt, vtkOctreePointLocatorNode* top,
194  int useDataBounds);
196 
198 
202  double GetDistance2ToInnerBoundary(double x, double y, double z,
205 
211  int GetSubOctantIndex(double* point, int CheckContainment);
212 
214 
217  void ComputeOctreeNodeInformation(vtkOctreePointLocatorNode* Parent,
218  int& NextLeafId, int & NextMinId,
219  float* coordinates);
221 
222 protected:
225 
226 private:
227 
228  double _GetDistance2ToBoundary(
229  double x, double y, double z, double *boundaryPt,
230  int innerBoundaryOnly, vtkOctreePointLocatorNode* top,
231  int useDataBounds);
232 
234  double MinBounds[3];
235 
237  double MaxBounds[3];
238 
241  double MinDataBounds[3];
242 
245  double MaxDataBounds[3];
246 
250  int NumberOfPoints;
251 
253  vtkOctreePointLocatorNode** Children;
254 
256  int ID;
257 
261  int MinID;
262 
263  vtkOctreePointLocatorNode(const vtkOctreePointLocatorNode&); // Not implemented
264  void operator=(const vtkOctreePointLocatorNode&); // Not implemented
265 };
266 
267 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
void SetMaxBounds(double maxBounds[3])
void SetNumberOfPoints(int numberOfPoints)
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
void SetMaxDataBounds(double maxDataBounds[3])
abstract class to specify cell behavior
Definition: vtkCell.h:61
void SetMinBounds(double minBounds[3])
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
void SetBounds(const double b[6])
Octree node that has 8 children each of equal size.
static vtkObject * New()
#define VTKCOMMONDATAMODEL_EXPORT
void SetMinDataBounds(double minDataBounds[3])