From da5e753d628c21284c20c5158f97d4e0465fa110 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 30 Apr 2010 14:58:07 +0000 Subject: [PATCH] Updated paths Added ccw test for area [SVN r61707] --- .../algorithms/buffer/traversing_buffer.hpp | 6 +++--- .../boost/geometry/extensions/algorithms/offset.hpp | 2 +- test/algorithms/area.cpp | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/boost/geometry/extensions/algorithms/buffer/traversing_buffer.hpp b/include/boost/geometry/extensions/algorithms/buffer/traversing_buffer.hpp index fe08b32c3..24224746e 100644 --- a/include/boost/geometry/extensions/algorithms/buffer/traversing_buffer.hpp +++ b/include/boost/geometry/extensions/algorithms/buffer/traversing_buffer.hpp @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/include/boost/geometry/extensions/algorithms/offset.hpp b/include/boost/geometry/extensions/algorithms/offset.hpp index 2c6ef82ca..56c37ea31 100644 --- a/include/boost/geometry/extensions/algorithms/offset.hpp +++ b/include/boost/geometry/extensions/algorithms/offset.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/test/algorithms/area.cpp b/test/algorithms/area.cpp index 737939cb2..fe90a1427 100644 --- a/test/algorithms/area.cpp +++ b/test/algorithms/area.cpp @@ -22,7 +22,6 @@ template void test_all() { - //test_area_circle(); test_geometry >("POLYGON((0 0,2 2))", 4.0); test_geometry >("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 +void test_ccw() +{ + typedef boost::geometry::polygon ccw_polygon; + // counterclockwise rings (second is wrongly ordered) + test_geometry("POLYGON((0 0,0 7,4 2,2 0,0 0))", -16.0); + test_geometry("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 > >(); + test_ccw >(); + #if defined(HAVE_CLN) test_all >(); #endif