VTK  9.0.1
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 =========================================================================*/
48 #ifndef vtkContourFilter_h
49 #define vtkContourFilter_h
50 
51 #include "vtkFiltersCoreModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 #include "vtkContourValues.h" // Needed for inline methods
55 
57 class vtkScalarTree;
62 class vtkCallbackCommand;
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  vtkIdType 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 
138  vtkSetMacro(UseScalarTree, vtkTypeBool);
139  vtkGetMacro(UseScalarTree, vtkTypeBool);
140  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
142 
144 
147  virtual void SetScalarTree(vtkScalarTree*);
148  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
150 
152 
156  void SetLocator(vtkIncrementalPointLocator* locator);
157  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
159 
164  void CreateDefaultLocator();
165 
167 
171  void SetArrayComponent(int);
172  int GetArrayComponent();
174 
176 
183  vtkSetMacro(GenerateTriangles, vtkTypeBool);
184  vtkGetMacro(GenerateTriangles, vtkTypeBool);
185  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
187 
189 
194  void SetOutputPointsPrecision(int precision);
195  int GetOutputPointsPrecision() const;
197 
198 protected:
200  ~vtkContourFilter() override;
201 
202  void ReportReferences(vtkGarbageCollector*) override;
203 
204  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
205  vtkInformationVector* outputVector) override;
207  int FillInputPortInformation(int port, vtkInformation* info) override;
208 
218 
224 
225  static void InternalProgressCallbackFunction(
226  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
227 
228 private:
229  vtkContourFilter(const vtkContourFilter&) = delete;
230  void operator=(const vtkContourFilter&) = delete;
231 };
232 
237 inline void vtkContourFilter::SetValue(int i, double value)
238 {
239  this->ContourValues->SetValue(i, value);
240 }
241 
245 inline double vtkContourFilter::GetValue(int i)
246 {
247  return this->ContourValues->GetValue(i);
248 }
249 
255 {
256  return this->ContourValues->GetValues();
257 }
258 
264 inline void vtkContourFilter::GetValues(double* contourValues)
265 {
266  this->ContourValues->GetValues(contourValues);
267 }
268 
275 {
276  this->ContourValues->SetNumberOfContours(number);
277 }
278 
283 {
284  return this->ContourValues->GetNumberOfContours();
285 }
286 
291 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
292 {
293  this->ContourValues->GenerateValues(numContours, range);
294 }
295 
300 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
301 {
302  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
303 }
304 
305 #endif
helper object to manage setting and generating contour values
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkContourValues * ContourValues
vtkTypeBool UseScalarTree
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
generate isosurface from structured grids
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool ComputeNormals
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.
vtkCallbackCommand * InternalProgressCallbackCommand
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:338
double GetValue(int i)
Get the ith contour value.
Detect and break reference loops.
generate isosurface from structured points
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void SetValue(int i, double value)
Methods to set / get contour values.
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:33
vtkTypeBool ComputeScalars
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkScalarTree * ScalarTree
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:54
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
vtkTypeBool GenerateTriangles
generate isosurface from rectilinear grid
vtkSynchronizedTemplates2D * SynchronizedTemplates2D
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
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
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.