VTK
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 =========================================================================*/
53 #ifndef vtkContourFilter_h
54 #define vtkContourFilter_h
55 
56 #include "vtkFiltersCoreModule.h" // For export macro
57 #include "vtkPolyDataAlgorithm.h"
58 
59 #include "vtkContourValues.h" // Needed for inline methods
60 
62 class vtkScalarTree;
67 class vtkCallbackCommand;
68 
69 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
79  static vtkContourFilter *New();
80 
82 
85  void SetValue(int i, double value);
86  double GetValue(int i);
87  double *GetValues();
88  void GetValues(double *contourValues);
89  void SetNumberOfContours(int number);
90  int GetNumberOfContours();
91  void GenerateValues(int numContours, double range[2]);
92  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
94 
98  vtkMTimeType GetMTime() override;
99 
101 
111  vtkSetMacro(ComputeNormals,int);
112  vtkGetMacro(ComputeNormals,int);
113  vtkBooleanMacro(ComputeNormals,int);
115 
117 
125  vtkSetMacro(ComputeGradients,int);
126  vtkGetMacro(ComputeGradients,int);
127  vtkBooleanMacro(ComputeGradients,int);
129 
131 
134  vtkSetMacro(ComputeScalars,int);
135  vtkGetMacro(ComputeScalars,int);
136  vtkBooleanMacro(ComputeScalars,int);
138 
140 
143  vtkSetMacro(UseScalarTree,int);
144  vtkGetMacro(UseScalarTree,int);
145  vtkBooleanMacro(UseScalarTree,int);
147 
149 
152  virtual void SetScalarTree(vtkScalarTree*);
153  vtkGetObjectMacro(ScalarTree,vtkScalarTree);
155 
157 
161  void SetLocator(vtkIncrementalPointLocator *locator);
162  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
164 
169  void CreateDefaultLocator();
170 
172 
176  void SetArrayComponent( int );
177  int GetArrayComponent();
179 
180 
182 
189  vtkSetMacro(GenerateTriangles,int);
190  vtkGetMacro(GenerateTriangles,int);
191  vtkBooleanMacro(GenerateTriangles,int);
193 
195 
200  void SetOutputPointsPrecision(int precision);
201  int GetOutputPointsPrecision() const;
203 
204 protected:
206  ~vtkContourFilter() override;
207 
208  void ReportReferences(vtkGarbageCollector*) override;
209 
210  int RequestData(vtkInformation* request,
211  vtkInformationVector** inputVector,
212  vtkInformationVector* outputVector) override;
215  vtkInformationVector*) override;
216  int FillInputPortInformation(int port, vtkInformation *info) override;
217 
227 
233 
234  static void InternalProgressCallbackFunction(vtkObject *caller,
235  unsigned long eid,
236  void *clientData,
237  void *callData);
238 
239 private:
240  vtkContourFilter(const vtkContourFilter&) = delete;
241  void operator=(const vtkContourFilter&) = delete;
242 };
243 
248 inline void vtkContourFilter::SetValue(int i, double value)
249 {this->ContourValues->SetValue(i,value);}
250 
254 inline double vtkContourFilter::GetValue(int i)
255 {return this->ContourValues->GetValue(i);}
256 
262 {return this->ContourValues->GetValues();}
263 
269 inline void vtkContourFilter::GetValues(double *contourValues)
270 {this->ContourValues->GetValues(contourValues);}
271 
278 {this->ContourValues->SetNumberOfContours(number);}
279 
284 {return this->ContourValues->GetNumberOfContours();}
285 
290 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
291 {this->ContourValues->GenerateValues(numContours, range);}
292 
297 inline void vtkContourFilter::GenerateValues(int numContours, double
298  rangeStart, double rangeEnd)
299 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
300 
301 
302 #endif
303 
304 
helper object to manage setting and generating contour values
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkContourValues * ContourValues
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
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.
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.
double GetValue(int i)
Get the ith contour value.
Detect and break reference loops.
generate isosurface from structured points
static vtkPolyDataAlgorithm * New()
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
int GetNumberOfContours()
Get the number of contours in the list of contour values.
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
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
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.