VTK  9.7.0
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
44
45#include "vtkContourValues.h" // Needed for direct access to ContourValues
46
47VTK_ABI_NAMESPACE_BEGIN
49
50class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMarchingCubes : public vtkPolyDataAlgorithm
51{
52public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57 // Methods to set contour values
58 void SetValue(int i, double value);
59 double GetValue(int i);
60 double* GetValues();
61 void GetValues(double* contourValues);
62 void SetNumberOfContours(int number);
64 void GenerateValues(int numContours, double range[2]);
65 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
66
67 // Because we delegate to vtkContourValues
69
71
79 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
81
83
93 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
95
97
102 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
104
106
113
119
120protected:
123
125 int FillInputPortInformation(int port, vtkInformation* info) override;
126
132
133private:
134 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
135 void operator=(const vtkMarchingCubes&) = delete;
136};
137
142inline void vtkMarchingCubes::SetValue(int i, double value)
143{
144 this->ContourValues->SetValue(i, value);
145}
146
150inline double vtkMarchingCubes::GetValue(int i)
151{
152 return this->ContourValues->GetValue(i);
153}
154
160{
161 return this->ContourValues->GetValues();
162}
163
169inline void vtkMarchingCubes::GetValues(double* contourValues)
170{
171 this->ContourValues->GetValues(contourValues);
172}
173
180{
181 this->ContourValues->SetNumberOfContours(number);
182}
183
188{
189 return this->ContourValues->GetNumberOfContours();
190}
191
196inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
197{
198 this->ContourValues->GenerateValues(numContours, range);
199}
200
205inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
206{
207 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
208}
209
210VTK_ABI_NAMESPACE_END
211#endif
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 SetNumberOfContours(int number)
Set the number of contours to place into the list.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
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:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_MARSHALAUTO