Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2015-06-10 20:39:04 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:52:09 +0300
commit93dcd65744b6af1e405d77aa50f53fa20a8fb633 (patch)
tree2b83da2224d6bc888e931554eb63f66e50784f8e /indexer/feature_visibility.cpp
parent6523a2ca67ad55781c33dbef9b0a26bd2acc4bcf (diff)
[omim] [indexer] Skip the buckets that are not allowed by classificator.
Diffstat (limited to 'indexer/feature_visibility.cpp')
-rw-r--r--indexer/feature_visibility.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp
index 7531bb9c87..2c06ca5eb8 100644
--- a/indexer/feature_visibility.cpp
+++ b/indexer/feature_visibility.cpp
@@ -288,6 +288,20 @@ bool IsDrawableForIndex(FeatureBase const & f, int level)
return false;
}
+bool IsDrawableForIndexClassifOnly(FeatureBase const & f, int level)
+{
+ Classificator const & c = classif();
+
+ TypesHolder const types(f);
+
+ IsDrawableChecker doCheck(level);
+ for (uint32_t t : types)
+ if (c.ProcessObjects(t, doCheck))
+ return true;
+
+ return false;
+}
+
namespace
{
class IsNonDrawableType
@@ -339,6 +353,18 @@ int GetMinDrawableScale(FeatureBase const & f)
return -1;
}
+int GetMinDrawableScaleClassifOnly(FeatureBase const & f)
+{
+ int const upBound = scales::GetUpperStyleScale();
+
+ for (int level = 0; level <= upBound; ++level)
+ if (IsDrawableForIndexClassifOnly(f, level))
+ return level;
+
+ ASSERT(false, ("Feature is never visible."));
+ return -1;
+}
+
namespace
{
void AddRange(pair<int, int> & dest, pair<int, int> const & src)