diff options
author | vng <viktor.govako@gmail.com> | 2013-09-07 12:56:42 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:01:05 +0300 |
commit | 467c228167af0ff4a9a4cd3be37c3b3c6b95af83 (patch) | |
tree | 1c9d3e876a10f850bf53846d1519e6813c1ab978 /indexer | |
parent | 37d31ff14b0c254ae533f433526b8979c9476c12 (diff) |
Simple test for styles checking.
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/feature_data.hpp | 2 | ||||
-rw-r--r-- | indexer/feature_utils.cpp | 2 | ||||
-rw-r--r-- | indexer/feature_visibility.cpp | 12 | ||||
-rw-r--r-- | indexer/feature_visibility.hpp | 5 |
4 files changed, 13 insertions, 8 deletions
diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index cf5463597e..37179abee0 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -57,7 +57,7 @@ namespace feature EGeomType m_geoType; public: - TypesHolder() : m_size(0), m_geoType(GEOM_UNDEFINED) {} + TypesHolder(EGeomType geoType = GEOM_UNDEFINED) : m_size(0), m_geoType(geoType) {} TypesHolder(FeatureBase const & f); /// Accumulation function. diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 8c14d3999a..5e708a9820 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -53,7 +53,7 @@ public: void CorrectScaleForVisibility(TypesHolder const & types, int & scale) const { - pair<int, int> const scaleR = GetDrawableScaleRangeForRules(types, RULE_TEXT); + pair<int, int> const scaleR = GetDrawableScaleRangeForRules(types, RULE_ANY_TEXT); ASSERT_LESS_OR_EQUAL ( scaleR.first, scaleR.second, () ); // Result types can be without visible texts (matched by category). diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 6e0066d040..62d01d381c 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -195,14 +195,15 @@ namespace { int m_scale; ClassifObject::FeatureGeoType m_ft; - bool m_arr[2]; + bool m_arr[3]; public: IsDrawableRulesChecker(int scale, feature::EGeomType ft, int rules) : m_scale(scale), m_ft(ClassifObject::FeatureGeoType(ft)) { - m_arr[0] = rules & RULE_TEXT; - m_arr[1] = rules & RULE_SYMBOL; + m_arr[0] = rules & RULE_CAPTION; + m_arr[1] = rules & RULE_PATH_TEXT; + m_arr[2] = rules & RULE_SYMBOL; } typedef bool ResultType; @@ -215,8 +216,9 @@ namespace for (size_t i = 0; i < keys.size(); ++i) { - if ((m_arr[0] && (keys[i].m_type == drule::caption || keys[i].m_type == drule::pathtext)) || - (m_arr[1] && keys[i].m_type == drule::symbol)) + if ((m_arr[0] && keys[i].m_type == drule::caption) || + (m_arr[1] && keys[i].m_type == drule::pathtext) || + (m_arr[2] && keys[i].m_type == drule::symbol)) { res = true; return true; diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index 403710075b..f3d6440c6f 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -46,7 +46,10 @@ namespace feature /// @name Get scale range when feature's text or symbol is visible. enum { - RULE_TEXT = 1, RULE_SYMBOL = 2 + RULE_CAPTION = 1, + RULE_PATH_TEXT = 2, + RULE_ANY_TEXT = RULE_CAPTION | RULE_PATH_TEXT, + RULE_SYMBOL = 4 }; pair<int, int> GetDrawableScaleRangeForRules(TypesHolder const & types, int rules); |