VTK  9.5.20251126
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
146
147#ifndef vtkMarchingCubes_h
148#define vtkMarchingCubes_h
149
150#include "vtkFiltersCoreModule.h" // For export macro
151#include "vtkPolyDataAlgorithm.h"
152#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
153
154#include "vtkContourValues.h" // Needed for direct access to ContourValues
155
156VTK_ABI_NAMESPACE_BEGIN
158
159class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMarchingCubes : public vtkPolyDataAlgorithm
160{
161public:
164 void PrintSelf(ostream& os, vtkIndent indent) override;
165
166 // Methods to set contour values
167 void SetValue(int i, double value);
168 double GetValue(int i);
169 double* GetValues();
170 void GetValues(double* contourValues);
171 void SetNumberOfContours(int number);
173 void GenerateValues(int numContours, double range[2]);
174 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
175
176 // Because we delegate to vtkContourValues
178
180
188 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
190
192
202 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
204
206
211 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
213
215
222
228
229protected:
232
234 int FillInputPortInformation(int port, vtkInformation* info) override;
235
241
242private:
243 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
244 void operator=(const vtkMarchingCubes&) = delete;
245};
246
251inline void vtkMarchingCubes::SetValue(int i, double value)
252{
253 this->ContourValues->SetValue(i, value);
254}
255
259inline double vtkMarchingCubes::GetValue(int i)
260{
261 return this->ContourValues->GetValue(i);
262}
263
269{
270 return this->ContourValues->GetValues();
271}
272
278inline void vtkMarchingCubes::GetValues(double* contourValues)
279{
280 this->ContourValues->GetValues(contourValues);
281}
282
289{
290 this->ContourValues->SetNumberOfContours(number);
291}
292
297{
298 return this->ContourValues->GetNumberOfContours();
299}
300
305inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
306{
307 this->ContourValues->GenerateValues(numContours, range);
308}
309
314inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
315{
316 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
317}
318
319VTK_ABI_NAMESPACE_END
320#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:108
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
Fill the input port information objects for this algorithm.
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:367
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_MARSHALAUTO