diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-03-04 17:00:11 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:52:56 +0300 |
commit | 01835487d022ad6d589df0322c7b7a1f47177b46 (patch) | |
tree | 80ee20ee1b70827598ee480aff016cf6b036bf5c /geometry/geometry_tests | |
parent | 40e5f2ecfa5b55e81933a60a0d8a5cb128e5f98e (diff) |
Optimized spline clipping, increased tile size
Diffstat (limited to 'geometry/geometry_tests')
-rw-r--r-- | geometry/geometry_tests/clipping_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/geometry/geometry_tests/clipping_test.cpp b/geometry/geometry_tests/clipping_test.cpp index 212dbc7051..39e456b40e 100644 --- a/geometry/geometry_tests/clipping_test.cpp +++ b/geometry/geometry_tests/clipping_test.cpp @@ -246,4 +246,17 @@ UNIT_TEST(Clipping_ClipSplineByRect) vector<m2::SharedSpline> result4 = m2::ClipSplineByRect(r, spline4); vector<m2::SharedSpline> expectedResult4 = ConstructSplineList({ { m2::PointD(-0.5, 0.0), m2::PointD(0.5, 0.5) } }); TEST(CompareSplineLists(result4, expectedResult4), ()); + + // Intersection. Long spline. + m2::SharedSpline spline5; + spline5.Reset(new m2::Spline(4)); + spline5->AddPoint(m2::PointD(-2.0, 0.0)); + spline5->AddPoint(m2::PointD(0.0, 0.0)); + spline5->AddPoint(m2::PointD(0.5, 0.5)); + spline5->AddPoint(m2::PointD(2.0, 1.0)); + vector<m2::SharedSpline> result5 = m2::ClipSplineByRect(r, spline5); + vector<m2::SharedSpline> expectedResult5 = ConstructSplineList({ { m2::PointD(-1.0, 0.0), m2::PointD(0.0, 0.0), + m2::PointD(0.5, 0.5), m2::PointD(1.0, 0.66666666) } }); + TEST(CompareSplineLists(result5, expectedResult5), ()); } + |