[graphics] allow drawing circles

This commit is contained in:
Darafei Praliaskouski 2013-09-12 20:23:20 +03:00 committed by Alex Zolotarev
parent f6e5a5988a
commit f1e0cb8e87
4 changed files with 27 additions and 11 deletions

View file

@ -58,10 +58,11 @@ namespace graphics
pivot() * m,
position());
r->drawTexturedPolygon(m2::PointD(0.0, 0.0), 0.0,
texRect.minX(), texRect.minY(), texRect.maxX(), texRect.maxY(),
posPt.x, posPt.y, posPt.x + texRect.SizeX(), posPt.y + texRect.SizeY(),
graphics::maxDepth,
depth(),
res->m_pipelineID);
}

View file

@ -52,6 +52,18 @@ namespace graphics
drawSymbol(params);
}
void OverlayRenderer::drawCircle(CircleElement::Params & params)
{
shared_ptr<OverlayElement> oe(new CircleElement(params));
math::Matrix<double, 3, 3> id = math::Identity<double, 3>();
if (!m_overlay.get())
oe->draw(this, id);
else
m_overlay->processOverlayElement(oe);
}
void OverlayRenderer::drawCircle(m2::PointD const & pt,
graphics::Circle::Info const & ci,
EPosition pos,
@ -64,14 +76,7 @@ namespace graphics
params.m_pivot = pt;
params.m_ci = ci;
shared_ptr<OverlayElement> oe(new CircleElement(params));
math::Matrix<double, 3, 3> id = math::Identity<double, 3>();
if (!m_overlay.get())
oe->draw(this, id);
else
m_overlay->processOverlayElement(oe);
drawCircle(params);
}
void OverlayRenderer::drawText(FontDesc const & fontDesc,

View file

@ -5,7 +5,7 @@
#include "text_renderer.hpp"
#include "overlay.hpp"
#include "circle.hpp"
#include "circle_element.hpp"
#include "straight_text_element.hpp"
namespace graphics
@ -39,6 +39,7 @@ namespace graphics
void drawSymbol(m2::PointD const & pt, string const & symbolName, EPosition pos, int depth);
/// Drawing circle
void drawCircle(CircleElement::Params & params);
void drawCircle(m2::PointD const & pt,
Circle::Info const & ci,
EPosition pos,

View file

@ -96,7 +96,16 @@ void Drawer::drawCircle(m2::PointD const & pt,
graphics::Circle::Info ci;
ConvertStyle(rule.m_rule->GetCircle(), m_visualScale, ci);
m_pScreen->drawCircle(pt, ci, pos, rule.m_depth);
graphics::CircleElement::Params params;
params.m_depth = rule.m_depth;
params.m_position = pos;
params.m_pivot = pt;
params.m_ci = ci;
params.m_userInfo.m_mwmID = id.first;
params.m_userInfo.m_offset = id.second;
m_pScreen->drawCircle(params);
}
void Drawer::drawSymbol(m2::PointD const & pt,