mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
25
libs/editor/editable_feature_source.cpp
Normal file
25
libs/editor/editable_feature_source.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "editor/editable_feature_source.hpp"
|
||||
|
||||
#include "editor/osm_editor.hpp"
|
||||
|
||||
FeatureStatus EditableFeatureSource::GetFeatureStatus(uint32_t index) const
|
||||
{
|
||||
osm::Editor & editor = osm::Editor::Instance();
|
||||
return editor.GetFeatureStatus(m_handle.GetId(), index);
|
||||
}
|
||||
|
||||
std::unique_ptr<FeatureType> EditableFeatureSource::GetModifiedFeature(uint32_t index) const
|
||||
{
|
||||
osm::Editor & editor = osm::Editor::Instance();
|
||||
auto const emo = editor.GetEditedFeature(FeatureID(m_handle.GetId(), index));
|
||||
if (emo)
|
||||
return FeatureType::CreateFromMapObject(*emo);
|
||||
return {};
|
||||
}
|
||||
|
||||
void EditableFeatureSource::ForEachAdditionalFeature(m2::RectD const & rect, int scale,
|
||||
std::function<void(uint32_t)> const & fn) const
|
||||
{
|
||||
osm::Editor & editor = osm::Editor::Instance();
|
||||
editor.ForEachCreatedFeature(m_handle.GetId(), fn, rect, scale);
|
||||
}
|
||||
Reference in New Issue
Block a user