VTK  9.3.0
vtkClipVolume.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
52 #ifndef vtkClipVolume_h
53 #define vtkClipVolume_h
54 
55 #include "vtkFiltersGeneralModule.h" // For export macro
57 
58 VTK_ABI_NAMESPACE_BEGIN
59 class vtkCellData;
60 class vtkDataArray;
61 class vtkIdList;
63 class vtkMergePoints;
65 class vtkPointData;
67 class vtkPoints;
69 class vtkCell;
70 class vtkTetra;
71 class vtkCellArray;
72 class vtkIdTypeArray;
74 
75 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
76 {
77 public:
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
85  static vtkClipVolume* New();
86 
88 
93  vtkSetMacro(Value, double);
94  vtkGetMacro(Value, double);
96 
98 
105  vtkSetMacro(InsideOut, vtkTypeBool);
106  vtkGetMacro(InsideOut, vtkTypeBool);
107  vtkBooleanMacro(InsideOut, vtkTypeBool);
109 
111 
117  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
119 
121 
127  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
128  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
129  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
131 
133 
137  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
138  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
139  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
141 
146 
148 
154  vtkSetMacro(Mixed3DCellGeneration, vtkTypeBool);
155  vtkGetMacro(Mixed3DCellGeneration, vtkTypeBool);
156  vtkBooleanMacro(Mixed3DCellGeneration, vtkTypeBool);
158 
160 
165  vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
166  vtkGetMacro(MergeTolerance, double);
168 
170 
175  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
177 
183 
187  vtkMTimeType GetMTime() override;
188 
189 protected:
191  ~vtkClipVolume() override;
192 
194 
197 
198  void ClipTets(double value, vtkTetra* clipTetra, vtkDataArray* clipScalars,
199  vtkDataArray* cellScalars, vtkIdList* tetraIds, vtkPoints* tetraPts, vtkPointData* inPD,
200  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
201  vtkCellData* clippedCD, int insideOut);
202  void ClipVoxel(double value, vtkDataArray* cellScalars, int flip, double origin[3],
203  double spacing[3], vtkIdList* cellIds, vtkPoints* cellPts, vtkPointData* inPD,
204  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
205  vtkCellData* clippedCD);
206 
210  double Value;
216 
217 private:
218  vtkOrderedTriangulator* Triangulator;
219 
220  // Used temporarily to pass data around
221  vtkIdType NumberOfCells;
222  vtkCellArray* Connectivity;
223  vtkUnsignedCharArray* Types;
224  vtkIdType NumberOfClippedCells;
225  vtkCellArray* ClippedConnectivity;
226  vtkUnsignedCharArray* ClippedTypes;
227 
228  vtkClipVolume(const vtkClipVolume&) = delete;
229  void operator=(const vtkClipVolume&) = delete;
230 };
231 
232 VTK_ABI_NAMESPACE_END
233 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:176
represent and manipulate cell attribute data
Definition: vtkCellData.h:31
abstract class to specify cell behavior
Definition: vtkCell.h:50
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:76
vtkUnstructuredGrid * ClippedOutput
vtkUnstructuredGrid * GetClippedOutput()
Return the clipped output.
void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars, vtkDataArray *cellScalars, vtkIdList *tetraIds, vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, vtkCellData *clippedCD, int insideOut)
vtkClipVolume(vtkImplicitFunction *cf=nullptr)
vtkTypeBool GenerateClipScalars
void ClipVoxel(double value, vtkDataArray *cellScalars, int flip, double origin[3], double spacing[3], vtkIdList *cellIds, vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD, vtkCellData *clippedCD)
vtkTypeBool InsideOut
virtual void SetClipFunction(vtkImplicitFunction *)
Specify the implicit function with which to perform the clipping.
vtkTypeBool GenerateClippedOutput
vtkIncrementalPointLocator * Locator
vtkMTimeType GetMTime() override
Return the mtime also considering the locator and clip function.
vtkImplicitFunction * ClipFunction
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkClipVolume() override
void ReportReferences(vtkGarbageCollector *) override
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void CreateDefaultLocator()
Create default locator.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
double MergeTolerance
vtkTypeBool Mixed3DCellGeneration
void SetLocator(vtkIncrementalPointLocator *locator)
Set / Get a spatial locator for merging points.
static vtkClipVolume * New()
Construct with user-specified implicit function; InsideOut turned off; value set to 0....
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
Detect and break reference loops.
list of point or cell ids
Definition: vtkIdList.h:23
dynamic, self-adjusting array of vtkIdType
abstract interface for implicit functions
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
merge exactly coincident points
helper class to generate triangulations
represent and manipulate point attribute data
Definition: vtkPointData.h:30
represent and manipulate 3D points
Definition: vtkPoints.h:29
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:34
dynamic, self-adjusting array of unsigned char
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ spacing
Definition: vtkX3D.h:481
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270