diff options
author | Ilya Zverev <zverik@textual.ru> | 2017-05-24 16:01:11 +0300 |
---|---|---|
committer | Sergey Yershov <syershov@maps.me> | 2017-06-13 20:16:44 +0300 |
commit | cc4e6c0a1e306cf456af609d027f07e804a6f825 (patch) | |
tree | 1db09d02f9f36635c649553d3ccb539d4e437c45 /indexer | |
parent | e8cb8b836175d77eac8456a7c4287d7e9c45fea7 (diff) |
[indexer] Check for runtime selectors for static displacement
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/displacement_manager.hpp | 2 | ||||
-rw-r--r-- | indexer/feature_visibility.cpp | 13 | ||||
-rw-r--r-- | indexer/feature_visibility.hpp | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/indexer/displacement_manager.hpp b/indexer/displacement_manager.hpp index ba1e8112cc..4b642a2367 100644 --- a/indexer/displacement_manager.hpp +++ b/indexer/displacement_manager.hpp @@ -185,6 +185,8 @@ private: // Calculate depth field drule::KeysT keys; feature::GetDrawRule(ft, zoomLevel, keys); + // While the function has "runtime" in its name, it merely filters by metadata-based rules. + feature::FilterRulesByRuntimeSelector(ft, zoomLevel, keys); drule::MakeUnique(keys); float depth = 0; for (size_t i = 0, count = keys.size(); i < count; ++i) diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 1b0e5ea084..322e5bb243 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -1,6 +1,6 @@ #include "indexer/feature_visibility.hpp" #include "indexer/classificator.hpp" -#include "indexer/feature.hpp" +#include "indexer/drawing_rules.hpp" #include "indexer/scales.hpp" #include "base/assert.hpp" @@ -114,6 +114,17 @@ void GetDrawRule(vector<uint32_t> const & types, int level, int geoType, (void)c.ProcessObjects(t, doRules); } +void FilterRulesByRuntimeSelector(FeatureType const & f, int zoomLevel, drule::KeysT & keys) +{ + keys.erase_if([&f, zoomLevel](drule::Key const & key)->bool + { + drule::BaseRule const * const rule = drule::rules().Find(key); + if (rule == nullptr) + return true; + return !rule->TestFeature(f, zoomLevel); + }); +} + namespace { class IsDrawableChecker diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index 0e0811d7d0..42a65aa827 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -1,6 +1,7 @@ #pragma once #include "indexer/drawing_rule_def.hpp" +#include "indexer/feature.hpp" #include "indexer/feature_decl.hpp" #include "base/base.hpp" @@ -64,6 +65,7 @@ namespace feature drule::KeysT & keys); void GetDrawRule(vector<uint32_t> const & types, int level, int geoType, drule::KeysT & keys); + void FilterRulesByRuntimeSelector(FeatureType const & f, int zoomLevel, drule::KeysT & keys); /// Used to check whether user types belong to particular classificator set. class TypeSetChecker |