VTK  9.3.1
vtkBoxClipDataSet.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
36 #ifndef vtkBoxClipDataSet_h
37 #define vtkBoxClipDataSet_h
38 
39 #include "vtkFiltersGeneralModule.h" // For export macro
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class vtkCell3D;
44 class vtkCellArray;
45 class vtkCellData;
46 class vtkDataArray;
48 class vtkIdList;
49 class vtkGenericCell;
50 class vtkPointData;
52 class vtkPoints;
53 
54 class VTKFILTERSGENERAL_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
65  static vtkBoxClipDataSet* New();
66 
68 
73  void SetBoxClip(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
74  void SetBoxClip(const double* n0, const double* o0, const double* n1, const double* o1,
75  const double* n2, const double* o2, const double* n3, const double* o3, const double* n4,
76  const double* o4, const double* n5, const double* o5);
78 
80 
84  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
85  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
86  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
88 
90 
94  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
95  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
96  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
98 
108 
112  vtkUnstructuredGrid* GetClippedOutput();
113  virtual int GetNumberOfOutputs();
115 
117 
121  void SetLocator(vtkIncrementalPointLocator* locator);
122  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
124 
129  void CreateDefaultLocator();
130 
134  vtkMTimeType GetMTime() override;
135 
137 
141  vtkGetMacro(Orientation, unsigned int);
142  vtkSetMacro(Orientation, unsigned int);
144 
145  static void InterpolateEdge(vtkDataSetAttributes* attributes, vtkIdType toId, vtkIdType fromId1,
146  vtkIdType fromId2, double t);
147 
148  void MinEdgeF(const unsigned int* id_v, const vtkIdType* cellIds, unsigned int* edgF);
149  void PyramidToTetra(
150  const vtkIdType* pyramId, const vtkIdType* cellIds, vtkCellArray* newCellArray);
151  void WedgeToTetra(const vtkIdType* wedgeId, const vtkIdType* cellIds, vtkCellArray* newCellArray);
152  void CellGrid(
153  vtkIdType typeobj, vtkIdType npts, const vtkIdType* cellIds, vtkCellArray* newCellArray);
154  void CreateTetra(vtkIdType npts, const vtkIdType* cellIds, vtkCellArray* newCellArray);
155  void ClipBox(vtkPoints* newPoints, vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
156  vtkCellArray* tets, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
157  vtkIdType cellId, vtkCellData* outCD);
158  void ClipHexahedron(vtkPoints* newPoints, vtkGenericCell* cell,
160  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
161  void ClipBoxInOut(vtkPoints* newPoints, vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
162  vtkCellArray** tets, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
163  vtkIdType cellId, vtkCellData** outCD);
164  void ClipHexahedronInOut(vtkPoints* newPoints, vtkGenericCell* cell,
165  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
166  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
167 
168  void ClipBox2D(vtkPoints* newPoints, vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
169  vtkCellArray* tets, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
170  vtkIdType cellId, vtkCellData* outCD);
171  void ClipBoxInOut2D(vtkPoints* newPoints, vtkGenericCell* cell,
172  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
173  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
174  void ClipHexahedron2D(vtkPoints* newPoints, vtkGenericCell* cell,
176  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
177  void ClipHexahedronInOut2D(vtkPoints* newPoints, vtkGenericCell* cell,
178  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
179  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
180 
181  void ClipBox1D(vtkPoints* newPoints, vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
182  vtkCellArray* lines, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
183  vtkIdType cellId, vtkCellData* outCD);
184  void ClipBoxInOut1D(vtkPoints* newPoints, vtkGenericCell* cell,
185  vtkIncrementalPointLocator* locator, vtkCellArray** lines, vtkPointData* inPD,
186  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
187  void ClipHexahedron1D(vtkPoints* newPoints, vtkGenericCell* cell,
188  vtkIncrementalPointLocator* locator, vtkCellArray* lines, vtkPointData* inPD,
189  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
190  void ClipHexahedronInOut1D(vtkPoints* newPoints, vtkGenericCell* cell,
191  vtkIncrementalPointLocator* locator, vtkCellArray** lines, vtkPointData* inPD,
192  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
193 
194  void ClipBox0D(vtkGenericCell* cell, vtkIncrementalPointLocator* locator, vtkCellArray* verts,
195  vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId,
196  vtkCellData* outCD);
197  void ClipBoxInOut0D(vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
198  vtkCellArray** verts, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
199  vtkIdType cellId, vtkCellData** outCD);
200  void ClipHexahedron0D(vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
201  vtkCellArray* verts, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
202  vtkIdType cellId, vtkCellData* outCD);
203  void ClipHexahedronInOut0D(vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
204  vtkCellArray** verts, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
205  vtkIdType cellId, vtkCellData** outCD);
206 
207 protected:
209  ~vtkBoxClipDataSet() override;
210 
212  int FillInputPortInformation(int port, vtkInformation* info) override;
213 
216 
218 
219  // double MergeTolerance;
220 
221  double BoundBoxClip[3][2];
222  unsigned int Orientation;
223  double PlaneNormal[6][3]; // normal of each plane
224  double PlanePoint[6][3]; // point on the plane
225 
226 private:
227  vtkBoxClipDataSet(const vtkBoxClipDataSet&) = delete;
228  void operator=(const vtkBoxClipDataSet&) = delete;
229 };
230 
231 VTK_ABI_NAMESPACE_END
232 #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:29
vtkTypeBool GenerateClippedOutput
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
represent and manipulate cell attribute data
Definition: vtkCellData.h:30
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
unsigned int Orientation
int vtkIdType
Definition: vtkType.h:315
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:27
clip an unstructured grid
int vtkTypeBool
Definition: vtkABI.h:64
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:28
list of point or cell ids
Definition: vtkIdList.h:22
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
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:175
vtkIncrementalPointLocator * Locator
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:28