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 =========================================================================*/
48 #ifndef vtkContourFilter_h
49 #define vtkContourFilter_h
50 
51 #include "vtkFiltersCoreModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 #include "vtkContourValues.h" // Needed for inline methods
55 
57 class vtkScalarTree;
62 class vtkCallbackCommand;
63 
64 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
74  static vtkContourFilter *New();
75 
77 
80  void SetValue(int i, double value);
81  double GetValue(int i);
82  double *GetValues();
83  void GetValues(double *contourValues);
84  void SetNumberOfContours(int number);
85  int GetNumberOfContours();
86  void GenerateValues(int numContours, double range[2]);
87  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
89 
93  vtkMTimeType GetMTime() override;
94 
96 
106  vtkSetMacro(ComputeNormals,vtkTypeBool);
107  vtkGetMacro(ComputeNormals,vtkTypeBool);
108  vtkBooleanMacro(ComputeNormals,vtkTypeBool);
110 
112 
120  vtkSetMacro(ComputeGradients,vtkTypeBool);
121  vtkGetMacro(ComputeGradients,vtkTypeBool);
122  vtkBooleanMacro(ComputeGradients,vtkTypeBool);
124 
126 
129  vtkSetMacro(ComputeScalars,vtkTypeBool);
130  vtkGetMacro(ComputeScalars,vtkTypeBool);
131  vtkBooleanMacro(ComputeScalars,vtkTypeBool);
133 
135 
138  vtkSetMacro(UseScalarTree,vtkTypeBool);
139  vtkGetMacro(UseScalarTree,vtkTypeBool);
140  vtkBooleanMacro(UseScalarTree,vtkTypeBool);
142 
144 
147  virtual void SetScalarTree(vtkScalarTree*);
148  vtkGetObjectMacro(ScalarTree,vtkScalarTree);
150 
152 
156  void SetLocator(vtkIncrementalPointLocator *locator);
157  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
159 
164  void CreateDefaultLocator();
165 
167 
171  void SetArrayComponent( int );
172  int GetArrayComponent();
174 
175 
177 
184  vtkSetMacro(GenerateTriangles,vtkTypeBool);
185  vtkGetMacro(GenerateTriangles,vtkTypeBool);
186  vtkBooleanMacro(GenerateTriangles,vtkTypeBool);
188 
190 
195  void SetOutputPointsPrecision(int precision);
196  int GetOutputPointsPrecision() const;
198 
199 protected:
201  ~vtkContourFilter() override;
202 
203  void ReportReferences(vtkGarbageCollector*) override;
204 
205  int RequestData(vtkInformation* request,
206  vtkInformationVector** inputVector,
207  vtkInformationVector* outputVector) override;
210  vtkInformationVector*) override;
211  int FillInputPortInformation(int port, vtkInformation *info) override;
212 
222 
228 
229  static void InternalProgressCallbackFunction(vtkObject *caller,
230  unsigned long eid,
231  void *clientData,
232  void *callData);
233 
234 private:
235  vtkContourFilter(const vtkContourFilter&) = delete;
236  void operator=(const vtkContourFilter&) = delete;
237 };
238 
243 inline void vtkContourFilter::SetValue(int i, double value)
244 {this->ContourValues->SetValue(i,value);}
245 
249 inline double vtkContourFilter::GetValue(int i)
250 {return this->ContourValues->GetValue(i);}
251 
257 {return this->ContourValues->GetValues();}
258 
264 inline void vtkContourFilter::GetValues(double *contourValues)
265 {this->ContourValues->GetValues(contourValues);}
266 
273 {this->ContourValues->SetNumberOfContours(number);}
274 
279 {return this->ContourValues->GetNumberOfContours();}
280 
285 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
286 {this->ContourValues->GenerateValues(numContours, range);}
287 
292 inline void vtkContourFilter::GenerateValues(int numContours, double
293  rangeStart, double rangeEnd)
294 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
295 
296 
297 #endif
vtkContourFilter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkContourFilter.h:278
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkX3D::value
Definition: vtkX3D.h:220
vtkContourFilter::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkContourFilter.h:220
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPolyDataAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkContourFilter.h:256
vtkX3D::range
Definition: vtkX3D.h:238
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkContourFilter.h:215
vtkContourFilter::GridSynchronizedTemplates
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkContourFilter.h:225
vtkSynchronizedTemplates2D
generate isoline(s) from a structured points set
Definition: vtkSynchronizedTemplates2D.h:41
vtkGridSynchronizedTemplates3D
generate isosurface from structured grids
Definition: vtkGridSynchronizedTemplates3D.h:39
vtkContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkContourFilter.h:285
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkContourFilter.h:213
vtkContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkContourFilter.h:219
vtkPolyDataAlgorithm.h
vtkContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkContourFilter.h:217
vtkRectilinearSynchronizedTemplates
generate isosurface from rectilinear grid
Definition: vtkRectilinearSynchronizedTemplates.h:41
vtkContourFilter::GenerateTriangles
vtkTypeBool GenerateTriangles
Definition: vtkContourFilter.h:221
vtkX3D::port
Definition: vtkX3D.h:447
vtkContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkContourFilter.h:249
vtkContourFilter::RectilinearSynchronizedTemplates
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkContourFilter.h:226
vtkContourFilter::SynchronizedTemplates3D
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkContourFilter.h:224
vtkContourFilter::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkContourFilter.h:218
vtkContourFilter::SynchronizedTemplates2D
vtkSynchronizedTemplates2D * SynchronizedTemplates2D
Definition: vtkContourFilter.h:223
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:96
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkX3D::info
Definition: vtkX3D.h:376
vtkAlgorithm::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkContourFilter.h:272
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkSynchronizedTemplates3D
generate isosurface from structured points
Definition: vtkSynchronizedTemplates3D.h:40
vtkContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkContourFilter.h:216
vtkContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkContourFilter.h:243
vtkContourFilter::InternalProgressCallbackCommand
vtkCallbackCommand * InternalProgressCallbackCommand
Definition: vtkContourFilter.h:227
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:54
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkContourFilter::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkContourFilter.h:214
vtkContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkContourFilter.h:64
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41