VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkRectilinearGridToTetrahedra.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00048 #ifndef __vtkRectilinearGridToTetrahedra_h 00049 #define __vtkRectilinearGridToTetrahedra_h 00050 00051 // ways to create the mesh from voxels 00052 #define VTK_VOXEL_TO_12_TET 12 00053 #define VTK_VOXEL_TO_5_TET 5 00054 #define VTK_VOXEL_TO_6_TET 6 00055 #define VTK_VOXEL_TO_5_AND_12_TET -1 00056 00057 #include "vtkUnstructuredGridAlgorithm.h" 00058 class vtkRectilinearGrid; 00059 class vtkSignedCharArray; 00060 class vtkIdList; 00061 class vtkCellArray; 00062 class vtkPoints; 00063 00064 class VTK_GRAPHICS_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm 00065 { 00066 public: 00067 vtkTypeMacro(vtkRectilinearGridToTetrahedra,vtkUnstructuredGridAlgorithm); 00068 void PrintSelf(ostream& os, vtkIndent indent); 00069 00071 static vtkRectilinearGridToTetrahedra *New(); 00072 00074 00076 void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);}; 00077 void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);}; 00078 void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);}; 00079 void SetTetraPerCellTo5And12() {SetTetraPerCell(VTK_VOXEL_TO_5_AND_12_TET);}; 00080 vtkSetMacro(TetraPerCell,int); 00081 vtkGetMacro(TetraPerCell,int); 00083 00085 00087 vtkSetMacro(RememberVoxelId,int); 00088 vtkGetMacro(RememberVoxelId,int); 00089 vtkBooleanMacro(RememberVoxelId,int); 00091 00093 00098 void SetInput(const double Extent[3], const double Spacing[3], 00099 const double tol=0.001); 00101 00102 00103 void SetInput(const double ExtentX, 00104 const double ExtentY, 00105 const double ExtentZ, 00106 const double SpacingX, 00107 const double SpacingY, 00108 const double SpacingZ, 00109 const double tol=0.001); 00111 00112 protected: 00113 vtkRectilinearGridToTetrahedra(); 00114 ~vtkRectilinearGridToTetrahedra() {}; 00115 00116 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00117 00118 int RememberVoxelId; 00119 int TetraPerCell; 00120 00121 virtual int FillInputPortInformation(int, vtkInformation*); 00122 00123 private: 00124 vtkRectilinearGridToTetrahedra(const vtkRectilinearGridToTetrahedra&); // Not implemented. 00125 00126 void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented. 00127 00128 //BTX 00130 00133 static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid, 00134 vtkSignedCharArray *VoxelSubdivisionType, 00135 const int &TetraPerCell); 00137 00139 00140 static void GridToTetMesh(vtkRectilinearGrid *RectGrid, 00141 vtkSignedCharArray *VoxelSubdivisionType, 00142 const int &TetraPerCell, 00143 const int &RememberVoxelId, 00144 vtkUnstructuredGrid *TetMesh); 00146 00148 00152 static int TetrahedralizeVoxel(vtkIdList *VoxelCorners, 00153 const int &DivisionType, 00154 vtkPoints *NodeList, 00155 vtkCellArray *TetList); 00157 00159 00161 static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners, 00162 vtkPoints *NodeList); 00163 //ETX 00164 }; 00166 00167 #endif /* __vtkRectilinearGridToTetrahedra_h */ 00168