VTK  9.3.0
vtkContourFilter.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
51 #ifndef vtkContourFilter_h
52 #define vtkContourFilter_h
53 
54 #include "vtkFiltersCoreModule.h" // For export macro
55 #include "vtkPolyDataAlgorithm.h"
56 
57 #include "vtkContourValues.h" // Needed for inline methods
58 
59 VTK_ABI_NAMESPACE_BEGIN
60 
61 class vtkCallbackCommand;
63 class vtkContourGrid;
64 class vtkFlyingEdges2D;
65 class vtkFlyingEdges3D;
69 class vtkScalarTree;
72 
73 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
74 {
75 public:
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
83  static vtkContourFilter* New();
84 
86 
89  void SetValue(int i, double value);
90  double GetValue(int i);
91  double* GetValues();
92  void GetValues(double* contourValues);
93  void SetNumberOfContours(int number);
94  vtkIdType GetNumberOfContours();
95  void GenerateValues(int numContours, double range[2]);
96  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
98 
102  vtkMTimeType GetMTime() override;
103 
105 
115  vtkSetMacro(ComputeNormals, vtkTypeBool);
116  vtkGetMacro(ComputeNormals, vtkTypeBool);
117  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
119 
121 
129  vtkSetMacro(ComputeGradients, vtkTypeBool);
130  vtkGetMacro(ComputeGradients, vtkTypeBool);
131  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
133 
135 
138  vtkSetMacro(ComputeScalars, vtkTypeBool);
139  vtkGetMacro(ComputeScalars, vtkTypeBool);
140  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
142 
144 
148  vtkSetMacro(UseScalarTree, vtkTypeBool);
149  vtkGetMacro(UseScalarTree, vtkTypeBool);
150  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
152 
154 
157  virtual void SetScalarTree(vtkScalarTree*);
158  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
160 
162 
167  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
169 
175 
177 
181  vtkSetMacro(ArrayComponent, int);
182  vtkGetMacro(ArrayComponent, int);
184 
186 
193  vtkSetMacro(GenerateTriangles, vtkTypeBool);
194  vtkGetMacro(GenerateTriangles, vtkTypeBool);
195  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
197 
199 
204  vtkSetMacro(OutputPointsPrecision, int);
205  vtkGetMacro(OutputPointsPrecision, int);
207 
209 
217  vtkSetMacro(FastMode, bool);
218  vtkGetMacro(FastMode, bool);
219  vtkBooleanMacro(FastMode, bool);
221 
222 protected:
224  ~vtkContourFilter() override;
225 
227 
228  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
229  vtkInformationVector* outputVector) override;
232 
243  bool FastMode;
244 
254 
256  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
257 
258 private:
259  vtkContourFilter(const vtkContourFilter&) = delete;
260  void operator=(const vtkContourFilter&) = delete;
261 };
262 
267 inline void vtkContourFilter::SetValue(int i, double value)
268 {
269  this->ContourValues->SetValue(i, value);
270 }
271 
275 inline double vtkContourFilter::GetValue(int i)
276 {
277  return this->ContourValues->GetValue(i);
278 }
279 
285 {
286  return this->ContourValues->GetValues();
287 }
288 
294 inline void vtkContourFilter::GetValues(double* contourValues)
295 {
296  this->ContourValues->GetValues(contourValues);
297 }
298 
305 {
306  this->ContourValues->SetNumberOfContours(number);
307 }
308 
313 {
314  return this->ContourValues->GetNumberOfContours();
315 }
316 
321 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
322 {
323  this->ContourValues->GenerateValues(numContours, range);
324 }
325 
330 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
331 {
332  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
333 }
334 
335 VTK_ABI_NAMESPACE_END
336 #endif
supports function callbacks
fast generation of isosurface from 3D linear cells
generate isosurfaces/isolines from scalar values
vtkNew< vtkContourValues > ContourValues
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkTypeBool ComputeNormals
void ReportReferences(vtkGarbageCollector *) override
double GetValue(int i)
Get the ith contour value.
vtkTypeBool UseScalarTree
vtkNew< vtkRectilinearSynchronizedTemplates > RectilinearSynchronizedTemplates
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkNew< vtkSynchronizedTemplates3D > SynchronizedTemplates3D
vtkNew< vtkGridSynchronizedTemplates3D > GridSynchronizedTemplates
vtkNew< vtkFlyingEdges3D > FlyingEdges3D
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
vtkNew< vtkCallbackCommand > InternalProgressCallbackCommand
vtkTypeBool ComputeScalars
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void CreateDefaultLocator()
Create default locator.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkTypeBool ComputeGradients
vtkIncrementalPointLocator * Locator
void SetValue(int i, double value)
Methods to set / get contour values.
virtual void SetScalarTree(vtkScalarTree *)
Enable the use of a scalar tree to accelerate contour extraction.
vtkNew< vtkSynchronizedTemplates2D > SynchronizedTemplates2D
static vtkContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkContourFilter() override
static void InternalProgressCallbackFunction(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
vtkTypeBool GenerateTriangles
vtkScalarTree * ScalarTree
double * GetValues()
Get a pointer to an array of contour values.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkNew< vtkContour3DLinearGrid > Contour3DLinearGrid
vtkNew< vtkFlyingEdges2D > FlyingEdges2D
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkNew< vtkContourGrid > ContourGrid
generate isosurfaces/isolines from scalar values (specialized for unstructured grids)
int GetNumberOfContours()
Return the number of contours in the.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
double * GetValues()
Return a pointer to a list of contour values.
generate isoline(s) from a structured points (image) dataset
generate isosurface from 3D image data (volume)
Detect and break reference loops.
generate isosurface from structured grids
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:61
Superclass for algorithms that produce only polydata as output.
generate isosurface from rectilinear grid
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:44
generate isoline(s) from a structured points set
generate isosurface from structured points
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270