VTK  9.1.0
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 =========================================================================*/
65 #ifndef vtkRectilinearGridToTetrahedra_h
66 #define vtkRectilinearGridToTetrahedra_h
67 
68 // ways to create the mesh from voxels
69 #define VTK_VOXEL_TO_12_TET 12
70 #define VTK_VOXEL_TO_5_TET 5
71 #define VTK_VOXEL_TO_6_TET 6
72 #define VTK_VOXEL_TO_5_AND_12_TET -1
73 
74 #include "vtkFiltersGeneralModule.h" // For export macro
76 class vtkRectilinearGrid;
77 class vtkSignedCharArray;
78 class vtkIdList;
79 class vtkCellArray;
80 class vtkPoints;
81 
82 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
83 {
84 public:
86  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
92 
94 
98  void SetTetraPerCellTo5() { SetTetraPerCell(VTK_VOXEL_TO_5_TET); }
99  void SetTetraPerCellTo6() { SetTetraPerCell(VTK_VOXEL_TO_6_TET); }
100  void SetTetraPerCellTo12() { SetTetraPerCell(VTK_VOXEL_TO_12_TET); }
102  vtkSetMacro(TetraPerCell, int);
103  vtkGetMacro(TetraPerCell, int);
105 
107 
111  vtkSetMacro(RememberVoxelId, vtkTypeBool);
112  vtkGetMacro(RememberVoxelId, vtkTypeBool);
113  vtkBooleanMacro(RememberVoxelId, vtkTypeBool);
115 
123  void SetInput(const double Extent[3], const double Spacing[3], const double tol = 0.001);
127  void SetInput(const double ExtentX, const double ExtentY, const double ExtentZ,
128  const double SpacingX, const double SpacingY, const double SpacingZ, const double tol = 0.001);
129 
130 protected:
132  ~vtkRectilinearGridToTetrahedra() override = default;
133 
135 
138 
140 
141 private:
143 
144  void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
145 
150  static void DetermineGridDivisionTypes(vtkRectilinearGrid* RectGrid,
151  vtkSignedCharArray* VoxelSubdivisionType, const int& TetraPerCell);
152 
156  static void GridToTetMesh(vtkRectilinearGrid* RectGrid, vtkSignedCharArray* VoxelSubdivisionType,
157  const int& TetraPerCell, const int& RememberVoxelId, vtkUnstructuredGrid* TetMesh);
158 
165  static int TetrahedralizeVoxel(
166  vtkIdList* VoxelCorners, const int& DivisionType, vtkPoints* NodeList, vtkCellArray* TetList);
167 
172  static inline void TetrahedralizeAddCenterPoint(vtkIdList* VoxelCorners, vtkPoints* NodeList);
173 };
174 
175 #endif /* vtkRectilinearGridToTetrahedra_h */
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkRectilinearGridToTetrahedra::TetraPerCell
int TetraPerCell
Definition: vtkRectilinearGridToTetrahedra.h:137
vtkRectilinearGridToTetrahedra::vtkRectilinearGridToTetrahedra
vtkRectilinearGridToTetrahedra()
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:151
vtkRectilinearGridToTetrahedra
create a Tetrahedral mesh from a RectilinearGrid
Definition: vtkRectilinearGridToTetrahedra.h:83
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5And12
void SetTetraPerCellTo5And12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:101
vtkRectilinearGridToTetrahedra::SetInput
void SetInput(const double Extent[3], const double Spacing[3], const double tol=0.001)
This function for convenience for creating a Rectilinear Grid If Spacing does not fit evenly into ext...
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo12
void SetTetraPerCellTo12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:100
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:36
vtkRectilinearGridToTetrahedra::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:69
vtkRectilinearGridToTetrahedra::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:290
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkRectilinearGridToTetrahedra::New
static vtkRectilinearGridToTetrahedra * New()
Form 5 Tetrahedra per cube.
vtkRectilinearGridToTetrahedra::~vtkRectilinearGridToTetrahedra
~vtkRectilinearGridToTetrahedra() override=default
VTK_VOXEL_TO_5_TET
#define VTK_VOXEL_TO_5_TET
Definition: vtkRectilinearGridToTetrahedra.h:70
vtkRectilinearGridToTetrahedra::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo6
void SetTetraPerCellTo6()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:99
VTK_VOXEL_TO_6_TET
#define VTK_VOXEL_TO_6_TET
Definition: vtkRectilinearGridToTetrahedra.h:71
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)
This version of the function for the wrappers.
vtkRectilinearGridToTetrahedra::RememberVoxelId
vtkTypeBool RememberVoxelId
Definition: vtkRectilinearGridToTetrahedra.h:136
vtkUnstructuredGridAlgorithm.h
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:41
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:204
VTK_VOXEL_TO_5_AND_12_TET
#define VTK_VOXEL_TO_5_AND_12_TET
Definition: vtkRectilinearGridToTetrahedra.h:72
vtkRectilinearGridToTetrahedra::SetTetraPerCellTo5
void SetTetraPerCellTo5()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
Definition: vtkRectilinearGridToTetrahedra.h:98
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69