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 =========================================================================*/
49 #ifndef vtkRectilinearGridToTetrahedra_h
50 #define vtkRectilinearGridToTetrahedra_h
51 
52 // ways to create the mesh from voxels
53 #define VTK_VOXEL_TO_12_TET 12
54 #define VTK_VOXEL_TO_5_TET 5
55 #define VTK_VOXEL_TO_6_TET 6
56 #define VTK_VOXEL_TO_5_AND_12_TET -1
57 
58 #include "vtkFiltersGeneralModule.h" // For export macro
60 class vtkRectilinearGrid;
61 class vtkSignedCharArray;
62 class vtkIdList;
63 class vtkCellArray;
64 class vtkPoints;
65 
66 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
67 {
68 public:
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
76 
78 
82  void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
83  void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
84  void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
86  vtkSetMacro(TetraPerCell,int);
87  vtkGetMacro(TetraPerCell,int);
89 
91 
95  vtkSetMacro(RememberVoxelId,vtkTypeBool);
96  vtkGetMacro(RememberVoxelId,vtkTypeBool);
97  vtkBooleanMacro(RememberVoxelId,vtkTypeBool);
99 
107  void SetInput(const double Extent[3], const double Spacing[3],
108  const double tol=0.001);
112  void SetInput(const double ExtentX,
113  const double ExtentY,
114  const double ExtentZ,
115  const double SpacingX,
116  const double SpacingY,
117  const double SpacingZ,
118  const double tol=0.001);
119 
120 protected:
123 
125 
128 
129  int FillInputPortInformation(int, vtkInformation*) override;
130 
131  private:
133 
134  void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
135 
140  static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid,
141  vtkSignedCharArray *VoxelSubdivisionType,
142  const int &TetraPerCell);
143 
147  static void GridToTetMesh(vtkRectilinearGrid *RectGrid,
148  vtkSignedCharArray *VoxelSubdivisionType,
149  const int &TetraPerCell,
150  const int &RememberVoxelId,
151  vtkUnstructuredGrid *TetMesh);
152 
159  static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
160  const int &DivisionType,
161  vtkPoints *NodeList,
162  vtkCellArray *TetList);
163 
168  static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
169  vtkPoints *NodeList);
170 
171 };
172 
173 #endif /* vtkRectilinearGridToTetrahedra_h */
174 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkRectilinearGridToTetrahedra::TetraPerCell
int TetraPerCell
Definition: vtkRectilinearGridToTetrahedra.h:127
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::SetTetraPerCellTo5And12
void SetTetraPerCellTo5And12()
Definition: vtkRectilinearGridToTetrahedra.h:85
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo12
void SetTetraPerCellTo12()
Definition: vtkRectilinearGridToTetrahedra.h:84
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:38
VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:53
vtkUnstructuredGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
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
vtkUnstructuredGridAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
VTK_VOXEL_TO_5_TET
#define VTK_VOXEL_TO_5_TET
Definition: vtkRectilinearGridToTetrahedra.h:54
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo6
void SetTetraPerCellTo6()
Definition: vtkRectilinearGridToTetrahedra.h:83
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
VTK_VOXEL_TO_6_TET
#define VTK_VOXEL_TO_6_TET
Definition: vtkRectilinearGridToTetrahedra.h:55
vtkUnstructuredGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRectilinearGridToTetrahedra::RememberVoxelId
vtkTypeBool RememberVoxelId
Definition: vtkRectilinearGridToTetrahedra.h:126
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:87
vtkRectilinearGridToTetrahedra::~vtkRectilinearGridToTetrahedra
~vtkRectilinearGridToTetrahedra() override
Definition: vtkRectilinearGridToTetrahedra.h:122
VTK_VOXEL_TO_5_AND_12_TET
#define VTK_VOXEL_TO_5_AND_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:56
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5
void SetTetraPerCellTo5()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:82
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69