From f9e1d2bcfb94ed255705c7a6426751fb663a4ce0 Mon Sep 17 00:00:00 2001 From: ExMix Date: Fri, 27 Dec 2013 15:56:37 +0300 Subject: [PATCH] [drape] mock read task for debug --- drape_frontend/read_mwm_task.cpp | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drape_frontend/read_mwm_task.cpp b/drape_frontend/read_mwm_task.cpp index 3b6705fe24..6fc0ecb33e 100644 --- a/drape_frontend/read_mwm_task.cpp +++ b/drape_frontend/read_mwm_task.cpp @@ -1,7 +1,38 @@ #include "read_mwm_task.hpp" +#include "area_shape.hpp" + #include "../std/vector.hpp" +namespace +{ + df::AreaShape * CreateFakeShape1() + { + df::AreaShape * shape = new df::AreaShape(Extract(0xFFEEAABB)); + shape->AddTriangle(m2::PointF(0.0f, 0.0f), + m2::PointF(1.0f, 0.0f), + m2::PointF(0.0f, 1.0f)); + + shape->AddTriangle(m2::PointF(1.0f, 0.0f), + m2::PointF(0.0f, 1.0f), + m2::PointF(1.0f, 1.0f)); + return shape; + } + + df::AreaShape * CreateFakeShape2() + { + df::AreaShape * shape = new df::AreaShape(Extract(0xFF66AAFF)); + shape->AddTriangle(m2::PointF(0.0f, 0.5f), + m2::PointF(0.5f, 1.5f), + m2::PointF(0.5f, 0.0f)); + + shape->AddTriangle(m2::PointF(0.5f, 0.0f), + m2::PointF(0.5f, 1.5f), + m2::PointF(1.5f, 0.5f)); + return shape; + } +} + namespace df { ReadMWMTask::ReadMWMTask(TileKey const & tileKey, @@ -59,12 +90,16 @@ namespace df void ReadMWMTask::ReadTileIndex() { + m_tileInfo.m_featureInfo.push_back(FeatureInfo(FeatureID(0, 1))); + m_tileInfo.m_featureInfo.push_back(FeatureInfo(FeatureID(0, 2))); /// TODO read index specified by m_tileInfo(m_x & m_y & m_zoomLevel) /// TODO insert readed FeatureIDs into m_tileInfo.m_featureInfo; } void ReadMWMTask::ReadGeometry(const FeatureID & id) { + m_context.InsertShape(TileKey(0, 0, 0), MovePointer(CreateFakeShape1())); + m_context.InsertShape(TileKey(0, 0, 0), MovePointer(CreateFakeShape2())); ///TODO read geometry ///TODO proccess geometry by styles ///foreach shape in shapes