00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00072
#ifndef __vtkOrderedTriangulator_h
00073
#define __vtkOrderedTriangulator_h
00074
00075
#include "vtkObject.h"
00076
00077
class vtkUnstructuredGrid;
00078
class vtkCellArray;
00079
class vtkHeap;
00080
class vtkIdList;
00081
class vtkPoints;
00082
class vtkTetra;
00083
class vtkDataArray;
00084
class vtkDoubleArray;
00085
struct vtkOTMesh;
00086
struct vtkOTTemplates;
00087
00088
00089
00090
#if VTK_SIZEOF_SHORT == 4
00091
typedef unsigned short TemplateIDType;
00092
#elif VTK_SIZEOF_INT == 4
00093
typedef unsigned int TemplateIDType;
00094
#elif VTK_SIZEOF_LONG == 4
00095
typedef unsigned long TemplateIDType;
00096
#endif
00097
00098 class VTK_COMMON_EXPORT vtkOrderedTriangulator :
public vtkObject
00099 {
00100
public:
00101 vtkTypeRevisionMacro(vtkOrderedTriangulator,
vtkObject);
00102
void PrintSelf(ostream& os,
vtkIndent indent);
00103
00105
static vtkOrderedTriangulator *
New();
00106
00108
00110
void InitTriangulation(
double xmin,
double xmax,
double ymin,
double ymax,
00111
double zmin,
double zmax,
int numPts);
00112
void InitTriangulation(
double bounds[6],
int numPts);
00114
00116
00129
vtkIdType InsertPoint(
vtkIdType id,
double x[3],
double p[3],
int type);
00130
vtkIdType InsertPoint(
vtkIdType id,
vtkIdType sortid,
double x[3],
00131
double p[3],
int type);
00132
vtkIdType InsertPoint(
vtkIdType id,
vtkIdType sortid,
vtkIdType sortid2,
00133
double x[3],
double p[3],
int type);
00135
00137
00140
void Triangulate();
00141
void TemplateTriangulate(
int cellType,
int numPts,
int numEdges);
00143
00149
void UpdatePointType(
vtkIdType internalId,
int type);
00150
00152
00157 vtkSetMacro(UseTemplates,
int);
00158 vtkGetMacro(UseTemplates,
int);
00159 vtkBooleanMacro(UseTemplates,
int);
00161
00163
00167 vtkSetMacro(PreSorted,
int);
00168 vtkGetMacro(PreSorted,
int);
00169 vtkBooleanMacro(PreSorted,
int);
00171
00173
00175 vtkSetMacro(UseTwoSortIds,
int);
00176 vtkGetMacro(UseTwoSortIds,
int);
00177 vtkBooleanMacro(UseTwoSortIds,
int);
00179
00189
vtkIdType GetTetras(
int classification,
vtkUnstructuredGrid *ugrid);
00190
00198
vtkIdType AddTetras(
int classification,
vtkUnstructuredGrid *ugrid);
00199
00205
vtkIdType AddTetras(
int classification,
vtkCellArray *connectivity);
00206
00210
vtkIdType AddTetras(
int classification,
vtkIdList *ptIds,
vtkPoints *pts);
00211
00214
vtkIdType AddTriangles(
vtkCellArray *connectivity);
00215
00219
vtkIdType AddTriangles(
vtkIdType id,
vtkCellArray *connectivity);
00220
00222
00224
void InitTetraTraversal();
00225
int GetNextTetra(
int classification,
vtkTetra *tet,
00226
vtkDataArray *cellScalars,
vtkDoubleArray *tetScalars);
00228
00229
protected:
00230 vtkOrderedTriangulator();
00231 ~vtkOrderedTriangulator();
00232
00233
private:
00234
void Initialize();
00235
00236 vtkOTMesh *Mesh;
00237
int NumberOfPoints;
00238
int MaximumNumberOfPoints;
00239
double Bounds[6];
00240
int PreSorted;
00241
int UseTwoSortIds;
00242
vtkHeap *Heap;
00243
double Quanta;
00244
00245
int UseTemplates;
00246
int CellType;
00247
int NumberOfCellPoints;
00248
int NumberOfCellEdges;
00249
vtkHeap *TemplateHeap;
00250 vtkOTTemplates *Templates;
00251
int TemplateTriangulation();
00252
void AddTemplate();
00253 TemplateIDType ComputeTemplateIndex();
00254
00255
private:
00256 vtkOrderedTriangulator(
const vtkOrderedTriangulator&);
00257
void operator=(
const vtkOrderedTriangulator&);
00258 };
00259
00260
#endif
00261
00262