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

Method RebuildRoute

libs/routing/routing_session.cpp:93–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void RoutingSession::RebuildRoute(m2::PointD const & startPoint, ReadyCallback const & readyCallback,
94 NeedMoreMapsCallback const & needMoreMapsCallback,
95 RemoveRouteCallback const & removeRouteCallback, uint32_t timeoutSec,
96 SessionState routeRebuildingState, bool adjustToPrevRoute)
97{
98 CHECK_THREAD_CHECKER(m_threadChecker, ());
99 CHECK(m_router, ());
100 SetState(routeRebuildingState);
101
102 ++m_routingRebuildCount;
103 auto const & direction =
104 m_routingSettings.m_useDirectionForRouteBuilding ? m_positionAccumulator.GetDirection() : m2::PointD::Zero();
105
106 Checkpoints checkpoints(m_checkpoints);
107 checkpoints.SetPointFrom(startPoint);
108 // Use old-style callback construction, because lambda constructs buggy function on Android
109 // (callback param isn't captured by value).
110 m_router->CalculateRoute(checkpoints, direction, adjustToPrevRoute, DoReadyCallback(*this, readyCallback),
111 needMoreMapsCallback, removeRouteCallback, m_progressCallback, timeoutSec);
112}
113
114m2::PointD RoutingSession::GetStartPoint() const
115{

Callers 2

UNIT_CLASS_TESTFunction · 0.80

Calls 5

ZeroFunction · 0.85
DoReadyCallbackClass · 0.85
SetPointFromMethod · 0.80
GetDirectionMethod · 0.45
CalculateRouteMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.64