1 #ifndef OSMSCOUT_UTIL_MAGNIFICATION_H 2 #define OSMSCOUT_UTIL_MAGNIFICATION_H 28 #include <unordered_map> 41 MagnificationLevel() =
default;
48 MagnificationLevel(
const MagnificationLevel& level) =
default;
50 inline uint32_t
Get()
const 55 MagnificationLevel& operator=(
const MagnificationLevel& other) =
default;
71 inline MagnificationLevel&
operator+=(uint32_t increment)
78 inline bool operator==(
const MagnificationLevel& other)
const 80 return level==other.level;
83 inline bool operator!=(
const MagnificationLevel& other)
const 85 return level!=other.level;
88 inline bool operator<(
const MagnificationLevel& other)
const 90 return level<other.level;
93 inline bool operator<=(
const MagnificationLevel& other)
const 95 return level<=other.level;
98 inline bool operator>=(
const MagnificationLevel& other)
const 100 return level>=other.level;
103 inline bool operator>(
const MagnificationLevel& other)
const 105 return level>other.level;
110 const MagnificationLevel& level)
118 const MagnificationLevel& level)
120 return std::string(text)+std::to_string(level.Get());
124 const MagnificationLevel& level)
126 return text+std::to_string(level.Get());
134 size_t operator()(
const osmscout::MagnificationLevel& level)
const 136 return hash<uint32_t>{}(level.Get());
164 double magnification=1;
168 Magnification() =
default;
169 ~Magnification() =
default;
171 Magnification(
const Magnification& other) =
default;
179 SetMagnification(magnification);
191 void SetMagnification(
double magnification);
193 void SetLevel(
const MagnificationLevel& level);
197 return magnification;
205 inline Magnification&
operator=(
const Magnification& other)
208 this->magnification=other.magnification;
209 this->level=other.level;
217 return magnification==other.magnification;
222 return magnification!=other.magnification;
227 return magnification<other.magnification;
232 return magnification<=other.magnification;
237 return magnification>=other.magnification;
242 return magnification>other.magnification;
265 std::unordered_map<std::string,MagnificationLevel> stringToMagMap;
266 std::unordered_map<MagnificationLevel,std::string> levelToStringMap;
271 bool Convert(
const std::string& name,
272 Magnification& magnification);
274 bool Convert(
const MagnificationLevel& level,
static MagnificationLevel magCloser
Definition: Magnification.h:157
static MagnificationLevel magCity
Definition: Magnification.h:153
static MagnificationLevel magClose
Definition: Magnification.h:156
Magnification operator++(int)
Definition: Magnification.h:253
static MagnificationLevel magHouse
Definition: Magnification.h:161
size_t operator()(const osmscout::MagnificationLevel &level) const
Definition: Magnification.h:134
uint32_t GetLevel() const
Definition: Magnification.h:200
static MagnificationLevel magCityOver
Definition: Magnification.h:152
Magnification & operator++()
Definition: Magnification.h:245
static MagnificationLevel magState
Definition: Magnification.h:147
std::ostream & operator<<(std::ostream &stream, const DBId &o)
Definition: DBFileOffset.h:80
bool operator!=(const Magnification &other) const
Definition: Magnification.h:220
bool operator>(const MagnificationLevel &other) const
Definition: Magnification.h:103
bool operator<=(const MagnificationLevel &other) const
Definition: Magnification.h:93
bool operator<(const MagnificationLevel &other) const
Definition: Magnification.h:88
static MagnificationLevel magCounty
Definition: Magnification.h:149
static MagnificationLevel magStateOver
Definition: Magnification.h:148
static MagnificationLevel magRegion
Definition: Magnification.h:150
MagnificationLevel(uint32_t level) noexcept
Definition: Magnification.h:43
#define CLASS_FINAL
Definition: Compiler.h:26
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
bool operator<=(const Magnification &other) const
Definition: Magnification.h:230
bool operator>(const Magnification &other) const
Definition: Magnification.h:240
bool operator>=(const MagnificationLevel &other) const
Definition: Magnification.h:98
static MagnificationLevel magContinent
Definition: Magnification.h:146
MagnificationLevel operator++(int)
Definition: Magnification.h:64
bool operator>=(const Magnification &other) const
Definition: Magnification.h:235
double GetMagnification() const
Definition: Magnification.h:195
static MagnificationLevel magWorld
Definition: Magnification.h:145
static MagnificationLevel magVeryClose
Definition: Magnification.h:158
static MagnificationLevel magStreet
Definition: Magnification.h:160
static MagnificationLevel magBlock
Definition: Magnification.h:159
Magnification(double magnification) noexcept
Definition: Magnification.h:177
std::string operator+(const char *text, const MagnificationLevel &level)
Definition: Magnification.h:117
bool operator==(const Magnification &other) const
Definition: Magnification.h:215
bool operator!=(const MagnificationLevel &other) const
Definition: Magnification.h:83
Definition: Magnification.h:262
uint32_t Get() const
Definition: Magnification.h:50
MagnificationLevel & operator++()
Definition: Magnification.h:57
Magnification(const MagnificationLevel &level) noexcept
Definition: Magnification.h:182
Magnification & operator=(const Magnification &other)
Definition: Magnification.h:205
bool operator<(const Magnification &other) const
Definition: Magnification.h:225
static MagnificationLevel magProximity
Definition: Magnification.h:151
MagnificationLevel & operator+=(uint32_t increment)
Definition: Magnification.h:71
static MagnificationLevel magDetail
Definition: Magnification.h:155
static MagnificationLevel magSuburb
Definition: Magnification.h:154
bool operator==(const MagnificationLevel &other) const
Definition: Magnification.h:78