MCPcopy Create free account
hub / github.com/comaps/comaps / SetDrapeEngine

Method SetDrapeEngine

libs/map/routing_manager.cpp:1277–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1275}
1276
1277void 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
1319bool RoutingManager::HasRouteAltitude() const
1320{

Callers

nothing calls this directly

Calls 12

SafeCallMethod · 0.80
GetDistanceToNextTurnMethod · 0.80
RunTaskMethod · 0.80
RouteCallMethod · 0.80
IsFollowingMethod · 0.80
SetMethod · 0.45
IsNavigableMethod · 0.45
GetCurrentSpeedLimitMethod · 0.45
resetMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected