Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
27
libs/storage/routing_helpers.cpp
Normal file
27
libs/storage/routing_helpers.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "storage/routing_helpers.hpp"
|
||||
|
||||
namespace routing
|
||||
{
|
||||
|
||||
std::unique_ptr<m4::Tree<routing::NumMwmId>> MakeNumMwmTree(NumMwmIds const & numMwmIds,
|
||||
storage::CountryInfoGetter const & countryInfoGetter)
|
||||
{
|
||||
auto tree = std::make_unique<m4::Tree<NumMwmId>>();
|
||||
|
||||
numMwmIds.ForEachId([&](NumMwmId numMwmId)
|
||||
{
|
||||
auto const & countryName = numMwmIds.GetFile(numMwmId).GetName();
|
||||
tree->Add(numMwmId, countryInfoGetter.GetLimitRectForLeaf(countryName));
|
||||
});
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
std::shared_ptr<routing::NumMwmIds> CreateNumMwmIds(storage::Storage const & storage)
|
||||
{
|
||||
auto numMwmIds = std::make_shared<routing::NumMwmIds>();
|
||||
storage.ForEachCountry([&](storage::Country const & country) { numMwmIds->RegisterFile(country.GetFile()); });
|
||||
return numMwmIds;
|
||||
}
|
||||
|
||||
} // namespace routing
|
||||
Loading…
Add table
Add a link
Reference in a new issue