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 =========================================================================*/
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,
208  vtkPoints *tetraPts, vtkPointData *inPD, vtkPointData *outPD,
209  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
210  vtkCellData *clippedCD, int insideOut);
211  void ClipVoxel(double value, vtkDataArray *cellScalars, int flip,
212  double origin[3], double spacing[3], vtkIdList *cellIds,
213  vtkPoints *cellPts, vtkPointData *inPD, vtkPointData *outPD,
214  vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD,
215  vtkCellData *clippedCD);
216 
220  double Value;
226 
227 private:
228  vtkOrderedTriangulator *Triangulator;
229 
230  // Used temporarily to pass data around
231  vtkIdType NumberOfCells;
232  vtkCellArray *Connectivity;
233  vtkUnsignedCharArray *Types;
234  vtkIdTypeArray *Locations;
235  vtkIdType NumberOfClippedCells;
236  vtkCellArray *ClippedConnectivity;
237  vtkUnsignedCharArray *ClippedTypes;
238  vtkIdTypeArray *ClippedLocations;
239 
240 private:
241  vtkClipVolume(const vtkClipVolume&) = delete;
242  void operator=(const vtkClipVolume&) = delete;
243 };
244 
245 #endif
abstract interface for implicit functions
clip volume data with user-specified implicit function or input scalar data
Definition: vtkClipVolume.h:83
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
represent and manipulate point attribute data
Definition: vtkPointData.h:31
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
void ReportReferences(vtkGarbageCollector *) override
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
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:347
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:69
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
abstract class to specify cell behavior
Definition: vtkCell.h:56
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:33
vtkIncrementalPointLocator * Locator
merge exactly coincident points
list of point or cell ids
Definition: vtkIdList.h:30
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
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:44
Store zero or more vtkInformation instances.
vtkTypeBool GenerateClippedOutput
vtkImplicitFunction * ClipFunction
vtkTypeBool InsideOut
represent and manipulate 3D points
Definition: vtkPoints.h:33