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 
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   vtkTypeRevisionMacro(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);
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 
00111 protected:
00112   vtkRectilinearGridToTetrahedra();
00113   ~vtkRectilinearGridToTetrahedra() {};
00114 
00115   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00116 
00117   int RememberVoxelId;
00118   int TetraPerCell;
00119 
00120   virtual int FillInputPortInformation(int, vtkInformation*);
00121 
00122  private:
00123   vtkRectilinearGridToTetrahedra(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00124 
00125   void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented.
00126 
00127 //BTX
00129 
00132   static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid, 
00133                                          vtkSignedCharArray *VoxelSubdivisionType,
00134                                          const int &TetraPerCell);
00136 
00138 
00139   static void GridToTetMesh(vtkRectilinearGrid *RectGrid, 
00140                             vtkSignedCharArray *VoxelSubdivisionType,
00141                             const int &TetraPerCell,
00142                             const int &RememberVoxelId,
00143                             vtkUnstructuredGrid *TetMesh);
00145 
00147 
00151   static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
00152                                  const int &DivisionType,
00153                                  vtkPoints *NodeList,
00154                                  vtkCellArray *TetList);
00156 
00158 
00160   static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
00161                                                   vtkPoints *NodeList);
00163 //ETX
00164 };
00165 
00166 #endif /* __vtkRectilinearGridToTetrahedra_h */
00167 

Generated on Mon Jan 21 23:07:26 2008 for VTK by  doxygen 1.4.3-20050530