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
172class vtkScalarTree;
178
179class VTKFILTERSCORE_EXPORT vtkContourFilter : public vtkPolyDataAlgorithm
180{
181public:
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
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
264 vtkGetObjectMacro(ScalarTree, vtkScalarTree);
266
268
273 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
275
281
283
290
292
299 vtkSetMacro(GenerateTriangles, vtkTypeBool);
300 vtkGetMacro(GenerateTriangles, vtkTypeBool);
301 vtkBooleanMacro(GenerateTriangles, vtkTypeBool);
303
305
310 void SetOutputPointsPrecision(int precision);
313
314protected:
317
319
321 vtkInformationVector* outputVector) override;
324
334
340
342 vtkObject* caller, unsigned long eid, void* clientData, void* callData);
343
344private:
345 vtkContourFilter(const vtkContourFilter&) = delete;
346 void operator=(const vtkContourFilter&) = delete;
347};
348
353inline void vtkContourFilter::SetValue(int i, double value)
354{
355 this->ContourValues->SetValue(i, value);
356}
357
361inline double vtkContourFilter::GetValue(int i)
362{
363 return this->ContourValues->GetValue(i);
364}
365
371{
372 return this->ContourValues->GetValues();
373}
374
380inline 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
407inline void vtkContourFilter::GenerateValues(int numContours, double range[2])
408{
409 this->ContourValues->GenerateValues(numContours, range);
410}
411
416inline void vtkContourFilter::GenerateValues(int numContours, double rangeStart, double rangeEnd)
417{
418 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
419}
420
421#endif
supports function callbacks
generate isosurfaces/isolines from scalar values
void SetOutputPointsPrecision(int precision)
Set/get the desired precision for the output types.
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkTypeBool ComputeNormals
void ReportReferences(vtkGarbageCollector *) override
double GetValue(int i)
Get the ith contour value.
vtkTypeBool UseScalarTree
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkSynchronizedTemplates2D * SynchronizedTemplates2D
int GetArrayComponent()
Set/get which component of the scalar array to contour on; defaults to 0.
vtkCallbackCommand * InternalProgressCallbackCommand
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void SetArrayComponent(int)
Set/get which component of the scalar array to contour on; defaults to 0.
vtkTypeBool ComputeScalars
int GetOutputPointsPrecision() const
Set/get the desired precision for the output types.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void CreateDefaultLocator()
Create default locator.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkTypeBool ComputeGradients
vtkRectilinearSynchronizedTemplates * RectilinearSynchronizedTemplates
vtkIncrementalPointLocator * Locator
void SetValue(int i, double value)
Methods to set / get contour values.
virtual void SetScalarTree(vtkScalarTree *)
Enable the use of a scalar tree to accelerate contour extraction.
static vtkContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkContourFilter() override
static void InternalProgressCallbackFunction(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
vtkTypeBool GenerateTriangles
vtkScalarTree * ScalarTree
vtkGridSynchronizedTemplates3D * GridSynchronizedTemplates
double * GetValues()
Get a pointer to an array of contour values.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkSynchronizedTemplates3D * SynchronizedTemplates3D
vtkContourValues * ContourValues
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
helper object to manage setting and generating contour values
double * GetValues()
Return a pointer to a list of contour values.
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
Detect and break reference loops.
generate isosurface from structured grids
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObject.h:73
Superclass for algorithms that produce only polydata as output.
generate isosurface from rectilinear grid
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
generate isoline(s) from a structured points set
generate isosurface from structured points
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287