VTK
vtkCutter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCutter.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=========================================================================*/
51#ifndef vtkCutter_h
52#define vtkCutter_h
53
54#include "vtkFiltersCoreModule.h" // For export macro
56
57#include "vtkContourValues.h" // Needed for inline methods
58
59#define VTK_SORT_BY_VALUE 0
60#define VTK_SORT_BY_CELL 1
61
68
69class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
70{
71public:
73 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
74
79 static vtkCutter *New();
80
85 void SetValue(int i, double value)
86 {this->ContourValues->SetValue(i,value);}
87
91 double GetValue(int i)
92 {return this->ContourValues->GetValue(i);}
93
98 double *GetValues()
99 {return this->ContourValues->GetValues();}
100
106 void GetValues(double *contourValues)
107 {this->ContourValues->GetValues(contourValues);}
108
114 void SetNumberOfContours(int number)
115 {this->ContourValues->SetNumberOfContours(number);}
116
121 {return this->ContourValues->GetNumberOfContours();}
122
127 void GenerateValues(int numContours, double range[2])
128 {this->ContourValues->GenerateValues(numContours, range);}
129
134 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
135 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
136
141 vtkMTimeType GetMTime() VTK_OVERRIDE;
142
144
147 virtual void SetCutFunction(vtkImplicitFunction*);
148 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
150
152
157 vtkSetMacro(GenerateCutScalars,int);
158 vtkGetMacro(GenerateCutScalars,int);
159 vtkBooleanMacro(GenerateCutScalars,int);
161
163
170 vtkSetMacro(GenerateTriangles,int);
171 vtkGetMacro(GenerateTriangles,int);
172 vtkBooleanMacro(GenerateTriangles,int);
174
176
180 void SetLocator(vtkIncrementalPointLocator *locator);
181 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
183
185
200 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
201 vtkGetMacro(SortBy,int);
202 void SetSortByToSortByValue()
203 {this->SetSortBy(VTK_SORT_BY_VALUE);}
205 {this->SetSortBy(VTK_SORT_BY_CELL);}
206 const char *GetSortByAsString();
208
214
220 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
221
223
228 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
229 vtkGetMacro(OutputPointsPrecision, int);
231
232protected:
234 ~vtkCutter() VTK_OVERRIDE;
235
236 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
237 int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
238 int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
239 void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
240 void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
241 void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
244 void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
245 void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
247 int GenerateTriangles;
248
249 vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
250 vtkSynchronizedTemplatesCutter3D *SynchronizedTemplatesCutter3D;
251 vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
252 vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
253
255 int SortBy;
256 vtkContourValues *ContourValues;
257 int GenerateCutScalars;
258 int OutputPointsPrecision;
259private:
260 vtkCutter(const vtkCutter&) VTK_DELETE_FUNCTION;
261 void operator=(const vtkCutter&) VTK_DELETE_FUNCTION;
262};
263
265
268inline const char *vtkCutter::GetSortByAsString(void)
269{
270 if ( this->SortBy == VTK_SORT_BY_VALUE )
271 {
272 return "SortByValue";
273 }
274 else
275 {
276 return "SortByCell";
277 }
278}
280
281#endif
helper object to manage setting and generating contour values
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:70
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkCutter.h:120
void GetValues(double *contourValues)
Fill a supplied list with contour values.
Definition: vtkCutter.h:106
void CreateDefaultLocator()
Create default locator.
static vtkCutter * New()
Construct with user-specified implicit function; initial value of 0.0; and generating cut scalars tur...
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkCutter.h:114
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkCutter.h:98
vtkMTimeType GetMTime() override
Override GetMTime because we delegate to vtkContourValues and refer to vtkImplicitFunction.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:127
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSortByToSortByCell()
Definition: vtkCutter.h:204
~vtkCutter() override
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition: vtkCutter.h:85
vtkCutter(vtkImplicitFunction *cf=NULL)
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:134
static void GetCellTypeDimensions(unsigned char *cellTypeDimensions)
Normally I would put this in a different class, but since This is a temporary fix until we convert th...
double GetValue(int i)
Get the ith contour value.
Definition: vtkCutter.h:91
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
generate isosurface from structured grids
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:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
generate isosurface from rectilinear grid
generate isosurface from structured points
generate cut surface from structured points
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:59
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:60
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248