| 56 | } |
| 57 | |
| 58 | void ReconstructRoute(DirectionsEngine & engine, IndexRoadGraph const & graph, base::Cancellable const & cancellable, |
| 59 | vector<geometry::PointWithAltitude> const & path, vector<double> const & times, Route & route) |
| 60 | { |
| 61 | if (path.empty()) |
| 62 | { |
| 63 | LOG(LERROR, ("Can't reconstruct route from an empty list of positions.")); |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | CHECK_EQUAL(path.size(), times.size() + 1, ()); |
| 68 | |
| 69 | vector<RouteSegment> routeSegments; |
| 70 | if (!engine.Generate(graph, path, cancellable, routeSegments)) |
| 71 | return; |
| 72 | |
| 73 | if (cancellable.IsCancelled()) |
| 74 | return; |
| 75 | |
| 76 | FillSegmentInfo(times, routeSegments); |
| 77 | route.SetRouteSegments(std::move(routeSegments)); |
| 78 | |
| 79 | vector<m2::PointD> routeGeometry; |
| 80 | JunctionsToPoints(path, routeGeometry); |
| 81 | |
| 82 | route.SetGeometry(routeGeometry.begin(), routeGeometry.end()); |
| 83 | |
| 84 | LOG(LDEBUG, (route.DebugPrintTurns())); |
| 85 | } |
| 86 | |
| 87 | Segment ConvertEdgeToSegment(NumMwmIds const & numMwmIds, Edge const & edge) |
| 88 | { |
no test coverage detected