VTK
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=========================================================================*/
39#ifndef vtkMarchingCubes_h
40#define vtkMarchingCubes_h
41
42#include "vtkFiltersCoreModule.h" // For export macro
44
45#include "vtkContourValues.h" // Needed for direct access to ContourValues
46
48
49class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
50{
51public:
54 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55
56 // Methods to set contour values
57 void SetValue(int i, double value);
58 double GetValue(int i);
59 double *GetValues();
60 void GetValues(double *contourValues);
61 void SetNumberOfContours(int number);
62 int GetNumberOfContours();
63 void GenerateValues(int numContours, double range[2]);
64 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
65
66 // Because we delegate to vtkContourValues
67 vtkMTimeType GetMTime() VTK_OVERRIDE;
68
70
76 vtkSetMacro(ComputeNormals,int);
77 vtkGetMacro(ComputeNormals,int);
78 vtkBooleanMacro(ComputeNormals,int);
80
82
90 vtkSetMacro(ComputeGradients,int);
91 vtkGetMacro(ComputeGradients,int);
92 vtkBooleanMacro(ComputeGradients,int);
94
96
99 vtkSetMacro(ComputeScalars,int);
100 vtkGetMacro(ComputeScalars,int);
101 vtkBooleanMacro(ComputeScalars,int);
103
105
109 void SetLocator(vtkIncrementalPointLocator *locator);
110 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
112
117 void CreateDefaultLocator();
118
119protected:
121 ~vtkMarchingCubes() VTK_OVERRIDE;
122
123 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
124 int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
125
126 vtkContourValues *ContourValues;
127 int ComputeNormals;
128 int ComputeGradients;
129 int ComputeScalars;
131private:
132 vtkMarchingCubes(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
133 void operator=(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
134};
135
140inline void vtkMarchingCubes::SetValue(int i, double value)
141{this->ContourValues->SetValue(i,value);}
142
146inline double vtkMarchingCubes::GetValue(int i)
147{return this->ContourValues->GetValue(i);}
148
154{return this->ContourValues->GetValues();}
155
161inline void vtkMarchingCubes::GetValues(double *contourValues)
162{this->ContourValues->GetValues(contourValues);}
163
170{this->ContourValues->SetNumberOfContours(number);}
171
176{return this->ContourValues->GetNumberOfContours();}
177
182inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
183{this->ContourValues->GenerateValues(numContours, range);}
184
189inline void vtkMarchingCubes::GenerateValues(int numContours, double
190 rangeStart, double rangeEnd)
191{this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
192
193#endif
helper object to manage setting and generating contour values
void SetValue(int i, double value)
Set 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
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 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.
int GetNumberOfContours()
Get the number of contours in the list of contour values.
static vtkMarchingCubes * New()
double GetValue(int i)
Get the ith contour value.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Superclass for algorithms that produce only polydata as output.
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248