OGS
GeoMapper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <cstddef>
7#include <vector>
8
9#include "GeoLib/GEOObjects.h"
10#include "GeoLib/Grid.h"
11#include "GeoLib/Point.h"
12#include "MathLib/Point3d.h"
13
14namespace MeshLib {
15 class Mesh;
16 class Node;
17}
18
19namespace GeoLib {
20 class Raster;
21}
22
23namespace MeshGeoToolsLib {
24
29{
30public:
31 GeoMapper(GeoLib::GEOObjects &geo_objects, const std::string &geo_name);
32 ~GeoMapper();
33
35 void mapOnDEM(std::unique_ptr<GeoLib::Raster const> raster);
36
41 void mapOnMesh(MeshLib::Mesh const*const mesh);
42
44 void mapToConstantValue(double value);
45
54 void advancedMapOnMesh(MeshLib::Mesh const& mesh);
55
56private:
58 void mapStationData(std::vector<GeoLib::Point*> const& points);
59
61 void mapPointDataToDEM(std::vector<GeoLib::Point*> const& points) const;
62
64 void mapPointDataToMeshSurface(std::vector<GeoLib::Point*> const& pnts);
65
68 double getMeshElevation(double x, double y, double min_val, double max_val) const;
69
71 float getDemElevation(GeoLib::Point const& pnt) const;
72
74 std::string& _geo_name;
75
79
81 std::unique_ptr<GeoLib::Raster const> _raster;
82};
83
84} // end namespace MeshGeoToolsLib
Container class for geometric objects.
Definition GEOObjects.h:46
Class Raster is used for managing raster data.
Definition Raster.h:39
GeoMapper(GeoLib::GEOObjects &geo_objects, const std::string &geo_name)
Definition GeoMapper.cpp:26
void mapToConstantValue(double value)
Maps geometry to a constant elevation value.
void mapOnDEM(std::unique_ptr< GeoLib::Raster const > raster)
Maps geometry based on a raster file.
Definition GeoMapper.cpp:41
void mapPointDataToDEM(std::vector< GeoLib::Point * > const &points) const
Mapping points on a raster.
std::string & _geo_name
Definition GeoMapper.h:74
void mapStationData(std::vector< GeoLib::Point * > const &points)
Mapping stations, boreholes on a raster or mesh.
double getMeshElevation(double x, double y, double min_val, double max_val) const
GeoLib::GEOObjects & _geo_objects
Definition GeoMapper.h:73
float getDemElevation(GeoLib::Point const &pnt) const
Returns the elevation at Point (x,y) based on a raster.
std::unique_ptr< GeoLib::Raster const > _raster
only necessary for mapping on DEM
Definition GeoMapper.h:81
MeshLib::Mesh * _surface_mesh
only necessary for mapping on mesh
Definition GeoMapper.h:77
void mapOnMesh(MeshLib::Mesh const *const mesh)
Definition GeoMapper.cpp:62
void advancedMapOnMesh(MeshLib::Mesh const &mesh)
GeoLib::Grid< MeshLib::Node > * _grid
Definition GeoMapper.h:78
void mapPointDataToMeshSurface(std::vector< GeoLib::Point * > const &pnts)
Mapping points on mesh.