drawing empty model message.

This commit is contained in:
rachytski 2011-12-04 00:47:28 +04:00 committed by Alex Zolotarev
parent 3daf021cf4
commit 2967d56af3
5 changed files with 19 additions and 15 deletions

View file

@ -216,7 +216,6 @@ namespace fwork
m_paintEvent(e),
m_zoom(scaleLevel),
m_hasNonCoast(false),
m_hasAnyFeature(false),
m_glyphCache(e->drawer()->screen()->glyphCache())
#ifdef PROFILER_DRAWING
, m_drawCount(0)
@ -407,16 +406,13 @@ namespace fwork
}
if (isExist)
{
pDrawer->Draw(ptr.get(), rules.data(), count);
m_hasAnyFeature = true;
}
return true;
}
bool DrawProcessor::IsEmptyDrawing() const
{
return (m_zoom >= feature::g_arrCountryScales[0] && (!m_hasAnyFeature || !m_hasNonCoast));
return (m_zoom >= feature::g_arrCountryScales[0] && !m_hasNonCoast);
}
}

View file

@ -95,6 +95,13 @@ Framework::Framework()
m_informationDisplay.enableDebugPoints(true);
#endif
char const s [] = "Nothing found. Have you tried\n"\
"downloading maps of the countries?\n"\
"Just click the downloader button \n"\
"at the bottom of the screen.";
m_informationDisplay.setEmptyModelMessage(s);
m_informationDisplay.enableCenter(true);
m_informationDisplay.enableRuler(true);
m_informationDisplay.setRulerParams(m_minRulerWidth, m_metresMinWidth, m_metresMaxWidth);

View file

@ -318,19 +318,16 @@ void InformationDisplay::enableEmptyModelMessage(bool doEnable)
m_isEmptyModelMessageEnabled = doEnable;
}
//#ifdef OMIM_OS_IPHONE
void InformationDisplay::setEmptyModelMessage(char const * msg)
{
m_emptyModelMessage = msg;
}
void InformationDisplay::drawEmptyModelMessage(DrawerYG * pDrawer)
{
m2::RectD pxRect = m_screen.PixelRect();
m2::PointD pt = m2::PointD(pxRect.SizeX() / 2, pxRect.SizeY() / 2) - m2::PointD(0, m_bottomShift * m_visualScale);
char const s [] = "Nothing found. Have you tried\n"\
"downloading maps of the countries?\n"\
"Just click the button at the bottom\n"\
"right corner to download the maps.";
// yg::FontDesc bigFont(false, 30 * m_visualScale);
yg::StraightTextElement::Params params;
params.m_depth = yg::maxDepth;
params.m_fontDesc = m_emptyMessageFont;
@ -338,7 +335,7 @@ void InformationDisplay::drawEmptyModelMessage(DrawerYG * pDrawer)
params.m_pivot = pt;
params.m_position = yg::EPosCenter;
params.m_glyphCache = pDrawer->screen()->glyphCache();
params.m_logText = strings::MakeUniString(s);
params.m_logText = strings::MakeUniString(m_emptyModelMessage);
params.m_doSplit = true;
params.m_delimiters = "\n";
params.m_useAllParts = true;
@ -347,7 +344,6 @@ void InformationDisplay::drawEmptyModelMessage(DrawerYG * pDrawer)
ste.draw(pDrawer->screen().get(), math::Identity<double, 3>());
}
//#endif
void InformationDisplay::enableBenchmarkInfo(bool doEnable)
{

View file

@ -44,6 +44,7 @@ private:
double m_frameDuration;
bool m_isEmptyModelMessageEnabled;
string m_emptyModelMessage;
bool m_isBenchmarkInfoEnabled;
@ -109,6 +110,7 @@ public:
void drawLog(DrawerYG * pDrawer);
void enableEmptyModelMessage(bool doEnable);
void setEmptyModelMessage(char const * msg);
void drawEmptyModelMessage(DrawerYG * pDrawer);
static void logMessage(my::LogLevel, my::SrcPoint const &, string const &);

View file

@ -336,7 +336,10 @@ void RenderQueueRoutine::Do()
);
}
else
{
m_threadDrawer->screen()->infoLayer()->clear();
m_renderState->m_isEmptyModelCurrent = true;
}
}
}