Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExMix <rahuba.youri@mapswithme.com>2013-11-20 13:09:30 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:05:33 +0300
commit0a8333ddef22570d4a3fead13556b86c1b831a93 (patch)
tree72bad65ea9a59d38c5fbee19968c3cbdf763bedf /drape_frontend/read_mwm_task.cpp
parent24c55759e8a77726a5592cc0fc057628793ccefc (diff)
[drape] backend renderer refactoring. Use new cross-thread communication.
Diffstat (limited to 'drape_frontend/read_mwm_task.cpp')
-rw-r--r--drape_frontend/read_mwm_task.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/drape_frontend/read_mwm_task.cpp b/drape_frontend/read_mwm_task.cpp
new file mode 100644
index 0000000000..91d9eaf8e3
--- /dev/null
+++ b/drape_frontend/read_mwm_task.cpp
@@ -0,0 +1,57 @@
+#include "read_mwm_task.hpp"
+
+namespace df
+{
+ ReadMWMTask::ReadMWMTask(TileKey const & tileKey, df::MemoryFeatureIndex & index)
+ : m_tileInfo(tileKey)
+ , m_isFinished(false)
+ , m_index(index)
+ {
+ }
+
+ void ReadMWMTask::Do()
+ {
+ if (m_tileInfo.m_featureInfo.empty())
+ ReadTileIndex();
+
+ vector<size_t> indexesToRead;
+ m_index.ReadFeaturesRequest(m_tileInfo.m_featureInfo, indexesToRead);
+ for (size_t i = 0; i < indexesToRead.size(); ++i)
+ {
+ df::FeatureInfo & info = m_tileInfo.m_featureInfo[i];
+ ReadGeometry(info.m_id);
+ info.m_isOwner = true;
+ }
+ }
+
+ df::TileInfo const & ReadMWMTask::GetTileInfo() const
+ {
+ return m_tileInfo;
+ }
+
+ void ReadMWMTask::PrepareToRestart()
+ {
+ m_isFinished = false;
+ }
+
+ void ReadMWMTask::Finish()
+ {
+ m_isFinished = true;
+ }
+
+ bool ReadMWMTask::IsFinished()
+ {
+ return m_isFinished;
+ }
+
+ void ReadMWMTask::ReadTileIndex()
+ {
+ /// 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)
+ {
+ ///TODO read geometry
+ }
+}