VTK  9.5.2
vtkMarchingCubes.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
37
38#ifndef vtkMarchingCubes_h
39#define vtkMarchingCubes_h
40
41#include "vtkFiltersCoreModule.h" // For export macro
43
44#include "vtkContourValues.h" // Needed for direct access to ContourValues
45
46VTK_ABI_NAMESPACE_BEGIN
48
49class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
50{
51public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
56 // Methods to set contour values
57 void SetValue(int i, double value);
58 double GetValue(int i);
59 double* GetValues();
60 void GetValues(double* contourValues);
61 void SetNumberOfContours(int number);
63 void GenerateValues(int numContours, double range[2]);
64 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
65
66 // Because we delegate to vtkContourValues
68
70
78 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
80
82
92 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
94
96
101 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
103
105
112
118
119protected:
122
124 int FillInputPortInformation(int port, vtkInformation* info) override;
125
131
132private:
133 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
134 void operator=(const vtkMarchingCubes&) = delete;
135};
136
141inline void vtkMarchingCubes::SetValue(int i, double value)
142{
143 this->ContourValues->SetValue(i, value);
144}
145
149inline double vtkMarchingCubes::GetValue(int i)
150{
151 return this->ContourValues->GetValue(i);
152}
153
159{
160 return this->ContourValues->GetValues();
161}
162
168inline void vtkMarchingCubes::GetValues(double* contourValues)
169{
170 this->ContourValues->GetValues(contourValues);
171}
172
179{
180 this->ContourValues->SetNumberOfContours(number);
181}
182
187{
188 return this->ContourValues->GetNumberOfContours();
189}
190
195inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
196{
197 this->ContourValues->GenerateValues(numContours, range);
198}
199
204inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
205{
206 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
207}
208
209VTK_ABI_NAMESPACE_END
210#endif
helper object to manage setting and generating contour values
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
vtkIncrementalPointLocator * Locator
vtkMTimeType GetMTime() override
Return this object's modified time.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateDefaultLocator()
Create default locator.
int FillInputPortInformation(int port, vtkInformation *info) override
vtkTypeBool ComputeNormals
vtkTypeBool ComputeScalars
void SetLocator(vtkIncrementalPointLocator *locator)
override the default locator.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
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.
static vtkMarchingCubes * New()
vtkTypeBool ComputeGradients
double GetValue(int i)
Get the ith contour value.
vtkContourValues * ContourValues
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkMarchingCubes() override
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set a particular contour value at contour number i.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287