| 98 | } |
| 99 | |
| 100 | m2::PointD BearingPointsSelector::GetEndPoint(Graph::Edge const & e, double distanceM) const |
| 101 | { |
| 102 | if (distanceM < m_bearDistM && m_bearDistM <= distanceM + EdgeLength(e)) |
| 103 | { |
| 104 | auto const edgeLen = EdgeLength(e); |
| 105 | auto const edgeBearDist = min(m_bearDistM - distanceM, edgeLen); |
| 106 | CHECK_LESS_OR_EQUAL(edgeBearDist, edgeLen, ()); |
| 107 | return m_isLastPoint ? PointAtSegmentM(e.GetEndPoint(), e.GetStartPoint(), edgeBearDist) |
| 108 | : PointAtSegmentM(e.GetStartPoint(), e.GetEndPoint(), edgeBearDist); |
| 109 | } |
| 110 | return m_isLastPoint ? e.GetStartPoint() : e.GetEndPoint(); |
| 111 | } |
| 112 | |
| 113 | bool PointsAreClose(m2::PointD const & p1, m2::PointD const & p2) |
| 114 | { |
no test coverage detected