forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
fa8ed8c9ac
commit
89e2b9e6fe
4 changed files with 10 additions and 7 deletions
|
@ -227,7 +227,9 @@ IRouter::ResultCode RoadGraphRouter::CalculateRoute(m2::PointD const & startPoin
|
|||
ASSERT_EQUAL(result.path.front(), startPos, ());
|
||||
ASSERT_EQUAL(result.path.back(), finalPos, ());
|
||||
ASSERT_GREATER(result.distance, 0., ());
|
||||
ReconstructRoute(m_directionsEngine.get(), *m_roadGraph, nullptr /* trafficColoring */,
|
||||
|
||||
CHECK(m_directionsEngine, ());
|
||||
ReconstructRoute(*m_directionsEngine, *m_roadGraph, nullptr /* trafficColoring */,
|
||||
delegate, result.path, route);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace routing
|
|||
{
|
||||
using namespace traffic;
|
||||
|
||||
void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph,
|
||||
void ReconstructRoute(IDirectionsEngine & engine, IRoadGraph const & graph,
|
||||
shared_ptr<TrafficInfo::Coloring> const & trafficColoring,
|
||||
my::Cancellable const & cancellable, vector<Junction> & path, Route & route)
|
||||
{
|
||||
|
@ -29,8 +29,7 @@ void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph,
|
|||
// @TODO(bykoianko) streetNames is not filled in Generate(). It should be done.
|
||||
Route::TStreets streetNames;
|
||||
vector<TrafficInfo::RoadSegmentId> trafficSegs;
|
||||
if (engine)
|
||||
engine->Generate(graph, path, times, turnsDir, junctions, trafficSegs, cancellable);
|
||||
engine.Generate(graph, path, times, turnsDir, junctions, trafficSegs, cancellable);
|
||||
|
||||
if (cancellable.IsCancelled())
|
||||
return;
|
||||
|
|
|
@ -25,7 +25,7 @@ bool IsRoad(TTypes const & types)
|
|||
BicycleModel::AllLimitsInstance().HasRoadType(types);
|
||||
}
|
||||
|
||||
void ReconstructRoute(IDirectionsEngine * engine, IRoadGraph const & graph,
|
||||
void ReconstructRoute(IDirectionsEngine & engine, IRoadGraph const & graph,
|
||||
shared_ptr<traffic::TrafficInfo::Coloring> const & trafficColoring,
|
||||
my::Cancellable const & cancellable, vector<Junction> & path, Route & route);
|
||||
} // namespace rouing
|
||||
|
|
|
@ -229,8 +229,10 @@ bool SingleMwmRouter::BuildRoute(MwmSet::MwmId const & mwmId, vector<Joint::Id>
|
|||
shared_ptr<traffic::TrafficInfo::Coloring> trafficColoring = m_trafficCache.GetTrafficInfo(mwmId);
|
||||
|
||||
vector<Junction> const oldJunctions(junctions);
|
||||
ReconstructRoute(m_directionsEngine.get(), m_roadGraph, trafficColoring, delegate, junctions,
|
||||
route);
|
||||
|
||||
CHECK(m_directionsEngine, ());
|
||||
ReconstructRoute(*m_directionsEngine, m_roadGraph, trafficColoring, delegate,
|
||||
junctions, route);
|
||||
|
||||
if (junctions != oldJunctions)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue