VTK  9.6.1
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
39
40#ifndef vtkCutter_h
41#define vtkCutter_h
42
43#include "vtkFiltersCoreModule.h" // For export macro
45#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
46
47#include "vtkContourValues.h" // Needed for inline methods
48
49#define VTK_SORT_BY_VALUE 0
50#define VTK_SORT_BY_CELL 1
51
52VTK_ABI_NAMESPACE_BEGIN
56class vtkPlaneCutter;
60
61class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkCutter : public vtkPolyDataAlgorithm
62{
63public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
71 static vtkCutter* New();
72
77 void SetValue(int i, double value) { this->ContourValues->SetValue(i, value); }
78
82 double GetValue(int i) { return this->ContourValues->GetValue(i); }
83
88 double* GetValues() { return this->ContourValues->GetValues(); }
89
95 void GetValues(double* contourValues) { this->ContourValues->GetValues(contourValues); }
96
102 void SetNumberOfContours(int number) { this->ContourValues->SetNumberOfContours(number); }
103
107 vtkIdType GetNumberOfContours() { return this->ContourValues->GetNumberOfContours(); }
108
113 void GenerateValues(int numContours, double range[2])
114 {
115 this->ContourValues->GenerateValues(numContours, range);
116 }
117
122 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
123 {
124 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
125 }
126
132
134
138 vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
140
142
151
153
164
166
173
175
190 vtkSetClampMacro(SortBy, int, VTK_SORT_BY_VALUE, VTK_SORT_BY_CELL);
191 vtkGetMacro(SortBy, int);
194 const char* GetSortByAsString();
196
202
204
210 vtkGetMacro(OutputPointsPrecision, int);
212
213protected:
215 ~vtkCutter() override;
216
219 int FillInputPortInformation(int port, vtkInformation* info) override;
221 void DataSetCutter(vtkDataSet* input, vtkPolyData* output);
228
234
240
241 // Garbage collection method
243
244private:
245 vtkCutter(const vtkCutter&) = delete;
246 void operator=(const vtkCutter&) = delete;
247};
248
253{
254 if (this->SortBy == VTK_SORT_BY_VALUE)
255 {
256 return "SortByValue";
257 }
258 else
259 {
260 return "SortByCell";
261 }
262}
263
264VTK_ABI_NAMESPACE_END
265#endif
vtkNew< vtkPlaneCutter > PlaneCutter
Definition vtkCutter.h:233
vtkNew< vtkRectilinearSynchronizedTemplates > RectilinearSynchronizedTemplates
Definition vtkCutter.h:232
void StructuredGridCutter(vtkDataSet *, vtkPolyData *)
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition vtkCutter.h:252
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:95
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:107
vtkNew< vtkContourValues > ContourValues
Definition vtkCutter.h:237
vtkNew< vtkSynchronizedTemplates3D > SynchronizedTemplates3D
Definition vtkCutter.h:229
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:102
double * GetValues()
Get a pointer to an array of contour values.
Definition vtkCutter.h:88
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:113
int FillInputPortInformation(int port, vtkInformation *info) override
vtkIncrementalPointLocator * Locator
Definition vtkCutter.h:235
vtkNew< vtkGridSynchronizedTemplates3D > GridSynchronizedTemplates
Definition vtkCutter.h:231
vtkImplicitFunction * CutFunction
Definition vtkCutter.h:226
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:193
vtkTypeBool GenerateCutScalars
Definition vtkCutter.h:238
void StructuredPointsCutter(vtkDataSet *, vtkPolyData *, vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void ReportReferences(vtkGarbageCollector *) override
~vtkCutter() override
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition vtkCutter.h:77
vtkTypeBool GenerateTriangles
Definition vtkCutter.h:227
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
int OutputPointsPrecision
Definition vtkCutter.h:239
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Definition vtkCutter.h:192
vtkNew< vtkSynchronizedTemplatesCutter3D > SynchronizedTemplatesCutter3D
Definition vtkCutter.h:230
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:122
void RectilinearGridCutter(vtkDataSet *, vtkPolyData *)
double GetValue(int i)
Get the ith contour value.
Definition vtkCutter.h:82
virtual void SetSortBy(int)
Set the sorting order for the generated polydata.
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
Detect and break reference loops.
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:58
cut any dataset with a plane and generate a polygonal cut surface
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
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:49
#define VTK_SORT_BY_CELL
Definition vtkCutter.h:50
int vtkIdType
Definition vtkType.h:368
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_MARSHALAUTO
#define vtkCutter
Definition vtkmSlice.h:23