| 1275 | } |
| 1276 | |
| 1277 | void RoutingManager::SetDrapeEngine(ref_ptr<df::DrapeEngine> engine, bool is3dAllowed) |
| 1278 | { |
| 1279 | m_drapeEngine.Set(engine); |
| 1280 | if (engine == nullptr) |
| 1281 | return; |
| 1282 | |
| 1283 | // Apply gps info which was set before drape engine creation. |
| 1284 | if (m_gpsInfoCache != nullptr) |
| 1285 | { |
| 1286 | auto routeMatchingInfo = GetRouteMatchingInfo(*m_gpsInfoCache); |
| 1287 | m_drapeEngine.SafeCall(&df::DrapeEngine::SetGpsInfo, *m_gpsInfoCache, m_routingSession.IsNavigable(), |
| 1288 | m_routingSession.GetDistanceToNextTurn(), m_routingSession.GetCurrentSpeedLimit(), |
| 1289 | routeMatchingInfo); |
| 1290 | m_gpsInfoCache.reset(); |
| 1291 | } |
| 1292 | |
| 1293 | vector<string> symbols; |
| 1294 | symbols.reserve(kTransitSymbols.size() * 2); |
| 1295 | for (auto const & typePair : kTransitSymbols) |
| 1296 | { |
| 1297 | symbols.push_back(typePair.second + "-s"); |
| 1298 | symbols.push_back(typePair.second + "-m"); |
| 1299 | } |
| 1300 | m_drapeEngine.SafeCall(&df::DrapeEngine::RequestSymbolsSize, symbols, |
| 1301 | [this, is3dAllowed](map<string, m2::PointF> && sizes) |
| 1302 | { |
| 1303 | GetPlatform().RunTask(Platform::Thread::Gui, [this, is3dAllowed, sizes = std::move(sizes)]() mutable |
| 1304 | { |
| 1305 | m_transitSymbolSizes = std::move(sizes); |
| 1306 | |
| 1307 | // In case of the engine reinitialization recover route. |
| 1308 | if (IsRoutingActive()) |
| 1309 | { |
| 1310 | m_routingSession.RouteCall([this](Route const & route) { InsertRoute(route); }); |
| 1311 | |
| 1312 | if (is3dAllowed && m_routingSession.IsFollowing()) |
| 1313 | m_drapeEngine.SafeCall(&df::DrapeEngine::EnablePerspective); |
| 1314 | } |
| 1315 | }); |
| 1316 | }); |
| 1317 | } |
| 1318 | |
| 1319 | bool RoutingManager::HasRouteAltitude() const |
| 1320 | { |
nothing calls this directly
no test coverage detected