VTK  9.5.20250902
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
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);
172 vtkIdType GetNumberOfContours();
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
186 vtkSetMacro(ComputeNormals, vtkTypeBool);
187 vtkGetMacro(ComputeNormals, vtkTypeBool);
188 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
190
192
200 vtkSetMacro(ComputeGradients, vtkTypeBool);
201 vtkGetMacro(ComputeGradients, vtkTypeBool);
202 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
204
206
209 vtkSetMacro(ComputeScalars, vtkTypeBool);
210 vtkGetMacro(ComputeScalars, vtkTypeBool);
211 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
213
215
220 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
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
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate isosurface(s) from volume
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.
Superclass for algorithms that produce only polydata as output.
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_MARSHALAUTO