From 899aa90144f28530ef2afff3246cd72e452286a5 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Fri, 19 May 2017 15:14:09 +0300 Subject: [PATCH] [routing] Route calculation on world graph in case of start and finish leaps. --- routing/index_router.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/routing/index_router.cpp b/routing/index_router.cpp index 8417b92398..a36ee2059a 100644 --- a/routing/index_router.cpp +++ b/routing/index_router.cpp @@ -305,7 +305,6 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector const & input, WorldGraph & worldGraph = starter.GetGraph(); WorldGraph::Mode const worldRouteMode = worldGraph.GetMode(); - worldGraph.SetMode(WorldGraph::Mode::SingleMwm); for (size_t i = 0; i < input.size(); ++i) { @@ -318,6 +317,19 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector const & input, continue; } + // In case of leaps from the start to its mwm transition and from finish mwm transition + // Route calculation should be made on the world graph (WorldGraph::Mode::NoLeaps). + if ((current.GetMwmId() == starter.GetStartVertex().GetMwmId() + || current.GetMwmId() == starter.GetFinishVertex().GetMwmId()) + && worldRouteMode == WorldGraph::Mode::LeapsOnly) + { + worldGraph.SetMode(WorldGraph::Mode::NoLeaps); + } + else + { + worldGraph.SetMode(WorldGraph::Mode::SingleMwm); + } + ++i; CHECK_LESS(i, input.size(), ()); Segment const & next = input[i];