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 
57 #include "vtkFiltersGeneralModule.h" // For export macro
59 class vtkRectilinearGrid;
60 class vtkSignedCharArray;
61 class vtkIdList;
62 class vtkCellArray;
63 class vtkPoints;
64 
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
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 
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
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store vtkAlgorithm input/output information.
static vtkUnstructuredGridAlgorithm * New()
virtual int FillInputPortInformation(int port, vtkInformation *info)
create a Tetrahedral mesh from a RectilinearGrid
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
dataset represents arbitrary combinations of all possible cell types
void PrintSelf(ostream &os, vtkIndent indent)
dynamic, self-adjusting array of signed char
#define VTK_VOXEL_TO_12_TET
#define VTKFILTERSGENERAL_EXPORT
Superclass for algorithms that produce only unstructured grid as output.
#define VTK_VOXEL_TO_5_AND_12_TET
object to represent cell connectivity
Definition: vtkCellArray.h:49
#define VTK_VOXEL_TO_5_TET
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:38