OGS
VoxelGridFromMesh.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <vtkSmartPointer.h>
14#include <vtkUnstructuredGrid.h>
15
16#include <array>
17#include <memory>
18
19namespace MeshLib
20{
21class Mesh;
22}
23
24namespace MathLib
25{
26class Point3d;
27}
29{
30static std::string const cell_id_name = "CellIds";
31
38std::array<std::size_t, 3> getNumberOfVoxelPerDimension(
39 std::array<double, 3> const& ranges, std::array<double, 3> const& cellsize);
40
41std::vector<int> assignCellIds(vtkSmartPointer<vtkUnstructuredGrid> const& mesh,
42 MathLib::Point3d const& min,
43 std::array<std::size_t, 3> const& dims,
44 std::array<double, 3> const& cellsize);
45
46// grid has to contain a PropertyVector with the name 'CellIds'
47bool removeUnusedGridCells(vtkSmartPointer<vtkUnstructuredGrid> const& mesh,
48 std::unique_ptr<MeshLib::Mesh>& grid);
49// map the cell data of mesh to voxelgrid
50void mapMeshArraysOntoGrid(vtkSmartPointer<vtkUnstructuredGrid> const& mesh,
51 std::unique_ptr<MeshLib::Mesh> const& grid);
52} // namespace MeshToolsLib::MeshGenerator::VoxelGridFromMesh
std::vector< int > assignCellIds(vtkSmartPointer< vtkUnstructuredGrid > const &mesh, MathLib::Point3d const &min, std::array< std::size_t, 3 > const &dims, std::array< double, 3 > const &cellsize)
void mapMeshArraysOntoGrid(vtkSmartPointer< vtkUnstructuredGrid > const &mesh, std::unique_ptr< MeshLib::Mesh > const &grid)
bool removeUnusedGridCells(vtkSmartPointer< vtkUnstructuredGrid > const &mesh, std::unique_ptr< MeshLib::Mesh > &grid)
std::array< std::size_t, 3 > getNumberOfVoxelPerDimension(std::array< double, 3 > const &ranges, std::array< double, 3 > const &cellsize)