OGS
LayeredMeshGenerator.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <limits>
18#include <memory>
19#include <string>
20#include <vector>
21
22namespace GeoLib
23{
24class Raster;
25}
26
27namespace MeshLib
28{
29class Mesh;
30class Node;
31class Element;
32} // namespace MeshLib
33
38{
39public:
56 virtual bool createLayers(MeshLib::Mesh const& mesh,
57 std::vector<GeoLib::Raster const*> const& rasters,
58 double minimum_thickness,
59 double noDataReplacementValue = 0.0) final;
60
77 virtual bool createRasterLayers(
78 MeshLib::Mesh const& mesh,
79 std::vector<GeoLib::Raster const*> const& rasters,
80 double minimum_thickness,
81 double noDataReplacementValue) = 0;
82
84 std::unique_ptr<MeshLib::Mesh> getMesh(std::string const& mesh_name) const;
85
86protected:
88 virtual ~LayeredMeshGenerator() = default;
89
91 virtual void addLayerToMesh(MeshLib::Mesh const& mesh_layer,
92 unsigned layer_id,
93 GeoLib::Raster const& raster) = 0;
94
108 MeshLib::Node const& last_layer_node,
109 GeoLib::Raster const& raster,
110 std::size_t new_node_id) const;
111
113 static double calcEpsilon(GeoLib::Raster const& low,
114 GeoLib::Raster const& high);
115
116 double _elevation_epsilon{0.0001};
117 double _minimum_thickness{std::numeric_limits<float>::epsilon()};
118 std::vector<int> _materials;
119 std::vector<MeshLib::Node*> _nodes;
120 std::vector<MeshLib::Element*> _elements;
121};
Class Raster is used for managing raster data.
Definition Raster.h:49
Base class for creation of 3D subsurface meshes based on raster data.
virtual bool createLayers(MeshLib::Mesh const &mesh, std::vector< GeoLib::Raster const * > const &rasters, double minimum_thickness, double noDataReplacementValue=0.0) final
virtual ~LayeredMeshGenerator()=default
virtual void addLayerToMesh(MeshLib::Mesh const &mesh_layer, unsigned layer_id, GeoLib::Raster const &raster)=0
Adds another layer to the subsurface mesh.
std::vector< int > _materials
static double calcEpsilon(GeoLib::Raster const &low, GeoLib::Raster const &high)
Calculates a data-dependent epsilon value.
MeshLib::Node * getNewLayerNode(MeshLib::Node const &dem_node, MeshLib::Node const &last_layer_node, GeoLib::Raster const &raster, std::size_t new_node_id) const
std::vector< MeshLib::Node * > _nodes
LayeredMeshGenerator()=default
virtual bool createRasterLayers(MeshLib::Mesh const &mesh, std::vector< GeoLib::Raster const * > const &rasters, double minimum_thickness, double noDataReplacementValue)=0
std::unique_ptr< MeshLib::Mesh > getMesh(std::string const &mesh_name) const
Returns a mesh of the subsurface representation.
std::vector< MeshLib::Element * > _elements