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 =========================================================================*/
46 #ifndef vtkRectilinearGridToTetrahedra_h
47 #define vtkRectilinearGridToTetrahedra_h
48 
49 // ways to create the mesh from voxels
50 #define VTK_VOXEL_TO_12_TET 12
51 #define VTK_VOXEL_TO_5_TET 5
52 #define VTK_VOXEL_TO_6_TET 6
53 #define VTK_VOXEL_TO_5_AND_12_TET -1
54 
55 #include "vtkFiltersGeneralModule.h" // For export macro
57 class vtkRectilinearGrid;
58 class vtkSignedCharArray;
59 class vtkIdList;
60 class vtkCellArray;
61 class vtkPoints;
62 
63 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
73 
75 
79  void SetTetraPerCellTo5() {SetTetraPerCell(VTK_VOXEL_TO_5_TET);};
80  void SetTetraPerCellTo6() {SetTetraPerCell(VTK_VOXEL_TO_6_TET);};
81  void SetTetraPerCellTo12() {SetTetraPerCell(VTK_VOXEL_TO_12_TET);};
83  vtkSetMacro(TetraPerCell,int);
84  vtkGetMacro(TetraPerCell,int);
86 
88 
92  vtkSetMacro(RememberVoxelId,vtkTypeBool);
93  vtkGetMacro(RememberVoxelId,vtkTypeBool);
94  vtkBooleanMacro(RememberVoxelId,vtkTypeBool);
96 
104  void SetInput(const double Extent[3], const double Spacing[3],
105  const double tol=0.001);
109  void SetInput(const double ExtentX,
110  const double ExtentY,
111  const double ExtentZ,
112  const double SpacingX,
113  const double SpacingY,
114  const double SpacingZ,
115  const double tol=0.001);
116 
117 protected:
120 
122 
125 
126  int FillInputPortInformation(int, vtkInformation*) override;
127 
128  private:
130 
131  void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
132 
137  static void DetermineGridDivisionTypes(vtkRectilinearGrid *RectGrid,
138  vtkSignedCharArray *VoxelSubdivisionType,
139  const int &TetraPerCell);
140 
144  static void GridToTetMesh(vtkRectilinearGrid *RectGrid,
145  vtkSignedCharArray *VoxelSubdivisionType,
146  const int &TetraPerCell,
147  const int &RememberVoxelId,
148  vtkUnstructuredGrid *TetMesh);
149 
156  static int TetrahedralizeVoxel(vtkIdList *VoxelCorners,
157  const int &DivisionType,
158  vtkPoints *NodeList,
159  vtkCellArray *TetList);
160 
165  static inline void TetrahedralizeAddCenterPoint(vtkIdList *VoxelCorners,
166  vtkPoints *NodeList);
167 
168 };
169 
170 #endif /* vtkRectilinearGridToTetrahedra_h */
171 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkRectilinearGridToTetrahedra::TetraPerCell
int TetraPerCell
Definition: vtkRectilinearGridToTetrahedra.h:124
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:50
vtkRectilinearGridToTetrahedra
create a Tetrahedral mesh from a RectilinearGrid
Definition: vtkRectilinearGridToTetrahedra.h:63
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5And12
void SetTetraPerCellTo5And12()
Definition: vtkRectilinearGridToTetrahedra.h:82
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo12
void SetTetraPerCellTo12()
Definition: vtkRectilinearGridToTetrahedra.h:81
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:35
VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:50
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:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
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:80
VTK_VOXEL_TO_5_TET
#define VTK_VOXEL_TO_5_TET
Definition: vtkRectilinearGridToTetrahedra.h:51
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo6
void SetTetraPerCellTo6()
Definition: vtkRectilinearGridToTetrahedra.h:80
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
VTK_VOXEL_TO_6_TET
#define VTK_VOXEL_TO_6_TET
Definition: vtkRectilinearGridToTetrahedra.h:52
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:123
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:81
vtkRectilinearGridToTetrahedra::~vtkRectilinearGridToTetrahedra
~vtkRectilinearGridToTetrahedra() override
Definition: vtkRectilinearGridToTetrahedra.h:119
VTK_VOXEL_TO_5_AND_12_TET
#define VTK_VOXEL_TO_5_AND_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:53
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5
void SetTetraPerCellTo5()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:79
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69