OGS
GeoMapper.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <cstddef>
18 #include <vector>
19 
20 #include "GeoLib/GEOObjects.h"
21 #include "GeoLib/Grid.h"
22 #include "GeoLib/Point.h"
23 #include "MathLib/Point3d.h"
24 
25 namespace MeshLib {
26  class Mesh;
27  class Node;
28 }
29 
30 namespace GeoLib {
31  class Raster;
32 }
33 
34 namespace MeshGeoToolsLib {
35 
39 class GeoMapper
40 {
41 public:
42  GeoMapper(GeoLib::GEOObjects &geo_objects, const std::string &geo_name);
43  ~GeoMapper();
44 
46  void mapOnDEM(std::unique_ptr<GeoLib::Raster const> raster);
47 
52  void mapOnMesh(MeshLib::Mesh const*const mesh);
53 
55  void mapToConstantValue(double value);
56 
66  void advancedMapOnMesh(MeshLib::Mesh const& mesh);
67 
68 private:
70  void mapStationData(std::vector<GeoLib::Point*> const& points);
71 
73  void mapPointDataToDEM(std::vector<GeoLib::Point*> const& points) const;
74 
76  void mapPointDataToMeshSurface(std::vector<GeoLib::Point*> const& pnts);
77 
80  double getMeshElevation(double x, double y, double min_val, double max_val) const;
81 
83  float getDemElevation(GeoLib::Point const& pnt) const;
84 
86  std::string& _geo_name;
87 
91 
93  std::unique_ptr<GeoLib::Raster const> _raster;
94 };
95 
96 } // end namespace MeshGeoToolsLib
Definition of the GEOObjects class.
Definition of the Point class.
Definition of the Grid class.
Definition of the Point3d class.
Container class for geometric objects.
Definition: GEOObjects.h:61
A set of tools for mapping the elevation of geometric objects.
Definition: GeoMapper.h:40
GeoMapper(GeoLib::GEOObjects &geo_objects, const std::string &geo_name)
Definition: GeoMapper.cpp:37
void mapToConstantValue(double value)
Maps geometry to a constant elevation value.
Definition: GeoMapper.cpp:124
void mapOnDEM(std::unique_ptr< GeoLib::Raster const > raster)
Maps geometry based on a raster file.
Definition: GeoMapper.cpp:52
void mapPointDataToDEM(std::vector< GeoLib::Point * > const &points) const
Mapping points on a raster.
Definition: GeoMapper.cpp:171
std::string & _geo_name
Definition: GeoMapper.h:86
void mapStationData(std::vector< GeoLib::Point * > const &points)
Mapping stations, boreholes on a raster or mesh.
Definition: GeoMapper.cpp:137
double getMeshElevation(double x, double y, double min_val, double max_val) const
Definition: GeoMapper.cpp:218
GeoLib::GEOObjects & _geo_objects
Definition: GeoMapper.h:85
float getDemElevation(GeoLib::Point const &pnt) const
Returns the elevation at Point (x,y) based on a raster.
Definition: GeoMapper.cpp:207
std::unique_ptr< GeoLib::Raster const > _raster
only necessary for mapping on DEM
Definition: GeoMapper.h:93
MeshLib::Mesh * _surface_mesh
only necessary for mapping on mesh
Definition: GeoMapper.h:89
void mapOnMesh(MeshLib::Mesh const *const mesh)
Definition: GeoMapper.cpp:73
void advancedMapOnMesh(MeshLib::Mesh const &mesh)
Definition: GeoMapper.cpp:617
GeoLib::Grid< MeshLib::Node > * _grid
Definition: GeoMapper.h:90
void mapPointDataToMeshSurface(std::vector< GeoLib::Point * > const &pnts)
Mapping points on mesh.
Definition: GeoMapper.cpp:181