VTK  9.3.1
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
42 #ifndef vtkContourFilter_h
43 #define vtkContourFilter_h
44 
45 #include "vtkFiltersCoreModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 #include "vtkContourValues.h" // Needed for inline methods
49 
50 VTK_ABI_NAMESPACE_BEGIN
51 
52 class vtkCallbackCommand;
54 class vtkContourGrid;
55 class vtkFlyingEdges2D;
56 class vtkFlyingEdges3D;
60 class vtkScalarTree;
63 
64 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
74  static vtkContourFilter* New();
75 
77 
80  void SetValue(int i, double value);
81  double GetValue(int i);
82  double* GetValues();
83  void GetValues(double* contourValues);
84  void SetNumberOfContours(int number);
85  int GetNumberOfContours();
86  void GenerateValues(int numContours, double range[2]);
87  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
89 
93  vtkMTimeType GetMTime() override;
94 
96 
106  vtkSetMacro(ComputeNormals, vtkTypeBool);
107  vtkGetMacro(ComputeNormals, vtkTypeBool);
108  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
110 
112 
120  vtkSetMacro(ComputeGradients, vtkTypeBool);
121  vtkGetMacro(ComputeGradients, vtkTypeBool);
122  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
124 
126 
129  vtkSetMacro(ComputeScalars, vtkTypeBool);
130  vtkGetMacro(ComputeScalars, vtkTypeBool);
131  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
133 
135 
139  vtkSetMacro(UseScalarTree, vtkTypeBool);
140  vtkGetMacro(UseScalarTree, vtkTypeBool);
141  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
143 
145 
148  virtual void SetScalarTree(vtkScalarTree*);
149  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
151 
153 
157  void SetLocator(vtkIncrementalPointLocator* locator);
158  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
160 
165  void CreateDefaultLocator();
166 
168 
172  vtkSetMacro(ArrayComponent, int);
173  vtkGetMacro(ArrayComponent, int);
175 
177 
184  vtkSetMacro(GenerateTriangles, vtkTypeBool);
185  vtkGetMacro(GenerateTriangles, vtkTypeBool);
186  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
188 
190 
195  vtkSetMacro(OutputPointsPrecision, int);
196  vtkGetMacro(OutputPointsPrecision, int);
198 
200 
208  vtkSetMacro(FastMode, bool);
209  vtkGetMacro(FastMode, bool);
210  vtkBooleanMacro(FastMode, bool);
212 
213 protected:
215  ~vtkContourFilter() override;
216 
217  void ReportReferences(vtkGarbageCollector*) override;
218 
219  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
220  vtkInformationVector* outputVector) override;
222  int FillInputPortInformation(int port, vtkInformation* info) override;
223 
234  bool FastMode;
235 
245 
246  static void InternalProgressCallbackFunction(
247  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
248 
249 private:
250  vtkContourFilter(const vtkContourFilter&) = delete;
251  void operator=(const vtkContourFilter&) = delete;
252 };
253 
258 inline void vtkContourFilter::SetValue(int i, double value)
259 {
260  this->ContourValues->SetValue(i, value);
261 }
262 
266 inline double vtkContourFilter::GetValue(int i)
267 {
268  return this->ContourValues->GetValue(i);
269 }
270 
276 {
277  return this->ContourValues->GetValues();
278 }
279 
285 inline void vtkContourFilter::GetValues(double* contourValues)
286 {
287  this->ContourValues->GetValues(contourValues);
288 }
289 
296 {
297  this->ContourValues->SetNumberOfContours(number);
298 }
299 
304 {
305  return this->ContourValues->GetNumberOfContours();
306 }
307 
312 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
313 {
314  this->ContourValues->GenerateValues(numContours, range);
315 }
316 
321 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
322 {
323  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
324 }
325 
326 VTK_ABI_NAMESPACE_END
327 #endif
generate isosurface from 3D image data (volume)
abstract base class for most VTK objects
Definition: vtkObject.h:51
generate isosurfaces/isolines from scalar values (specialized for unstructured grids) ...
vtkTypeBool UseScalarTree
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
generate isosurface from structured grids
vtkTypeBool ComputeNormals
vtkNew< vtkContourValues > ContourValues
void ReportReferences(vtkGarbageCollector *) override
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Abstract class in support of both point location and point insertion.
vtkNew< vtkCallbackCommand > InternalProgressCallbackCommand
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
double GetValue(int i)
Get the ith contour value.
Detect and break reference loops.
generate isosurface from structured points
vtkNew< vtkGridSynchronizedTemplates3D > GridSynchronizedTemplates
vtkNew< vtkContour3DLinearGrid > Contour3DLinearGrid
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void SetValue(int i, double value)
Methods to set / get contour values.
fast generation of isosurface from 3D linear cells
double * GetValues()
Return a pointer to a list of contour values.
supports function callbacks
Superclass for algorithms that produce only polydata as output.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
generate isosurfaces/isolines from scalar values
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkTypeBool ComputeScalars
int GetNumberOfContours()
Get the number of contours in the list of contour values.
generate isoline(s) from a structured points (image) dataset
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkScalarTree * ScalarTree
vtkNew< vtkFlyingEdges3D > FlyingEdges3D
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:43
vtkTypeBool GenerateTriangles
generate isosurface from rectilinear grid
vtkNew< vtkContourGrid > ContourGrid
double GetValue(int i)
Get the ith contour value.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool ComputeGradients
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
vtkNew< vtkSynchronizedTemplates2D > SynchronizedTemplates2D
vtkNew< vtkFlyingEdges2D > FlyingEdges2D
generate isoline(s) from a structured points set
void SetValue(int i, double value)
Set the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetValues()
Get a pointer to an array of contour values.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
vtkNew< vtkRectilinearSynchronizedTemplates > RectilinearSynchronizedTemplates
vtkNew< vtkSynchronizedTemplates3D > SynchronizedTemplates3D