VTK
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 =========================================================================*/
51 #ifndef vtkCutter_h
52 #define vtkCutter_h
53 
54 #include "vtkFiltersCoreModule.h" // For export macro
55 #include "vtkPolyDataAlgorithm.h"
56 
57 #include "vtkContourValues.h" // Needed for inline methods
58 
59 #define VTK_SORT_BY_VALUE 0
60 #define VTK_SORT_BY_CELL 1
61 
68 
69 class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
79  static vtkCutter *New();
80 
85  void SetValue(int i, double value)
86  {this->ContourValues->SetValue(i,value);}
87 
91  double GetValue(int i)
92  {return this->ContourValues->GetValue(i);}
93 
98  double *GetValues()
99  {return this->ContourValues->GetValues();}
100 
106  void GetValues(double *contourValues)
107  {this->ContourValues->GetValues(contourValues);}
108 
114  void SetNumberOfContours(int number)
115  {this->ContourValues->SetNumberOfContours(number);}
116 
121  {return this->ContourValues->GetNumberOfContours();}
122 
127  void GenerateValues(int numContours, double range[2])
128  {this->ContourValues->GenerateValues(numContours, range);}
129 
134  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
135  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
136 
141  vtkMTimeType GetMTime() override;
142 
144 
147  virtual void SetCutFunction(vtkImplicitFunction*);
148  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
150 
152 
157  vtkSetMacro(GenerateCutScalars,vtkTypeBool);
158  vtkGetMacro(GenerateCutScalars,vtkTypeBool);
159  vtkBooleanMacro(GenerateCutScalars,vtkTypeBool);
161 
163 
170  vtkSetMacro(GenerateTriangles,vtkTypeBool);
171  vtkGetMacro(GenerateTriangles,vtkTypeBool);
172  vtkBooleanMacro(GenerateTriangles,vtkTypeBool);
174 
176 
180  void SetLocator(vtkIncrementalPointLocator *locator);
181  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
183 
185 
200  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
201  vtkGetMacro(SortBy,int);
203  {this->SetSortBy(VTK_SORT_BY_VALUE);}
205  {this->SetSortBy(VTK_SORT_BY_CELL);}
206  const char *GetSortByAsString();
208 
213  void CreateDefaultLocator();
214 
220  static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
221 
223 
228  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
229  vtkGetMacro(OutputPointsPrecision, int);
231 
232 protected:
233  vtkCutter(vtkImplicitFunction *cf=nullptr);
234  ~vtkCutter() override;
235 
238  int FillInputPortInformation(int port, vtkInformation *info) override;
239  void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
240  void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
241  void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
244  void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
245  void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
248 
253 
255  int SortBy;
259 private:
260  vtkCutter(const vtkCutter&) = delete;
261  void operator=(const vtkCutter&) = delete;
262 };
263 
265 
268 inline const char *vtkCutter::GetSortByAsString(void)
269 {
270  if ( this->SortBy == VTK_SORT_BY_VALUE )
271  {
272  return "SortByValue";
273  }
274  else
275  {
276  return "SortByCell";
277  }
278 }
280 
281 #endif
vtkCutter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkCutter.h:91
vtkSynchronizedTemplatesCutter3D
generate cut surface from structured points
Definition: vtkSynchronizedTemplatesCutter3D.h:39
vtkCutter::ContourValues
vtkContourValues * ContourValues
Definition: vtkCutter.h:256
vtkCutter::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkCutter.h:258
vtkCutter::RectilinearSynchronizedTemplates
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkCutter.h:252
vtkCutter::GenerateValues
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:134
vtkCutter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkCutter.h:254
vtkCutter
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:69
vtkX3D::value
Definition: vtkX3D.h:220
vtkCutter::SynchronizedTemplates3D
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkCutter.h:249
vtkCutter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:127
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_SORT_BY_VALUE
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:59
vtkPolyDataAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkCutter::SynchronizedTemplatesCutter3D
vtkSynchronizedTemplatesCutter3D * SynchronizedTemplatesCutter3D
Definition: vtkCutter.h:250
vtkX3D::range
Definition: vtkX3D.h:238
vtkGridSynchronizedTemplates3D
generate isosurface from structured grids
Definition: vtkGridSynchronizedTemplates3D.h:39
vtkCutter::SetSortByToSortByCell
void SetSortByToSortByCell()
Definition: vtkCutter.h:204
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCutter::GenerateCutScalars
vtkTypeBool GenerateCutScalars
Definition: vtkCutter.h:257
vtkCutter::SetSortByToSortByValue
void SetSortByToSortByValue()
Definition: vtkCutter.h:202
vtkPolyDataAlgorithm.h
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkRectilinearSynchronizedTemplates
generate isosurface from rectilinear grid
Definition: vtkRectilinearSynchronizedTemplates.h:44
vtkX3D::port
Definition: vtkX3D.h:447
vtkCutter::GenerateTriangles
vtkTypeBool GenerateTriangles
Definition: vtkCutter.h:247
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkCutter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkCutter.h:98
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkCutter::GetValues
void GetValues(double *contourValues)
Fill a supplied list with contour values.
Definition: vtkCutter.h:106
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkCutter::GetSortByAsString
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
Definition: vtkCutter.h:268
vtkContourValues.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
Definition: vtkX3D.h:376
vtkCutter::GridSynchronizedTemplates
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkCutter.h:251
vtkCutter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkCutter.h:120
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkCutter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkCutter.h:114
vtkCutter::SortBy
int SortBy
Definition: vtkCutter.h:255
vtkSynchronizedTemplates3D
generate isosurface from structured points
Definition: vtkSynchronizedTemplates3D.h:43
VTK_SORT_BY_CELL
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:60
vtkCutter::CutFunction
vtkImplicitFunction * CutFunction
Definition: vtkCutter.h:246
vtkCutter::SetValue
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition: vtkCutter.h:85
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44