VTK  9.2.6
vtkMarchingCubes.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMarchingCubes.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
59#ifndef vtkMarchingCubes_h
60#define vtkMarchingCubes_h
61
62#include "vtkFiltersCoreModule.h" // For export macro
64
65#include "vtkContourValues.h" // Needed for direct access to ContourValues
66
68
69class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
70{
71public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
76 // Methods to set contour values
77 void SetValue(int i, double value);
78 double GetValue(int i);
79 double* GetValues();
80 void GetValues(double* contourValues);
81 void SetNumberOfContours(int number);
82 vtkIdType GetNumberOfContours();
83 void GenerateValues(int numContours, double range[2]);
84 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
85
86 // Because we delegate to vtkContourValues
88
90
96 vtkSetMacro(ComputeNormals, vtkTypeBool);
97 vtkGetMacro(ComputeNormals, vtkTypeBool);
98 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
100
102
110 vtkSetMacro(ComputeGradients, vtkTypeBool);
111 vtkGetMacro(ComputeGradients, vtkTypeBool);
112 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
114
116
119 vtkSetMacro(ComputeScalars, vtkTypeBool);
120 vtkGetMacro(ComputeScalars, vtkTypeBool);
121 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
123
125
130 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
132
138
139protected:
142
144 int FillInputPortInformation(int port, vtkInformation* info) override;
145
151
152private:
153 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
154 void operator=(const vtkMarchingCubes&) = delete;
155};
156
161inline void vtkMarchingCubes::SetValue(int i, double value)
162{
163 this->ContourValues->SetValue(i, value);
164}
165
169inline double vtkMarchingCubes::GetValue(int i)
170{
171 return this->ContourValues->GetValue(i);
172}
173
179{
180 return this->ContourValues->GetValues();
181}
182
188inline void vtkMarchingCubes::GetValues(double* contourValues)
189{
190 this->ContourValues->GetValues(contourValues);
191}
192
199{
200 this->ContourValues->SetNumberOfContours(number);
201}
202
207{
208 return this->ContourValues->GetNumberOfContours();
209}
210
215inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
216{
217 this->ContourValues->GenerateValues(numContours, range);
218}
219
224inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
225{
226 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
227}
228
229#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 GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
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:49
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:69
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287