VTK  9.3.20240328
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 
65 #ifndef vtkBoxClipDataSet_h
66 #define vtkBoxClipDataSet_h
67 
68 #include "vtkFiltersGeneralModule.h" // For export macro
70 
71 VTK_ABI_NAMESPACE_BEGIN
72 class vtkCell3D;
73 class vtkCellArray;
74 class vtkCellData;
75 class vtkDataArray;
77 class vtkIdList;
78 class vtkGenericCell;
79 class vtkPointData;
81 class vtkPoints;
82 
83 class VTKFILTERSGENERAL_EXPORT vtkBoxClipDataSet : public vtkUnstructuredGridAlgorithm
84 {
85 public:
87  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
95 
97 
102  void SetBoxClip(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
103  void SetBoxClip(const double* n0, const double* o0, const double* n1, const double* o1,
104  const double* n2, const double* o2, const double* n3, const double* o3, const double* n4,
105  const double* o4, const double* n5, const double* o5);
107 
109 
113  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
114  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
115  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
117 
119 
123  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
124  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
125  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
127 
138 
142  virtual int GetNumberOfOutputs();
144 
146 
151  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
153 
159 
163  vtkMTimeType GetMTime() override;
164 
166 
170  vtkGetMacro(Orientation, unsigned int);
171  vtkSetMacro(Orientation, unsigned int);
173 
174  static void InterpolateEdge(vtkDataSetAttributes* attributes, vtkIdType toId, vtkIdType fromId1,
175  vtkIdType fromId2, double t);
176 
177  void MinEdgeF(const unsigned int* id_v, const vtkIdType* cellIds, unsigned int* edgF);
179  const vtkIdType* pyramId, const vtkIdType* cellIds, vtkCellArray* newCellArray);
180  void WedgeToTetra(const vtkIdType* wedgeId, const vtkIdType* cellIds, vtkCellArray* newCellArray);
181  void CellGrid(
182  vtkIdType typeobj, vtkIdType npts, const vtkIdType* cellIds, vtkCellArray* newCellArray);
183  void CreateTetra(vtkIdType npts, const vtkIdType* cellIds, vtkCellArray* newCellArray);
184  void ClipBox(vtkPoints* newPoints, vtkGenericCell* cell, vtkIncrementalPointLocator* locator,
185  vtkCellArray* tets, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
186  vtkIdType cellId, vtkCellData* outCD);
187  void ClipHexahedron(vtkPoints* newPoints, vtkGenericCell* cell,
189  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
191  vtkCellArray** tets, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
192  vtkIdType cellId, vtkCellData** outCD);
194  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
195  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
196 
198  vtkCellArray* tets, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
199  vtkIdType cellId, vtkCellData* outCD);
200  void ClipBoxInOut2D(vtkPoints* newPoints, vtkGenericCell* cell,
201  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
202  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
203  void ClipHexahedron2D(vtkPoints* newPoints, vtkGenericCell* cell,
205  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
207  vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
208  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
209 
211  vtkCellArray* lines, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
212  vtkIdType cellId, vtkCellData* outCD);
213  void ClipBoxInOut1D(vtkPoints* newPoints, vtkGenericCell* cell,
214  vtkIncrementalPointLocator* locator, vtkCellArray** lines, vtkPointData* inPD,
215  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
216  void ClipHexahedron1D(vtkPoints* newPoints, vtkGenericCell* cell,
217  vtkIncrementalPointLocator* locator, vtkCellArray* lines, vtkPointData* inPD,
218  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD);
220  vtkIncrementalPointLocator* locator, vtkCellArray** lines, vtkPointData* inPD,
221  vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD);
222 
224  vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId,
225  vtkCellData* outCD);
227  vtkCellArray** verts, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
228  vtkIdType cellId, vtkCellData** outCD);
230  vtkCellArray* verts, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
231  vtkIdType cellId, vtkCellData* outCD);
233  vtkCellArray** verts, vtkPointData* inPD, vtkPointData** outPD, vtkCellData* inCD,
234  vtkIdType cellId, vtkCellData** outCD);
235 
236 protected:
238  ~vtkBoxClipDataSet() override;
239 
242 
245 
247 
248  // double MergeTolerance;
249 
250  double BoundBoxClip[3][2];
251  unsigned int Orientation;
252  double PlaneNormal[6][3]; // normal of each plane
253  double PlanePoint[6][3]; // point on the plane
254 
255 private:
256  vtkBoxClipDataSet(const vtkBoxClipDataSet&) = delete;
257  void operator=(const vtkBoxClipDataSet&) = delete;
258 };
259 
260 VTK_ABI_NAMESPACE_END
261 #endif
clip an unstructured grid
vtkIncrementalPointLocator * Locator
void ClipBox2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void ClipBoxInOut(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void CreateDefaultLocator()
Create default locator.
void ClipHexahedron(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void ClipHexahedron1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void CellGrid(vtkIdType typeobj, vtkIdType npts, const vtkIdType *cellIds, vtkCellArray *newCellArray)
void CreateTetra(vtkIdType npts, const vtkIdType *cellIds, vtkCellArray *newCellArray)
void ClipHexahedronInOut(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void ClipBoxInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **lines, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void ClipHexahedronInOut2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
static vtkBoxClipDataSet * New()
Constructor of the clipping box.
vtkTypeBool GenerateClipScalars
void ClipBoxInOut2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **tets, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
static void InterpolateEdge(vtkDataSetAttributes *attributes, vtkIdType toId, vtkIdType fromId1, vtkIdType fromId2, double t)
void ClipHexahedronInOut0D(vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **verts, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void ClipBox1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *lines, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
~vtkBoxClipDataSet() override
vtkTypeBool GenerateClippedOutput
void WedgeToTetra(const vtkIdType *wedgeId, const vtkIdType *cellIds, vtkCellArray *newCellArray)
void ClipBox0D(vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void MinEdgeF(const unsigned int *id_v, const vtkIdType *cellIds, unsigned int *edgF)
void ClipBoxInOut0D(vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **verts, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void ClipHexahedronInOut1D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray **lines, vtkPointData *inPD, vtkPointData **outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData **outCD)
void ClipHexahedron0D(vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void SetBoxClip(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
Specify the Box with which to perform the clipping.
vtkMTimeType GetMTime() override
Return the mtime also considering the locator.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void ClipHexahedron2D(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
void PyramidToTetra(const vtkIdType *pyramId, const vtkIdType *cellIds, vtkCellArray *newCellArray)
virtual int GetNumberOfOutputs()
Set the tolerance for merging clip intersection points that are near the vertices of cells.
vtkUnstructuredGrid * GetClippedOutput()
Set the tolerance for merging clip intersection points that are near the vertices of cells.
unsigned int Orientation
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetBoxClip(const double *n0, const double *o0, const double *n1, const double *o1, const double *n2, const double *o2, const double *n3, const double *o3, const double *n4, const double *o4, const double *n5, const double *o5)
Specify the Box with which to perform the clipping.
void ClipBox(vtkPoints *newPoints, vtkGenericCell *cell, vtkIncrementalPointLocator *locator, vtkCellArray *tets, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:28
object to represent cell connectivity
Definition: vtkCellArray.h:285
represent and manipulate cell attribute data
Definition: vtkCellData.h:140
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
represent and manipulate attribute data in a dataset
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:132
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:139
represent and manipulate 3D points
Definition: vtkPoints.h:138
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270