added capbility to draw symbols by path

This commit is contained in:
Roman Sorokin 2014-07-30 13:38:18 +03:00 committed by Alex Zolotarev
parent d2f4f5133e
commit c37d33c0de
2 changed files with 23 additions and 7 deletions

View file

@ -7,6 +7,7 @@
#include "line_shape.hpp"
#include "text_shape.hpp"
#include "poi_symbol_shape.hpp"
#include "path_symbol_shape.hpp"
#include "circle_shape.hpp"
#include "../indexer/drawing_rules.hpp"
@ -243,8 +244,8 @@ void ApplyAreaFeature::ProcessRule(Stylist::rule_wrapper_t const & rule)
// ============================================= //
ApplyLineFeature::ApplyLineFeature(EngineContext & context, TileKey tileKey, FeatureID const & id)
: base_t(context, tileKey, id)
ApplyLineFeature::ApplyLineFeature(EngineContext & context, TileKey tileKey, FeatureID const & id, double nextModelViewScale)
: base_t(context, tileKey, id), m_nextModelViewScale(nextModelViewScale)
{
}
@ -280,11 +281,24 @@ void ApplyLineFeature::ProcessRule(Stylist::rule_wrapper_t const & rule)
if (pRule != NULL)
{
LineViewParams params;
Extract(pRule, params);
params.m_depth = depth;
if (pRule->has_pathsym())
{
PathSymProto const & symRule = pRule->pathsym();
PathSymbolViewParams params;
params.m_depth = depth;
params.m_symbolName = symRule.name();
params.m_Offset = symRule.offset() * df::VisualParams::Instance().GetVisualScale();
params.m_OffsetStart = symRule.step() * df::VisualParams::Instance().GetVisualScale();
m_context.InsertShape(m_tileKey, MovePointer<MapShape>(new LineShape(m_path, params)));
m_context.InsertShape(m_tileKey, MovePointer<MapShape>(new PathSymbolShape(m_path, params, m_nextModelViewScale)));
}
else
{
LineViewParams params;
Extract(pRule, params);
params.m_depth = depth;
m_context.InsertShape(m_tileKey, MovePointer<MapShape>(new LineShape(m_path, params)));
}
}
}

View file

@ -79,7 +79,8 @@ class ApplyLineFeature : public BaseApplyFeature
public:
ApplyLineFeature(EngineContext & context,
TileKey tileKey,
FeatureID const & id);
FeatureID const & id,
double nextModelViewScale);
void operator ()(CoordPointT const & point);
bool HasGeometry() const;
@ -87,6 +88,7 @@ public:
private:
vector<m2::PointF> m_path;
double m_nextModelViewScale;
};
} // namespace df