hivemind 1.0.0
Loading...
Searching...
No Matches
map_manager.h
Go to the documentation of this file.
1#pragma once
2
3#include "core/types.h"
4
5#include <QObject>
6
7namespace MapManagement
8{
9
10 ///
11 /// \brief This is the class responsible for retrieving maps from
12 /// Kartverket.
13 ///
14 class MapManager : public QObject
15 {
16 Q_OBJECT
17 public:
18 /// \brief Returns the singleton instance of the class.
19 static MapManager&
21 {
22 static MapManager instance;
23 return instance;
24 }
25
26 /// \brief Retrieves the map from Kartverket for the specified UTM
27 /// coordinate and size.
28 ///
29 /// This function retrieves the satellite map data from Kartverket with
30 /// a HTTP request for the specified UTM coordinate and size.
31 ///
32 /// \param coord The UTM coordinate for the center of the map.
33 /// \param size The size of the map in meters.
34 static void GetMap(Core::UTMCoordinate coord, int size);
35
36 /// \brief Calculates the UTM corner coordinates for the specified UTM
37 /// coordinate and size.
38 ///
39 /// This function calculates the UTM corner coordinates for the
40 /// specified UTM coordinate and size, and stores them in the
41 /// CornerCoordinates variable.
42 ///
43 /// \param coord The UTM coordinate for the center of the map.
44 /// \param size The size of the map in meters.
45 static void CalculateCornerCoordinates(Core::UTMCoordinate coord, int size);
46
47 /// \brief Returns the map data as a byte array.
48 static inline QByteArray&
50 {
51 return Instance().m_Data;
52 }
53
54 static inline int
56 {
58 }
59
60 signals:
61 /// \brief Signal emitted when the map image data has been retrieved.
62 void GotImage();
64
65 private:
66 /// \brief Constructor.
68
69 /// \brief Destructor.
70 ~MapManager() = default;
71
72 QByteArray m_Data;
73 QString m_Area;
75 };
76
77} // namespace MapManagement
This is the class responsible for retrieving maps from Kartverket.
Definition: map_manager.h:15
static void CalculateCornerCoordinates(Core::UTMCoordinate coord, int size)
Calculates the UTM corner coordinates for the specified UTM coordinate and size.
Definition: map_manager.cpp:77
static int GetImageResolution()
Definition: map_manager.h:55
static QByteArray & GetData()
Returns the map data as a byte array.
Definition: map_manager.h:49
static MapManager & Instance()
Returns the singleton instance of the class.
Definition: map_manager.h:20
static void GetMap(Core::UTMCoordinate coord, int size)
Retrieves the map from Kartverket for the specified UTM coordinate and size.
Definition: map_manager.cpp:17
~MapManager()=default
Destructor.
void GotImage()
Signal emitted when the map image data has been retrieved.
MapManager()
Constructor.
Definition: map_manager.h:67
\ A structure that represents a coordinate in the Universal Transverse Mercator coordinate system
Definition: types.h:46