VTK  9.3.20240327
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
71 #ifndef vtkClipVolume_h
72 #define vtkClipVolume_h
73 
74 #include "vtkFiltersGeneralModule.h" // For export macro
76 
77 VTK_ABI_NAMESPACE_BEGIN
78 class vtkCellData;
79 class vtkDataArray;
80 class vtkIdList;
82 class vtkMergePoints;
84 class vtkPointData;
86 class vtkPoints;
88 class vtkCell;
89 class vtkTetra;
90 class vtkCellArray;
91 class vtkIdTypeArray;
93 
94 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
95 {
96 public:
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
104  static vtkClipVolume* New();
105 
107 
112  vtkSetMacro(Value, double);
113  vtkGetMacro(Value, double);
115 
117 
124  vtkSetMacro(InsideOut, vtkTypeBool);
125  vtkGetMacro(InsideOut, vtkTypeBool);
126  vtkBooleanMacro(InsideOut, vtkTypeBool);
128 
130 
136  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
138 
140 
146  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
147  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
148  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
150 
152 
156  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
157  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
158  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
160 
165 
167 
173  vtkSetMacro(Mixed3DCellGeneration, vtkTypeBool);
174  vtkGetMacro(Mixed3DCellGeneration, vtkTypeBool);
175  vtkBooleanMacro(Mixed3DCellGeneration, vtkTypeBool);
177 
179 
184  vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
185  vtkGetMacro(MergeTolerance, double);
187 
189 
194  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
196 
202 
206  vtkMTimeType GetMTime() override;
207 
208 protected:
210  ~vtkClipVolume() override;
211 
213 
216 
217  void ClipTets(double value, vtkTetra* clipTetra, vtkDataArray* clipScalars,
218  vtkDataArray* cellScalars, vtkIdList* tetraIds, vtkPoints* tetraPts, vtkPointData* inPD,
219  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
220  vtkCellData* clippedCD, int insideOut);
221  void ClipVoxel(double value, vtkDataArray* cellScalars, int flip, double origin[3],
222  double spacing[3], vtkIdList* cellIds, vtkPoints* cellPts, vtkPointData* inPD,
223  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
224  vtkCellData* clippedCD);
225 
229  double Value;
235 
236 private:
237  vtkOrderedTriangulator* Triangulator;
238 
239  // Used temporarily to pass data around
240  vtkIdType NumberOfCells;
241  vtkCellArray* Connectivity;
242  vtkUnsignedCharArray* Types;
243  vtkIdType NumberOfClippedCells;
244  vtkCellArray* ClippedConnectivity;
245  vtkUnsignedCharArray* ClippedTypes;
246 
247  vtkClipVolume(const vtkClipVolume&) = delete;
248  void operator=(const vtkClipVolume&) = delete;
249 };
250 
251 VTK_ABI_NAMESPACE_END
252 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:285
represent and manipulate cell attribute data
Definition: vtkCellData.h:140
abstract class to specify cell behavior
Definition: vtkCell.h:130
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:95
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:154
Detect and break reference loops.
list of point or cell ids
Definition: vtkIdList.h:132
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:108
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:139
represent and manipulate 3D points
Definition: vtkPoints.h:138
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:113
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