Welcome to mirror list, hosted at ThFree Co, Russian Federation.

road_shields_parser.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d68691b2f93d74d6820a47a3d7976bab903f9665 (plain)
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
#pragma once

#include "indexer/feature.hpp"

#include "geometry/rect2d.hpp"

#include <map>
#include <string>
#include <vector>

namespace ftypes
{
enum class RoadShieldType
{
  Default = 0,
  Generic_White,  // The same as default, for semantics
  Generic_Green,
  Generic_Blue,
  Generic_Red,
  Generic_Orange,
  US_Interstate,
  US_Highway,
  UK_Highway,
  Hidden,
  Count
};

struct RoadShield
{
  RoadShieldType m_type;
  std::string m_name;
  std::string m_additionalText;

  RoadShield() = default;
  RoadShield(RoadShieldType const & type, std::string const & name)
  : m_type(type), m_name(name)
  {}
  RoadShield(RoadShieldType const & type, std::string const & name,
             std::string const & additionalText)
  : m_type(type), m_name(name), m_additionalText(additionalText)
  {}

  inline bool operator<(RoadShield const & other) const
  {
    if (m_additionalText == other.m_additionalText)
    {
      if (m_type == other.m_type)
        return m_name < other.m_name;
      return m_type < other.m_type;
    }
    return m_additionalText < other.m_additionalText;
  }
};

std::set<RoadShield> GetRoadShields(FeatureType const & f);
std::string DebugPrint(RoadShieldType shieldType);
std::string DebugPrint(RoadShield const & shield);
}  // namespace ftypes

using GeneratedRoadShields = std::map<ftypes::RoadShield, std::vector<m2::RectD>>;