VTK
vtkImageMarchingCubes.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageMarchingCubes.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 vtkImageMarchingCubes_h
40#define vtkImageMarchingCubes_h
41
42#include "vtkFiltersGeneralModule.h" // For export macro
44
45#include "vtkContourValues.h" // Needed for direct access to ContourValues
46
47class vtkCellArray;
48class vtkFloatArray;
49class vtkImageData;
50class vtkPoints;
51
52class VTKFILTERSGENERAL_EXPORT vtkImageMarchingCubes : public vtkPolyDataAlgorithm
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
58
60
63 void SetValue(int i, double value);
64 double GetValue(int i);
65 double *GetValues();
66 void GetValues(double *contourValues);
67 void SetNumberOfContours(int number);
68 int GetNumberOfContours();
69 void GenerateValues(int numContours, double range[2]);
70 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
72
76 vtkMTimeType GetMTime() VTK_OVERRIDE;
77
79
82 vtkSetMacro(ComputeScalars, int);
83 vtkGetMacro(ComputeScalars, int);
84 vtkBooleanMacro(ComputeScalars, int);
86
88
93 vtkSetMacro(ComputeNormals, int);
94 vtkGetMacro(ComputeNormals, int);
95 vtkBooleanMacro(ComputeNormals, int);
97
99
106 vtkSetMacro(ComputeGradients, int);
107 vtkGetMacro(ComputeGradients, int);
108 vtkBooleanMacro(ComputeGradients, int);
110
111 // Should be protected, but the templated functions need these
112 int ComputeScalars;
113 int ComputeNormals;
114 int ComputeGradients;
115 int NeedGradients;
116
117 vtkCellArray *Triangles;
119 vtkPoints *Points;
121 vtkFloatArray *Gradients;
122
123 vtkIdType GetLocatorPoint(int cellX, int cellY, int edge);
124 void AddLocatorPoint(int cellX, int cellY, int edge, vtkIdType ptId);
125 void IncrementLocatorZ();
126
128
133 vtkSetMacro(InputMemoryLimit, vtkIdType);
134 vtkGetMacro(InputMemoryLimit, vtkIdType);
136
137protected:
139 ~vtkImageMarchingCubes() VTK_OVERRIDE;
140
141 int NumberOfSlicesPerChunk;
142 vtkIdType InputMemoryLimit;
143
144 vtkContourValues *ContourValues;
145
146 vtkIdType *LocatorPointIds;
147 int LocatorDimX;
148 int LocatorDimY;
149 int LocatorMinX;
150 int LocatorMinY;
151
152 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
153 int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
154
155 void March(vtkImageData *inData, int chunkMin, int chunkMax,
156 int numContours, double *values);
157 void InitializeLocator(int min0, int max0, int min1, int max1);
158 void DeleteLocator();
159 vtkIdType *GetLocatorPointer(int cellX, int cellY, int edge);
160
161private:
162 vtkImageMarchingCubes(const vtkImageMarchingCubes&) VTK_DELETE_FUNCTION;
163 void operator=(const vtkImageMarchingCubes&) VTK_DELETE_FUNCTION;
164};
165
170inline void vtkImageMarchingCubes::SetValue(int i, double value)
171{this->ContourValues->SetValue(i,value);}
172
177{return this->ContourValues->GetValue(i);}
178
184{return this->ContourValues->GetValues();}
185
191inline void vtkImageMarchingCubes::GetValues(double *contourValues)
192{this->ContourValues->GetValues(contourValues);}
193
200{this->ContourValues->SetNumberOfContours(number);}
201
206{return this->ContourValues->GetNumberOfContours();}
207
212inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
213{this->ContourValues->GenerateValues(numContours, range);}
214
219inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
220 rangeStart, double rangeEnd)
221{this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
222
223#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
helper object to manage setting and generating contour values
void SetValue(int i, double value)
Set the ith contour value.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
generate isosurface(s) from volume/images
static vtkImageMarchingCubes * New()
int GetNumberOfContours()
Get the number of contours in the list of contour values.
double GetValue(int i)
Get the ith contour value.
vtkMTimeType GetMTime() override
Because we delegate to vtkContourValues & refer to vtkImplicitFunction.
double * GetValues()
Get a pointer to an array of contour values.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:40
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.
int vtkIdType
Definition: vtkType.h:287
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248