From c29638f3052979df018d0d24afe9513a308fe22c Mon Sep 17 00:00:00 2001 From: ExMix Date: Wed, 12 Aug 2015 21:36:56 +0300 Subject: [PATCH] [drape] restore debug TileNet drawing --- drape_frontend/engine_context.cpp | 44 ------------------------------- drape_frontend/rule_drawer.cpp | 42 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/drape_frontend/engine_context.cpp b/drape_frontend/engine_context.cpp index 70896fb13b..ec70bab7cd 100644 --- a/drape_frontend/engine_context.cpp +++ b/drape_frontend/engine_context.cpp @@ -1,17 +1,8 @@ #include "drape_frontend/engine_context.hpp" -//#define DRAW_TILE_NET - #include "drape_frontend/message_subclasses.hpp" #include "drape/texture_manager.hpp" -#ifdef DRAW_TILE_NET -#include "drape_frontend/line_shape.hpp" -#include "drape_frontend/text_shape.hpp" - -#include "base/string_utils.hpp" -#endif - namespace df { @@ -40,41 +31,6 @@ void EngineContext::Flush(list> && shapes) void EngineContext::EndReadTile() { -#ifdef DRAW_TILE_NET - m2::RectD r = m_tileKey.GetGlobalRect(); - vector path; - path.push_back(r.LeftBottom()); - path.push_back(r.LeftTop()); - path.push_back(r.RightTop()); - path.push_back(r.RightBottom()); - path.push_back(r.LeftBottom()); - - m2::SharedSpline spline(path); - df::LineViewParams p; - p.m_baseGtoPScale = 1.0; - p.m_cap = dp::ButtCap; - p.m_color = dp::Color::Red(); - p.m_depth = 20000; - p.m_width = 5; - p.m_join = dp::RoundJoin; - - InsertShape(make_unique_dp(spline, p, m_texMng)); - - df::TextViewParams tp; - tp.m_anchor = dp::Center; - tp.m_depth = 0; - tp.m_primaryText = strings::to_string(m_tileKey.m_x) + " " + - strings::to_string(m_tileKey.m_y) + " " + - strings::to_string(m_tileKey.m_zoomLevel); - - tp.m_primaryTextFont = dp::FontDecl(dp::Color::Red(), 30); - - list> shapes; - shapes.push_back(make_unique_dp(r.Center(), tp)); - - Flush(move(shapes)); -#endif - PostMessage(make_unique_dp(m_tileKey)); } diff --git a/drape_frontend/rule_drawer.cpp b/drape_frontend/rule_drawer.cpp index a9b5475b00..828212a774 100644 --- a/drape_frontend/rule_drawer.cpp +++ b/drape_frontend/rule_drawer.cpp @@ -10,6 +10,15 @@ #include "base/assert.hpp" #include "std/bind.hpp" +//#define DRAW_TILE_NET + +#ifdef DRAW_TILE_NET +#include "drape_frontend/line_shape.hpp" +#include "drape_frontend/text_shape.hpp" + +#include "base/string_utils.hpp" +#endif + namespace df { @@ -87,6 +96,39 @@ void RuleDrawer::operator()(FeatureType const & f) apply.Finish(); } +#ifdef DRAW_TILE_NET + TileKey key = m_context->GetTileKey(); + m2::RectD r = key.GetGlobalRect(); + vector path; + path.push_back(r.LeftBottom()); + path.push_back(r.LeftTop()); + path.push_back(r.RightTop()); + path.push_back(r.RightBottom()); + path.push_back(r.LeftBottom()); + + m2::SharedSpline spline(path); + df::LineViewParams p; + p.m_baseGtoPScale = 1.0; + p.m_cap = dp::ButtCap; + p.m_color = dp::Color::Red(); + p.m_depth = 20000; + p.m_width = 5; + p.m_join = dp::RoundJoin; + + insertShape(make_unique_dp(spline, p)); + + df::TextViewParams tp; + tp.m_anchor = dp::Center; + tp.m_depth = 0; + tp.m_primaryText = strings::to_string(key.m_x) + " " + + strings::to_string(key.m_y) + " " + + strings::to_string(key.m_zoomLevel); + + tp.m_primaryTextFont = dp::FontDecl(dp::Color::Red(), 30); + + insertShape(make_unique_dp(r.Center(), tp)); +#endif + for (auto & shape : m_mapShapes) shape->Prepare(m_context->GetTextureManager());