VTK  9.0.1
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 =========================================================================*/
61 #ifndef vtkClipVolume_h
62 #define vtkClipVolume_h
63 
64 #include "vtkFiltersGeneralModule.h" // For export macro
66 
67 class vtkCellData;
68 class vtkDataArray;
69 class vtkIdList;
71 class vtkMergePoints;
73 class vtkPointData;
75 class vtkPoints;
77 class vtkCell;
78 class vtkTetra;
79 class vtkCellArray;
80 class vtkIdTypeArray;
82 
83 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
84 {
85 public:
87  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
93  static vtkClipVolume* New();
94 
96 
101  vtkSetMacro(Value, double);
102  vtkGetMacro(Value, double);
104 
106 
113  vtkSetMacro(InsideOut, vtkTypeBool);
114  vtkGetMacro(InsideOut, vtkTypeBool);
115  vtkBooleanMacro(InsideOut, vtkTypeBool);
117 
119 
124  virtual void SetClipFunction(vtkImplicitFunction*);
125  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
127 
129 
135  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
136  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
137  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
139 
141 
145  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
146  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
147  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
149 
153  vtkUnstructuredGrid* GetClippedOutput();
154 
156 
162  vtkSetMacro(Mixed3DCellGeneration, vtkTypeBool);
163  vtkGetMacro(Mixed3DCellGeneration, vtkTypeBool);
164  vtkBooleanMacro(Mixed3DCellGeneration, vtkTypeBool);
166 
168 
173  vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
174  vtkGetMacro(MergeTolerance, double);
176 
178 
182  void SetLocator(vtkIncrementalPointLocator* locator);
183  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
185 
190  void CreateDefaultLocator();
191 
195  vtkMTimeType GetMTime() override;
196 
197 protected:
198  vtkClipVolume(vtkImplicitFunction* cf = nullptr);
199  ~vtkClipVolume() override;
200 
201  void ReportReferences(vtkGarbageCollector*) override;
202 
204  int FillInputPortInformation(int port, vtkInformation* info) override;
205 
206  void ClipTets(double value, vtkTetra* clipTetra, vtkDataArray* clipScalars,
207  vtkDataArray* cellScalars, vtkIdList* tetraIds, vtkPoints* tetraPts, vtkPointData* inPD,
208  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
209  vtkCellData* clippedCD, int insideOut);
210  void ClipVoxel(double value, vtkDataArray* cellScalars, int flip, double origin[3],
211  double spacing[3], vtkIdList* cellIds, vtkPoints* cellPts, vtkPointData* inPD,
212  vtkPointData* outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD,
213  vtkCellData* clippedCD);
214 
218  double Value;
224 
225 private:
226  vtkOrderedTriangulator* Triangulator;
227 
228  // Used temporarily to pass data around
229  vtkIdType NumberOfCells;
230  vtkCellArray* Connectivity;
231  vtkUnsignedCharArray* Types;
232  vtkIdType NumberOfClippedCells;
233  vtkCellArray* ClippedConnectivity;
234  vtkUnsignedCharArray* ClippedTypes;
235 
236 private:
237  vtkClipVolume(const vtkClipVolume&) = delete;
238  void operator=(const vtkClipVolume&) = delete;
239 };
240 
241 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkClipVolume::ClipFunction
vtkImplicitFunction * ClipFunction
Definition: vtkClipVolume.h:215
vtkClipVolume
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:83
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkClipVolume::GenerateClipScalars
vtkTypeBool GenerateClipScalars
Definition: vtkClipVolume.h:219
vtkClipVolume::MergeTolerance
double MergeTolerance
Definition: vtkClipVolume.h:220
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkClipVolume::Value
double Value
Definition: vtkClipVolume.h:218
vtkOrderedTriangulator
helper class to generate triangulations
Definition: vtkOrderedTriangulator.h:114
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkClipVolume::InsideOut
vtkTypeBool InsideOut
Definition: vtkClipVolume.h:217
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkUnstructuredGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkClipVolume::GenerateClippedOutput
vtkTypeBool GenerateClippedOutput
Definition: vtkClipVolume.h:222
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkUnstructuredGridAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:94
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:487
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkAlgorithm::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkClipVolume::ClippedOutput
vtkUnstructuredGrid * ClippedOutput
Definition: vtkClipVolume.h:223
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
vtkUnstructuredGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkUnstructuredGridAlgorithm.h
vtkClipVolume::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkClipVolume.h:216
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:40
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:92
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
vtkClipVolume::Mixed3DCellGeneration
vtkTypeBool Mixed3DCellGeneration
Definition: vtkClipVolume.h:221
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMergePoints
merge exactly coincident points
Definition: vtkMergePoints.h:33
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293