VTK: Filters/General/vtkClipVolume.h Source File

| VTK 9.3.1

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
61 #ifndef vtkClipVolume_h
62 #define vtkClipVolume_h
63
64 #include "vtkFiltersGeneralModule.h" // For export macro
65 #include "vtkUnstructuredGridAlgorithm.h"
66
67 VTK_ABI_NAMESPACE_BEGIN
68 class vtkCellData;
69 class vtkDataArray;
70 class vtkIdList;
71 class vtkImplicitFunction;
72 class vtkMergePoints;
73 class vtkOrderedTriangulator;
74 class vtkPointData;
75 class vtkIncrementalPointLocator;
76 class vtkPoints;
77 class vtkUnstructuredGrid;
78 class vtkCell;
79 class vtkTetra;
80 class vtkCellArray;
81 class vtkIdTypeArray;
82 class vtkUnsignedCharArray;
83
84 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
85 {
86 public:
87 vtkTypeMacro(vtkClipVolume, vtkUnstructuredGridAlgorithm);
88 void PrintSelf(ostream& os, vtkIndent indent) override;
89
94 static vtkClipVolume* New();
95
97
102 vtkSetMacro(Value, double);
103 vtkGetMacro(Value, double);
105
107
114 vtkSetMacro(InsideOut, vtkTypeBool);
115 vtkGetMacro(InsideOut, vtkTypeBool);
116 vtkBooleanMacro(InsideOut, vtkTypeBool);
118
120
125 virtual void SetClipFunction(vtkImplicitFunction*);
126 vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
128
130
136 vtkSetMacro(GenerateClipScalars, vtkTypeBool);
137 vtkGetMacro(GenerateClipScalars, vtkTypeBool);
138 vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
140
142
146 vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
147 vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
148 vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
150
154 vtkUnstructuredGrid* GetClippedOutput();
155
157
163 vtkSetMacro(Mixed3DCellGeneration, vtkTypeBool);
164 vtkGetMacro(Mixed3DCellGeneration, vtkTypeBool);
165 vtkBooleanMacro(Mixed3DCellGeneration, vtkTypeBool);
167
169
174 vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
175 vtkGetMacro(MergeTolerance, double);
177
179
183 void SetLocator(vtkIncrementalPointLocator* locator);
184 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
186
191 void CreateDefaultLocator();
192
196 vtkMTimeType GetMTime() override;
197
198 protected:
199 vtkClipVolume(vtkImplicitFunction* cf = nullptr);
200 ~vtkClipVolume() override;
201
202 void ReportReferences(vtkGarbageCollector*) override;
203
204 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
205 int FillInputPortInformation(int port, vtkInformation* info) override;
206
207 void ClipTets(double value, vtkTetra* clipTetra, vtkDataArray* clipScalars,
208 vtkDataArray* cellScalars, vtkIdList* tetraIds, vtkPoints* tetraPts, vtkPointData* inPD,
209 vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
210 vtkCellData* clippedCD, int insideOut);
211 void ClipVoxel(double value, vtkDataArray* cellScalars, int flip, double origin[3],
212 double spacing[3], vtkIdList* cellIds, vtkPoints* cellPts, vtkPointData* inPD,
213 vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
214 vtkCellData* clippedCD);
215
216 vtkImplicitFunction* ClipFunction;
217 vtkIncrementalPointLocator* Locator;
218 vtkTypeBool InsideOut;
219 double Value;
220 vtkTypeBool GenerateClipScalars;
221 double MergeTolerance;
222 vtkTypeBool Mixed3DCellGeneration;
223 vtkTypeBool GenerateClippedOutput;
224 vtkUnstructuredGrid* ClippedOutput;
225
226 private:
227 vtkOrderedTriangulator* Triangulator;
228
229 // Used temporarily to pass data around
230 vtkIdType NumberOfCells;
231 vtkCellArray* Connectivity;
232 vtkUnsignedCharArray* Types;
233 vtkIdType NumberOfClippedCells;
234 vtkCellArray* ClippedConnectivity;
235 vtkUnsignedCharArray* ClippedTypes;
236
237 vtkClipVolume(const vtkClipVolume&) = delete;
238 void operator=(const vtkClipVolume&) = delete;
239 };
240
241 VTK_ABI_NAMESPACE_END
242 #endif
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:40
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkClipVolume
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:85
vtkClipVolume::ClippedOutput
vtkUnstructuredGrid * ClippedOutput
Definition: vtkClipVolume.h:224
vtkClipVolume::GetClippedOutput
vtkUnstructuredGrid * GetClippedOutput()
Return the clipped output.
vtkClipVolume::Value
double Value
Definition: vtkClipVolume.h:219
vtkClipVolume::ClipTets
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::vtkClipVolume
vtkClipVolume(vtkImplicitFunction *cf=nullptr)
vtkClipVolume::GenerateClipScalars
vtkTypeBool GenerateClipScalars
Definition: vtkClipVolume.h:220
vtkClipVolume::ClipVoxel
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)
vtkClipVolume::InsideOut
vtkTypeBool InsideOut
Definition: vtkClipVolume.h:218
vtkClipVolume::SetClipFunction
virtual void SetClipFunction(vtkImplicitFunction *)
Specify the implicit function with which to perform the clipping.
vtkClipVolume::GenerateClippedOutput
vtkTypeBool GenerateClippedOutput
Definition: vtkClipVolume.h:223
vtkClipVolume::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkClipVolume.h:217
vtkClipVolume::GetMTime
vtkMTimeType GetMTime() override
Return the mtime also considering the locator and clip function.
vtkClipVolume::ClipFunction
vtkImplicitFunction * ClipFunction
Definition: vtkClipVolume.h:216
vtkClipVolume::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkClipVolume::~vtkClipVolume
~vtkClipVolume() override
vtkClipVolume::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkClipVolume::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkClipVolume::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkClipVolume::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkClipVolume::MergeTolerance
double MergeTolerance
Definition: vtkClipVolume.h:221
vtkClipVolume::Mixed3DCellGeneration
vtkTypeBool Mixed3DCellGeneration
Definition: vtkClipVolume.h:222
vtkClipVolume::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Set / Get a spatial locator for merging points.
vtkClipVolume::New
static vtkClipVolume * New()
Construct with user-specified implicit function; InsideOut turned off; value set to 0....
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:32
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:59
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMergePoints
merge exactly coincident points
Definition: vtkMergePoints.h:35
vtkOrderedTriangulator
helper class to generate triangulations
Definition: vtkOrderedTriangulator.h:107
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:39
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:43
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:30
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:99
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:481
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
vtkUnstructuredGridAlgorithm.h