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
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 
116  virtual void SetClipFunction(vtkImplicitFunction*);
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 
145  vtkUnstructuredGrid* GetClippedOutput();
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 
174  void SetLocator(vtkIncrementalPointLocator* locator);
175  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
177 
182  void CreateDefaultLocator();
183 
187  vtkMTimeType GetMTime() override;
188 
189 protected:
190  vtkClipVolume(vtkImplicitFunction* cf = nullptr);
191  ~vtkClipVolume() override;
192 
193  void ReportReferences(vtkGarbageCollector*) override;
194 
196  int FillInputPortInformation(int port, vtkInformation* info) override;
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
abstract interface for implicit functions
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:75
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
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
void ReportReferences(vtkGarbageCollector *) override
represent and manipulate cell attribute data
Definition: vtkCellData.h:30
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
helper class to generate triangulations
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Detect and break reference loops.
int vtkTypeBool
Definition: vtkABI.h:64
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:33
abstract class to specify cell behavior
Definition: vtkCell.h:49
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool GenerateClipScalars
double MergeTolerance
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIncrementalPointLocator * Locator
merge exactly coincident points
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 Mixed3DCellGeneration
Superclass for algorithms that produce only unstructured grid as output.
dynamic, self-adjusting array of unsigned char
vtkUnstructuredGrid * ClippedOutput
object to represent cell connectivity
Definition: vtkCellArray.h:175
Store zero or more vtkInformation instances.
vtkTypeBool GenerateClippedOutput
vtkImplicitFunction * ClipFunction
vtkTypeBool InsideOut
represent and manipulate 3D points
Definition: vtkPoints.h:28