VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkRectilinearGridToTetrahedra.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRectilinearGridToTetrahedra.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
48 #ifndef __vtkRectilinearGridToTetrahedra_h
49 #define __vtkRectilinearGridToTetrahedra_h
50 
51 // ways to create the mesh from voxels
52 #define VTK_VOXEL_TO_12_TET 12
53 #define VTK_VOXEL_TO_5_TET 5
54 #define VTK_VOXEL_TO_6_TET 6
55 #define VTK_VOXEL_TO_5_AND_12_TET -1
56 
57 #include "vtkFiltersGeneralModule.h" // For export macro
58 #include "vtkUnstructuredGridAlgorithm.h"
59 class vtkRectilinearGrid;
60 class vtkSignedCharArray;
61 class vtkIdList;
62 class vtkCellArray;
63 class vtkPoints;
64 
65 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
66 {
67 public:
68  vtkTypeMacro(vtkRectilinearGridToTetrahedra,vtkUnstructuredGridAlgorithm);
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72  static vtkRectilinearGridToTetrahedra *New();
73 
75 
77  void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
78  void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
79  void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
81  vtkSetMacro(TetraPerCell,int);
82  vtkGetMacro(TetraPerCell,int);
84 
86 
88  vtkSetMacro(RememberVoxelId,int);
89  vtkGetMacro(RememberVoxelId,int);
90  vtkBooleanMacro(RememberVoxelId,int);
92 
94 
99  void SetInput(const double Extent[3], const double Spacing[3],
100  const double tol=0.001);
102 
103 
104  void SetInput(const double ExtentX,
105  const double ExtentY,
106  const double ExtentZ,
107  const double SpacingX,
108  const double SpacingY,
109  const double SpacingZ,
110  const double tol=0.001);
112 
113 protected:
116 
117  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
118 
121 
122  virtual int FillInputPortInformation(int, vtkInformation*);
123 
124  private:
126 
127  void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented.
128 
129 //BTX
131 
134  static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid,
135  vtkSignedCharArray *VoxelSubdivisionType,
136  const int &TetraPerCell);
138 
140 
141  static void GridToTetMesh(vtkRectilinearGrid *RectGrid,
142  vtkSignedCharArray *VoxelSubdivisionType,
143  const int &TetraPerCell,
144  const int &RememberVoxelId,
145  vtkUnstructuredGrid *TetMesh);
147 
149 
153  static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
154  const int &DivisionType,
155  vtkPoints *NodeList,
156  vtkCellArray *TetList);
158 
160 
162  static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
163  vtkPoints *NodeList);
164 //ETX
165 };
167 
168 #endif /* __vtkRectilinearGridToTetrahedra_h */
169 
#define VTK_VOXEL_TO_6_TET
create a Tetrahedral mesh from a RectilinearGrid
#define VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_5_AND_12_TET
#define VTK_VOXEL_TO_5_TET