diff options
author | vng <viktor.govako@gmail.com> | 2012-10-20 15:45:07 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:45:57 +0300 |
commit | 9c3cc8be68cea1780b00de848f3bf7da859a2931 (patch) | |
tree | 24c1a153294e909fda4e093b269b522ca3892a20 /indexer/feature_visibility.hpp | |
parent | 33563e317580071a2b06edd0d8cd7264bdbc824a (diff) |
[generator] Avoid duplicating for "place" in closed area features that are transformed to point features.
Diffstat (limited to 'indexer/feature_visibility.hpp')
-rw-r--r-- | indexer/feature_visibility.hpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index 65d28220e7..d5c1ca0586 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -57,9 +57,6 @@ namespace feature pair<int, bool> GetDrawRule(FeatureBase const & f, int level, vector<drule::Key> & keys, string & names); - bool IsHighway(vector<uint32_t> const & types); - //bool IsJunction(vector<uint32_t> const & types); - bool UsePopulationRank(uint32_t type); template <class IterT> @@ -72,4 +69,36 @@ namespace feature } return false; } + + /// Used to check whether user types belong to particular classificator set. + class TypeSetChecker + { + uint32_t m_type; + uint8_t m_level; + + typedef char const * StringT; + void SetType(StringT * beg, StringT * end); + + public: + /// Construct by classificator set name. + //@{ + TypeSetChecker(StringT name) { SetType(&name, &name + 1); } + TypeSetChecker(StringT arr[], size_t n) { SetType(arr, arr + n); } + //@} + + bool IsEqual(uint32_t type) const; + template <class IterT> bool IsEqualR(IterT beg, IterT end) const + { + while (beg != end) + { + if (IsEqual(*beg++)) + return true; + } + return false; + } + bool IsEqualV(vector<uint32_t> const & v) const + { + return IsEqualR(v.begin(), v.end()); + } + }; } |