mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-11 11:52:11 +00:00
Updated paths
Added ccw test for area [SVN r61707]
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
//test_area_circle<P, double>();
|
||||
test_geometry<boost::geometry::box<P> >("POLYGON((0 0,2 2))", 4.0);
|
||||
test_geometry<boost::geometry::box<P> >("POLYGON((2 2,0 0))", 4.0);
|
||||
|
||||
@@ -66,6 +65,15 @@ void test_spherical()
|
||||
BOOST_CHECK_CLOSE(area, 2.0 * 2.0 * expected, 0.0001);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_ccw()
|
||||
{
|
||||
typedef boost::geometry::polygon<P, std::vector, std::vector, false> ccw_polygon;
|
||||
// counterclockwise rings (second is wrongly ordered)
|
||||
test_geometry<ccw_polygon>("POLYGON((0 0,0 7,4 2,2 0,0 0))", -16.0);
|
||||
test_geometry<ccw_polygon>("POLYGON((0 0,2 0,4 2,0 7,0 0))", 16.0);
|
||||
}
|
||||
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
@@ -75,6 +83,8 @@ int test_main(int, char* [])
|
||||
|
||||
test_spherical<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
|
||||
|
||||
test_ccw<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
|
||||
|
||||
#if defined(HAVE_CLN)
|
||||
test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user