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
vtkContourFilter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkContourFilter.h:284
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:226
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
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:262
vtkX3D::range
Definition: vtkX3D.h:238
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkContourFilter.h:221
vtkContourFilter::GridSynchronizedTemplates
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkContourFilter.h:231
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:291
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:219
vtkContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkContourFilter.h:225
vtkPolyDataAlgorithm.h
vtkContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkContourFilter.h:223
vtkRectilinearSynchronizedTemplates
generate isosurface from rectilinear grid
Definition: vtkRectilinearSynchronizedTemplates.h:44
vtkContourFilter::GenerateTriangles
vtkTypeBool GenerateTriangles
Definition: vtkContourFilter.h:227
vtkX3D::port
Definition: vtkX3D.h:447
vtkContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkContourFilter.h:255
vtkContourFilter::RectilinearSynchronizedTemplates
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkContourFilter.h:232
vtkContourFilter::SynchronizedTemplates3D
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkContourFilter.h:230
vtkContourFilter::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkContourFilter.h:224
vtkContourFilter::SynchronizedTemplates2D
vtkSynchronizedTemplates2D * SynchronizedTemplates2D
Definition: vtkContourFilter.h:229
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:39
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:99
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
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:278
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkSynchronizedTemplates3D
generate isosurface from structured points
Definition: vtkSynchronizedTemplates3D.h:43
vtkContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkContourFilter.h:222
vtkContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkContourFilter.h:249
vtkContourFilter::InternalProgressCallbackCommand
vtkCallbackCommand * InternalProgressCallbackCommand
Definition: vtkContourFilter.h:233
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:220
vtkContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkContourFilter.h:70
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:44