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) VTK_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() VTK_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() VTK_OVERRIDE;
207 
208  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
209 
210  int RequestData(vtkInformation* request,
211  vtkInformationVector** inputVector,
212  vtkInformationVector* outputVector) VTK_OVERRIDE;
213  int RequestUpdateExtent(vtkInformation*,
215  vtkInformationVector*) VTK_OVERRIDE;
216  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
217 
218  vtkContourValues *ContourValues;
219  int ComputeNormals;
220  int ComputeGradients;
221  int ComputeScalars;
222  vtkIncrementalPointLocator *Locator;
223  int UseScalarTree;
224  vtkScalarTree *ScalarTree;
225  int OutputPointsPrecision;
226  int GenerateTriangles;
227 
228  vtkSynchronizedTemplates2D *SynchronizedTemplates2D;
229  vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
230  vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
231  vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
232  vtkCallbackCommand *InternalProgressCallbackCommand;
233 
234  static void InternalProgressCallbackFunction(vtkObject *caller,
235  unsigned long eid,
236  void *clientData,
237  void *callData);
238 
239 private:
240  vtkContourFilter(const vtkContourFilter&) VTK_DELETE_FUNCTION;
241  void operator=(const vtkContourFilter&) VTK_DELETE_FUNCTION;
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
Store vtkAlgorithm input/output information.
generate isosurface from structured grids
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.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
Detect and break reference loops.
generate isosurface from structured points
static vtkPolyDataAlgorithm * New()
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.
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:54
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
generate isosurface from rectilinear grid
double GetValue(int i)
Get the ith contour value.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.