VTK  9.2.20230320
vtkContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContourFilter.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 =========================================================================*/
163 #ifndef vtkContourFilter_h
164 #define vtkContourFilter_h
165 
166 #include "vtkFiltersCoreModule.h" // For export macro
167 #include "vtkPolyDataAlgorithm.h"
168 
169 #include "vtkContourValues.h" // Needed for inline methods
170 
171 VTK_ABI_NAMESPACE_BEGIN
172 
173 class vtkCallbackCommand;
175 class vtkContourGrid;
176 class vtkFlyingEdges2D;
177 class vtkFlyingEdges3D;
181 class vtkScalarTree;
184 
185 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
186 {
187 public:
189  void PrintSelf(ostream& os, vtkIndent indent) override;
190 
196 
198 
201  void SetValue(int i, double value);
202  double GetValue(int i);
203  double* GetValues();
204  void GetValues(double* contourValues);
205  void SetNumberOfContours(int number);
206  vtkIdType GetNumberOfContours();
207  void GenerateValues(int numContours, double range[2]);
208  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
210 
214  vtkMTimeType GetMTime() override;
215 
217 
227  vtkSetMacro(ComputeNormals, vtkTypeBool);
228  vtkGetMacro(ComputeNormals, vtkTypeBool);
229  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
231 
233 
241  vtkSetMacro(ComputeGradients, vtkTypeBool);
242  vtkGetMacro(ComputeGradients, vtkTypeBool);
243  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
245 
247 
250  vtkSetMacro(ComputeScalars, vtkTypeBool);
251  vtkGetMacro(ComputeScalars, vtkTypeBool);
252  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
254 
256 
260  vtkSetMacro(UseScalarTree, vtkTypeBool);
261  vtkGetMacro(UseScalarTree, vtkTypeBool);
262  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
264 
266 
269  virtual void SetScalarTree(vtkScalarTree*);
270  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
272 
274 
279  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
281 
287 
289 
293  vtkSetMacro(ArrayComponent, int);
294  vtkGetMacro(ArrayComponent, int);
296 
298 
305  vtkSetMacro(GenerateTriangles, vtkTypeBool);
306  vtkGetMacro(GenerateTriangles, vtkTypeBool);
307  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
309 
311 
316  vtkSetMacro(OutputPointsPrecision, int);
317  vtkGetMacro(OutputPointsPrecision, int);
319 
321 
329  vtkSetMacro(FastMode, bool);
330  vtkGetMacro(FastMode, bool);
331  vtkBooleanMacro(FastMode, bool);
333 
334 protected:
336  ~vtkContourFilter() override;
337 
339 
340  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
341  vtkInformationVector* outputVector) override;
344 
355  bool FastMode;
356 
366 
368  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
369 
370 private:
371  vtkContourFilter(const vtkContourFilter&) = delete;
372  void operator=(const vtkContourFilter&) = delete;
373 };
374 
379 inline void vtkContourFilter::SetValue(int i, double value)
380 {
381  this->ContourValues->SetValue(i, value);
382 }
383 
387 inline double vtkContourFilter::GetValue(int i)
388 {
389  return this->ContourValues->GetValue(i);
390 }
391 
397 {
398  return this->ContourValues->GetValues();
399 }
400 
406 inline void vtkContourFilter::GetValues(double* contourValues)
407 {
408  this->ContourValues->GetValues(contourValues);
409 }
410 
417 {
418  this->ContourValues->SetNumberOfContours(number);
419 }
420 
425 {
426  return this->ContourValues->GetNumberOfContours();
427 }
428 
433 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
434 {
435  this->ContourValues->GenerateValues(numContours, range);
436 }
437 
442 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
443 {
444  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
445 }
446 
447 VTK_ABI_NAMESPACE_END
448 #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 GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
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:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:83
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:56
generate isoline(s) from a structured points set
generate isosurface from structured points
@ info
Definition: vtkX3D.h:388
@ value
Definition: vtkX3D.h:232
@ port
Definition: vtkX3D.h:459
@ range
Definition: vtkX3D.h:250
int vtkTypeBool
Definition: vtkABI.h:71
int vtkIdType
Definition: vtkType.h:327
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:282