New cpp folder structure

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk
2025-07-17 22:35:52 +03:00
committed by Konstantin Pastbin
parent c9cbb64f12
commit 76ffc99abd
2390 changed files with 345 additions and 339 deletions

View File

@@ -0,0 +1,45 @@
#include "search/editor_delegate.hpp"
#include "search/reverse_geocoder.hpp"
#include "editor/editable_data_source.hpp"
#include "indexer/data_source_helpers.hpp"
#include "indexer/feature_decl.hpp"
using namespace std;
namespace search
{
EditorDelegate::EditorDelegate(DataSource const & dataSource) : m_dataSource(dataSource) {}
MwmSet::MwmId EditorDelegate::GetMwmIdByMapName(string const & name) const
{
return m_dataSource.GetMwmIdByCountryFile(platform::CountryFile(name));
}
unique_ptr<osm::EditableMapObject> EditorDelegate::GetOriginalMapObject(FeatureID const & fid) const
{
FeaturesLoaderGuard guard(m_dataSource, fid.m_mwmId);
auto feature = guard.GetOriginalFeatureByIndex(fid.m_index);
if (!feature)
return {};
auto object = make_unique<osm::EditableMapObject>();
object->SetFromFeatureType(*feature);
return object;
}
string EditorDelegate::GetOriginalFeatureStreet(FeatureID const & fid) const
{
search::ReverseGeocoder const coder(m_dataSource);
return coder.GetOriginalFeatureStreetName(fid);
}
void EditorDelegate::ForEachFeatureAtPoint(osm::Editor::FeatureTypeFn && fn,
m2::PointD const & point) const
{
auto const kToleranceMeters = 1e-2;
indexer::ForEachFeatureAtPoint(m_dataSource, std::move(fn), point, kToleranceMeters);
}
} // namespace search