00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00092 #ifndef __vtkOrderedTriangulator_h
00093 #define __vtkOrderedTriangulator_h
00094
00095 #include "vtkObject.h"
00096
00097 class vtkUnstructuredGrid;
00098 class vtkCellArray;
00099 class vtkHeap;
00100 class vtkIdList;
00101 class vtkPoints;
00102 class vtkTetra;
00103 class vtkDataArray;
00104 class vtkDoubleArray;
00105 struct vtkOTMesh;
00106 struct vtkOTTemplates;
00107
00108
00109
00110 #if VTK_SIZEOF_SHORT == 4
00111 typedef unsigned short TemplateIDType;
00112 #elif VTK_SIZEOF_INT == 4
00113 typedef unsigned int TemplateIDType;
00114 #elif VTK_SIZEOF_LONG == 4
00115 typedef unsigned long TemplateIDType;
00116 #endif
00117
00118 class VTK_FILTERING_EXPORT vtkOrderedTriangulator : public vtkObject
00119 {
00120 public:
00121 vtkTypeRevisionMacro(vtkOrderedTriangulator,vtkObject);
00122 void PrintSelf(ostream& os, vtkIndent indent);
00123
00125 static vtkOrderedTriangulator *New();
00126
00128
00130 void InitTriangulation(double xmin, double xmax, double ymin, double ymax,
00131 double zmin, double zmax, int numPts);
00132 void InitTriangulation(double bounds[6], int numPts);
00134
00136
00149 vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
00150 vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3],
00151 double p[3], int type);
00152 vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, vtkIdType sortid2,
00153 double x[3], double p[3], int type);
00155
00157
00160 void Triangulate();
00161 void TemplateTriangulate(int cellType, int numPts, int numEdges);
00163
00169 void UpdatePointType(vtkIdType internalId, int type);
00170
00172
00177 vtkSetMacro(UseTemplates,int);
00178 vtkGetMacro(UseTemplates,int);
00179 vtkBooleanMacro(UseTemplates,int);
00181
00183
00187 vtkSetMacro(PreSorted,int);
00188 vtkGetMacro(PreSorted,int);
00189 vtkBooleanMacro(PreSorted,int);
00191
00193
00195 vtkSetMacro(UseTwoSortIds,int);
00196 vtkGetMacro(UseTwoSortIds,int);
00197 vtkBooleanMacro(UseTwoSortIds,int);
00199
00209 vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid);
00210
00218 vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid);
00219
00225 vtkIdType AddTetras(int classification, vtkCellArray *connectivity);
00226
00230 vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts);
00231
00234 vtkIdType AddTriangles(vtkCellArray *connectivity);
00235
00239 vtkIdType AddTriangles(vtkIdType id, vtkCellArray *connectivity);
00240
00242
00244 void InitTetraTraversal();
00245 int GetNextTetra(int classification, vtkTetra *tet,
00246 vtkDataArray *cellScalars, vtkDoubleArray *tetScalars);
00248
00249 protected:
00250 vtkOrderedTriangulator();
00251 ~vtkOrderedTriangulator();
00252
00253 private:
00254 void Initialize();
00255
00256 vtkOTMesh *Mesh;
00257 int NumberOfPoints;
00258 int MaximumNumberOfPoints;
00259 double Bounds[6];
00260 int PreSorted;
00261 int UseTwoSortIds;
00262 vtkHeap *Heap;
00263 double Quanta;
00264
00265 int UseTemplates;
00266 int CellType;
00267 int NumberOfCellPoints;
00268 int NumberOfCellEdges;
00269 vtkHeap *TemplateHeap;
00270 vtkOTTemplates *Templates;
00271 int TemplateTriangulation();
00272 void AddTemplate();
00273 TemplateIDType ComputeTemplateIndex();
00274
00275 private:
00276 vtkOrderedTriangulator(const vtkOrderedTriangulator&);
00277 void operator=(const vtkOrderedTriangulator&);
00278 };
00279
00280 #endif
00281
00282