VTK  9.2.5
vtkClipVolume.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkClipVolume.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
83 #ifndef vtkClipVolume_h
84 #define vtkClipVolume_h
85 
86 #include "vtkFiltersGeneralModule.h" // For export macro
88 
89 class vtkCellData;
90 class vtkDataArray;
91 class vtkIdList;
93 class vtkMergePoints;
95 class vtkPointData;
97 class vtkPoints;
99 class vtkCell;
100 class vtkTetra;
101 class vtkCellArray;
102 class vtkIdTypeArray;
104 
105 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
106 {
107 public:
109  void PrintSelf(ostream& os, vtkIndent indent) override;
110 
115  static vtkClipVolume* New();
116 
118 
123  vtkSetMacro(Value, double);
124  vtkGetMacro(Value, double);
126 
128 
135  vtkSetMacro(InsideOut, vtkTypeBool);
136  vtkGetMacro(InsideOut, vtkTypeBool);
137  vtkBooleanMacro(InsideOut, vtkTypeBool);
139 
141 
147  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
149 
151 
157  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
158  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
159  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
161 
163 
167  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
168  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
169  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
171 
176 
178 
184  vtkSetMacro(Mixed3DCellGeneration, vtkTypeBool);
185  vtkGetMacro(Mixed3DCellGeneration, vtkTypeBool);
186  vtkBooleanMacro(Mixed3DCellGeneration, vtkTypeBool);
188 
190 
195  vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
196  vtkGetMacro(MergeTolerance, double);
198 
200 
205  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
207 
213 
217  vtkMTimeType GetMTime() override;
218 
219 protected:
221  ~vtkClipVolume() override;
222 
224 
227 
228  void ClipTets(double value, vtkTetra* clipTetra, vtkDataArray* clipScalars,
229  vtkDataArray* cellScalars, vtkIdList* tetraIds, vtkPoints* tetraPts, vtkPointData* inPD,
230  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
231  vtkCellData* clippedCD, int insideOut);
232  void ClipVoxel(double value, vtkDataArray* cellScalars, int flip, double origin[3],
233  double spacing[3], vtkIdList* cellIds, vtkPoints* cellPts, vtkPointData* inPD,
234  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
235  vtkCellData* clippedCD);
236 
240  double Value;
246 
247 private:
248  vtkOrderedTriangulator* Triangulator;
249 
250  // Used temporarily to pass data around
251  vtkIdType NumberOfCells;
252  vtkCellArray* Connectivity;
253  vtkUnsignedCharArray* Types;
254  vtkIdType NumberOfClippedCells;
255  vtkCellArray* ClippedConnectivity;
256  vtkUnsignedCharArray* ClippedTypes;
257 
258 private:
259  vtkClipVolume(const vtkClipVolume&) = delete;
260  void operator=(const vtkClipVolume&) = delete;
261 };
262 
263 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
abstract class to specify cell behavior
Definition: vtkCell.h:150
clip volume data with user-specified implicit function or input scalar data
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:165
Detect and break reference loops.
list of point or cell ids
Definition: vtkIdList.h:143
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:119
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:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:114
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:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ spacing
Definition: vtkX3D.h:487
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287