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
00057 #ifndef __vtkImageMarchingCubes_h
00058 #define __vtkImageMarchingCubes_h
00059
00060 #include "vtkPolyDataSource.h"
00061
00062 #include "vtkContourValues.h"
00063
00064 class vtkCellArray;
00065 class vtkFloatArray;
00066 class vtkImageData;
00067 class vtkPoints;
00068
00069 class VTK_PATENTED_EXPORT vtkImageMarchingCubes : public vtkPolyDataSource
00070 {
00071 public:
00072 static vtkImageMarchingCubes *New();
00073 vtkTypeRevisionMacro(vtkImageMarchingCubes,vtkPolyDataSource);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00077
00078 void SetInput(vtkImageData *input);
00079 vtkImageData *GetInput();
00081
00082
00083 void SetValue(int i, double value);
00084 double GetValue(int i);
00085 double *GetValues();
00086 void GetValues(double *contourValues);
00087 void SetNumberOfContours(int number);
00088 int GetNumberOfContours();
00089 void GenerateValues(int numContours, double range[2]);
00090 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00091
00092
00093 unsigned long int GetMTime();
00094
00096
00097 vtkSetMacro(ComputeScalars, int);
00098 vtkGetMacro(ComputeScalars, int);
00099 vtkBooleanMacro(ComputeScalars, int);
00101
00103
00107 vtkSetMacro(ComputeNormals, int);
00108 vtkGetMacro(ComputeNormals, int);
00109 vtkBooleanMacro(ComputeNormals, int);
00111
00113
00119 vtkSetMacro(ComputeGradients, int);
00120 vtkGetMacro(ComputeGradients, int);
00121 vtkBooleanMacro(ComputeGradients, int);
00123
00124
00125 int ComputeScalars;
00126 int ComputeNormals;
00127 int ComputeGradients;
00128 int NeedGradients;
00129
00130 vtkCellArray *Triangles;
00131 vtkFloatArray *Scalars;
00132 vtkPoints *Points;
00133 vtkFloatArray *Normals;
00134 vtkFloatArray *Gradients;
00135
00136 int GetLocatorPoint(int cellX, int cellY, int edge);
00137 void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
00138 void IncrementLocatorZ();
00139
00140 void Update();
00141
00143
00146 vtkSetMacro(InputMemoryLimit, int);
00147 vtkGetMacro(InputMemoryLimit, int);
00149
00150 protected:
00151 vtkImageMarchingCubes();
00152 ~vtkImageMarchingCubes();
00153
00154 int NumberOfSlicesPerChunk;
00155 int InputMemoryLimit;
00156
00157 vtkContourValues *ContourValues;
00158
00159 int *LocatorPointIds;
00160 int LocatorDimX;
00161 int LocatorDimY;
00162 int LocatorMinX;
00163 int LocatorMinY;
00164
00165 void Execute();
00166
00167 void March(vtkImageData *inData, int chunkMin, int chunkMax,
00168 int numContours, double *values);
00169 void InitializeLocator(int min0, int max0, int min1, int max1);
00170 void DeleteLocator();
00171 int *GetLocatorPointer(int cellX, int cellY, int edge);
00172 private:
00173 vtkImageMarchingCubes(const vtkImageMarchingCubes&);
00174 void operator=(const vtkImageMarchingCubes&);
00175 };
00176
00179 inline void vtkImageMarchingCubes::SetValue(int i, double value)
00180 {this->ContourValues->SetValue(i,value);}
00181
00183
00184 inline double vtkImageMarchingCubes::GetValue(int i)
00185 {return this->ContourValues->GetValue(i);}
00187
00189
00191 inline double *vtkImageMarchingCubes::GetValues()
00192 {return this->ContourValues->GetValues();}
00194
00198 inline void vtkImageMarchingCubes::GetValues(double *contourValues)
00199 {this->ContourValues->GetValues(contourValues);}
00200
00204 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
00205 {this->ContourValues->SetNumberOfContours(number);}
00206
00208
00209 inline int vtkImageMarchingCubes::GetNumberOfContours()
00210 {return this->ContourValues->GetNumberOfContours();}
00212
00214
00216 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
00217 {this->ContourValues->GenerateValues(numContours, range);}
00219
00221
00223 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
00224 rangeStart, double rangeEnd)
00225 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00227
00228 #endif
00229
00230
00231