VTK  9.2.5
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=========================================================================*/
50#ifndef vtkMarchingCubes_h
51#define vtkMarchingCubes_h
52
53#include "vtkFiltersCoreModule.h" // For export macro
55
56#include "vtkContourValues.h" // Needed for direct access to ContourValues
57
59
60class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
67 // Methods to set contour values
68 void SetValue(int i, double value);
69 double GetValue(int i);
70 double* GetValues();
71 void GetValues(double* contourValues);
72 void SetNumberOfContours(int number);
73 vtkIdType GetNumberOfContours();
74 void GenerateValues(int numContours, double range[2]);
75 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
76
77 // Because we delegate to vtkContourValues
79
81
87 vtkSetMacro(ComputeNormals, vtkTypeBool);
88 vtkGetMacro(ComputeNormals, vtkTypeBool);
89 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
91
93
101 vtkSetMacro(ComputeGradients, vtkTypeBool);
102 vtkGetMacro(ComputeGradients, vtkTypeBool);
103 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
105
107
110 vtkSetMacro(ComputeScalars, vtkTypeBool);
111 vtkGetMacro(ComputeScalars, vtkTypeBool);
112 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
114
116
121 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
123
129
130protected:
133
135 int FillInputPortInformation(int port, vtkInformation* info) override;
136
142
143private:
144 vtkMarchingCubes(const vtkMarchingCubes&) = delete;
145 void operator=(const vtkMarchingCubes&) = delete;
146};
147
152inline void vtkMarchingCubes::SetValue(int i, double value)
153{
154 this->ContourValues->SetValue(i, value);
155}
156
160inline double vtkMarchingCubes::GetValue(int i)
161{
162 return this->ContourValues->GetValue(i);
163}
164
170{
171 return this->ContourValues->GetValues();
172}
173
179inline void vtkMarchingCubes::GetValues(double* contourValues)
180{
181 this->ContourValues->GetValues(contourValues);
182}
183
190{
191 this->ContourValues->SetNumberOfContours(number);
192}
193
198{
199 return this->ContourValues->GetNumberOfContours();
200}
201
206inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
207{
208 this->ContourValues->GenerateValues(numContours, range);
209}
210
215inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
216{
217 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
218}
219
220#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:40
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