VTK  9.2.6
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 =========================================================================*/
60 #ifndef vtkContourFilter_h
61 #define vtkContourFilter_h
62 
63 #include "vtkFiltersCoreModule.h" // For export macro
64 #include "vtkPolyDataAlgorithm.h"
65 
66 #include "vtkContourValues.h" // Needed for inline methods
67 
69 class vtkScalarTree;
74 class vtkCallbackCommand;
75 
76 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
77 {
78 public:
80  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
86  static vtkContourFilter* New();
87 
89 
92  void SetValue(int i, double value);
93  double GetValue(int i);
94  double* GetValues();
95  void GetValues(double* contourValues);
96  void SetNumberOfContours(int number);
97  vtkIdType GetNumberOfContours();
98  void GenerateValues(int numContours, double range[2]);
99  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
101 
105  vtkMTimeType GetMTime() override;
106 
108 
118  vtkSetMacro(ComputeNormals, vtkTypeBool);
119  vtkGetMacro(ComputeNormals, vtkTypeBool);
120  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
122 
124 
132  vtkSetMacro(ComputeGradients, vtkTypeBool);
133  vtkGetMacro(ComputeGradients, vtkTypeBool);
134  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
136 
138 
141  vtkSetMacro(ComputeScalars, vtkTypeBool);
142  vtkGetMacro(ComputeScalars, vtkTypeBool);
143  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
145 
147 
151  vtkSetMacro(UseScalarTree, vtkTypeBool);
152  vtkGetMacro(UseScalarTree, vtkTypeBool);
153  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
155 
157 
160  virtual void SetScalarTree(vtkScalarTree*);
161  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
163 
165 
169  void SetLocator(vtkIncrementalPointLocator* locator);
170  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
172 
177  void CreateDefaultLocator();
178 
180 
184  void SetArrayComponent(int);
185  int GetArrayComponent();
187 
189 
196  vtkSetMacro(GenerateTriangles, vtkTypeBool);
197  vtkGetMacro(GenerateTriangles, vtkTypeBool);
198  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
200 
202 
207  void SetOutputPointsPrecision(int precision);
208  int GetOutputPointsPrecision() const;
210 
211 protected:
213  ~vtkContourFilter() override;
214 
215  void ReportReferences(vtkGarbageCollector*) override;
216 
217  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
218  vtkInformationVector* outputVector) override;
220  int FillInputPortInformation(int port, vtkInformation* info) override;
221 
231 
237 
238  static void InternalProgressCallbackFunction(
239  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
240 
241 private:
242  vtkContourFilter(const vtkContourFilter&) = delete;
243  void operator=(const vtkContourFilter&) = delete;
244 };
245 
250 inline void vtkContourFilter::SetValue(int i, double value)
251 {
252  this->ContourValues->SetValue(i, value);
253 }
254 
258 inline double vtkContourFilter::GetValue(int i)
259 {
260  return this->ContourValues->GetValue(i);
261 }
262 
268 {
269  return this->ContourValues->GetValues();
270 }
271 
277 inline void vtkContourFilter::GetValues(double* contourValues)
278 {
279  this->ContourValues->GetValues(contourValues);
280 }
281 
288 {
289  this->ContourValues->SetNumberOfContours(number);
290 }
291 
296 {
297  return this->ContourValues->GetNumberOfContours();
298 }
299 
304 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
305 {
306  this->ContourValues->GenerateValues(numContours, range);
307 }
308 
313 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
314 {
315  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
316 }
317 
318 #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:287
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:332
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:39
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.