VTK  9.3.1
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
37 #ifndef vtkRectilinearGridToTetrahedra_h
38 #define vtkRectilinearGridToTetrahedra_h
39 
40 // ways to create the mesh from voxels
41 #define VTK_VOXEL_TO_12_TET 12
42 #define VTK_VOXEL_TO_5_TET 5
43 #define VTK_VOXEL_TO_6_TET 6
44 #define VTK_VOXEL_TO_5_AND_12_TET -1
45 
46 #include "vtkFiltersGeneralModule.h" // For export macro
48 VTK_ABI_NAMESPACE_BEGIN
49 class vtkRectilinearGrid;
50 class vtkSignedCharArray;
51 class vtkIdList;
52 class vtkCellArray;
53 class vtkPoints;
54 
55 class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
56 {
57 public:
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
65 
67 
71  void SetTetraPerCellTo5() { SetTetraPerCell(VTK_VOXEL_TO_5_TET); }
72  void SetTetraPerCellTo6() { SetTetraPerCell(VTK_VOXEL_TO_6_TET); }
73  void SetTetraPerCellTo12() { SetTetraPerCell(VTK_VOXEL_TO_12_TET); }
75  vtkSetMacro(TetraPerCell, int);
76  vtkGetMacro(TetraPerCell, int);
78 
80 
84  vtkSetMacro(RememberVoxelId, vtkTypeBool);
85  vtkGetMacro(RememberVoxelId, vtkTypeBool);
86  vtkBooleanMacro(RememberVoxelId, vtkTypeBool);
88 
96  void SetInput(const double Extent[3], const double Spacing[3], double tol = 0.001);
100  void SetInput(double ExtentX, double ExtentY, double ExtentZ, double SpacingX, double SpacingY,
101  double SpacingZ, double tol = 0.001);
102 
103 protected:
105  ~vtkRectilinearGridToTetrahedra() override = default;
106 
108 
111 
112  int FillInputPortInformation(int, vtkInformation*) override;
113 
114 private:
116 
117  void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
118 
123  static void DetermineGridDivisionTypes(vtkRectilinearGrid* RectGrid,
124  vtkSignedCharArray* VoxelSubdivisionType, const int& TetraPerCell);
125 
129  static void GridToTetMesh(vtkRectilinearGrid* RectGrid, vtkSignedCharArray* VoxelSubdivisionType,
130  const int& TetraPerCell, const int& RememberVoxelId, vtkUnstructuredGrid* TetMesh,
132 
139  static int TetrahedralizeVoxel(
140  vtkIdList* VoxelCorners, const int& DivisionType, vtkPoints* NodeList, vtkCellArray* TetList);
141 
146  static void TetrahedralizeAddCenterPoint(vtkIdList* VoxelCorners, vtkPoints* NodeList);
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #endif /* vtkRectilinearGridToTetrahedra_h */
#define VTK_VOXEL_TO_6_TET
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store vtkAlgorithm input/output information.
void SetTetraPerCellTo6()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
static vtkUnstructuredGridAlgorithm * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
create a Tetrahedral mesh from a RectilinearGrid
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
dataset represents arbitrary combinations of all possible cell types
dynamic, self-adjusting array of signed char
#define VTK_VOXEL_TO_12_TET
Superclass for algorithms that produce only unstructured grid as output.
#define VTK_VOXEL_TO_5_AND_12_TET
object to represent cell connectivity
Definition: vtkCellArray.h:175
void SetTetraPerCellTo5And12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
#define VTK_VOXEL_TO_5_TET
Store zero or more vtkInformation instances.
void SetTetraPerCellTo12()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
void SetTetraPerCellTo5()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
represent and manipulate 3D points
Definition: vtkPoints.h:28