VTK  9.1.0
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=========================================================================*/
56#ifndef vtkMarchingCubes_h
57#define vtkMarchingCubes_h
58
59#include "vtkFiltersCoreModule.h" // For export macro
61
62#include "vtkContourValues.h" // Needed for direct access to ContourValues
63
65
66class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
67{
68public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
73 // Methods to set contour values
74 void SetValue(int i, double value);
75 double GetValue(int i);
76 double* GetValues();
77 void GetValues(double* contourValues);
78 void SetNumberOfContours(int number);
79 vtkIdType GetNumberOfContours();
80 void GenerateValues(int numContours, double range[2]);
81 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
82
83 // Because we delegate to vtkContourValues
85
87
93 vtkSetMacro(ComputeNormals, vtkTypeBool);
94 vtkGetMacro(ComputeNormals, vtkTypeBool);
95 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
97
99
107 vtkSetMacro(ComputeGradients, vtkTypeBool);
108 vtkGetMacro(ComputeGradients, vtkTypeBool);
109 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
111
113
116 vtkSetMacro(ComputeScalars, vtkTypeBool);
117 vtkGetMacro(ComputeScalars, vtkTypeBool);
118 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
120
122
127 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
129
135
136protected:
139
142
148
149private:
150 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
151 void operator=(const vtkMarchingCubes&) = delete;
152};
153
158inline void vtkMarchingCubes::SetValue(int i, double value)
159{
160 this->ContourValues->SetValue(i, value);
161}
162
166inline double vtkMarchingCubes::GetValue(int i)
167{
168 return this->ContourValues->GetValue(i);
169}
170
176{
177 return this->ContourValues->GetValues();
178}
179
185inline void vtkMarchingCubes::GetValues(double* contourValues)
186{
187 this->ContourValues->GetValues(contourValues);
188}
189
196{
197 this->ContourValues->SetNumberOfContours(number);
198}
199
204{
205 return this->ContourValues->GetNumberOfContours();
206}
207
212inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
213{
214 this->ContourValues->GenerateValues(numContours, range);
215}
216
221inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
222{
223 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
224}
225
226#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:43
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.
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287