00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00096 #ifndef __vtkDelaunay3D_h
00097 #define __vtkDelaunay3D_h
00098
00099 #include "vtkUnstructuredGridAlgorithm.h"
00100
00101 class vtkIdList;
00102 class vtkPointLocator;
00103 class vtkPointSet;
00104 class vtkPoints;
00105 class vtkTetraArray;
00106
00107 class VTK_GRAPHICS_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
00108 {
00109 public:
00110 vtkTypeRevisionMacro(vtkDelaunay3D,vtkUnstructuredGridAlgorithm);
00111 void PrintSelf(ostream& os, vtkIndent indent);
00112
00115 static vtkDelaunay3D *New();
00116
00118
00122 vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
00123 vtkGetMacro(Alpha,double);
00125
00127
00130 vtkSetClampMacro(Tolerance,double,0.0,1.0);
00131 vtkGetMacro(Tolerance,double);
00133
00135
00137 vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
00138 vtkGetMacro(Offset,double);
00140
00142
00146 vtkSetMacro(BoundingTriangulation,int);
00147 vtkGetMacro(BoundingTriangulation,int);
00148 vtkBooleanMacro(BoundingTriangulation,int);
00150
00152
00154 void SetLocator(vtkPointLocator *locator);
00155 vtkGetObjectMacro(Locator,vtkPointLocator);
00157
00160 void CreateDefaultLocator();
00161
00163
00173 vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
00174 vtkIdType numPts, vtkPoints* &pts);
00176
00178
00187 void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
00188 vtkIdType id, double x[3], vtkIdList *holeTetras);
00190
00195 void EndPointInsertion();
00196
00198 unsigned long GetMTime();
00199
00200 protected:
00201 vtkDelaunay3D();
00202 ~vtkDelaunay3D();
00203
00204 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00205
00206 double Alpha;
00207 double Tolerance;
00208 int BoundingTriangulation;
00209 double Offset;
00210
00211 vtkPointLocator *Locator;
00212
00213 vtkTetraArray *TetraArray;
00214 int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
00215 int depth);
00216 int InSphere(double x[3], vtkIdType tetraId);
00217 void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
00218 vtkIdType tetraId);
00219
00220 int NumberOfDuplicatePoints;
00221 int NumberOfDegeneracies;
00222
00223
00224 int *References;
00225
00226 vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
00227 vtkIdList *tetras, vtkIdList *faces,
00228 vtkPointLocator *Locator);
00229
00230 virtual int FillInputPortInformation(int, vtkInformation*);
00231 private:
00232 vtkIdList *Tetras;
00233 vtkIdList *Faces;
00234 vtkIdList *BoundaryPts;
00235 vtkIdList *CheckedTetras;
00236 vtkIdList *NeiTetras;
00237
00238 private:
00239 vtkDelaunay3D(const vtkDelaunay3D&);
00240 void operator=(const vtkDelaunay3D&);
00241 };
00242
00243 #endif
00244
00245