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 =========================================================================*/
47 #ifndef vtkContourFilter_h
48 #define vtkContourFilter_h
49 
50 #include "vtkFiltersCoreModule.h" // For export macro
51 #include "vtkPolyDataAlgorithm.h"
52 
53 #include "vtkContourValues.h" // Needed for inline methods
54 
56 class vtkScalarTree;
61 class vtkCallbackCommand;
62 
63 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
68 
73  static vtkContourFilter *New();
74 
76 
79  void SetValue(int i, double value);
80  double GetValue(int i);
81  double *GetValues();
82  void GetValues(double *contourValues);
83  void SetNumberOfContours(int number);
84  int GetNumberOfContours();
85  void GenerateValues(int numContours, double range[2]);
86  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
88 
92  vtkMTimeType GetMTime() VTK_OVERRIDE;
93 
95 
105  vtkSetMacro(ComputeNormals,int);
106  vtkGetMacro(ComputeNormals,int);
107  vtkBooleanMacro(ComputeNormals,int);
109 
111 
119  vtkSetMacro(ComputeGradients,int);
120  vtkGetMacro(ComputeGradients,int);
121  vtkBooleanMacro(ComputeGradients,int);
123 
125 
128  vtkSetMacro(ComputeScalars,int);
129  vtkGetMacro(ComputeScalars,int);
130  vtkBooleanMacro(ComputeScalars,int);
132 
134 
137  vtkSetMacro(UseScalarTree,int);
138  vtkGetMacro(UseScalarTree,int);
139  vtkBooleanMacro(UseScalarTree,int);
141 
143 
146  virtual void SetScalarTree(vtkScalarTree*);
147  vtkGetObjectMacro(ScalarTree,vtkScalarTree);
149 
151 
155  void SetLocator(vtkIncrementalPointLocator *locator);
156  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
158 
163  void CreateDefaultLocator();
164 
166 
170  void SetArrayComponent( int );
171  int GetArrayComponent();
173 
174 
176 
183  vtkSetMacro(GenerateTriangles,int);
184  vtkGetMacro(GenerateTriangles,int);
185  vtkBooleanMacro(GenerateTriangles,int);
187 
189 
194  void SetOutputPointsPrecision(int precision);
195  int GetOutputPointsPrecision() const;
197 
198 protected:
200  ~vtkContourFilter() VTK_OVERRIDE;
201 
202  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
203 
204  int RequestData(vtkInformation* request,
205  vtkInformationVector** inputVector,
206  vtkInformationVector* outputVector) VTK_OVERRIDE;
207  int RequestUpdateExtent(vtkInformation*,
209  vtkInformationVector*) VTK_OVERRIDE;
210  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
211 
212  vtkContourValues *ContourValues;
213  int ComputeNormals;
214  int ComputeGradients;
215  int ComputeScalars;
217  int UseScalarTree;
218  vtkScalarTree *ScalarTree;
219  int OutputPointsPrecision;
220  int GenerateTriangles;
221 
222  vtkSynchronizedTemplates2D *SynchronizedTemplates2D;
223  vtkSynchronizedTemplates3D *SynchronizedTemplates3D;
224  vtkGridSynchronizedTemplates3D *GridSynchronizedTemplates;
225  vtkRectilinearSynchronizedTemplates *RectilinearSynchronizedTemplates;
226  vtkCallbackCommand *InternalProgressCallbackCommand;
227 
228  static void InternalProgressCallbackFunction(vtkObject *caller,
229  unsigned long eid,
230  void *clientData,
231  void *callData);
232 
233 private:
234  vtkContourFilter(const vtkContourFilter&) VTK_DELETE_FUNCTION;
235  void operator=(const vtkContourFilter&) VTK_DELETE_FUNCTION;
236 };
237 
242 inline void vtkContourFilter::SetValue(int i, double value)
243 {this->ContourValues->SetValue(i,value);}
244 
248 inline double vtkContourFilter::GetValue(int i)
249 {return this->ContourValues->GetValue(i);}
250 
256 {return this->ContourValues->GetValues();}
257 
263 inline void vtkContourFilter::GetValues(double *contourValues)
264 {this->ContourValues->GetValues(contourValues);}
265 
272 {this->ContourValues->SetNumberOfContours(number);}
273 
278 {return this->ContourValues->GetNumberOfContours();}
279 
284 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
285 {this->ContourValues->GenerateValues(numContours, range);}
286 
291 inline void vtkContourFilter::GenerateValues(int numContours, double
292  rangeStart, double rangeEnd)
293 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
294 
295 
296 #endif
297 
298 
helper object to manage setting and generating contour values
abstract base class for most VTK objects
Definition: vtkObject.h:53
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
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.
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:33
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.