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 
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 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkRectilinearGridToTetrahedra::TetraPerCell
int TetraPerCell
Definition: vtkRectilinearGridToTetrahedra.h:120
vtkRectilinearGridToTetrahedra::vtkRectilinearGridToTetrahedra
vtkRectilinearGridToTetrahedra()
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:56
vtkRectilinearGridToTetrahedra
create a Tetrahedral mesh from a RectilinearGrid
Definition: vtkRectilinearGridToTetrahedra.h:66
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkRectilinearGridToTetrahedra::FillInputPortInformation
virtual int FillInputPortInformation(int, vtkInformation *)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5And12
void SetTetraPerCellTo5And12()
Definition: vtkRectilinearGridToTetrahedra.h:80
vtkRectilinearGridToTetrahedra::~vtkRectilinearGridToTetrahedra
~vtkRectilinearGridToTetrahedra()
Definition: vtkRectilinearGridToTetrahedra.h:115
vtkRectilinearGridToTetrahedra::SetInput
void SetInput(const double Extent[3], const double Spacing[3], const double tol=0.001)
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo12
void SetTetraPerCellTo12()
Definition: vtkRectilinearGridToTetrahedra.h:79
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:46
vtkRectilinearGridToTetrahedra::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:52
vtkFiltersGeneralModule.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
VTKFILTERSGENERAL_EXPORT
#define VTKFILTERSGENERAL_EXPORT
Definition: vtkFiltersGeneralModule.h:15
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkRectilinearGridToTetrahedra::New
static vtkRectilinearGridToTetrahedra * New()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
VTK_VOXEL_TO_5_TET
#define VTK_VOXEL_TO_5_TET
Definition: vtkRectilinearGridToTetrahedra.h:53
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo6
void SetTetraPerCellTo6()
Definition: vtkRectilinearGridToTetrahedra.h:78
vtkRectilinearGridToTetrahedra::RememberVoxelId
int RememberVoxelId
Definition: vtkRectilinearGridToTetrahedra.h:119
VTK_VOXEL_TO_6_TET
#define VTK_VOXEL_TO_6_TET
Definition: vtkRectilinearGridToTetrahedra.h:54
vtkRectilinearGridToTetrahedra::SetInput
void SetInput(const double ExtentX, const double ExtentY, const double ExtentZ, const double SpacingX, const double SpacingY, const double SpacingZ, const double tol=0.001)
vtkRectilinearGridToTetrahedra::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkUnstructuredGridAlgorithm.h
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:40
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:82
VTK_VOXEL_TO_5_AND_12_TET
#define VTK_VOXEL_TO_5_AND_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:55
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5
void SetTetraPerCellTo5()
Definition: vtkRectilinearGridToTetrahedra.h:77