added API for drawing single Placemark

This commit is contained in:
rachytski 2012-02-24 16:38:09 +04:00 committed by Alex Zolotarev
parent 6559c5ecf7
commit 32e1833acc
2 changed files with 25 additions and 0 deletions

View file

@ -31,6 +31,7 @@ InformationDisplay::InformationDisplay()
enableMemoryWarning(false);
enableBenchmarkInfo(false);
enableEmptyModelMessage(false);
enablePlacemark(false);
for (int i = 0; i < sizeof(m_DebugPts) / sizeof(m2::PointD); ++i)
m_DebugPts[i] = m2::PointD(0, 0);
@ -243,6 +244,21 @@ void InformationDisplay::drawMemoryWarning(DrawerYG * drawer)
enableMemoryWarning(false);
}
void InformationDisplay::enablePlacemark(bool doEnable)
{
m_isPlacemarkEnabled = doEnable;
}
void InformationDisplay::setPlacemarkPosition(m2::PointD const & glbPos)
{
m_placemarkPos = glbPos;
}
void InformationDisplay::drawPlacemark(DrawerYG *pDrawer)
{
pDrawer->drawSymbol(m_screen.GtoP(m_placemarkPos), "placemark", yg::EPosAbove, yg::maxDepth);
}
bool InformationDisplay::s_isLogEnabled = false;
list<string> InformationDisplay::s_log;
size_t InformationDisplay::s_logSize = 10;
@ -441,4 +457,6 @@ void InformationDisplay::doDraw(DrawerYG *drawer)
drawLog(drawer);
if (m_isEmptyModelMessageEnabled)
drawEmptyModelMessage(drawer);
if (m_isPlacemarkEnabled)
drawPlacemark(drawer);
}

View file

@ -36,6 +36,9 @@ private:
bool m_isRulerEnabled;
Ruler m_ruler;
bool m_isPlacemarkEnabled;
m2::PointD m_placemarkPos;
bool m_isCenterEnabled;
m2::PointD m_centerPtLonLat;
int m_currentScale;
@ -99,6 +102,10 @@ public:
void memoryWarning();
void drawMemoryWarning(DrawerYG * pDrawer);
void enablePlacemark(bool doEnable);
void setPlacemarkPosition(m2::PointD const & glbPt);
void drawPlacemark(DrawerYG * pDrawer);
void enableBenchmarkInfo(bool doEnable);
bool addBenchmarkInfo(string const & name, m2::RectD const & globalRect, double frameDuration);
void drawBenchmarkInfo(DrawerYG * pDrawer);