VTK
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 =========================================================================*/
64 #ifndef vtkClipVolume_h
65 #define vtkClipVolume_h
66 
67 #include "vtkFiltersGeneralModule.h" // For export macro
69 
70 class vtkCellData;
71 class vtkDataArray;
72 class vtkIdList;
74 class vtkMergePoints;
76 class vtkPointData;
78 class vtkPoints;
80 class vtkCell;
81 class vtkTetra;
82 class vtkCellArray;
83 class vtkIdTypeArray;
85 
86 class VTKFILTERSGENERAL_EXPORT vtkClipVolume : public vtkUnstructuredGridAlgorithm
87 {
88 public:
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
96  static vtkClipVolume *New();
97 
99 
104  vtkSetMacro(Value,double);
105  vtkGetMacro(Value,double);
107 
109 
116  vtkSetMacro(InsideOut,vtkTypeBool);
117  vtkGetMacro(InsideOut,vtkTypeBool);
118  vtkBooleanMacro(InsideOut,vtkTypeBool);
120 
122 
127  virtual void SetClipFunction(vtkImplicitFunction*);
128  vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
130 
132 
138  vtkSetMacro(GenerateClipScalars,vtkTypeBool);
139  vtkGetMacro(GenerateClipScalars,vtkTypeBool);
140  vtkBooleanMacro(GenerateClipScalars,vtkTypeBool);
142 
144 
148  vtkSetMacro(GenerateClippedOutput,vtkTypeBool);
149  vtkGetMacro(GenerateClippedOutput,vtkTypeBool);
150  vtkBooleanMacro(GenerateClippedOutput,vtkTypeBool);
152 
156  vtkUnstructuredGrid *GetClippedOutput();
157 
159 
165  vtkSetMacro(Mixed3DCellGeneration,vtkTypeBool);
166  vtkGetMacro(Mixed3DCellGeneration,vtkTypeBool);
167  vtkBooleanMacro(Mixed3DCellGeneration,vtkTypeBool);
169 
171 
176  vtkSetClampMacro(MergeTolerance,double,0.0001,0.25);
177  vtkGetMacro(MergeTolerance,double);
179 
181 
185  void SetLocator(vtkIncrementalPointLocator *locator);
186  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
188 
193  void CreateDefaultLocator();
194 
198  vtkMTimeType GetMTime() override;
199 
200 protected:
201  vtkClipVolume(vtkImplicitFunction *cf=nullptr);
202  ~vtkClipVolume() override;
203 
204  void ReportReferences(vtkGarbageCollector*) override;
205 
207  int FillInputPortInformation(int port, vtkInformation *info) override;
208 
209  void ClipTets(double value, vtkTetra *clipTetra, vtkDataArray *clipScalars,
210  vtkDataArray *cellScalars, vtkIdList *tetraIds,
211  vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD,
212  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
213  vtkCellData *clippedCD, int insideOut);
214  void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
215  double origin[3], double spacing[3], vtkIdList *cellIds,
216  vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD,
217  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
218  vtkCellData *clippedCD);
219 
223  double Value;
229 
230 private:
231  vtkOrderedTriangulator *Triangulator;
232 
233  // Used temporarily to pass data around
234  vtkIdType NumberOfCells;
235  vtkCellArray *Connectivity;
236  vtkUnsignedCharArray *Types;
237  vtkIdTypeArray *Locations;
238  vtkIdType NumberOfClippedCells;
239  vtkCellArray *ClippedConnectivity;
240  vtkUnsignedCharArray *ClippedTypes;
241  vtkIdTypeArray *ClippedLocations;
242 
243 private:
244  vtkClipVolume(const vtkClipVolume&) = delete;
245  void operator=(const vtkClipVolume&) = delete;
246 };
247 
248 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkClipVolume::ClipFunction
vtkImplicitFunction * ClipFunction
Definition: vtkClipVolume.h:220
vtkClipVolume
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:86
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkX3D::value
Definition: vtkX3D.h:220
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkClipVolume::GenerateClipScalars
vtkTypeBool GenerateClipScalars
Definition: vtkClipVolume.h:224
vtkClipVolume::MergeTolerance
double MergeTolerance
Definition: vtkClipVolume.h:225
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkClipVolume::Value
double Value
Definition: vtkClipVolume.h:223
vtkOrderedTriangulator
helper class to generate triangulations
Definition: vtkOrderedTriangulator.h:117
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkX3D::port
Definition: vtkX3D.h:447
vtkClipVolume::InsideOut
vtkTypeBool InsideOut
Definition: vtkClipVolume.h:222
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
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:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkClipVolume::GenerateClippedOutput
vtkTypeBool GenerateClippedOutput
Definition: vtkClipVolume.h:227
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
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:36
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:99
vtkX3D::spacing
Definition: vtkX3D.h:481
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
Definition: vtkX3D.h:376
vtkAlgorithm::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkClipVolume::ClippedOutput
vtkUnstructuredGrid * ClippedOutput
Definition: vtkClipVolume.h:228
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:221
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:87
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
vtkClipVolume::Mixed3DCellGeneration
vtkTypeBool Mixed3DCellGeneration
Definition: vtkClipVolume.h:226
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMergePoints
merge exactly coincident points
Definition: vtkMergePoints.h:36
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302