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 "vtkObject.h"
37 
38 class vtkTimeStamp;
39 class vtkCell;
40 class vtkKdNode;
41 class vtkBSPCuts;
42 
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
49  static vtkBSPIntersections *New();
50 
53  void SetCuts(vtkBSPCuts *cuts);
54  vtkGetObjectMacro(Cuts, vtkBSPCuts);
55 
59  int GetBounds(double *bounds);
60 
63  int GetNumberOfRegions();
64 
68  int GetRegionBounds(int regionID, double bounds[6]);
69 
73  int GetRegionDataBounds(int regionID, double bounds[6]);
74 
76 
78  int IntersectsBox(int regionId, double *x);
79  int IntersectsBox(int regionId, double xmin, double xmax,
80  double ymin, double ymax,
81  double zmin, double zmax);
83 
85 
87  int IntersectsBox(int *ids, int len, double *x);
88  int IntersectsBox(int *ids, int len, double x0, double x1,
89  double y0, double y1, double z0, double z1);
91 
93 
95  int IntersectsSphere2(int regionId,
96  double x, double y, double z, double rSquared);
98 
100 
103  int IntersectsSphere2(int *ids, int len,
104  double x, double y, double z, double rSquared);
106 
111  int IntersectsCell(int regionId, vtkCell *cell, int cellRegion=-1);
112 
117  int IntersectsCell(int *ids, int len, vtkCell *cell, int cellRegion=-1);
118 
126  vtkGetMacro(ComputeIntersectionsUsingDataBounds, int);
127  void SetComputeIntersectionsUsingDataBounds(int c);
128  void ComputeIntersectionsUsingDataBoundsOn();
129  void ComputeIntersectionsUsingDataBoundsOff();
130 
131 protected:
132 
135 
136  vtkGetMacro(RegionListBuildTime, unsigned long);
137 
138  int BuildRegionList();
139 
140  vtkKdNode **GetRegionList(){return this->RegionList;}
141 
142  double CellBoundsCache[6]; // to speed cell intersection queries
143 
144 //BTX
145  enum {
146  XDIM = 0, // don't change these values
147  YDIM = 1,
148  ZDIM = 2
149  };
150 //ETX
151 
152 private:
153 
154  static int NumberOfLeafNodes(vtkKdNode *kd);
155  static void SetIDRanges(vtkKdNode *kd, int &min, int &max);
156 
157  int SelfRegister(vtkKdNode *kd);
158 
159  static void SetCellBounds(vtkCell *cell, double *bounds);
160 
161  int _IntersectsBox(vtkKdNode *node, int *ids, int len,
162  double x0, double x1,
163  double y0, double y1,
164  double z0, double z1);
165 
166  int _IntersectsSphere2(vtkKdNode *node, int *ids, int len,
167  double x, double y, double z, double rSquared);
168 
169  int _IntersectsCell(vtkKdNode *node, int *ids, int len,
170  vtkCell *cell, int cellRegion=-1);
171 
172  vtkBSPCuts *Cuts;
173 
174  int NumberOfRegions;
175  vtkKdNode **RegionList;
176 
177  vtkTimeStamp RegionListBuildTime;
178 
179  int ComputeIntersectionsUsingDataBounds;
180 
181  vtkBSPIntersections(const vtkBSPIntersections&); // Not implemented
182  void operator=(const vtkBSPIntersections&); // Not implemented
183 };
184 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
Perform calculations (mostly intersection calculations) on regions of a 3D binary spatial partitionin...
#define VTK_FILTERING_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:33
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
static vtkObject * New()
vtkKdNode ** GetRegionList()