Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkRectilinearGridToTetrahedra.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkRectilinearGridToTetrahedra.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00049 #ifndef __vtkRectilinearGridToTetrahedra_h
00050 #define __vtkRectilinearGridToTetrahedra_h
00051 
00052 // ways to create the mesh from voxels
00053 #define VTK_VOXEL_TO_12_TET      12
00054 #define VTK_VOXEL_TO_5_TET        5
00055 #define VTK_VOXEL_TO_6_TET        6
00056 #define VTK_VOXEL_TO_5_AND_12_TET -1
00057 
00058 #include "vtkUnstructuredGridSource.h"
00059 class vtkRectilinearGrid;
00060 class vtkCharArray;
00061 class vtkIdList;
00062 class vtkCellArray;
00063 class vtkPoints;
00064 
00065 class VTK_GRAPHICS_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridSource
00066 {
00067 public:
00068   vtkTypeRevisionMacro(vtkRectilinearGridToTetrahedra,vtkUnstructuredGridSource);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072   static vtkRectilinearGridToTetrahedra *New();
00073 
00075 
00077   void SetTetraPerCellTo5()      {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
00078   void SetTetraPerCellTo6()      {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
00079   void SetTetraPerCellTo12()     {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
00080   void SetTetraPerCellTo5And12() {SetTetraPerCell(VTK_VOXEL_TO_5_AND_12_TET);};
00081   vtkSetMacro(TetraPerCell,int);
00082   vtkGetMacro(TetraPerCell,int);
00084 
00086 
00088   vtkSetMacro(RememberVoxelId,int);
00089   vtkGetMacro(RememberVoxelId,int);
00090   vtkBooleanMacro(RememberVoxelId,int);
00092 
00094 
00099   void SetInput(const float Extent[3], const float Spacing[3],
00100                 const float tol=0.001);
00101   // Description:
00102   // This version of the function for the wrappers
00103   void SetInput(const float ExtentX, 
00104                 const float ExtentY,
00105                 const float ExtentZ, 
00106                 const float SpacingX,
00107                 const float SpacingY,
00108                 const float SpacingZ,
00109                 const float tol=0.001);
00111 
00113 
00116   void SetInput(vtkRectilinearGrid *input);
00117   vtkRectilinearGrid *GetInput();
00119 
00120 protected:
00121   vtkRectilinearGridToTetrahedra();
00122   ~vtkRectilinearGridToTetrahedra() {};
00123 
00124   void Execute();
00125 
00126   int RememberVoxelId;
00127   int TetraPerCell;
00128 
00129  private:
00130   vtkRectilinearGridToTetrahedra(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00131 
00132   void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00133 
00134 //BTX
00136 
00139   static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid, 
00140                                          vtkCharArray *VoxelSubdivisionType,
00141                                          const int &TetraPerCell);
00143 
00145 
00146   static void GridToTetMesh(vtkRectilinearGrid *RectGrid, 
00147                             vtkCharArray *VoxelSubdivisionType,
00148                             const int &TetraPerCell,
00149                             const int &RememberVoxelId,
00150                             vtkUnstructuredGrid *TetMesh);
00152 
00154 
00158   static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
00159                                  const int &DivisionType,
00160                                  vtkPoints *NodeList,
00161                                  vtkCellArray *TetList);
00163 
00165 
00167   static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
00168                                                   vtkPoints *NodeList);
00170 //ETX
00171 };
00172 
00173 #endif /* __vtkRectilinearGridToTetrahedra_h */
00174