| 6 | { |
| 7 | |
| 8 | TEST( MRMesh, Polyline2 ) |
| 9 | { |
| 10 | Contour2f cont; |
| 11 | cont.push_back( Vector2f( 0.f, 0.f ) ); |
| 12 | cont.push_back( Vector2f( 1.f, 0.f ) ); |
| 13 | cont.push_back( Vector2f( 0.f, 1.f ) ); |
| 14 | cont.push_back( Vector2f( 1.f, 1.f ) ); |
| 15 | |
| 16 | Contour2f cont2; |
| 17 | cont2.push_back( Vector2f( 2.f, 0.f ) ); |
| 18 | cont2.push_back( Vector2f( 3.f, 0.f ) ); |
| 19 | cont2.push_back( Vector2f( 2.f, 1.f ) ); |
| 20 | cont2.push_back( Vector2f( 3.f, 1.f ) ); |
| 21 | |
| 22 | Contours2f conts{ cont,cont2 }; |
| 23 | |
| 24 | Polyline2 pl( conts ); |
| 25 | auto conts2 = pl.contours(); |
| 26 | |
| 27 | for ( auto i = 0; i < conts.size(); i++ ) |
| 28 | { |
| 29 | auto& c1 = conts[i]; |
| 30 | auto& c2 = conts2[i]; |
| 31 | for ( auto j = 0; j < c1.size(); j++ ) |
| 32 | { |
| 33 | auto v1 = c1[j]; |
| 34 | auto v2 = c2[j]; |
| 35 | EXPECT_NEAR( v1[0], v2[0], 1e-8 ); |
| 36 | EXPECT_NEAR( v1[1], v2[1], 1e-8 ); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | TEST( MRMesh, Polyline2LoopDir ) |
| 42 | { |
nothing calls this directly
no test coverage detected