VTK
vtkBoxClipDataSet.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBoxClipDataSet.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 
48 #ifndef vtkBoxClipDataSet_h
49 #define vtkBoxClipDataSet_h
50 
51 #include "vtkFiltersGeneralModule.h" // For export macro
53 
54 class vtkCell3D;
55 class vtkCellArray;
56 class vtkCellData;
57 class vtkDataArray;
59 class vtkIdList;
60 class vtkGenericCell;
61 class vtkPointData;
63 class vtkPoints;
64 
65 class VTKFILTERSGENERAL_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
76  static vtkBoxClipDataSet *New();
77 
79 
84  void SetBoxClip(double xmin, double xmax,
85  double ymin, double ymax,
86  double zmin, double zmax);
87  void SetBoxClip(const double *n0, const double *o0,
88  const double *n1, const double *o1,
89  const double *n2, const double *o2,
90  const double *n3, const double *o3,
91  const double *n4, const double *o4,
92  const double *n5, const double *o5);
94 
95 
97 
101  vtkSetMacro(GenerateClipScalars,vtkTypeBool);
102  vtkGetMacro(GenerateClipScalars,vtkTypeBool);
103  vtkBooleanMacro(GenerateClipScalars,vtkTypeBool);
105 
107 
111  vtkSetMacro(GenerateClippedOutput,vtkTypeBool);
112  vtkGetMacro(GenerateClippedOutput,vtkTypeBool);
113  vtkBooleanMacro(GenerateClippedOutput,vtkTypeBool);
115 
129  vtkUnstructuredGrid *GetClippedOutput();
130  virtual int GetNumberOfOutputs();
132 
134 
138  void SetLocator(vtkIncrementalPointLocator *locator);
139  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
141 
146  void CreateDefaultLocator();
147 
151  vtkMTimeType GetMTime() override;
152 
154 
158  vtkGetMacro(Orientation,unsigned int);
159  vtkSetMacro(Orientation,unsigned int);
161 
162 
163  static void InterpolateEdge(vtkDataSetAttributes *attributes,
164  vtkIdType toId,
165  vtkIdType fromId1, vtkIdType fromId2,
166  double t);
167 
168  void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds,
169  unsigned int *edgF );
170  void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds,
171  vtkCellArray *newCellArray);
172  void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds,
173  vtkCellArray *newCellArray);
174  void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds,
175  vtkCellArray *newCellArray);
176  void CreateTetra(vtkIdType npts, const vtkIdType *cellIds,
177  vtkCellArray *newCellArray);
178  void ClipBox(vtkPoints *newPoints,vtkGenericCell *cell,
180  vtkPointData *outPD,vtkCellData *inCD,vtkIdType cellId,
181  vtkCellData *outCD);
182  void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell,
184  vtkPointData *inPD, vtkPointData *outPD,
185  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD);
186  void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell,
187  vtkIncrementalPointLocator *locator, vtkCellArray **tets,
188  vtkPointData *inPD, vtkPointData **outPD,
189  vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
190  void ClipHexahedronInOut(vtkPoints *newPoints,vtkGenericCell *cell,
191  vtkIncrementalPointLocator *locator, vtkCellArray **tets,
192  vtkPointData *inPD, vtkPointData **outPD,
193  vtkCellData *inCD, vtkIdType cellId,
194  vtkCellData **outCD);
195 
196  void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell,
198  vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
199  vtkIdType cellId, vtkCellData *outCD);
200  void ClipBoxInOut2D(vtkPoints *newPoints,vtkGenericCell *cell,
201  vtkIncrementalPointLocator *locator, vtkCellArray **tets,
202  vtkPointData *inPD, vtkPointData **outPD,
203  vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
204  void ClipHexahedron2D(vtkPoints *newPoints,vtkGenericCell *cell,
206  vtkPointData *inPD, vtkPointData *outPD,
207  vtkCellData *inCD, vtkIdType cellId,
208  vtkCellData *outCD);
209  void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell,
210  vtkIncrementalPointLocator *locator, vtkCellArray **tets,
211  vtkPointData *inPD, vtkPointData **outPD,
212  vtkCellData *inCD,vtkIdType cellId,
213  vtkCellData **outCD);
214 
215  void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell,
216  vtkIncrementalPointLocator *locator, vtkCellArray *lines,
217  vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
218  vtkIdType cellId, vtkCellData *outCD);
219  void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
220  vtkIncrementalPointLocator *locator, vtkCellArray **lines,
221  vtkPointData *inPD, vtkPointData **outPD,
222  vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD);
223  void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell,
224  vtkIncrementalPointLocator *locator, vtkCellArray *lines,
225  vtkPointData *inPD, vtkPointData *outPD,
226  vtkCellData *inCD, vtkIdType cellId,
227  vtkCellData *outCD);
228  void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell,
229  vtkIncrementalPointLocator *locator, vtkCellArray **lines,
230  vtkPointData *inPD, vtkPointData **outPD,
231  vtkCellData *inCD, vtkIdType cellId,
232  vtkCellData **outCD);
233 
234  void ClipBox0D(vtkGenericCell *cell,
235  vtkIncrementalPointLocator *locator, vtkCellArray *verts,
236  vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD,
237  vtkIdType cellId, vtkCellData *outCD);
238  void ClipBoxInOut0D(vtkGenericCell *cell,
239  vtkIncrementalPointLocator *locator, vtkCellArray **verts,
240  vtkPointData *inPD, vtkPointData **outPD,
241  vtkCellData *inCD,
242  vtkIdType cellId, vtkCellData **outCD);
243  void ClipHexahedron0D(vtkGenericCell *cell,
244  vtkIncrementalPointLocator *locator, vtkCellArray *verts,
245  vtkPointData *inPD, vtkPointData *outPD,
246  vtkCellData *inCD,
247  vtkIdType cellId, vtkCellData *outCD);
248  void ClipHexahedronInOut0D(vtkGenericCell *cell,
249  vtkIncrementalPointLocator *locator, vtkCellArray **verts,
250  vtkPointData *inPD, vtkPointData **outPD,
251  vtkCellData *inCD,
252  vtkIdType cellId, vtkCellData **outCD);
253 protected:
255  ~vtkBoxClipDataSet() override;
256 
258  int FillInputPortInformation(int port, vtkInformation *info) override;
259 
262 
264 
265  //double MergeTolerance;
266 
267  double BoundBoxClip[3][2];
268  unsigned int Orientation;
269  double PlaneNormal[6][3]; //normal of each plane
270  double PlanePoint[6][3]; //point on the plane
271 
272 private:
273  vtkBoxClipDataSet(const vtkBoxClipDataSet&) = delete;
274  void operator=(const vtkBoxClipDataSet&) = delete;
275 };
276 
277 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkTypeBool GenerateClippedOutput
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
unsigned int Orientation
int vtkIdType
Definition: vtkType.h:347
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
provides thread-safe access to cells
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:38
clip an unstructured grid
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkTypeBool GenerateClipScalars
represent and manipulate attribute data in a dataset
Superclass for algorithms that produce only unstructured grid as output.
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkIncrementalPointLocator * Locator
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:33