[editor] Init with feature loader lambda.

This commit is contained in:
Alex Zolotarev 2016-01-02 11:46:48 +01:00 committed by Sergey Yershov
parent 3112311064
commit 96f0b92a4f
2 changed files with 7 additions and 0 deletions

View file

@ -30,6 +30,7 @@ class Editor final
public:
using TMwmIdByMapNameFn = function<MwmSet::MwmId(string const & /*map*/)>;
using TInvalidateFn = function<void()>;
using TFeatureLoaderFn = function<FeatureType (FeatureID const & /*fid*/)>;
enum FeatureStatus
{
@ -46,6 +47,7 @@ public:
void SetMwmIdByNameAndVersionFn(TMwmIdByMapNameFn const & fn) { m_mwmIdByMapNameFn = fn; }
void SetInvalidateFn(TInvalidateFn const & fn) { m_invalidateFn = fn; }
void SetFeatureLoaderFn(TFeatureLoaderFn const & fn) { m_featureLoaderFn = fn; }
void LoadMapEdits();
@ -102,6 +104,7 @@ private:
TMwmIdByMapNameFn m_mwmIdByMapNameFn;
/// Invalidate map viewport after edits.
TInvalidateFn m_invalidateFn;
TFeatureLoaderFn m_featureLoaderFn;
}; // class Editor
} // namespace osm

View file

@ -328,6 +328,10 @@ Framework::Framework()
return m_model.GetIndex().GetMwmIdByCountryFile(platform::CountryFile(name));
});
editor.SetInvalidateFn([this](){ InvalidateRect(GetCurrentViewport()); });
editor.SetFeatureLoaderFn([this](FeatureID const & fid) -> FeatureType
{
return GetPOIByID(fid);
});
editor.LoadMapEdits();
}