From a81bbd3cb85535d7664ca39c661fd6b163f50694 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Tue, 15 Jan 2013 15:58:35 +0300 Subject: feature styler --- indexer/drawing_rule_def.hpp | 2 +- indexer/feature.cpp | 15 --------------- indexer/feature.hpp | 1 - indexer/feature_visibility.cpp | 37 ------------------------------------- indexer/feature_visibility.hpp | 13 ------------- 5 files changed, 1 insertion(+), 67 deletions(-) (limited to 'indexer') diff --git a/indexer/drawing_rule_def.hpp b/indexer/drawing_rule_def.hpp index 385320e2f8..3276506e57 100644 --- a/indexer/drawing_rule_def.hpp +++ b/indexer/drawing_rule_def.hpp @@ -34,7 +34,7 @@ namespace drule /// geo type of rule - can be one combined of ... enum rule_geo_t { node = 1, way = 2 }; - int const layer_base_priority = 2000; + double const layer_base_priority = 2000; void MakeUnique(vector & keys); void SortByScaleTypeDepth(vector & keys); diff --git a/indexer/feature.cpp b/indexer/feature.cpp index dfb406a894..f5fc4f555e 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -311,21 +311,6 @@ uint32_t FeatureType::GetPopulation() const return (r == 0 ? 1 : static_cast(pow(1.1, r))); } -double FeatureType::GetPopulationDrawRank() const -{ - uint32_t const n = GetPopulation(); - if (n == 1) return 0.0; - - // Do not return rank for countries. - if (feature::UsePopulationRank(m_Types, m_Types + GetTypesCount())) - { - double const upperBound = 3.0E6; - return min(upperBound, static_cast(n)) / upperBound; - } - else - return 0.0; -} - namespace { class DoCalcDistance diff --git a/indexer/feature.hpp b/indexer/feature.hpp index a9c3a3b761..1ff1d5deac 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -243,7 +243,6 @@ public: uint8_t GetRank() const; uint32_t GetPopulation() const; - double GetPopulationDrawRank() const; inline string GetRoadNumber() const { return m_Params.ref; } diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 5e88bb51cc..0ecaeeb698 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -404,43 +404,6 @@ pair GetDrawableScaleRangeForRules(FeatureBase const & f, int rules) return GetDrawableScaleRangeForRules(TypesHolder(f), rules); } -bool UsePopulationRank(uint32_t type) -{ - class CheckerT - { - uint32_t m_types[3]; - - public: - CheckerT() - { - Classificator & c = classif(); - - vector vec; - vec.push_back("place"); - 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 - { - uint32_t const * e = m_types + ARRAY_SIZE(m_types); - return (find(m_types, e, t) != e); - } - }; - - static CheckerT checker; - return (checker.IsMyType(type)); -} - - void TypeSetChecker::SetType(StringT * beg, StringT * end) { m_type = classif().GetTypeByPath(vector(beg, end)); diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index d5c1ca0586..bc1ad86bd2 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -57,19 +57,6 @@ namespace feature pair GetDrawRule(FeatureBase const & f, int level, vector & keys, string & names); - bool UsePopulationRank(uint32_t type); - - template - inline bool UsePopulationRank(IterT beg, IterT end) - { - while (beg != end) - { - if (UsePopulationRank(*beg++)) - return true; - } - return false; - } - /// Used to check whether user types belong to particular classificator set. class TypeSetChecker { -- cgit v1.2.3