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:
authorConstantin Shalnev <c.shalnev@corp.mail.ru>2015-08-21 13:33:54 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:02:06 +0300
commit1c69060932b586c4af1e6eab33076b6e9c147af3 (patch)
tree04bb2014209037ba708bb1c6563e3cc678c273f8 /indexer
parent1e6bad85f20e8ca2db8e1c2e438bbf7af455d9f6 (diff)
Added Shield class in DrawingRules
Diffstat (limited to 'indexer')
-rw-r--r--indexer/classificator.cpp6
-rw-r--r--indexer/drawing_rule_def.hpp2
-rw-r--r--indexer/drawing_rules.cpp17
-rw-r--r--indexer/drawing_rules.hpp2
4 files changed, 23 insertions, 4 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp
index cdf596a702..e702ef39e9 100644
--- a/indexer/classificator.cpp
+++ b/indexer/classificator.cpp
@@ -246,9 +246,9 @@ namespace
void add_rule(int ft, iter_t i)
{
static const int visible[3][drule::count_of_rules] = {
- { 0, 0, 1, 1, 1, 0, 0 }, // fpoint
- { 1, 0, 0, 0, 0, 1, 0 }, // fline
- { 1, 1, 1, 1, 1, 0, 0 } // farea
+ { 0, 0, 1, 1, 1, 0, 0, 0 }, // fpoint
+ { 1, 0, 0, 0, 0, 1, 0, 1 }, // fline
+ { 1, 1, 1, 1, 1, 0, 0, 0 } // farea
};
if (visible[ft][i->m_type] == 1)
diff --git a/indexer/drawing_rule_def.hpp b/indexer/drawing_rule_def.hpp
index 7b8fdf7797..ce7dd2158d 100644
--- a/indexer/drawing_rule_def.hpp
+++ b/indexer/drawing_rule_def.hpp
@@ -25,7 +25,7 @@ namespace drule
};
/// drawing type of rule - can be one of ...
- enum rule_type_t { line, area, symbol, caption, circle, pathtext, waymarker, count_of_rules };
+ enum rule_type_t { line, area, symbol, caption, circle, pathtext, waymarker, shield, count_of_rules };
/// geo type of rule - can be one combined of ...
enum rule_geo_t { node = 1, way = 2 };
diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp
index fa78019104..3dd98076af 100644
--- a/indexer/drawing_rules.cpp
+++ b/indexer/drawing_rules.cpp
@@ -84,6 +84,11 @@ CircleRuleProto const * BaseRule::GetCircle() const
return 0;
}
+ShieldRuleProto const * BaseRule::GetShield() const
+{
+ return nullptr;
+}
+
RulesHolder::RulesHolder()
: m_bgColors(scales::UPPER_STYLE_SCALE+1, DEFAULT_BG_COLOR)
{}
@@ -239,6 +244,15 @@ namespace
virtual CircleRuleProto const * GetCircle() const { return &m_circle; }
};
+
+ class Shield : public BaseRule
+ {
+ ShieldRuleProto m_shield;
+ public:
+ Shield(ShieldRuleProto const & r) : m_shield(r) {}
+
+ virtual ShieldRuleProto const * GetShield() const { return &m_shield; }
+ };
}
class DoSetIndex
@@ -350,6 +364,9 @@ namespace
if (de.has_path_text())
AddRule<PathText>(p, de.scale(), pathtext, de.path_text());
+
+ if (de.has_shield())
+ AddRule<Shield>(p, de.scale(), shield, de.shield());
}
}
diff --git a/indexer/drawing_rules.hpp b/indexer/drawing_rules.hpp
index f7f4d0eab2..1624ed3f3a 100644
--- a/indexer/drawing_rules.hpp
+++ b/indexer/drawing_rules.hpp
@@ -17,6 +17,7 @@ class AreaRuleProto;
class SymbolRuleProto;
class CaptionDefProto;
class CircleRuleProto;
+class ShieldRuleProto;
class ContainerProto;
@@ -49,6 +50,7 @@ namespace drule
virtual SymbolRuleProto const * GetSymbol() const;
virtual CaptionDefProto const * GetCaption(int) const;
virtual CircleRuleProto const * GetCircle() const;
+ virtual ShieldRuleProto const * GetShield() const;
};
class RulesHolder