| 264 | } |
| 265 | |
| 266 | void RoutesBuilder::Processor::InitRouter(VehicleType type) |
| 267 | { |
| 268 | if (m_router && m_router->GetVehicleType() == type) |
| 269 | return; |
| 270 | |
| 271 | auto const & cig = m_cig; |
| 272 | auto const countryFileGetter = [cig](m2::PointD const & pt) |
| 273 | { |
| 274 | auto const cigSharedPtr = cig.lock(); |
| 275 | return cigSharedPtr->GetRegionCountryId(pt); |
| 276 | }; |
| 277 | |
| 278 | auto const getMwmRectByName = [cig](std::string const & countryId) |
| 279 | { |
| 280 | auto const cigSharedPtr = cig.lock(); |
| 281 | return cigSharedPtr->GetLimitRectForLeaf(countryId); |
| 282 | }; |
| 283 | |
| 284 | bool const loadAltitudes = type != VehicleType::Car; |
| 285 | if (!m_dataSource) |
| 286 | m_dataSource = m_dataSourceStorage.GetDataSource(); |
| 287 | |
| 288 | m_router = std::make_unique<IndexRouter>(type, loadAltitudes, *m_cpg.lock(), countryFileGetter, getMwmRectByName, |
| 289 | m_numMwmIds, MakeNumMwmTree(*m_numMwmIds, *m_cig.lock()), *m_trafficCache, |
| 290 | *m_dataSource); |
| 291 | } |
| 292 | |
| 293 | RoutesBuilder::Result RoutesBuilder::Processor::operator()(Params const & params) |
| 294 | { |
nothing calls this directly
no test coverage detected