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 =========================================================================*/
45 #ifndef vtkCutter_h
46 #define vtkCutter_h
47 
48 #include "vtkFiltersCoreModule.h" // For export macro
49 #include "vtkPolyDataAlgorithm.h"
50 
51 #include "vtkContourValues.h" // Needed for inline methods
52 
53 #define VTK_SORT_BY_VALUE 0
54 #define VTK_SORT_BY_CELL 1
55 
62 
63 class VTKFILTERSCORE_EXPORT vtkCutter : public vtkPolyDataAlgorithm
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
73  static vtkCutter *New();
74 
79  void SetValue(int i, double value)
80  {this->ContourValues->SetValue(i,value);}
81 
85  double GetValue(int i)
86  {return this->ContourValues->GetValue(i);}
87 
92  double *GetValues()
93  {return this->ContourValues->GetValues();}
94 
100  void GetValues(double *contourValues)
101  {this->ContourValues->GetValues(contourValues);}
102 
108  void SetNumberOfContours(int number)
109  {this->ContourValues->SetNumberOfContours(number);}
110 
115  {return this->ContourValues->GetNumberOfContours();}
116 
121  void GenerateValues(int numContours, double range[2])
122  {this->ContourValues->GenerateValues(numContours, range);}
123 
128  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
129  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
130 
135  vtkMTimeType GetMTime() override;
136 
138 
141  virtual void SetCutFunction(vtkImplicitFunction*);
142  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
144 
146 
151  vtkSetMacro(GenerateCutScalars,vtkTypeBool);
152  vtkGetMacro(GenerateCutScalars,vtkTypeBool);
153  vtkBooleanMacro(GenerateCutScalars,vtkTypeBool);
155 
157 
164  vtkSetMacro(GenerateTriangles,vtkTypeBool);
165  vtkGetMacro(GenerateTriangles,vtkTypeBool);
166  vtkBooleanMacro(GenerateTriangles,vtkTypeBool);
168 
170 
174  void SetLocator(vtkIncrementalPointLocator *locator);
175  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
177 
179 
194  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
195  vtkGetMacro(SortBy,int);
197  {this->SetSortBy(VTK_SORT_BY_VALUE);}
199  {this->SetSortBy(VTK_SORT_BY_CELL);}
200  const char *GetSortByAsString();
202 
207  void CreateDefaultLocator();
208 
214  static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
215 
217 
222  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
223  vtkGetMacro(OutputPointsPrecision, int);
225 
226 protected:
227  vtkCutter(vtkImplicitFunction *cf=nullptr);
228  ~vtkCutter() override;
229 
232  int FillInputPortInformation(int port, vtkInformation *info) override;
233  void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
234  void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
235  void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
238  void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
239  void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
242 
247 
249  int SortBy;
253 private:
254  vtkCutter(const vtkCutter&) = delete;
255  void operator=(const vtkCutter&) = delete;
256 };
257 
259 
262 inline const char *vtkCutter::GetSortByAsString(void)
263 {
264  if ( this->SortBy == VTK_SORT_BY_VALUE )
265  {
266  return "SortByValue";
267  }
268  else
269  {
270  return "SortByCell";
271  }
272 }
274 
275 #endif
vtkCutter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkCutter.h:85
vtkSynchronizedTemplatesCutter3D
generate cut surface from structured points
Definition: vtkSynchronizedTemplatesCutter3D.h:36
vtkCutter::ContourValues
vtkContourValues * ContourValues
Definition: vtkCutter.h:250
vtkCutter::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkCutter.h:252
vtkCutter::RectilinearSynchronizedTemplates
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkCutter.h:246
vtkCutter::GenerateValues
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:128
vtkCutter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkCutter.h:248
vtkCutter
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:63
vtkX3D::value
Definition: vtkX3D.h:220
vtkCutter::SynchronizedTemplates3D
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkCutter.h:243
vtkCutter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkCutter.h:121
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
VTK_SORT_BY_VALUE
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:53
vtkPolyDataAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkCutter::SynchronizedTemplatesCutter3D
vtkSynchronizedTemplatesCutter3D * SynchronizedTemplatesCutter3D
Definition: vtkCutter.h:244
vtkX3D::range
Definition: vtkX3D.h:238
vtkGridSynchronizedTemplates3D
generate isosurface from structured grids
Definition: vtkGridSynchronizedTemplates3D.h:39
vtkCutter::SetSortByToSortByCell
void SetSortByToSortByCell()
Definition: vtkCutter.h:198
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:251
vtkCutter::SetSortByToSortByValue
void SetSortByToSortByValue()
Definition: vtkCutter.h:196
vtkPolyDataAlgorithm.h
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkRectilinearSynchronizedTemplates
generate isosurface from rectilinear grid
Definition: vtkRectilinearSynchronizedTemplates.h:41
vtkX3D::port
Definition: vtkX3D.h:447
vtkCutter::GenerateTriangles
vtkTypeBool GenerateTriangles
Definition: vtkCutter.h:241
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:92
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:100
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:262
vtkContourValues.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkX3D::info
Definition: vtkX3D.h:376
vtkCutter::GridSynchronizedTemplates
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkCutter.h:245
vtkCutter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkCutter.h:114
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkCutter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkCutter.h:108
vtkCutter::SortBy
int SortBy
Definition: vtkCutter.h:249
vtkSynchronizedTemplates3D
generate isosurface from structured points
Definition: vtkSynchronizedTemplates3D.h:40
VTK_SORT_BY_CELL
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:54
vtkCutter::CutFunction
vtkImplicitFunction * CutFunction
Definition: vtkCutter.h:240
vtkCutter::SetValue
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition: vtkCutter.h:79
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:41