VTK
vtkKdNode.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkKdNode.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 
35 #ifndef vtkKdNode_h
36 #define vtkKdNode_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkObject.h"
40 
41 class vtkCell;
43 
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
50  static vtkKdNode *New();
51 
53 
55  vtkSetMacro(Dim, int);
56  vtkGetMacro(Dim, int);
58 
62  virtual double GetDivisionPosition();
63 
65 
66  vtkSetMacro(NumberOfPoints, int);
67  vtkGetMacro(NumberOfPoints, int);
69 
71 
73  void SetBounds(double x1,double x2,double y1,double y2,double z1,double z2);
74  void SetBounds(const double b[6])
75  {
76  this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
77  }
78  void GetBounds(double *b) const;
80 
82 
85  void SetDataBounds(double x1,double x2,double y1,double y2,double z1,double z2);
86  void GetDataBounds(double *b) const;
88 
91  void SetDataBounds(float *v);
92 
94 
96  double *GetMinBounds() {return this->Min;}
97  double *GetMaxBounds() {return this->Max;}
99 
101  void SetMinBounds(const double *mb);
102 
104  void SetMaxBounds(const double *mb);
105 
107 
109  double *GetMinDataBounds() {return this->MinVal;}
110  double *GetMaxDataBounds() {return this->MaxVal;}
112 
115  void SetMinDataBounds(const double *mb);
116 
119  void SetMaxDataBounds(const double *mb);
120 
122 
124  vtkSetMacro(ID, int);
125  vtkGetMacro(ID, int);
127 
129 
134  vtkGetMacro(MinID, int);
135  vtkGetMacro(MaxID, int);
136  vtkSetMacro(MinID, int);
137  vtkSetMacro(MaxID, int);
139 
142 
145 
147 
151 
153 
157 
159 
161  void SetUp(vtkKdNode* up);
163 
165 
168  int IntersectsBox(double x1,double x2,double y1,double y2,double z1,double z2,
169  int useDataBounds);
171 
173 
176  int IntersectsSphere2(double x, double y, double z, double rSquared,
177  int useDataBounds);
179 
186  int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds);
187 
189 
196  int IntersectsCell(vtkCell *cell, int useDataBounds,
197  int cellRegion=-1, double *cellBounds=NULL);
199 
201 
204  int ContainsBox(double x1,double x2,double y1,double y2,double z1,double z2,
205  int useDataBounds);
207 
211  int ContainsPoint(double x, double y, double z, int useDataBounds);
212 
216  double GetDistance2ToBoundary(double x, double y, double z, int useDataBounds);
217 
219 
223  double GetDistance2ToBoundary(double x, double y, double z, double *boundaryPt,
224  int useDataBounds);
226 
231  double GetDistance2ToInnerBoundary(double x, double y, double z);
232 
234 
235  void PrintNode(int depth);
238 
239 protected:
240 
243 
244 private:
245 
246  double _GetDistance2ToBoundary(
247  double x, double y, double z, double *boundaryPt,
248  int innerBoundaryOnly, int useDataBounds);
249 
250  double Min[3]; // spatial bounds of node
251  double Max[3]; // spatial bounds of node
252  double MinVal[3]; // spatial bounds of data within node
253  double MaxVal[3]; // spatial bounds of data within node
254  int NumberOfPoints;
255 
256  vtkKdNode *Up;
257 
258  vtkKdNode *Left;
259  vtkKdNode *Right;
260 
261  int Dim;
262 
263  int ID; // region id
264 
265  int MinID;
266  int MaxID;
267 
268  vtkKdNode(const vtkKdNode&); // Not implemented
269  void operator=(const vtkKdNode&); // Not implemented
270 };
271 
272 #endif
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkKdNode::SetMaxBounds
void SetMaxBounds(const double *mb)
vtkKdNode
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning....
Definition: vtkKdNode.h:45
vtkKdNode::GetDistance2ToInnerBoundary
double GetDistance2ToInnerBoundary(double x, double y, double z)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkKdNode::SetUp
void SetUp(vtkKdNode *up)
vtkKdNode::GetMaxDataBounds
double * GetMaxDataBounds()
Definition: vtkKdNode.h:110
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkKdNode::SetLeft
void SetLeft(vtkKdNode *left)
vtkCommonDataModelModule.h
vtkKdNode::SetMaxDataBounds
void SetMaxDataBounds(const double *mb)
vtkKdNode::New
static vtkKdNode * New()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkKdNode::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkKdNode::~vtkKdNode
~vtkKdNode()
vtkKdNode::GetDataBounds
void GetDataBounds(double *b) const
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkKdNode::SetMinBounds
void SetMinBounds(const double *mb)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkgl::left
GLint left
Definition: vtkgl.h:14367
vtkKdNode::GetMinBounds
double * GetMinBounds()
Definition: vtkKdNode.h:96
vtkKdNode::GetDistance2ToBoundary
double GetDistance2ToBoundary(double x, double y, double z, int useDataBounds)
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:52
vtkKdNode::SetDataBounds
void SetDataBounds(float *v)
vtkKdNode::SetDataBounds
void SetDataBounds(double x1, double x2, double y1, double y2, double z1, double z2)
vtkgl::depth
GLint GLint GLsizei GLsizei GLsizei depth
Definition: vtkgl.h:11316
vtkKdNode::PrintVerboseNode
void PrintVerboseNode(int depth)
vtkgl::right
GLdouble GLdouble right
Definition: vtkgl.h:18180
vtkKdNode::IntersectsSphere2
int IntersectsSphere2(double x, double y, double z, double rSquared, int useDataBounds)
vtkKdNode::vtkKdNode
vtkKdNode()
vtkKdNode::GetMinDataBounds
double * GetMinDataBounds()
Definition: vtkKdNode.h:109
vtkKdNode::SetBounds
void SetBounds(const double b[6])
Definition: vtkKdNode.h:74
vtkKdNode::IntersectsBox
int IntersectsBox(double x1, double x2, double y1, double y2, double z1, double z2, int useDataBounds)
vtkKdNode::GetDivisionPosition
virtual double GetDivisionPosition()
vtkKdNode::PrintNode
void PrintNode(int depth)
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkKdNode::DeleteChildNodes
void DeleteChildNodes()
vtkKdNode::SetRight
void SetRight(vtkKdNode *right)
vtkKdNode::GetMaxBounds
double * GetMaxBounds()
Definition: vtkKdNode.h:97
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkKdNode::SetBounds
void SetBounds(double x1, double x2, double y1, double y2, double z1, double z2)
vtkKdNode::GetBounds
void GetBounds(double *b) const
vtkKdNode::GetDistance2ToBoundary
double GetDistance2ToBoundary(double x, double y, double z, double *boundaryPt, int useDataBounds)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkKdNode::SetMinDataBounds
void SetMinDataBounds(const double *mb)
vtkKdNode::AddChildNodes
void AddChildNodes(vtkKdNode *left, vtkKdNode *right)
vtkKdNode::ContainsPoint
int ContainsPoint(double x, double y, double z, int useDataBounds)
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkKdNode::ContainsBox
int ContainsBox(double x1, double x2, double y1, double y2, double z1, double z2, int useDataBounds)
vtkKdNode::IntersectsRegion
int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds)
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkKdNode::IntersectsCell
int IntersectsCell(vtkCell *cell, int useDataBounds, int cellRegion=-1, double *cellBounds=NULL)