| 133 | } |
| 134 | |
| 135 | pair<double, double> GetConnectionAngleAndDistance(bool & isBeg, Street const * s1, Street const * s2) |
| 136 | { |
| 137 | m2::PointD const & p1 = isBeg ? s1->m_points.front() : s1->m_points.back(); |
| 138 | m2::PointD const & p0 = isBeg ? s1->m_points[1] : s1->m_points[s1->m_points.size() - 2]; |
| 139 | |
| 140 | double const d0 = p1.SquaredLength(s2->m_points.front()); |
| 141 | double const d2 = p1.SquaredLength(s2->m_points.back()); |
| 142 | isBeg = (d0 < d2); |
| 143 | m2::PointD const & p2 = isBeg ? s2->m_points[1] : s2->m_points[s2->m_points.size() - 2]; |
| 144 | |
| 145 | return make_pair(ang::GetShortestDistance(ang::AngleTo(p0, p1), ang::AngleTo(p1, p2)), min(d0, d2)); |
| 146 | } |
| 147 | |
| 148 | class HasSecond |
| 149 | { |
no test coverage detected