[drape]use engine context to draw map shapes

This commit is contained in:
ExMix 2013-12-17 16:01:42 +03:00 committed by Alex Zolotarev
parent 388eb3be14
commit 3943834834
2 changed files with 25 additions and 6 deletions

View file

@ -1,11 +1,16 @@
#include "read_mwm_task.hpp"
#include "../std/vector.hpp"
namespace df
{
ReadMWMTask::ReadMWMTask(TileKey const & tileKey, df::MemoryFeatureIndex & index)
ReadMWMTask::ReadMWMTask(TileKey const & tileKey,
MemoryFeatureIndex & index,
EngineContext &context)
: m_tileInfo(tileKey)
, m_isFinished(false)
, m_index(index)
, m_context(context)
{
}
@ -16,15 +21,22 @@ namespace df
vector<size_t> indexesToRead;
m_index.ReadFeaturesRequest(m_tileInfo.m_featureInfo, indexesToRead);
if (!indexesToRead.empty())
m_context.BeginReadTile(m_tileInfo.m_key);
for (size_t i = 0; i < indexesToRead.size(); ++i)
{
df::FeatureInfo & info = m_tileInfo.m_featureInfo[i];
FeatureInfo & info = m_tileInfo.m_featureInfo[i];
ReadGeometry(info.m_id);
info.m_isOwner = true;
}
if (!indexesToRead.empty())
m_context.EndReadTile(m_tileInfo.m_key);
}
df::TileInfo const & ReadMWMTask::GetTileInfo() const
TileInfo const & ReadMWMTask::GetTileInfo() const
{
return m_tileInfo;
}
@ -53,5 +65,8 @@ namespace df
void ReadMWMTask::ReadGeometry(const FeatureID & id)
{
///TODO read geometry
///TODO proccess geometry by styles
///foreach shape in shapes
/// m_context.InsertShape(shape);
}
}

View file

@ -2,6 +2,7 @@
#include "tile_info.hpp"
#include "memory_feature_index.hpp"
#include "engine_context.hpp"
#include "../base/thread.hpp"
#include "../base/object_tracker.hpp"
@ -11,7 +12,9 @@ namespace df
class ReadMWMTask : public threads::IRoutine
{
public:
ReadMWMTask(TileKey const & tileKey, df::MemoryFeatureIndex & index);
ReadMWMTask(TileKey const & tileKey,
MemoryFeatureIndex & index,
EngineContext & context);
virtual void Do();
@ -26,9 +29,10 @@ namespace df
void ReadGeometry(const FeatureID & id);
private:
df::TileInfo m_tileInfo;
TileInfo m_tileInfo;
bool m_isFinished;
df::MemoryFeatureIndex & m_index;
MemoryFeatureIndex & m_index;
EngineContext & m_context;
#ifdef DEBUG
dbg::ObjectTracker m_objTracker;