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

Graphics/vtkRectilinearGridToTetrahedra.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkRectilinearGridToTetrahedra.h,v $
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 "vtkUnstructuredGridSource.h"
00058 class vtkRectilinearGrid;
00059 class vtkCharArray;
00060 class vtkIdList;
00061 class vtkCellArray;
00062 class vtkPoints;
00063 
00064 class VTK_GRAPHICS_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridSource
00065 {
00066 public:
00067   vtkTypeRevisionMacro(vtkRectilinearGridToTetrahedra,vtkUnstructuredGridSource);
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);
00100   // Description:
00101   // This version of the function for the wrappers
00102   void SetInput(const double ExtentX, 
00103                 const double ExtentY,
00104                 const double ExtentZ, 
00105                 const double SpacingX,
00106                 const double SpacingY,
00107                 const double SpacingZ,
00108                 const double tol=0.001);
00110 
00112 
00115   void SetInput(vtkRectilinearGrid *input);
00116   vtkRectilinearGrid *GetInput();
00118 
00119 protected:
00120   vtkRectilinearGridToTetrahedra();
00121   ~vtkRectilinearGridToTetrahedra() {};
00122 
00123   void Execute();
00124 
00125   int RememberVoxelId;
00126   int TetraPerCell;
00127 
00128  private:
00129   vtkRectilinearGridToTetrahedra(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00130 
00131   void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00132 
00133 //BTX
00135 
00138   static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid, 
00139                                          vtkCharArray *VoxelSubdivisionType,
00140                                          const int &TetraPerCell);
00142 
00144 
00145   static void GridToTetMesh(vtkRectilinearGrid *RectGrid, 
00146                             vtkCharArray *VoxelSubdivisionType,
00147                             const int &TetraPerCell,
00148                             const int &RememberVoxelId,
00149                             vtkUnstructuredGrid *TetMesh);
00151 
00153 
00157   static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
00158                                  const int &DivisionType,
00159                                  vtkPoints *NodeList,
00160                                  vtkCellArray *TetList);
00162 
00164 
00166   static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
00167                                                   vtkPoints *NodeList);
00169 //ETX
00170 };
00171 
00172 #endif /* __vtkRectilinearGridToTetrahedra_h */
00173