| 27 | |
| 28 | template <class AddPointFnT> |
| 29 | void InsertCorners(CornersT const & corners, m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3, |
| 30 | AddPointFnT const & addPolygonPoint, int code1, int code2) |
| 31 | { |
| 32 | int cornerInd = GetRectSideIndex(code1); |
| 33 | int endCornerInd = GetRectSideIndex(code2); |
| 34 | |
| 35 | if (!IsPointInsideTriangle(corners[cornerInd], p1, p2, p3)) |
| 36 | { |
| 37 | if (!IsPointInsideTriangle(corners[endCornerInd], p1, p2, p3)) |
| 38 | return; |
| 39 | std::swap(cornerInd, endCornerInd); |
| 40 | } |
| 41 | |
| 42 | while (cornerInd != endCornerInd) |
| 43 | { |
| 44 | addPolygonPoint(corners[cornerInd]); |
| 45 | cornerInd = (cornerInd + 1) % 4; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | template <class AddPointFnT> |
| 50 | bool IntersectEdge(m2::RectD const & rect, CornersT const & corners, m2::PointD const & pp1, m2::PointD const & pp2, |
no test coverage detected