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 =========================================================================*/
38 #ifndef vtkImageMarchingCubes_h
39 #define vtkImageMarchingCubes_h
40 
41 #include "vtkFiltersGeneralModule.h" // For export macro
42 #include "vtkPolyDataAlgorithm.h"
43 
44 #include "vtkContourValues.h" // Needed for direct access to ContourValues
45 
46 class vtkCellArray;
47 class vtkFloatArray;
48 class vtkImageData;
49 class vtkPoints;
50 
52 {
53 public:
54  static vtkImageMarchingCubes *New();
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
60  void SetValue(int i, double value);
61  double GetValue(int i);
62  double *GetValues();
63  void GetValues(double *contourValues);
64  void SetNumberOfContours(int number);
65  int GetNumberOfContours();
66  void GenerateValues(int numContours, double range[2]);
67  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
69 
72  unsigned long int GetMTime();
73 
75 
76  vtkSetMacro(ComputeScalars, int);
77  vtkGetMacro(ComputeScalars, int);
78  vtkBooleanMacro(ComputeScalars, int);
80 
82 
86  vtkSetMacro(ComputeNormals, int);
87  vtkGetMacro(ComputeNormals, int);
88  vtkBooleanMacro(ComputeNormals, int);
90 
92 
98  vtkSetMacro(ComputeGradients, int);
99  vtkGetMacro(ComputeGradients, int);
100  vtkBooleanMacro(ComputeGradients, int);
102 
103  // Should be protected, but the templated functions need these
104  int ComputeScalars;
108 
114 
115  vtkIdType GetLocatorPoint(int cellX, int cellY, int edge);
116  void AddLocatorPoint(int cellX, int cellY, int edge, vtkIdType ptId);
117  void IncrementLocatorZ();
118 
120 
123  vtkSetMacro(InputMemoryLimit, vtkIdType);
124  vtkGetMacro(InputMemoryLimit, vtkIdType);
126 
127 protected:
130 
133 
135 
141 
144 
145  void March(vtkImageData *inData, int chunkMin, int chunkMax,
146  int numContours, double *values);
147  void InitializeLocator(int min0, int max0, int min1, int max1);
148  void DeleteLocator();
149  vtkIdType *GetLocatorPointer(int cellX, int cellY, int edge);
150 
151 private:
152  vtkImageMarchingCubes(const vtkImageMarchingCubes&); // Not implemented.
153  void operator=(const vtkImageMarchingCubes&); // Not implemented.
154 };
155 
157 
159 inline void vtkImageMarchingCubes::SetValue(int i, double value)
160 {this->ContourValues->SetValue(i,value);}
162 
164 
166 {return this->ContourValues->GetValue(i);}
168 
170 
173 {return this->ContourValues->GetValues();}
175 
177 
180 inline void vtkImageMarchingCubes::GetValues(double *contourValues)
181 {this->ContourValues->GetValues(contourValues);}
183 
185 
189 {this->ContourValues->SetNumberOfContours(number);}
191 
193 
195 {return this->ContourValues->GetNumberOfContours();}
197 
199 
201 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
202 {this->ContourValues->GenerateValues(numContours, range);}
204 
206 
208 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
209  rangeStart, double rangeEnd)
210 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
212 
213 #endif
helper object to manage setting and generating contour values
virtual int FillInputPortInformation(int port, vtkInformation *info)
void SetNumberOfContours(int number)
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetNumberOfContours(const int number)
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
void GenerateValues(int numContours, double range[2])
int vtkIdType
Definition: vtkType.h:275
double GetValue(int i)
generate isosurface(s) from volume/images
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
double * GetValues()
Superclass for algorithms that produce only polydata as output.
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTKFILTERSGENERAL_EXPORT
void SetValue(int i, double value)
vtkContourValues * ContourValues
object to represent cell connectivity
Definition: vtkCellArray.h:49
Store zero or more vtkInformation instances.
int GetNumberOfContours()
void GenerateValues(int numContours, double range[2])
void SetValue(int i, double value)
represent and manipulate 3D points
Definition: vtkPoints.h:38