VTK
vtkBSPIntersections.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBSPIntersections.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 
33 #ifndef vtkBSPIntersections_h
34 #define vtkBSPIntersections_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkObject.h"
38 
39 class vtkTimeStamp;
40 class vtkCell;
41 class vtkKdNode;
42 class vtkBSPCuts;
43 
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
54  void SetCuts(vtkBSPCuts *cuts);
56 
60  int GetBounds(double *bounds);
61 
65 
69  int GetRegionBounds(int regionID, double bounds[6]);
70 
74  int GetRegionDataBounds(int regionID, double bounds[6]);
75 
77 
79  int IntersectsBox(int regionId, double *x);
80  int IntersectsBox(int regionId, double xmin, double xmax,
81  double ymin, double ymax,
82  double zmin, double zmax);
84 
86 
88  int IntersectsBox(int *ids, int len, double *x);
89  int IntersectsBox(int *ids, int len, double x0, double x1,
90  double y0, double y1, double z0, double z1);
92 
94 
96  int IntersectsSphere2(int regionId,
97  double x, double y, double z, double rSquared);
99 
101 
104  int IntersectsSphere2(int *ids, int len,
105  double x, double y, double z, double rSquared);
107 
112  int IntersectsCell(int regionId, vtkCell *cell, int cellRegion=-1);
113 
118  int IntersectsCell(int *ids, int len, vtkCell *cell, int cellRegion=-1);
119 
127  vtkGetMacro(ComputeIntersectionsUsingDataBounds, int);
131 
132 protected:
133 
136 
137  vtkGetMacro(RegionListBuildTime, unsigned long);
138 
140 
141  vtkKdNode **GetRegionList(){return this->RegionList;}
142 
143  double CellBoundsCache[6]; // to speed cell intersection queries
144 
145 //BTX
146  enum {
147  XDIM = 0, // don't change these values
148  YDIM = 1,
149  ZDIM = 2
150  };
151 //ETX
152 
153 private:
154 
155  static int NumberOfLeafNodes(vtkKdNode *kd);
156  static void SetIDRanges(vtkKdNode *kd, int &min, int &max);
157 
158  int SelfRegister(vtkKdNode *kd);
159 
160  static void SetCellBounds(vtkCell *cell, double *bounds);
161 
162  int _IntersectsBox(vtkKdNode *node, int *ids, int len,
163  double x0, double x1,
164  double y0, double y1,
165  double z0, double z1);
166 
167  int _IntersectsSphere2(vtkKdNode *node, int *ids, int len,
168  double x, double y, double z, double rSquared);
169 
170  int _IntersectsCell(vtkKdNode *node, int *ids, int len,
171  vtkCell *cell, int cellRegion=-1);
172 
173  vtkBSPCuts *Cuts;
174 
175  int NumberOfRegions;
176  vtkKdNode **RegionList;
177 
178  vtkTimeStamp RegionListBuildTime;
179 
180  int ComputeIntersectionsUsingDataBounds;
181 
182  vtkBSPIntersections(const vtkBSPIntersections&); // Not implemented
183  void operator=(const vtkBSPIntersections&); // Not implemented
184 };
185 #endif
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkKdNode
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning....
Definition: vtkKdNode.h:45
vtkBSPIntersections::ComputeIntersectionsUsingDataBoundsOn
void ComputeIntersectionsUsingDataBoundsOn()
vtkBSPIntersections::IntersectsSphere2
int IntersectsSphere2(int regionId, double x, double y, double z, double rSquared)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkBSPIntersections::SetComputeIntersectionsUsingDataBounds
void SetComputeIntersectionsUsingDataBounds(int c)
vtkBSPIntersections::IntersectsCell
int IntersectsCell(int regionId, vtkCell *cell, int cellRegion=-1)
vtkBSPIntersections::IntersectsBox
int IntersectsBox(int regionId, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
vtkBSPIntersections::New
static vtkBSPIntersections * New()
vtkCommonDataModelModule.h
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkBSPIntersections::ComputeIntersectionsUsingDataBoundsOff
void ComputeIntersectionsUsingDataBoundsOff()
vtkBSPIntersections::IntersectsBox
int IntersectsBox(int *ids, int len, double x0, double x1, double y0, double y1, double z0, double z1)
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkBSPIntersections
Perform calculations (mostly intersection calculations) on regions of a 3D binary spatial partitionin...
Definition: vtkBSPIntersections.h:45
vtkBSPIntersections::BuildRegionList
int BuildRegionList()
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkgl::ids
GLuint * ids
Definition: vtkgl.h:11831
vtkBSPIntersections::GetRegionList
vtkKdNode ** GetRegionList()
Definition: vtkBSPIntersections.h:141
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBSPIntersections::GetNumberOfRegions
int GetNumberOfRegions()
vtkBSPCuts
This class represents an axis-aligned Binary Spatial Partitioning of a 3D space.
Definition: vtkBSPCuts.h:44
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::zmax
GLclampd zmax
Definition: vtkgl.h:17479
vtkObject.h
vtkBSPIntersections::GetRegionBounds
int GetRegionBounds(int regionID, double bounds[6])
vtkBSPIntersections::IntersectsBox
int IntersectsBox(int *ids, int len, double *x)
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkBSPIntersections::SetCuts
void SetCuts(vtkBSPCuts *cuts)
vtkBSPIntersections::~vtkBSPIntersections
~vtkBSPIntersections()
vtkBSPIntersections::vtkBSPIntersections
vtkBSPIntersections()
vtkgl::len
GLenum GLsizei len
Definition: vtkgl.h:13010
vtkBSPIntersections::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkBSPIntersections::IntersectsBox
int IntersectsBox(int regionId, double *x)
vtkBSPIntersections::GetBounds
int GetBounds(double *bounds)
vtkBSPIntersections::IntersectsSphere2
int IntersectsSphere2(int *ids, int len, double x, double y, double z, double rSquared)
vtkBSPIntersections::GetRegionDataBounds
int GetRegionDataBounds(int regionID, double bounds[6])
vtkBSPIntersections::IntersectsCell
int IntersectsCell(int *ids, int len, vtkCell *cell, int cellRegion=-1)