VTK  9.1.0
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=========================================================================*/
144#ifndef vtkCutter_h
145#define vtkCutter_h
146
147#include "vtkFiltersCoreModule.h" // For export macro
148#include "vtkPolyDataAlgorithm.h"
149
150#include "vtkContourValues.h" // Needed for inline methods
151
152#define VTK_SORT_BY_VALUE 0
153#define VTK_SORT_BY_CELL 1
154
161
162class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
163{
164public:
166 void PrintSelf(ostream& os, vtkIndent indent) override;
167
172 static vtkCutter* New();
173
178 void SetValue(int i, double value) { this->ContourValues->SetValue(i, value); }
179
183 double GetValue(int i) { return this->ContourValues->GetValue(i); }
184
189 double* GetValues() { return this->ContourValues->GetValues(); }
190
196 void GetValues(double* contourValues) { this->ContourValues->GetValues(contourValues); }
197
203 void SetNumberOfContours(int number) { this->ContourValues->SetNumberOfContours(number); }
204
208 vtkIdType GetNumberOfContours() { return this->ContourValues->GetNumberOfContours(); }
209
214 void GenerateValues(int numContours, double range[2])
215 {
216 this->ContourValues->GenerateValues(numContours, range);
217 }
218
223 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
224 {
225 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
226 }
227
233
235
239 vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
241
243
248 vtkSetMacro(GenerateCutScalars, vtkTypeBool);
249 vtkGetMacro(GenerateCutScalars, vtkTypeBool);
250 vtkBooleanMacro(GenerateCutScalars, vtkTypeBool);
252
254
261 vtkSetMacro(GenerateTriangles, vtkTypeBool);
262 vtkGetMacro(GenerateTriangles, vtkTypeBool);
263 vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
265
267
272 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
274
276
291 vtkSetClampMacro(SortBy, int, VTK_SORT_BY_VALUE, VTK_SORT_BY_CELL);
292 vtkGetMacro(SortBy, int);
293 void SetSortByToSortByValue() { this->SetSortBy(VTK_SORT_BY_VALUE); }
294 void SetSortByToSortByCell() { this->SetSortBy(VTK_SORT_BY_CELL); }
295 const char* GetSortByAsString();
297
303
309 static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
310
312
317 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
318 vtkGetMacro(OutputPointsPrecision, int);
320
321protected:
323 ~vtkCutter() override;
324
329 void DataSetCutter(vtkDataSet* input, vtkPolyData* output);
336
341
347
348private:
349 vtkCutter(const vtkCutter&) = delete;
350 void operator=(const vtkCutter&) = delete;
351};
352
357{
358 if (this->SortBy == VTK_SORT_BY_VALUE)
359 {
360 return "SortByValue";
361 }
362 else
363 {
364 return "SortByCell";
365 }
366}
367
368#endif
helper object to manage setting and generating contour values
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:163
void StructuredGridCutter(vtkDataSet *, vtkPolyData *)
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition: vtkCutter.h:356
vtkContourValues * ContourValues
Definition: vtkCutter.h:344
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:196
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void CreateDefaultLocator()
Create default locator.
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkCutter.h:337
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkCutter.h:208
vtkSynchronizedTemplatesCutter3D * SynchronizedTemplatesCutter3D
Definition: vtkCutter.h:338
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:203
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkCutter.h:189
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:214
int SortBy
Definition: vtkCutter.h:343
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkCutter.h:339
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIncrementalPointLocator * Locator
Definition: vtkCutter.h:342
vtkImplicitFunction * CutFunction
Definition: vtkCutter.h:334
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:294
vtkTypeBool GenerateCutScalars
Definition: vtkCutter.h:345
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:178
vtkTypeBool GenerateTriangles
Definition: vtkCutter.h:335
void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
int OutputPointsPrecision
Definition: vtkCutter.h:346
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Definition: vtkCutter.h:293
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:223
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:183
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkCutter.h:340
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
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:113
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:195
generate isosurface from rectilinear grid
generate isosurface from structured points
generate cut surface from structured points
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:152
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:153
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287