VTK  9.2.6
vtkMarchingContourFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMarchingContourFilter.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=========================================================================*/
56
57#ifndef vtkMarchingContourFilter_h
58#define vtkMarchingContourFilter_h
59
60#include "vtkFiltersGeneralModule.h" // For export macro
62
63#include "vtkContourValues.h" // Needed for direct access to ContourValues
64
66class vtkScalarTree;
67
68class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
69{
70public:
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
79
81
84 void SetValue(int i, double value);
85 double GetValue(int i);
86 double* GetValues();
87 void GetValues(double* contourValues);
88 void SetNumberOfContours(int number);
90 void GenerateValues(int numContours, double range[2]);
91 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
93
98
100
108 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
110
112
122 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
124
126
131 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
133
135
140 vtkBooleanMacro(UseScalarTree, vtkTypeBool);
142
144
151
157
158protected:
161
163 int FillInputPortInformation(int port, vtkInformation* info) override;
164
172
173 // special contouring for structured points
174 void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
175 // special contouring for image data
176 void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
177 // default if not structured data
178 void DataSetContour(vtkDataSet* input, vtkPolyData* output);
179
180private:
182 void operator=(const vtkMarchingContourFilter&) = delete;
183};
184
189inline void vtkMarchingContourFilter::SetValue(int i, double value)
190{
191 this->ContourValues->SetValue(i, value);
192}
193
198{
199 return this->ContourValues->GetValue(i);
200}
201
207{
208 return this->ContourValues->GetValues();
209}
210
216inline void vtkMarchingContourFilter::GetValues(double* contourValues)
217{
218 this->ContourValues->GetValues(contourValues);
219}
220
227{
228 this->ContourValues->SetNumberOfContours(number);
229}
230
235{
236 return this->ContourValues->GetNumberOfContours();
237}
238
243inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
244{
245 this->ContourValues->GenerateValues(numContours, range);
246}
247
253 int numContours, double rangeStart, double rangeEnd)
254{
255 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
256}
257
258#endif
helper object to manage setting and generating contour values
abstract class to specify dataset behavior
Definition vtkDataSet.h:63
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkIncrementalPointLocator * Locator
void CreateDefaultLocator()
Create default locator.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
~vtkMarchingContourFilter() override
double GetValue(int i)
Get the ith contour value.
void SetValue(int i, double value)
Methods to set / get contour values.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
double * GetValues()
Get a pointer to an array of contour values.
void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output)
void DataSetContour(vtkDataSet *input, vtkPolyData *output)
static vtkMarchingContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
organize data according to scalar values (used to accelerate contouring operations)
int vtkTypeBool
Definition vtkABI.h:69
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287