VTK  9.1.0
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 =========================================================================*/
163 #ifndef vtkContourFilter_h
164 #define vtkContourFilter_h
165 
166 #include "vtkFiltersCoreModule.h" // For export macro
167 #include "vtkPolyDataAlgorithm.h"
168 
169 #include "vtkContourValues.h" // Needed for inline methods
170 
172 class vtkScalarTree;
177 class vtkCallbackCommand;
178 
179 class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
180 {
181 public:
183  void PrintSelf(ostream& os, vtkIndent indent) override;
184 
190 
192 
195  void SetValue(int i, double value);
196  double GetValue(int i);
197  double* GetValues();
198  void GetValues(double* contourValues);
199  void SetNumberOfContours(int number);
200  vtkIdType GetNumberOfContours();
201  void GenerateValues(int numContours, double range[2]);
202  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
204 
208  vtkMTimeType GetMTime() override;
209 
211 
221  vtkSetMacro(ComputeNormals, vtkTypeBool);
222  vtkGetMacro(ComputeNormals, vtkTypeBool);
223  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
225 
227 
235  vtkSetMacro(ComputeGradients, vtkTypeBool);
236  vtkGetMacro(ComputeGradients, vtkTypeBool);
237  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
239 
241 
244  vtkSetMacro(ComputeScalars, vtkTypeBool);
245  vtkGetMacro(ComputeScalars, vtkTypeBool);
246  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
248 
250 
254  vtkSetMacro(UseScalarTree, vtkTypeBool);
255  vtkGetMacro(UseScalarTree, vtkTypeBool);
256  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
258 
260 
263  virtual void SetScalarTree(vtkScalarTree*);
264  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
266 
268 
273  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
275 
281 
283 
287  void SetArrayComponent(int);
290 
292 
299  vtkSetMacro(GenerateTriangles, vtkTypeBool);
300  vtkGetMacro(GenerateTriangles, vtkTypeBool);
301  vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
303 
305 
310  void SetOutputPointsPrecision(int precision);
313 
314 protected:
316  ~vtkContourFilter() override;
317 
319 
320  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
321  vtkInformationVector* outputVector) override;
324 
334 
340 
342  vtkObject* caller, unsigned long eid, void* clientData, void* callData);
343 
344 private:
345  vtkContourFilter(const vtkContourFilter&) = delete;
346  void operator=(const vtkContourFilter&) = delete;
347 };
348 
353 inline void vtkContourFilter::SetValue(int i, double value)
354 {
355  this->ContourValues->SetValue(i, value);
356 }
357 
361 inline double vtkContourFilter::GetValue(int i)
362 {
363  return this->ContourValues->GetValue(i);
364 }
365 
371 {
372  return this->ContourValues->GetValues();
373 }
374 
380 inline void vtkContourFilter::GetValues(double* contourValues)
381 {
382  this->ContourValues->GetValues(contourValues);
383 }
384 
391 {
392  this->ContourValues->SetNumberOfContours(number);
393 }
394 
399 {
400  return this->ContourValues->GetNumberOfContours();
401 }
402 
407 inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
408 {
409  this->ContourValues->GenerateValues(numContours, range);
410 }
411 
416 inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
417 {
418  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
419 }
420 
421 #endif
vtkContourFilter::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkContourFilter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkContourFilter::GetArrayComponent
int GetArrayComponent()
Set/get which component of the scalar array to contour on; defaults to 0.
vtkContourFilter::InternalProgressCallbackFunction
static void InternalProgressCallbackFunction(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkContourFilter::GetMTime
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkContourFilter::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkContourFilter.h:332
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkContourFilter.h:370
vtkContourFilter::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkContourFilter.h:327
vtkContourFilter::GridSynchronizedTemplates
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
Definition: vtkContourFilter.h:337
vtkSynchronizedTemplates2D
generate isoline(s) from a structured points set
Definition: vtkSynchronizedTemplates2D.h:42
vtkGridSynchronizedTemplates3D
generate isosurface from structured grids
Definition: vtkGridSynchronizedTemplates3D.h:40
vtkContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkContourFilter.h:407
vtkContourFilter::SetArrayComponent
void SetArrayComponent(int)
Set/get which component of the scalar array to contour on; defaults to 0.
vtkContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourFilter::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkContourFilter.h:325
vtkContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkContourFilter.h:331
vtkPolyDataAlgorithm.h
vtkContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkContourFilter.h:329
vtkRectilinearSynchronizedTemplates
generate isosurface from rectilinear grid
Definition: vtkRectilinearSynchronizedTemplates.h:42
vtkContourFilter::GenerateTriangles
vtkTypeBool GenerateTriangles
Definition: vtkContourFilter.h:333
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkContourFilter::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkContourFilter.h:361
vtkContourFilter::RectilinearSynchronizedTemplates
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
Definition: vtkContourFilter.h:338
vtkContourFilter::SynchronizedTemplates3D
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
Definition: vtkContourFilter.h:336
vtkContourFilter::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkContourFilter.h:330
vtkContourFilter::SynchronizedTemplates2D
vtkSynchronizedTemplates2D * SynchronizedTemplates2D
Definition: vtkContourFilter.h:335
vtkContourFilter::~vtkContourFilter
~vtkContourFilter() override
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkContourFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkContourFilter::GetOutputPointsPrecision
int GetOutputPointsPrecision() const
Set/get the desired precision for the output types.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkContourFilter::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkContourFilter.h:398
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:52
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkContourFilter::vtkContourFilter
vtkContourFilter()
vtkContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkContourFilter.h:390
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:154
vtkSynchronizedTemplates3D
generate isosurface from structured points
Definition: vtkSynchronizedTemplates3D.h:41
vtkContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkContourFilter.h:328
vtkContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkContourFilter.h:353
vtkContourFilter::InternalProgressCallbackCommand
vtkCallbackCommand * InternalProgressCallbackCommand
Definition: vtkContourFilter.h:339
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkContourFilter::New
static vtkContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkContourFilter::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkContourFilter.h:326
vtkContourFilter::SetOutputPointsPrecision
void SetOutputPointsPrecision(int precision)
Set/get the desired precision for the output types.
vtkContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkContourFilter.h:180
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151
vtkContourFilter::SetScalarTree
virtual void SetScalarTree(vtkScalarTree *)
Enable the use of a scalar tree to accelerate contour extraction.