VTK  9.3.0
vtkCutter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
40#ifndef vtkCutter_h
41#define vtkCutter_h
42
43#include "vtkFiltersCoreModule.h" // For export macro
45
46#include "vtkContourValues.h" // Needed for inline methods
47
48#define VTK_SORT_BY_VALUE 0
49#define VTK_SORT_BY_CELL 1
50
51VTK_ABI_NAMESPACE_BEGIN
55class vtkPlaneCutter;
59
60class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
61{
62public:
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
70 static vtkCutter* New();
71
76 void SetValue(int i, double value) { this->ContourValues->SetValue(i, value); }
77
81 double GetValue(int i) { return this->ContourValues->GetValue(i); }
82
87 double* GetValues() { return this->ContourValues->GetValues(); }
88
94 void GetValues(double* contourValues) { this->ContourValues->GetValues(contourValues); }
95
101 void SetNumberOfContours(int number) { this->ContourValues->SetNumberOfContours(number); }
102
106 vtkIdType GetNumberOfContours() { return this->ContourValues->GetNumberOfContours(); }
107
112 void GenerateValues(int numContours, double range[2])
113 {
114 this->ContourValues->GenerateValues(numContours, range);
115 }
116
121 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
122 {
123 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
124 }
125
131
133
137 vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
139
141
146 vtkSetMacro(GenerateCutScalars, vtkTypeBool);
147 vtkGetMacro(GenerateCutScalars, vtkTypeBool);
148 vtkBooleanMacro(GenerateCutScalars, vtkTypeBool);
150
152
159 vtkSetMacro(GenerateTriangles, vtkTypeBool);
160 vtkGetMacro(GenerateTriangles, vtkTypeBool);
161 vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
163
165
170 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
172
174
189 vtkSetClampMacro(SortBy, int, VTK_SORT_BY_VALUE, VTK_SORT_BY_CELL);
190 vtkGetMacro(SortBy, int);
191 void SetSortByToSortByValue() { this->SetSortBy(VTK_SORT_BY_VALUE); }
192 void SetSortByToSortByCell() { this->SetSortBy(VTK_SORT_BY_CELL); }
193 const char* GetSortByAsString();
195
201
207 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
208
210
215 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
216 vtkGetMacro(OutputPointsPrecision, int);
218
219protected:
221 ~vtkCutter() override;
222
225 int FillInputPortInformation(int port, vtkInformation* info) override;
227 void DataSetCutter(vtkDataSet* input, vtkPolyData* output);
234
240
246
247private:
248 vtkCutter(const vtkCutter&) = delete;
249 void operator=(const vtkCutter&) = delete;
250};
251
256{
257 if (this->SortBy == VTK_SORT_BY_VALUE)
258 {
259 return "SortByValue";
260 }
261 else
262 {
263 return "SortByCell";
264 }
265}
266
267VTK_ABI_NAMESPACE_END
268#endif
Cut vtkDataSet with user-specified implicit function.
Definition vtkCutter.h:61
vtkNew< vtkPlaneCutter > PlaneCutter
Definition vtkCutter.h:239
vtkNew< vtkRectilinearSynchronizedTemplates > RectilinearSynchronizedTemplates
Definition vtkCutter.h:238
void StructuredGridCutter(vtkDataSet *, vtkPolyData *)
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition vtkCutter.h:255
void DataSetCutter(vtkDataSet *input, vtkPolyData *output)
virtual void SetCutFunction(vtkImplicitFunction *)
Specify the implicit function to perform the cutting.
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
Definition vtkCutter.h:94
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void CreateDefaultLocator()
Create default locator.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition vtkCutter.h:106
vtkNew< vtkContourValues > ContourValues
Definition vtkCutter.h:243
vtkNew< vtkSynchronizedTemplates3D > SynchronizedTemplates3D
Definition vtkCutter.h:235
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:101
double * GetValues()
Get a pointer to an array of contour values.
Definition vtkCutter.h:87
vtkMTimeType GetMTime() override
Override GetMTime because we delegate to vtkContourValues and refer to vtkImplicitFunction.
vtkCutter(vtkImplicitFunction *cf=nullptr)
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition vtkCutter.h:112
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIncrementalPointLocator * Locator
Definition vtkCutter.h:241
vtkNew< vtkGridSynchronizedTemplates3D > GridSynchronizedTemplates
Definition vtkCutter.h:237
vtkImplicitFunction * CutFunction
Definition vtkCutter.h:232
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSortByToSortByCell()
Set the sorting order for the generated polydata.
Definition vtkCutter.h:192
vtkTypeBool GenerateCutScalars
Definition vtkCutter.h:244
void StructuredPointsCutter(vtkDataSet *, vtkPolyData *, vtkInformation *, vtkInformationVector **, vtkInformationVector *)
~vtkCutter() override
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition vtkCutter.h:76
vtkTypeBool GenerateTriangles
Definition vtkCutter.h:233
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
int OutputPointsPrecision
Definition vtkCutter.h:245
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Definition vtkCutter.h:191
vtkNew< vtkSynchronizedTemplatesCutter3D > SynchronizedTemplatesCutter3D
Definition vtkCutter.h:236
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
Definition vtkCutter.h:121
void RectilinearGridCutter(vtkDataSet *, vtkPolyData *)
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:81
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:51
cut any dataset with a plane and generate a polygonal cut surface
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
generate isosurface from rectilinear grid
generate isosurface from structured points
generate cut surface from structured points
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SORT_BY_VALUE
Definition vtkCutter.h:48
#define VTK_SORT_BY_CELL
Definition vtkCutter.h:49
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270