VTK  9.3.0
vtkRectilinearGridToTetrahedra.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
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 VTK_ABI_NAMESPACE_BEGIN
58 class vtkRectilinearGrid;
59 class vtkSignedCharArray;
60 class vtkIdList;
61 class vtkCellArray;
62 class vtkPoints;
63 
64 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
74 
76 
80  void SetTetraPerCellTo5() { SetTetraPerCell(VTK_VOXEL_TO_5_TET); }
81  void SetTetraPerCellTo6() { SetTetraPerCell(VTK_VOXEL_TO_6_TET); }
82  void SetTetraPerCellTo12() { SetTetraPerCell(VTK_VOXEL_TO_12_TET); }
84  vtkSetMacro(TetraPerCell, int);
85  vtkGetMacro(TetraPerCell, int);
87 
89 
93  vtkSetMacro(RememberVoxelId, vtkTypeBool);
94  vtkGetMacro(RememberVoxelId, vtkTypeBool);
95  vtkBooleanMacro(RememberVoxelId, vtkTypeBool);
97 
105  void SetInput(const double Extent[3], const double Spacing[3], double tol = 0.001);
109  void SetInput(double ExtentX, double ExtentY, double ExtentZ, double SpacingX, double SpacingY,
110  double SpacingZ, double tol = 0.001);
111 
112 protected:
114  ~vtkRectilinearGridToTetrahedra() override = default;
115 
117 
120 
122 
123 private:
125 
126  void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
127 
132  static void DetermineGridDivisionTypes(vtkRectilinearGrid* RectGrid,
133  vtkSignedCharArray* VoxelSubdivisionType, const int& TetraPerCell);
134 
138  static void GridToTetMesh(vtkRectilinearGrid* RectGrid, vtkSignedCharArray* VoxelSubdivisionType,
139  const int& TetraPerCell, const int& RememberVoxelId, vtkUnstructuredGrid* TetMesh,
141 
148  static int TetrahedralizeVoxel(
149  vtkIdList* VoxelCorners, const int& DivisionType, vtkPoints* NodeList, vtkCellArray* TetList);
150 
155  static void TetrahedralizeAddCenterPoint(vtkIdList* VoxelCorners, vtkPoints* NodeList);
156 };
157 
158 VTK_ABI_NAMESPACE_END
159 #endif /* vtkRectilinearGridToTetrahedra_h */
object to represent cell connectivity
Definition: vtkCellArray.h:185
list of point or cell ids
Definition: vtkIdList.h:32
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
create a Tetrahedral mesh from a RectilinearGrid
void SetTetraPerCellTo5And12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTetraPerCellTo6()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
void SetInput(double ExtentX, double ExtentY, double ExtentZ, double SpacingX, double SpacingY, double SpacingZ, double tol=0.001)
This version of the function for the wrappers.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetInput(const double Extent[3], const double Spacing[3], double tol=0.001)
This function for convenience for creating a Rectilinear Grid If Spacing does not fit evenly into ext...
static vtkRectilinearGridToTetrahedra * New()
Form 5 Tetrahedra per cube.
void SetTetraPerCellTo5()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
~vtkRectilinearGridToTetrahedra() override=default
void SetTetraPerCellTo12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
a dataset that is topologically regular with variable spacing in the three coordinate directions
dynamic, self-adjusting array of signed char
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_VOXEL_TO_12_TET
#define VTK_VOXEL_TO_5_TET
#define VTK_VOXEL_TO_6_TET
#define VTK_VOXEL_TO_5_AND_12_TET