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 =========================================================================*/
39 #ifndef vtkExtractSelectedFrustum_h
40 #define vtkExtractSelectedFrustum_h
41 
42 #include "vtkFiltersGeneralModule.h" // For export macro
44 
45 class vtkPlanes;
46 class vtkInformation;
48 class vtkCell;
49 class vtkPoints;
50 class vtkDoubleArray;
51 
52 class VTKFILTERSGENERAL_EXPORT vtkExtractSelectedFrustum : public vtkExtractSelectionBase
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
58 
62  vtkMTimeType GetMTime() VTK_OVERRIDE;
63 
65 
68  virtual void SetFrustum(vtkPlanes*);
69  vtkGetObjectMacro(Frustum,vtkPlanes);
71 
81  void CreateFrustum(double vertices[32]);
82 
84 
88  vtkGetObjectMacro(ClipPoints, vtkPoints);
90 
92 
95  vtkSetMacro(FieldType,int);
96  vtkGetMacro(FieldType,int);
98 
100 
104  vtkSetMacro(ContainingCells,int);
105  vtkGetMacro(ContainingCells,int);
107 
111  int OverallBoundsTest(double *bounds);
112 
114 
118  vtkSetMacro(ShowBounds,int);
119  vtkGetMacro(ShowBounds,int);
120  vtkBooleanMacro(ShowBounds,int);
122 
124 
127  vtkSetMacro(InsideOut,int);
128  vtkGetMacro(InsideOut,int);
129  vtkBooleanMacro(InsideOut,int);
131 
132 protected:
134  ~vtkExtractSelectedFrustum() VTK_OVERRIDE;
135 
136  // sets up output dataset
137  int RequestDataObject(vtkInformation* request,
138  vtkInformationVector** inputVector,
139  vtkInformationVector* outputVector) VTK_OVERRIDE;
140 
141  //execution
142  int RequestData(vtkInformation *,
143  vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
144  int ABoxFrustumIsect(double bounds[], vtkCell *cell);
145  int FrustumClipPolygon(int nverts,
146  double *ivlist, double *wvlist, double *ovlist);
147  void PlaneClipPolygon(int nverts, double *ivlist,
148  int pid, int &noverts, double *ovlist);
149  void PlaneClipEdge(double *V0, double *V1,
150  int pid, int &noverts, double *overts);
151  int IsectDegenerateCell(vtkCell *cell);
152 
153 
154  //used in CreateFrustum
155  void ComputePlane(int idx,
156  double v0[3], double v1[2], double v2[3],
157  vtkPoints *points, vtkDoubleArray *norms);
158 
159  //modes
160  int FieldType;
161  int ContainingCells;
162  int InsideOut;
163 
164  //used internally
165  vtkPlanes *Frustum;
166  int np_vertids[6][2];
167 
168  //for debugging
169  vtkPoints *ClipPoints;
170  int NumRejects;
171  int NumIsects;
172  int NumAccepts;
173  int ShowBounds;
174 
175 private:
176  vtkExtractSelectedFrustum(const vtkExtractSelectedFrustum&) VTK_DELETE_FUNCTION;
177  void operator=(const vtkExtractSelectedFrustum&) VTK_DELETE_FUNCTION;
178 
179 };
180 
181 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:60
dynamic, self-adjusting array of double
Returns the portion of the input dataset that lies within a selection frustum.
static vtkExtractSelectedFrustum * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Return the MTime taking into account changes to the Frustum.
abstract base class for all extract selection filters.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
implicit function for convex set of planes
Definition: vtkPlanes.h:55
represent and manipulate 3D points
Definition: vtkPoints.h:40
@ points
Definition: vtkX3D.h:446
std::pair< boost::graph_traits< vtkGraph * >::vertex_iterator, boost::graph_traits< vtkGraph * >::vertex_iterator > vertices(vtkGraph *g)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248