VTK: Filters/General/vtkMarchingContourFilter.h Source File

| VTK 9.3.1

vtkMarchingContourFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
54 #ifndef vtkMarchingContourFilter_h
55 #define vtkMarchingContourFilter_h
56
57 #include "vtkFiltersGeneralModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59
60 #include "vtkContourValues.h" // Needed for direct access to ContourValues
61
62 VTK_ABI_NAMESPACE_BEGIN
63 class vtkIncrementalPointLocator;
64 class vtkScalarTree;
65
66 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
67 {
68 public:
69 vtkTypeMacro(vtkMarchingContourFilter, vtkPolyDataAlgorithm);
70 void PrintSelf(ostream& os, vtkIndent indent) override;
71
76 static vtkMarchingContourFilter* New();
77
79
82 void SetValue(int i, double value);
83 double GetValue(int i);
84 double* GetValues();
85 void GetValues(double* contourValues);
86 void SetNumberOfContours(int number);
87 vtkIdType GetNumberOfContours();
88 void GenerateValues(int numContours, double range[2]);
89 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
91
95 vtkMTimeType GetMTime() override;
96
98
104 vtkSetMacro(ComputeNormals, vtkTypeBool);
105 vtkGetMacro(ComputeNormals, vtkTypeBool);
106 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
108
110
118 vtkSetMacro(ComputeGradients, vtkTypeBool);
119 vtkGetMacro(ComputeGradients, vtkTypeBool);
120 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
122
124
127 vtkSetMacro(ComputeScalars, vtkTypeBool);
128 vtkGetMacro(ComputeScalars, vtkTypeBool);
129 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
131
133
136 vtkSetMacro(UseScalarTree, vtkTypeBool);
137 vtkGetMacro(UseScalarTree, vtkTypeBool);
138 vtkBooleanMacro(UseScalarTree, vtkTypeBool);
140
142
146 void SetLocator(vtkIncrementalPointLocator* locator);
147 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
149
154 void CreateDefaultLocator();
155
156 protected:
157 vtkMarchingContourFilter();
158 ~vtkMarchingContourFilter() override;
159
160 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
161 int FillInputPortInformation(int port, vtkInformation* info) override;
162
163 vtkContourValues* ContourValues;
164 vtkTypeBool ComputeNormals;
165 vtkTypeBool ComputeGradients;
166 vtkTypeBool ComputeScalars;
167 vtkIncrementalPointLocator* Locator;
168 vtkTypeBool UseScalarTree;
169 vtkScalarTree* ScalarTree;
170
171 // special contouring for structured points
172 void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
173 // special contouring for image data
174 void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
175 // default if not structured data
176 void DataSetContour(vtkDataSet* input, vtkPolyData* output);
177
178 private:
179 vtkMarchingContourFilter(const vtkMarchingContourFilter&) = delete;
180 void operator=(const vtkMarchingContourFilter&) = delete;
181 };
182
187 inline void vtkMarchingContourFilter::SetValue(int i, double value)
188 {
189 this->ContourValues->SetValue(i, value);
190 }
191
195 inline double vtkMarchingContourFilter::GetValue(int i)
196 {
197 return this->ContourValues->GetValue(i);
198 }
199
204 inline double* vtkMarchingContourFilter::GetValues()
205 {
206 return this->ContourValues->GetValues();
207 }
208
214 inline void vtkMarchingContourFilter::GetValues(double* contourValues)
215 {
216 this->ContourValues->GetValues(contourValues);
217 }
218
224 inline void vtkMarchingContourFilter::SetNumberOfContours(int number)
225 {
226 this->ContourValues->SetNumberOfContours(number);
227 }
228
232 inline vtkIdType vtkMarchingContourFilter::GetNumberOfContours()
233 {
234 return this->ContourValues->GetNumberOfContours();
235 }
236
241 inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
242 {
243 this->ContourValues->GenerateValues(numContours, range);
244 }
245
250 inline void vtkMarchingContourFilter::GenerateValues(
251 int numContours, double rangeStart, double rangeEnd)
252 {
253 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
254 }
255
256 VTK_ABI_NAMESPACE_END
257 #endif
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:34
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMarchingContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkMarchingContourFilter.h:67
vtkMarchingContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingContourFilter.h:163
vtkMarchingContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkMarchingContourFilter.h:165
vtkMarchingContourFilter::GetMTime
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkMarchingContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingContourFilter.h:167
vtkMarchingContourFilter::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkMarchingContourFilter::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingContourFilter.h:232
vtkMarchingContourFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMarchingContourFilter::vtkMarchingContourFilter
vtkMarchingContourFilter()
vtkMarchingContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingContourFilter.h:224
vtkMarchingContourFilter::~vtkMarchingContourFilter
~vtkMarchingContourFilter() override
vtkMarchingContourFilter::New
static vtkMarchingContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
vtkMarchingContourFilter::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkMarchingContourFilter.h:168
vtkMarchingContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkMarchingContourFilter.h:169
vtkMarchingContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingContourFilter.h:195
vtkMarchingContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkMarchingContourFilter.h:166
vtkMarchingContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkMarchingContourFilter.h:187
vtkMarchingContourFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMarchingContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingContourFilter.h:241
vtkMarchingContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingContourFilter.h:204
vtkMarchingContourFilter::ImageContour
void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output)
vtkMarchingContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMarchingContourFilter::StructuredPointsContour
void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output)
vtkMarchingContourFilter::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkMarchingContourFilter.h:164
vtkMarchingContourFilter::DataSetContour
void DataSetContour(vtkDataSet *input, vtkPolyData *output)
vtkMarchingContourFilter::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:44
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkContourValues.h
vtkPolyDataAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270