diff options
author | vng <viktor.govako@gmail.com> | 2011-12-09 01:08:25 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:29:59 +0300 |
commit | 16f89e272b2b145ab5df03349fc535e5a00dc099 (patch) | |
tree | d273fbc7cb45ea1c3f72d00c762b79fc5cdaa247 /indexer/feature_visibility.cpp | |
parent | 5bda2539a4523161adef742152393644fada1b07 (diff) |
Use population rank (height of font) only for place-[city(-capital), town].
Diffstat (limited to 'indexer/feature_visibility.cpp')
-rw-r--r-- | indexer/feature_visibility.cpp | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index b86d6ee277..d5ead6d4bd 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -335,24 +335,42 @@ bool IsHighway(vector<uint32_t> const & types) return false; } -bool IsCountry(uint32_t type) +bool UsePopulationRank(uint32_t type) { - class checker_t + class CheckerT { - public: - uint32_t m_type; + uint32_t m_types[3]; - checker_t() + public: + CheckerT() { + Classificator & c = classif(); + vector<string> vec; vec.push_back("place"); - vec.push_back("country"); - m_type = classif().GetTypeByPath(vec); + vec.push_back("city"); + m_types[0] = c.GetTypeByPath(vec); + + vec.push_back("capital"); + m_types[1] = c.GetTypeByPath(vec); + + vec.clear(); + vec.push_back("place"); + vec.push_back("town"); + m_types[2] = c.GetTypeByPath(vec); + } + + bool IsMyType(uint32_t t) const + { + for (size_t i = 0; i < ARRAY_SIZE(m_types); ++i) + if (t == m_types[i]) + return true; + return false; } }; - static checker_t checker; - return (type == checker.m_type); + static CheckerT checker; + return (checker.IsMyType(type)); } } |