From 3ed3990358bfd4b9c46f94bdb02004d04ba5b531 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Thu, 16 Apr 2015 13:30:38 +0300 Subject: [PATCH] pedestrian graph loader refactoring --- routing/features_road_graph.cpp | 63 ++------------------------------- 1 file changed, 2 insertions(+), 61 deletions(-) diff --git a/routing/features_road_graph.cpp b/routing/features_road_graph.cpp index 64e81889cf..91c8f90274 100644 --- a/routing/features_road_graph.cpp +++ b/routing/features_road_graph.cpp @@ -60,7 +60,7 @@ public: void operator()(FeatureType & ft) { FeatureID const fID = ft.GetID(); - if (m_featureID == fID.m_offset || fID.m_mwm != m_graph.GetMwmID()) + if (fID.m_mwm != m_graph.GetMwmID()) return; /// @todo remove overhead with type and speed checks (now speed loads in cache creation) @@ -139,15 +139,7 @@ void FeaturesRoadGraph::GetNearestTurns(RoadPos const & pos, vector 0) indexFound++; - - { - PossibleTurn revTurn; - revTurn.m_speed = fc.m_speed; - revTurn.m_metersCovered = 0; - revTurn.m_secondsCovered = 0; - revTurn.m_startPoint = fc.m_points.front(); - revTurn.m_endPoint = fc.m_points.back(); - revTurn.m_pos = - RoadPos(pos.GetFeatureId(), !pos.IsForward(), pos.GetSegId(), pos.GetSegEndpoint()); - turns.push_back(revTurn); - } - - // Following code adds "fake" turn from an adjacent segment to pos. - // That's why m_startPoint and m_endPoint are set to the bounds of - // the current road. - PossibleTurn thisTurn; - thisTurn.m_speed = fc.m_speed; - thisTurn.m_metersCovered = segmentDistance; - thisTurn.m_secondsCovered = segmentTime; - thisTurn.m_startPoint = fc.m_points.front(); - thisTurn.m_endPoint = fc.m_points.back(); - - // Push turn points for this feature. - if (isForward && segId > 0) - { - thisTurn.m_pos = RoadPos(featureId, isForward, segId - 1, point); - turns.push_back(thisTurn); - } - if (!isForward && segId + 2 < numPoints) - { - thisTurn.m_pos = RoadPos(featureId, isForward, segId + 1, point); - turns.push_back(thisTurn); - } - - // Checks that the road is not a loop. - if (!m2::AlmostEqual(fc.m_points.front(), fc.m_points.back())) - return; - - if (isForward && segId == 0) - { - // It seems that it's possible to get from the last segment to the first. - thisTurn.m_pos = RoadPos(featureId, isForward, numPoints - 2 /* segId */, point); - turns.push_back(thisTurn); - } - if (!isForward && segId + 2 == numPoints) - { - // It seems that it's possible to get from the first segment to the last. - thisTurn.m_pos = RoadPos(featureId, isForward, 0 /* segId */, point); - turns.push_back(thisTurn); - } } void FeaturesRoadGraph::ReconstructPath(RoadPosVectorT const & positions, Route & route)