VTK  9.2.6
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=========================================================================*/
68#ifndef vtkRectilinearGridToTetrahedra_h
69#define vtkRectilinearGridToTetrahedra_h
70
71// ways to create the mesh from voxels
72#define VTK_VOXEL_TO_12_TET 12
73#define VTK_VOXEL_TO_5_TET 5
74#define VTK_VOXEL_TO_6_TET 6
75#define VTK_VOXEL_TO_5_AND_12_TET -1
76
77#include "vtkFiltersGeneralModule.h" // For export macro
81class vtkIdList;
82class vtkCellArray;
83class vtkPoints;
84
85class VTKFILTERSGENERAL_EXPORT vtkRectilinearGridToTetrahedra : public vtkUnstructuredGridAlgorithm
86{
87public:
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
95
97
101 void SetTetraPerCellTo5() { SetTetraPerCell(VTK_VOXEL_TO_5_TET); }
102 void SetTetraPerCellTo6() { SetTetraPerCell(VTK_VOXEL_TO_6_TET); }
103 void SetTetraPerCellTo12() { SetTetraPerCell(VTK_VOXEL_TO_12_TET); }
105 vtkSetMacro(TetraPerCell, int);
106 vtkGetMacro(TetraPerCell, int);
108
110
114 vtkSetMacro(RememberVoxelId, vtkTypeBool);
115 vtkGetMacro(RememberVoxelId, vtkTypeBool);
116 vtkBooleanMacro(RememberVoxelId, vtkTypeBool);
118
126 void SetInput(const double Extent[3], const double Spacing[3], const double tol = 0.001);
130 void SetInput(const double ExtentX, const double ExtentY, const double ExtentZ,
131 const double SpacingX, const double SpacingY, const double SpacingZ, const double tol = 0.001);
132
133protected:
136
138
141
143
144private:
146
147 void operator=(const vtkRectilinearGridToTetrahedra&) = delete;
148
153 static void DetermineGridDivisionTypes(vtkRectilinearGrid* RectGrid,
154 vtkSignedCharArray* VoxelSubdivisionType, const int& TetraPerCell);
155
159 static void GridToTetMesh(vtkRectilinearGrid* RectGrid, vtkSignedCharArray* VoxelSubdivisionType,
160 const int& TetraPerCell, const int& RememberVoxelId, vtkUnstructuredGrid* TetMesh);
161
168 static int TetrahedralizeVoxel(
169 vtkIdList* VoxelCorners, const int& DivisionType, vtkPoints* NodeList, vtkCellArray* TetList);
170
175 static inline void TetrahedralizeAddCenterPoint(vtkIdList* VoxelCorners, vtkPoints* NodeList);
176};
177
178#endif /* vtkRectilinearGridToTetrahedra_h */
object to represent cell connectivity
Definition: vtkCellArray.h:296
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:149
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.
static vtkRectilinearGridToTetrahedra * New()
Form 5 Tetrahedra per cube.
void SetTetraPerCellTo6()
Set the method to divide each cell (voxel) in the RectilinearGrid into tetrahedra.
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...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
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.
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.
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:69
#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