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
00070 #ifndef __vtkImageMarchingCubes_h
00071 #define __vtkImageMarchingCubes_h
00072
00073 #include "vtkPolyDataSource.h"
00074
00075 #include "vtkContourValues.h"
00076
00077 class vtkCellArray;
00078 class vtkFloatArray;
00079 class vtkImageData;
00080 class vtkPoints;
00081
00082 class VTK_PATENTED_EXPORT vtkImageMarchingCubes : public vtkPolyDataSource
00083 {
00084 public:
00085 static vtkImageMarchingCubes *New();
00086 vtkTypeRevisionMacro(vtkImageMarchingCubes,vtkPolyDataSource);
00087 void PrintSelf(ostream& os, vtkIndent indent);
00088
00090
00091 void SetInput(vtkImageData *input);
00092 vtkImageData *GetInput();
00094
00095
00096 void SetValue(int i, double value);
00097 double GetValue(int i);
00098 double *GetValues();
00099 void GetValues(double *contourValues);
00100 void SetNumberOfContours(int number);
00101 int GetNumberOfContours();
00102 void GenerateValues(int numContours, double range[2]);
00103 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00104
00105
00106 unsigned long int GetMTime();
00107
00109
00110 vtkSetMacro(ComputeScalars, int);
00111 vtkGetMacro(ComputeScalars, int);
00112 vtkBooleanMacro(ComputeScalars, int);
00114
00116
00120 vtkSetMacro(ComputeNormals, int);
00121 vtkGetMacro(ComputeNormals, int);
00122 vtkBooleanMacro(ComputeNormals, int);
00124
00126
00132 vtkSetMacro(ComputeGradients, int);
00133 vtkGetMacro(ComputeGradients, int);
00134 vtkBooleanMacro(ComputeGradients, int);
00136
00137
00138 int ComputeScalars;
00139 int ComputeNormals;
00140 int ComputeGradients;
00141 int NeedGradients;
00142
00143 vtkCellArray *Triangles;
00144 vtkFloatArray *Scalars;
00145 vtkPoints *Points;
00146 vtkFloatArray *Normals;
00147 vtkFloatArray *Gradients;
00148
00149 int GetLocatorPoint(int cellX, int cellY, int edge);
00150 void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
00151 void IncrementLocatorZ();
00152
00153 void Update();
00154
00156
00159 vtkSetMacro(InputMemoryLimit, int);
00160 vtkGetMacro(InputMemoryLimit, int);
00162
00163 protected:
00164 vtkImageMarchingCubes();
00165 ~vtkImageMarchingCubes();
00166
00167 int NumberOfSlicesPerChunk;
00168 int InputMemoryLimit;
00169
00170 vtkContourValues *ContourValues;
00171
00172 int *LocatorPointIds;
00173 int LocatorDimX;
00174 int LocatorDimY;
00175 int LocatorMinX;
00176 int LocatorMinY;
00177
00178 void Execute();
00179
00180 void March(vtkImageData *inData, int chunkMin, int chunkMax,
00181 int numContours, double *values);
00182 void InitializeLocator(int min0, int max0, int min1, int max1);
00183 void DeleteLocator();
00184 int *GetLocatorPointer(int cellX, int cellY, int edge);
00185
00186 virtual int FillInputPortInformation(int, vtkInformation*);
00187 private:
00188 vtkImageMarchingCubes(const vtkImageMarchingCubes&);
00189 void operator=(const vtkImageMarchingCubes&);
00190 };
00191
00194 inline void vtkImageMarchingCubes::SetValue(int i, double value)
00195 {this->ContourValues->SetValue(i,value);}
00196
00198
00199 inline double vtkImageMarchingCubes::GetValue(int i)
00200 {return this->ContourValues->GetValue(i);}
00202
00204
00206 inline double *vtkImageMarchingCubes::GetValues()
00207 {return this->ContourValues->GetValues();}
00209
00213 inline void vtkImageMarchingCubes::GetValues(double *contourValues)
00214 {this->ContourValues->GetValues(contourValues);}
00215
00219 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
00220 {this->ContourValues->SetNumberOfContours(number);}
00221
00223
00224 inline int vtkImageMarchingCubes::GetNumberOfContours()
00225 {return this->ContourValues->GetNumberOfContours();}
00227
00229
00231 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
00232 {this->ContourValues->GenerateValues(numContours, range);}
00234
00236
00238 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
00239 rangeStart, double rangeEnd)
00240 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00242
00243 #endif
00244
00245
00246