Graphics/vtkRectilinearGridToTetrahedra.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00059 #ifndef __vtkRectilinearGridToTetrahedra_h
00060 #define __vtkRectilinearGridToTetrahedra_h
00061
00062
00063 #define VTK_VOXEL_TO_12_TET 12
00064 #define VTK_VOXEL_TO_5_TET 5
00065 #define VTK_VOXEL_TO_6_TET 6
00066 #define VTK_VOXEL_TO_5_AND_12_TET -1
00067
00068 #include "vtkUnstructuredGridSource.h"
00069 class vtkRectilinearGrid;
00070 class vtkCharArray;
00071 class vtkIdList;
00072 class vtkCellArray;
00073 class vtkPoints;
00074
00075 class VTK_GRAPHICS_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridSource
00076 {
00077 public:
00078 vtkTypeRevisionMacro(vtkRectilinearGridToTetrahedra,vtkUnstructuredGridSource);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00082 static vtkRectilinearGridToTetrahedra *New();
00083
00085
00087 void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
00088 void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
00089 void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
00090 void SetTetraPerCellTo5And12() {SetTetraPerCell(VTK_VOXEL_TO_5_AND_12_TET);};
00091 vtkSetMacro(TetraPerCell,int);
00092 vtkGetMacro(TetraPerCell,int);
00094
00096
00098 vtkSetMacro(RememberVoxelId,int);
00099 vtkGetMacro(RememberVoxelId,int);
00100 vtkBooleanMacro(RememberVoxelId,int);
00102
00104
00109 void SetInput(const float Extent[3], const float Spacing[3],
00110 const float tol=0.001);
00111
00112
00113 void SetInput(const float ExtentX,
00114 const float ExtentY,
00115 const float ExtentZ,
00116 const float SpacingX,
00117 const float SpacingY,
00118 const float SpacingZ,
00119 const float tol=0.001);
00121
00123
00126 void SetInput(vtkRectilinearGrid *input);
00127 vtkRectilinearGrid *GetInput();
00129
00130 protected:
00131 vtkRectilinearGridToTetrahedra();
00132 ~vtkRectilinearGridToTetrahedra() {};
00133
00134 void Execute();
00135
00136 int RememberVoxelId;
00137 int TetraPerCell;
00138
00139 private:
00140 vtkRectilinearGridToTetrahedra(const vtkRectilinearGridToTetrahedra&);
00141
00142 void operator=(const vtkRectilinearGridToTetrahedra&);
00143
00144
00146
00149 static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid,
00150 vtkCharArray *VoxelSubdivisionType,
00151 const int &TetraPerCell);
00153
00155
00156 static void GridToTetMesh(vtkRectilinearGrid *RectGrid,
00157 vtkCharArray *VoxelSubdivisionType,
00158 const int &TetraPerCell,
00159 const int &RememberVoxelId,
00160 vtkUnstructuredGrid *TetMesh);
00162
00164
00168 static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
00169 const int &DivisionType,
00170 vtkPoints *NodeList,
00171 vtkCellArray *TetList);
00173
00175
00177 static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
00178 vtkPoints *NodeList);
00180
00181 };
00182
00183 #endif
00184