-
-
Notifications
You must be signed in to change notification settings - Fork 991
/
elevation_info.hpp
67 lines (57 loc) · 1.69 KB
/
elevation_info.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include "map/track.hpp"
#include "geometry/point_with_altitude.hpp"
#include <cstdint>
#include <string>
#include <vector>
class ElevationInfo
{
public:
struct Point
{
Point(double distance, geometry::Altitude altitude)
: m_distance(distance), m_altitude(altitude)
{
}
double m_distance;
geometry::Altitude m_altitude;
};
using Points = std::vector<Point>;
enum Difficulty : uint8_t
{
Unknown,
Easy,
Medium,
Hard
};
ElevationInfo() = default;
explicit ElevationInfo(Track const & track);
kml::TrackId GetId() const { return m_id; };
std::string const & GetName() const { return m_name; }
size_t GetSize() const { return m_points.size(); };
Points const & GetPoints() const { return m_points; };
uint16_t GetAscent() const { return m_ascent; }
uint16_t GetDescent() const { return m_descent; }
uint16_t GetMinAltitude() const { return m_minAltitude; }
uint16_t GetMaxAltitude() const { return m_maxAltitude; }
uint8_t GetDifficulty() const { return m_difficulty; }
uint32_t GetDuration() const { return m_duration; }
private:
kml::TrackId m_id = kml::kInvalidTrackId;
std::string m_name;
// Points with distance from start of the track and altitude.
Points m_points;
// Ascent in meters.
uint16_t m_ascent = 0;
// Descent in meters.
uint16_t m_descent = 0;
// Altitude in meters.
uint16_t m_minAltitude = 0;
// Altitude in meters.
uint16_t m_maxAltitude = 0;
// Some digital difficulty level with value in range [0-kMaxDifficulty]
// or kInvalidDifficulty when difficulty is not found or incorrect.
Difficulty m_difficulty = Difficulty::Unknown;
// Duration in seconds.
uint32_t m_duration = 0;
};