hivemind 1.0.0
Loading...
Searching...
No Matches
coordinate_converter.h
Go to the documentation of this file.
1#pragma once
2
3#include "core/types.h"
4#include <GeographicLib/Geodesic.hpp>
5#include <GeographicLib/LocalCartesian.hpp>
6#include <GeographicLib/UTMUPS.hpp>
7
9{
10
11 ///
12 /// \brief This is the class that performs coordinate conversions
14 {
15 public:
16 ///
17 /// \brief Sets the origin coordinate to use with relative coordinates
18 ///
19 /// \param geoCoord Geographical coordinate to be used as the
20 /// origin of relative coordinates
21 ///
22 static void ResetOrigin(Core::GeographicalCoordinate geoCoord,
23 int size);
24
25 ///
26 /// \brief Function used to convert a geographical coordinate to a
27 /// cartesian coordinate
28 ///
29 /// \param geoCoord Geograhical coordinate to convert
30 /// \return return a cartesian point relative to origin
33
34 ///
35 /// \biref Function used to convert a cartesian coordinate to a
36 /// geograpical coordinate
37 ///
38 /// \param cartCoord Cartesian coordinate to convert
39 /// \return return a geographical point relative to origin and the
40 /// cartesian coordinates.
43
44 ///
45 /// \return The geographical coordinates to origin.
47
48 ///
49 /// \brief Function used to convert a coordinate in a symmetric
50 /// coordinate system to a coordinate in an asymmetric coordinate system
51 ///
52 /// \param symmetric Cartesian coordinate in a symmetric coordinate
53 /// system \return The asymmetric coordinate corresponds to the
54 /// symmetric coordinate
57
58 ///
59 /// \brief Function used to convert a coordinate in an asymmetric
60 /// cooridnate system to a coordinate in a symmetric coordinate system
61 /// \param asymmetric Cartesian coordinate in an asymmetric coordinate
62 /// system \return The symmetric coordinate corresponds to the
63 /// asymmetric coordinate
66
67 ///
68 /// \brief Function used to convert a geographical coordinate to a UTM
69 /// coordinate \param GeoCoord Geographical coordinate \return UTM
70 /// coordinate corresponds to the geographical coordinate
73
74 ///
75 /// \brief Function used to convert a UTM coordinate to a geographical
76 /// coordinate \param UTMCoord UTM coordinate \return Geographical
77 /// coordinate corresponds to the UTM coordinate
80
81 static inline int
83 {
84 return GetInstance().m_Size;
85 }
86
87 private:
88 ///
89 /// \brief The constructor is made private to adhere to the singleton
90 /// pattern
92
93 /// \brief Get the single instance of CoordConv.
94 ///
95 /// \return The single instance of CoordConv.
96 static CoordConv&
98 {
99 static CoordConv instance;
100 return instance;
101 }
102
103 private:
105 GeographicLib::LocalCartesian m_Origin;
107 };
108
109} // namespace CoordinateConverter
This is the class that performs coordinate conversions.
static Core::GeographicalCoordinate UTMToGeographic(Core::UTMCoordinate UTMCoord)
Function used to convert a UTM coordinate to a geographical coordinate.
static void ResetOrigin(Core::GeographicalCoordinate geoCoord, int size)
Sets the origin coordinate to use with relative coordinates.
GeographicLib::LocalCartesian m_Origin
Core::GeographicalCoordinate m_OriginGeographical
CoordConv()
The constructor is made private to adhere to the singleton pattern.
static Core::CartesianCoordinate SymmetricToAsymmetric(Core::CartesianCoordinate symmetric)
Function used to convert a coordinate in a symmetric coordinate system to a coordinate in an asymmetr...
static Core::UTMCoordinate GeographicToUTM(Core::GeographicalCoordinate GeoCoord)
Function used to convert a geographical coordinate to a UTM coordinate.
static Core::GeographicalCoordinate CartesianToGeographical(Core::CartesianCoordinate cartCoord)
\biref Function used to convert a cartesian coordinate to a geograpical coordinate
static Core::GeographicalCoordinate GetOrigin()
static Core::CartesianCoordinate AsymmetricToSymmetric(Core::CartesianCoordinate asymmetric)
Function used to convert a coordinate in an asymmetric cooridnate system to a coordinate in a symmetr...
static CoordConv & GetInstance()
Get the single instance of CoordConv.
static Core::CartesianCoordinate GeographicalToCartesian(Core::GeographicalCoordinate geoCoord)
Function used to convert a geographical coordinate to a cartesian coordinate.
A structure that represents a cartesian coordinate.
Definition: types.h:12
A structure that represents a geographic coordinate.
Definition: types.h:29
\ A structure that represents a coordinate in the Universal Transverse Mercator coordinate system
Definition: types.h:46