VTK
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 
58 class vtkRectilinearGrid;
59 class vtkSignedCharArray;
60 class vtkIdList;
61 class vtkCellArray;
62 class vtkPoints;
63 
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
72 
74 
76  void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
77  void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
78  void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
80  vtkSetMacro(TetraPerCell,int);
81  vtkGetMacro(TetraPerCell,int);
83 
85 
87  vtkSetMacro(RememberVoxelId,int);
88  vtkGetMacro(RememberVoxelId,int);
89  vtkBooleanMacro(RememberVoxelId,int);
91 
93 
98  void SetInput(const double Extent[3], const double Spacing[3],
99  const double tol=0.001);
101 
102 
103  void SetInput(const double ExtentX,
104  const double ExtentY,
105  const double ExtentZ,
106  const double SpacingX,
107  const double SpacingY,
108  const double SpacingZ,
109  const double tol=0.001);
111 
112 protected:
115 
117 
120 
121  virtual int FillInputPortInformation(int, vtkInformation*);
122 
123  private:
125 
126  void operator=(const vtkRectilinearGridToTetrahedra&); // Not implemented.
127 
128 //BTX
130 
133  static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid,
134  vtkSignedCharArray *VoxelSubdivisionType,
135  const int &TetraPerCell);
137 
139 
140  static void GridToTetMesh(vtkRectilinearGrid *RectGrid,
141  vtkSignedCharArray *VoxelSubdivisionType,
142  const int &TetraPerCell,
143  const int &RememberVoxelId,
144  vtkUnstructuredGrid *TetMesh);
146 
148 
152  static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
153  const int &DivisionType,
154  vtkPoints *NodeList,
155  vtkCellArray *TetList);
157 
159 
161  static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
162  vtkPoints *NodeList);
163 //ETX
164 };
166 
167 #endif /* __vtkRectilinearGridToTetrahedra_h */
168