| 189 | } |
| 190 | |
| 191 | bool GetPrevInSegmentRoutePoint(IRoutingResult const & result, RoutePointIndex const & index, |
| 192 | RoutePointIndex & nextIndex) |
| 193 | { |
| 194 | if (index.m_pathIndex == 0) |
| 195 | return false; |
| 196 | |
| 197 | auto const & segments = result.GetSegments(); |
| 198 | if (segments[index.m_segmentIndex].m_path.size() >= 3 && |
| 199 | index.m_pathIndex < segments[index.m_segmentIndex].m_path.size() - 1) |
| 200 | { |
| 201 | double const oneSegmentTurnAngle = CalcPathTurnAngle(segments[index.m_segmentIndex], index.m_pathIndex); |
| 202 | CarDirection const oneSegmentDirection = IntermediateDirection(oneSegmentTurnAngle); |
| 203 | if (!IsGoStraightOrSlightTurn(oneSegmentDirection)) |
| 204 | return false; // Too sharp turn angle. |
| 205 | } |
| 206 | |
| 207 | nextIndex = {index.m_segmentIndex, index.m_pathIndex - 1}; |
| 208 | return true; |
| 209 | } |
| 210 | |
| 211 | bool GetNextRoutePointIndex(IRoutingResult const & result, RoutePointIndex const & index, NumMwmIds const & numMwmIds, |
| 212 | bool const forward, RoutePointIndex & nextIndex) |
no test coverage detected