VTK
vtkExtractSelectedFrustum.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractSelectedFrustum.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 =========================================================================*/
36 #ifndef vtkExtractSelectedFrustum_h
37 #define vtkExtractSelectedFrustum_h
38 
39 #include "vtkFiltersGeneralModule.h" // For export macro
41 
42 class vtkPlanes;
43 class vtkInformation;
45 class vtkCell;
46 class vtkPoints;
47 class vtkDoubleArray;
48 
49 class VTKFILTERSGENERAL_EXPORT vtkExtractSelectedFrustum : public vtkExtractSelectionBase
50 {
51 public:
54  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
59  vtkMTimeType GetMTime() VTK_OVERRIDE;
60 
62 
65  virtual void SetFrustum(vtkPlanes*);
66  vtkGetObjectMacro(Frustum,vtkPlanes);
68 
78  void CreateFrustum(double vertices[32]);
79 
81 
85  vtkGetObjectMacro(ClipPoints, vtkPoints);
87 
89 
92  vtkSetMacro(FieldType,int);
93  vtkGetMacro(FieldType,int);
95 
97 
101  vtkSetMacro(ContainingCells,int);
102  vtkGetMacro(ContainingCells,int);
104 
108  int OverallBoundsTest(double *bounds);
109 
111 
115  vtkSetMacro(ShowBounds,int);
116  vtkGetMacro(ShowBounds,int);
117  vtkBooleanMacro(ShowBounds,int);
119 
121 
124  vtkSetMacro(InsideOut,int);
125  vtkGetMacro(InsideOut,int);
126  vtkBooleanMacro(InsideOut,int);
128 
129 protected:
131  ~vtkExtractSelectedFrustum() VTK_OVERRIDE;
132 
133  // sets up output dataset
134  int RequestDataObject(vtkInformation* request,
135  vtkInformationVector** inputVector,
136  vtkInformationVector* outputVector) VTK_OVERRIDE;
137 
138  //execution
139  int RequestData(vtkInformation *,
140  vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
141  int ABoxFrustumIsect(double bounds[], vtkCell *cell);
142  int FrustumClipPolygon(int nverts,
143  double *ivlist, double *wvlist, double *ovlist);
144  void PlaneClipPolygon(int nverts, double *ivlist,
145  int pid, int &noverts, double *ovlist);
146  void PlaneClipEdge(double *V0, double *V1,
147  int pid, int &noverts, double *overts);
148  int IsectDegenerateCell(vtkCell *cell);
149 
150 
151  //used in CreateFrustum
152  void ComputePlane(int idx,
153  double v0[3], double v1[2], double v2[3],
154  vtkPoints *points, vtkDoubleArray *norms);
155 
156  //modes
157  int FieldType;
158  int ContainingCells;
159  int InsideOut;
160 
161  //used internally
162  vtkPlanes *Frustum;
163  int np_vertids[6][2];
164 
165  //for debugging
166  vtkPoints *ClipPoints;
167  int NumRejects;
168  int NumIsects;
169  int NumAccepts;
170  int ShowBounds;
171 
172 private:
173  vtkExtractSelectedFrustum(const vtkExtractSelectedFrustum&) VTK_DELETE_FUNCTION;
174  void operator=(const vtkExtractSelectedFrustum&) VTK_DELETE_FUNCTION;
175 
176 };
177 
178 #endif
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
static vtkDataObjectAlgorithm * New()
abstract base class for all extract selection filters.
implicit function for convex set of planes
Definition: vtkPlanes.h:48
dynamic, self-adjusting array of double
abstract class to specify cell behavior
Definition: vtkCell.h:56
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
std::pair< boost::graph_traits< vtkGraph *>::vertex_iterator, boost::graph_traits< vtkGraph *>::vertex_iterator > vertices(vtkGraph *g)
Returns the portion of the input dataset that lies within a selection frustum.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.