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

Method RemoveRoute

libs/map/routing_manager.cpp:561–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561void RoutingManager::RemoveRoute(bool deactivateFollowing)
562{
563 GetPlatform().RunTask(Platform::Thread::Gui, [this, deactivateFollowing]()
564 {
565 {
566 auto es = m_bmManager->GetEditSession();
567 es.ClearGroup(UserMark::Type::TRANSIT);
568 es.ClearGroup(UserMark::Type::SPEED_CAM);
569 es.ClearGroup(UserMark::Type::TRAFFIC_LIGHT);
570 es.ClearGroup(UserMark::Type::ROAD_WARNING);
571 }
572 if (deactivateFollowing)
573 SetPointsFollowingMode(false /* enabled */);
574 });
575
576 RemovePassedPoints();
577
578 if (deactivateFollowing)
579 {
580 m_transitReadManager->BlockTransitSchemeMode(false /* isBlocked */);
581 // Remove all subroutes.
582 m_drapeEngine.SafeCall(&df::DrapeEngine::RemoveSubroute, dp::DrapeID(), true /* deactivateFollowing */);
583 }
584 else
585 {
586 df::DrapeEngineLockGuard lock(m_drapeEngine);
587 if (lock)
588 {
589 lock_guard<mutex> lockSubroutes(m_drapeSubroutesMutex);
590 for (auto const & subrouteId : m_drapeSubroutes)
591 lock.Get()->RemoveSubroute(subrouteId, false /* deactivateFollowing */);
592 }
593 }
594
595 {
596 lock_guard<mutex> lock(m_drapeSubroutesMutex);
597 m_drapeSubroutes.clear();
598 m_transitRouteInfo = TransitRouteInfo();
599 }
600}
601
602void RoutingManager::CollectFeaturesAlongRoute(vector<RouteSegment> const & segments,
603 m2::PointD const & startPt,

Calls 9

RunTaskMethod · 0.80
GetEditSessionMethod · 0.80
ClearGroupMethod · 0.80
SafeCallMethod · 0.80
RemoveSubrouteMethod · 0.80
TransitRouteInfoClass · 0.50
GetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected