Thanks to visit codestin.com
Credit goes to vtk.org

VTK  9.5.20250921
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
139#ifndef vtkCutter_h
140#define vtkCutter_h
141
142#include "vtkFiltersCoreModule.h" // For export macro
143#include "vtkPolyDataAlgorithm.h"
144#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
145
146#include "vtkContourValues.h" // Needed for inline methods
147
148#define VTK_SORT_BY_VALUE 0
149#define VTK_SORT_BY_CELL 1
150
151VTK_ABI_NAMESPACE_BEGIN
155class vtkPlaneCutter;
159
160class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkCutter : public vtkPolyDataAlgorithm
161{
162public:
164 void PrintSelf(ostream& os, vtkIndent indent) override;
165
170 static vtkCutter* New();
171
176 void SetValue(int i, double value) { this->ContourValues->SetValue(i, value); }
177
181 double GetValue(int i) { return this->ContourValues->GetValue(i); }
182
187 double* GetValues() { return this->ContourValues->GetValues(); }
188
194 void GetValues(double* contourValues) { this->ContourValues->GetValues(contourValues); }
195
201 void SetNumberOfContours(int number) { this->ContourValues->SetNumberOfContours(number); }
202
206 vtkIdType GetNumberOfContours() { return this->ContourValues->GetNumberOfContours(); }
207
212 void GenerateValues(int numContours, double range[2])
213 {
214 this->ContourValues->GenerateValues(numContours, range);
215 }
216
221 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
222 {
223 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
224 }
225
231
233
237 vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
239
241
246 vtkSetMacro(GenerateCutScalars, vtkTypeBool);
247 vtkGetMacro(GenerateCutScalars, vtkTypeBool);
248 vtkBooleanMacro(GenerateCutScalars, vtkTypeBool);
250
252
259 vtkSetMacro(GenerateTriangles, vtkTypeBool);
260 vtkGetMacro(GenerateTriangles, vtkTypeBool);
261 vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
263
265
270 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
272
274
289 vtkSetClampMacro(SortBy, int, VTK_SORT_BY_VALUE, VTK_SORT_BY_CELL);
290 vtkGetMacro(SortBy, int);
291 void SetSortByToSortByValue() { this->SetSortBy(VTK_SORT_BY_VALUE); }
292 void SetSortByToSortByCell() { this->SetSortBy(VTK_SORT_BY_CELL); }
293 const char* GetSortByAsString();
295
301
303
308 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
309 vtkGetMacro(OutputPointsPrecision, int);
311
312protected:
314 ~vtkCutter() override;
315
318 int FillInputPortInformation(int port, vtkInformation* info) override;
320 void DataSetCutter(vtkDataSet* input, vtkPolyData* output);
327
333
339
340 // Garbage collection method
342
343private:
344 vtkCutter(const vtkCutter&) = delete;
345 void operator=(const vtkCutter&) = delete;
346};
347
352{
353 if (this->SortBy == VTK_SORT_BY_VALUE)
354 {
355 return "SortByValue";
356 }
357 else
358 {
359 return "SortByCell";
360 }
361}
362
363VTK_ABI_NAMESPACE_END
364#endif
Cut vtkDataSet with user-specified implicit function.
Definition vtkCutter.h:161
vtkNew< vtkPlaneCutter > PlaneCutter
Definition vtkCutter.h:332
vtkNew< vtkRectilinearSynchronizedTemplates > RectilinearSynchronizedTemplates
Definition vtkCutter.h:331
void StructuredGridCutter(vtkDataSet *, vtkPolyData *)
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition vtkCutter.h:351
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:194
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:206
vtkNew< vtkContourValues > ContourValues
Definition vtkCutter.h:336
vtkNew< vtkSynchronizedTemplates3D > SynchronizedTemplates3D
Definition vtkCutter.h:328
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:201
double * GetValues()
Get a pointer to an array of contour values.
Definition vtkCutter.h:187
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:212
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIncrementalPointLocator * Locator
Definition vtkCutter.h:334
vtkNew< vtkGridSynchronizedTemplates3D > GridSynchronizedTemplates
Definition vtkCutter.h:330
vtkImplicitFunction * CutFunction
Definition vtkCutter.h:325
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:292
vtkTypeBool GenerateCutScalars
Definition vtkCutter.h:337
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:176
vtkTypeBool GenerateTriangles
Definition vtkCutter.h:326
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
int OutputPointsPrecision
Definition vtkCutter.h:338
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Definition vtkCutter.h:291
vtkNew< vtkSynchronizedTemplatesCutter3D > SynchronizedTemplatesCutter3D
Definition vtkCutter.h:329
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:221
void RectilinearGridCutter(vtkDataSet *, vtkPolyData *)
double GetValue(int i)
Get the ith contour value.
Definition vtkCutter.h:181
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:167
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
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:148
#define VTK_SORT_BY_CELL
Definition vtkCutter.h:149
int vtkIdType
Definition vtkType.h:333
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:288
#define VTK_MARSHALAUTO