Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
Patented/vtkImageMarchingCubes.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00073 #ifndef __vtkImageMarchingCubes_h
00074 #define __vtkImageMarchingCubes_h
00075
00076 #include "vtkPolyDataSource.h"
00077
00078 #include "vtkContourValues.h"
00079
00080 class vtkCellArray;
00081 class vtkFloatArray;
00082 class vtkImageData;
00083 class vtkPoints;
00084
00085 class VTK_PATENTED_EXPORT vtkImageMarchingCubes : public vtkPolyDataSource
00086 {
00087 public:
00088 static vtkImageMarchingCubes *New();
00089 vtkTypeRevisionMacro(vtkImageMarchingCubes,vtkPolyDataSource);
00090 void PrintSelf(ostream& os, vtkIndent indent);
00091
00093
00094 void SetInput(vtkImageData *input);
00095 vtkImageData *GetInput();
00097
00098
00099 void SetValue(int i, float value);
00100 float GetValue(int i);
00101 float *GetValues();
00102 void GetValues(float *contourValues);
00103 void SetNumberOfContours(int number);
00104 int GetNumberOfContours();
00105 void GenerateValues(int numContours, float range[2]);
00106 void GenerateValues(int numContours, float rangeStart, float rangeEnd);
00107
00108
00109 unsigned long int GetMTime();
00110
00112
00113 vtkSetMacro(ComputeScalars, int);
00114 vtkGetMacro(ComputeScalars, int);
00115 vtkBooleanMacro(ComputeScalars, int);
00117
00119
00123 vtkSetMacro(ComputeNormals, int);
00124 vtkGetMacro(ComputeNormals, int);
00125 vtkBooleanMacro(ComputeNormals, int);
00127
00129
00135 vtkSetMacro(ComputeGradients, int);
00136 vtkGetMacro(ComputeGradients, int);
00137 vtkBooleanMacro(ComputeGradients, int);
00139
00140
00141 int ComputeScalars;
00142 int ComputeNormals;
00143 int ComputeGradients;
00144 int NeedGradients;
00145
00146 vtkCellArray *Triangles;
00147 vtkFloatArray *Scalars;
00148 vtkPoints *Points;
00149 vtkFloatArray *Normals;
00150 vtkFloatArray *Gradients;
00151
00152 int GetLocatorPoint(int cellX, int cellY, int edge);
00153 void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
00154 void IncrementLocatorZ();
00155
00156 void Update();
00157
00159
00162 vtkSetMacro(InputMemoryLimit, int);
00163 vtkGetMacro(InputMemoryLimit, int);
00165
00166 protected:
00167 vtkImageMarchingCubes();
00168 ~vtkImageMarchingCubes();
00169
00170 int NumberOfSlicesPerChunk;
00171 int InputMemoryLimit;
00172
00173 vtkContourValues *ContourValues;
00174
00175 int *LocatorPointIds;
00176 int LocatorDimX;
00177 int LocatorDimY;
00178 int LocatorMinX;
00179 int LocatorMinY;
00180
00181 void Execute();
00182
00183 void March(vtkImageData *inData, int chunkMin, int chunkMax,
00184 int numContours, float *values);
00185 void InitializeLocator(int min0, int max0, int min1, int max1);
00186 void DeleteLocator();
00187 int *GetLocatorPointer(int cellX, int cellY, int edge);
00188 private:
00189 vtkImageMarchingCubes(const vtkImageMarchingCubes&);
00190 void operator=(const vtkImageMarchingCubes&);
00191 };
00192
00195 inline void vtkImageMarchingCubes::SetValue(int i, float value)
00196 {this->ContourValues->SetValue(i,value);}
00197
00199
00200 inline float vtkImageMarchingCubes::GetValue(int i)
00201 {return this->ContourValues->GetValue(i);}
00203
00205
00207 inline float *vtkImageMarchingCubes::GetValues()
00208 {return this->ContourValues->GetValues();}
00210
00214 inline void vtkImageMarchingCubes::GetValues(float *contourValues)
00215 {this->ContourValues->GetValues(contourValues);}
00216
00220 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
00221 {this->ContourValues->SetNumberOfContours(number);}
00222
00224
00225 inline int vtkImageMarchingCubes::GetNumberOfContours()
00226 {return this->ContourValues->GetNumberOfContours();}
00228
00230
00232 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float range[2])
00233 {this->ContourValues->GenerateValues(numContours, range);}
00235
00237
00239 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float
00240 rangeStart, float rangeEnd)
00241 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00243
00244 #endif
00245
00246
00247