VTK  9.2.6
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=========================================================================*/
54
55#ifndef vtkCutter_h
56#define vtkCutter_h
57
58#include "vtkFiltersCoreModule.h" // For export macro
60
61#include "vtkContourValues.h" // Needed for inline methods
62
63#define VTK_SORT_BY_VALUE 0
64#define VTK_SORT_BY_CELL 1
65
72
73class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
74{
75public:
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
83 static vtkCutter* New();
84
89 void SetValue(int i, double value) { this->ContourValues->SetValue(i, value); }
90
94 double GetValue(int i) { return this->ContourValues->GetValue(i); }
95
100 double* GetValues() { return this->ContourValues->GetValues(); }
101
107 void GetValues(double* contourValues) { this->ContourValues->GetValues(contourValues); }
108
114 void SetNumberOfContours(int number) { this->ContourValues->SetNumberOfContours(number); }
115
119 vtkIdType GetNumberOfContours() { return this->ContourValues->GetNumberOfContours(); }
120
125 void GenerateValues(int numContours, double range[2])
126 {
127 this->ContourValues->GenerateValues(numContours, range);
128 }
129
134 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
135 {
136 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
137 }
138
144
146
150 vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
152
154
163
165
176
178
185
187
202 vtkSetClampMacro(SortBy, int, VTK_SORT_BY_VALUE, VTK_SORT_BY_CELL);
203 vtkGetMacro(SortBy, int);
206 const char* GetSortByAsString();
208
214
220 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
221
223
229 vtkGetMacro(OutputPointsPrecision, int);
231
232protected:
234 ~vtkCutter() override;
235
238 int FillInputPortInformation(int port, vtkInformation* info) override;
240 void DataSetCutter(vtkDataSet* input, vtkPolyData* output);
247
252
258
259private:
260 vtkCutter(const vtkCutter&) = delete;
261 void operator=(const vtkCutter&) = delete;
262};
263
268{
269 if (this->SortBy == VTK_SORT_BY_VALUE)
270 {
271 return "SortByValue";
272 }
273 else
274 {
275 return "SortByCell";
276 }
277}
278
279#endif
helper object to manage setting and generating contour values
void StructuredGridCutter(vtkDataSet *, vtkPolyData *)
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition vtkCutter.h:267
vtkContourValues * ContourValues
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:107
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void CreateDefaultLocator()
Create default locator.
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition vtkCutter.h:248
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition vtkCutter.h:119
vtkSynchronizedTemplatesCutter3D * SynchronizedTemplatesCutter3D
Definition vtkCutter.h:249
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:100
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:125
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition vtkCutter.h:250
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIncrementalPointLocator * Locator
Definition vtkCutter.h:253
vtkImplicitFunction * CutFunction
Definition vtkCutter.h:245
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:205
vtkTypeBool GenerateCutScalars
Definition vtkCutter.h:256
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:89
vtkTypeBool GenerateTriangles
Definition vtkCutter.h:246
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
int OutputPointsPrecision
Definition vtkCutter.h:257
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Definition vtkCutter.h:204
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:134
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:94
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition vtkCutter.h:251
virtual void SetSortBy(int)
Set the sorting order for the generated polydata.
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.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
generate isosurface from rectilinear grid
generate isosurface from structured points
generate cut surface from structured points
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SORT_BY_VALUE
Definition vtkCutter.h:63
#define VTK_SORT_BY_CELL
Definition vtkCutter.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287