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 =========================================================================*/
54 #ifndef vtkContourFilter_h
55 #define vtkContourFilter_h
56 
57 #include "vtkFiltersCoreModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59 
60 #include "vtkContourValues.h" // Needed for inline methods
61 
63 class vtkScalarTree;
68 class vtkCallbackCommand;
69 
70 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
71 {
72 public:
74  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
80  static vtkContourFilter *New();
81 
83 
86  void SetValue(int i, double value);
87  double GetValue(int i);
88  double *GetValues();
89  void GetValues(double *contourValues);
90  void SetNumberOfContours(int number);
91  int GetNumberOfContours();
92  void GenerateValues(int numContours, double range[2]);
93  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
95 
99  vtkMTimeType GetMTime() override;
100 
102 
112  vtkSetMacro(ComputeNormals,vtkTypeBool);
113  vtkGetMacro(ComputeNormals,vtkTypeBool);
114  vtkBooleanMacro(ComputeNormals,vtkTypeBool);
116 
118 
126  vtkSetMacro(ComputeGradients,vtkTypeBool);
127  vtkGetMacro(ComputeGradients,vtkTypeBool);
128  vtkBooleanMacro(ComputeGradients,vtkTypeBool);
130 
132 
135  vtkSetMacro(ComputeScalars,vtkTypeBool);
136  vtkGetMacro(ComputeScalars,vtkTypeBool);
137  vtkBooleanMacro(ComputeScalars,vtkTypeBool);
139 
141 
144  vtkSetMacro(UseScalarTree,vtkTypeBool);
145  vtkGetMacro(UseScalarTree,vtkTypeBool);
146  vtkBooleanMacro(UseScalarTree,vtkTypeBool);
148 
150 
153  virtual void SetScalarTree(vtkScalarTree*);
154  vtkGetObjectMacro(ScalarTree,vtkScalarTree);
156 
158 
162  void SetLocator(vtkIncrementalPointLocator *locator);
163  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
165 
170  void CreateDefaultLocator();
171 
173 
177  void SetArrayComponent( int );
178  int GetArrayComponent();
180 
181 
183 
190  vtkSetMacro(GenerateTriangles,vtkTypeBool);
191  vtkGetMacro(GenerateTriangles,vtkTypeBool);
192  vtkBooleanMacro(GenerateTriangles,vtkTypeBool);
194 
196 
201  void SetOutputPointsPrecision(int precision);
202  int GetOutputPointsPrecision() const;
204 
205 protected:
207  ~vtkContourFilter() override;
208 
209  void ReportReferences(vtkGarbageCollector*) override;
210 
211  int RequestData(vtkInformation* request,
212  vtkInformationVector** inputVector,
213  vtkInformationVector* outputVector) override;
216  vtkInformationVector*) override;
217  int FillInputPortInformation(int port, vtkInformation *info) override;
218 
228 
234 
235  static void InternalProgressCallbackFunction(vtkObject *caller,
236  unsigned long eid,
237  void *clientData,
238  void *callData);
239 
240 private:
241  vtkContourFilter(const vtkContourFilter&) = delete;
242  void operator=(const vtkContourFilter&) = delete;
243 };
244 
249 inline void vtkContourFilter::SetValue(int i, double value)
250 {this->ContourValues->SetValue(i,value);}
251 
255 inline double vtkContourFilter::GetValue(int i)
256 {return this->ContourValues->GetValue(i);}
257 
263 {return this->ContourValues->GetValues();}
264 
270 inline void vtkContourFilter::GetValues(double *contourValues)
271 {this->ContourValues->GetValues(contourValues);}
272 
279 {this->ContourValues->SetNumberOfContours(number);}
280 
285 {return this->ContourValues->GetNumberOfContours();}
286 
291 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
292 {this->ContourValues->GenerateValues(numContours, range);}
293 
298 inline void vtkContourFilter::GenerateValues(int numContours, double
299  rangeStart, double rangeEnd)
300 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
301 
302 
303 #endif
helper object to manage setting and generating contour values
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkContourValues * ContourValues
vtkTypeBool UseScalarTree
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
generate isosurface from structured grids
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
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.
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
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
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.
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
generate isoline(s) from a structured points set
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.