|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67375 - in sandbox/geometry/libs/geometry/test: algorithms algorithms/overlay multi/algorithms multi/algorithms/overlay
From: barend.gehrels_at_[hidden]
Date: 2010-12-20 16:33:56
Author: barendgehrels
Date: 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
New Revision: 67375
URL: http://svn.boost.org/trac/boost/changeset/67375
Log:
Update testcases to ccw
Added point_order to some multi-testcases, now explicitly necessary
Text files modified:
sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp | 4
sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp | 7
sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp | 2
sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp | 1
sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp | 1
sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp | 19 +-
sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp | 1
sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp | 11 +
sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp | 310 +++++++++++++++++++++------------------
10 files changed, 202 insertions(+), 156 deletions(-)
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -46,7 +46,7 @@
bg::detail::overlay::calculate_distance_policy
>(g1, g2, turns, policy);
- bg::enrich_intersection_points(turns, bg::detail::overlay::operation_intersection,
+ bg::enrich_intersection_points<rev<Geometry1>::value, rev<Geometry2>::value >(turns, bg::detail::overlay::operation_intersection,
g1, g2, side_strategy_type());
typedef bg::model::linear_ring<typename bg::point_type<Geometry1>::type> ring_type;
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -19,6 +19,7 @@
+#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
@@ -50,6 +51,9 @@
G2 g2;
bg::read_wkt(wkt2, g2);
+ bg::correct(g1);
+ bg::correct(g2);
+
//std::cout << bg::wkt(g1) << std::endl;
//std::cout << bg::wkt(g2) << std::endl;
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -111,9 +111,14 @@
***/
#if defined(BOOST_GEOMETRY_DEBUG_OVERLAY) || defined(BOOST_GEOMETRY_DEBUG_ENRICH)
+ bool const ccw =
+ bg::point_order<G1>::value == bg::counterclockwise
+ || bg::point_order<G2>::value == bg::counterclockwise;
+
std::cout << std::endl
<< "TRAVERSE"
<< " " << id
+ << (ccw ? "_ccw" : "")
<< " " << string_from_type<typename bg::coordinate_type<G1>::type>::name()
<< "(" << operation(Direction) << ")" << std::endl;
@@ -134,7 +139,7 @@
bg::detail::get_turns::no_interrupt_policy policy;
bg::get_turns<Reverse1, Reverse2, bg::detail::overlay::calculate_distance_policy>(g1, g2, turns, policy);
- bg::enrich_intersection_points(turns,
+ bg::enrich_intersection_points<Reverse1, Reverse2>(turns,
Direction == 1 ? bg::detail::overlay::operation_union
: bg::detail::overlay::operation_intersection,
g1, g2, side_strategy_type());
Modified: sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -44,6 +44,8 @@
{
static const bool is_line = bg::geometry_id<OutputType>::type::value == 2;
+ //std::cout << caseid << std::endl;
+
std::vector<OutputType> clip;
typedef typename bg::coordinate_type<G1>::type coordinate_type;
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -9,6 +9,7 @@
#include <algorithms/test_centroid.hpp>
+#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/algorithms/centroid.hpp>
#include <boost/geometry/multi/strategies/centroid.hpp>
#include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp>
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -16,6 +16,7 @@
#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/core/point_type.hpp>
#include <boost/geometry/multi/iterators/range_type.hpp>
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -8,6 +8,7 @@
#include <iostream>
#include <string>
+// #define BOOST_GEOMETRY_DEBUG_ASSEMBLE
#include <algorithms/test_intersection.hpp>
#include <algorithms/test_overlay.hpp>
@@ -24,7 +25,7 @@
#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
template <typename Ring, typename Polygon, typename MultiPolygon>
-void test_areal(bool skip = false)
+void test_areal()
{
test_one<Polygon, MultiPolygon, MultiPolygon>("simplex_multi",
case_multi_simplex[0], case_multi_simplex[1],
@@ -79,7 +80,9 @@
test_one<Polygon, MultiPolygon, MultiPolygon>("case_102_multi",
case_102_multi[0], case_102_multi[1],
3, 26, 19.75);
-
+ test_one<Polygon, MultiPolygon, MultiPolygon>("case_107_multi",
+ case_107_multi[0], case_107_multi[1],
+ 2, 10, 1.5);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_1",
case_recursive_boxes_1[0], case_recursive_boxes_1[1],
10, 97, 47.0);
@@ -87,13 +90,9 @@
case_recursive_boxes_2[0], case_recursive_boxes_2[1],
1, 47, 90.0); // Area from SQL Server
- // TODO: fix for CCW
- if (! skip)
- {
- test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_3",
- case_recursive_boxes_3[0], case_recursive_boxes_3[1],
- 19, 87, 12.5); // Area from SQL Server
- }
+ test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_3",
+ case_recursive_boxes_3[0], case_recursive_boxes_3[1],
+ 19, 87, 12.5); // Area from SQL Server
}
template <typename Polygon, typename MultiPolygon, typename Box>
@@ -146,7 +145,7 @@
typedef bg::model::polygon<P, false> polygon_ccw;
typedef bg::model::multi_polygon<polygon_ccw> multi_polygon_ccw;
- test_areal<ring_ccw, polygon_ccw, multi_polygon_ccw>(true);
+ test_areal<ring_ccw, polygon_ccw, multi_polygon_ccw>();
typedef bg::model::linear_ring<P, true, false> ring_open;
typedef bg::model::polygon<P, true, false> polygon_open;
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -15,6 +15,7 @@
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/polygon.hpp>
+#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/algorithms/within.hpp>
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -337,6 +337,13 @@
"MULTIPOLYGON(((0 0,0 5,1 5,1 4,2 4,2 5,3 5,3 3,4 4,5 4,5 0,2 0,3 1,2 1,2 3,1 3,2 2,1.5 1.5,2 1,1 1,0 0)),((1 0,2 1,2 0,1 0)))"
};
+static std::string case_107_multi[2] =
+{
+ // For CCW polygon reports a iu/iu problem.
+ "MULTIPOLYGON(((6 8,7 9,7 7,8 7,7 6,6 6,6 8)),((6.5 9.5,7 10,7 9,6 9,6 10,6.5 9.5)))",
+ "MULTIPOLYGON(((5 7,6 8,6 10,7 9,8 10,8 8,7 8,6 7,6 6,5 6)))"
+};
+
static std::string case_recursive_boxes_1[2] =
{
@@ -357,7 +364,9 @@
static std::string case_recursive_boxes_3[2] =
{
- // Previously a iu/ux problem causing union to fail. KEEP
+ // Previously a iu/ux problem causing union to fail.
+ // For CCW polygon it also reports a iu/iu problem.
+ // KEEP
"MULTIPOLYGON(((8 3,9 4,9 3,8 3)),((5 9,5 10,6 10,5 9)),((2 0,2 1,3 0,2 0)),((2 5,2 6,3 6,3 5,2 5)),((2 2,1 2,1 3,2 3,3 2,3 1,2 1,2 2)),((6 8,7 9,7 7,8 7,7 6,6 6,6 8)),((4 6,5 7,5 6,4 6)),((4 8,4 9,5 9,5 8,4 8)),((0 3,1 4,1 3,0 3)),((8 7,9 8,9 7,8 7)),((9 6,9 7,10 7,9 6)),((7 0,8 1,8 0,7 0)),((0 4,0 5,1 5,1 4,0 4)),((4 2,5 3,5 2,4 1,4 2)),((4 10,4 9,2 9,3 10,4 10)),((5 2,6 3,7 3,7 2,6 2,6 1,5 0,5 2)),((5 3,4 3,4 4,2 4,4 6,4 5,4.5 4.5,6 6,6 5,7 4,5 4,5 3)),((10 2,9 1,9 3,10 2)),((8 4,7 4,8 5,7 5,7 6,9 6,9 5,10 5,10 4,8 4)),((1 7,0 7,0 8,1 8,1 7)),((1 10,2 10,1 9,0 9,0 10,1 10)),((6.5 9.5,7 10,7 9,6 9,6 10,6.5 9.5)),((8 8,8 9,10 9,9 8,8 8)))",
"MULTIPOLYGON(((0 7,0 8,1 8,1 7,0 7)),((5 3,4 3,4 4,6 4,6 3,7 3,6 2,5 2,5 3)),((8 2,8 3,9 2,8 2)),((1 1,2 2,2 1,1 1)),((2 1,3 1,2 0,1 0,2 1)),((2 3,3 4,3 3,2 3)),((1 9,2 8,1 8,1 9)),((2 10,2 9,1 9,1 10,2 10)),((9 7,9 8,10 8,10 7,9 7)),((6 0,6 1,7 1,7 0,6 0)),((8 0,9 1,9 0,8 0)),((1 6,1 5,0 5,1 6)),((0 2,1 1,0 1,0 2)),((1 3,2 3,2 2,1 2,1 3)),((5 1,5 0,4 0,4 1,3 1,4 2,5 2,6 1,5 1)),((1 3,0 3,0 4,1 4,1 3)),((3 6,4 5,2 5,3 6)),((9 2,10 2,10 1,9 1,9 2)),((7 5,6 4,6 5,7 6,8 6,8 5,7 5)),((7 4,8 5,8.5 4.5,9 5,9 4,8 4,8.5 3.5,9 4,10 3,7 3,7 4)),((1 6,1 7,3 7,3 8,4 7,5 7,6 8,6 10,7 9,8 10,9 10,9 9,8 9,8 8,7 8,6 7,6 6,1 6)))"
};
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp 2010-12-20 16:33:48 EST (Mon, 20 Dec 2010)
@@ -16,8 +16,10 @@
#include <boost/geometry/multi/core/geometry_id.hpp>
+#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/core/ring_type.hpp>
+#include <boost/geometry/multi/algorithms/correct.hpp>
#include <boost/geometry/multi/algorithms/num_points.hpp>
#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
@@ -45,59 +47,50 @@
// and cases which are specific to multi (if any)
-template <typename T>
-void test_all()
+template <typename MultiPolygon, bool Reverse>
+void test_geometries()
{
-//goto wrong;
namespace ov = bg::detail::overlay;
- typedef bg::model::multi_polygon
- <
- bg::model::polygon
- <
- bg::model::point<T, 2, bg::cs::cartesian>
- >
- > multi_polygon;
-
typedef boost::tuple<int, double> Tuple;
// Intersections:
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"simplex", boost::make_tuple(2, 6.42),
case_multi_simplex[0], case_multi_simplex[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_65_multi", boost::make_tuple(1, 1),
case_65_multi[0], case_65_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_66_multi", boost::make_tuple(1, 1),
case_66_multi[0], case_66_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_67_multi", boost::make_tuple(1, 1),
case_67_multi[0], case_67_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_69_multi", boost::make_tuple(1, 1),
case_69_multi[0], case_69_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_71_multi", boost::make_tuple(2, 2),
case_71_multi[0], case_71_multi[1]
@@ -105,372 +98,384 @@
// #72, note that it intersects into 2 shapes,
// the third one is done by assemble (see intersection #72)
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_72_multi", boost::make_tuple(2, 1.35),
case_72_multi[0], case_72_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_73_multi", boost::make_tuple(2, 2),
case_73_multi[0], case_73_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_74_multi", boost::make_tuple(2, 3),
case_74_multi[0], case_74_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_75_multi", boost::make_tuple(1, 1),
case_75_multi[0], case_75_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_77_multi", boost::make_tuple(5, 9),
case_77_multi[0], case_77_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_78_multi", boost::make_tuple(3, 22),
case_78_multi[0], case_78_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_80_multi", boost::make_tuple(1, 0.5),
case_80_multi[0], case_80_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_81_multi", boost::make_tuple(1, 0.25),
case_81_multi[0], case_81_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_83_multi", boost::make_tuple(3, 1.25),
case_83_multi[0], case_83_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_91_multi", boost::make_tuple(2, 1.0),
case_91_multi[0], case_91_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_92_multi", boost::make_tuple(3, 1.5),
case_92_multi[0], case_92_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_93_multi", boost::make_tuple(2, 1.25),
case_93_multi[0], case_93_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_96_multi", boost::make_tuple(2, 1.0),
case_96_multi[0], case_96_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_98_multi", boost::make_tuple(4, 3.0),
case_98_multi[0], case_98_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_99_multi", boost::make_tuple(3, 1.75),
case_99_multi[0], case_99_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_100_multi", boost::make_tuple(2, 1.5),
case_100_multi[0], case_100_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
- (
- "case_101_multi", boost::make_tuple(1, 22.25),
- case_101_multi[0], case_101_multi[1]
- );
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"case_recursive_boxes_2", boost::make_tuple(1, 91),
case_recursive_boxes_2[0], case_recursive_boxes_2[1]
);
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
+ (
+ "case_107_multi", boost::make_tuple(2, 1.5),
+ case_107_multi[0], case_107_multi[1]
+ );
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
+ (
+ "case_recursive_boxes_3", boost::make_tuple(19, 12.5),
+ case_recursive_boxes_3[0], case_recursive_boxes_3[1]
+ );
// Unions
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"simplex", boost::make_tuple(1, 14.58),
case_multi_simplex[0], case_multi_simplex[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_61_multi", boost::make_tuple(1, 4),
case_61_multi[0], case_61_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_62_multi", boost::make_tuple(1, 1 /*UU 2, 2 */),
case_62_multi[0], case_62_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_63_multi", boost::make_tuple(1, 1 /*UU 2, 2 */),
case_63_multi[0], case_63_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_64_multi", boost::make_tuple(1, 3),
case_64_multi[0], case_64_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_66_multi", boost::make_tuple(1, 4 /*UU 3, 7 */),
case_66_multi[0], case_66_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_68_multi", boost::make_tuple(1, 4 /*UU 2, 5 */),
case_68_multi[0], case_68_multi[1]
);
// 71: single-polygon generates 2 shapes, multi-polygon
// generates 1 shape, both are self-tangent and OK
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_71_multi", boost::make_tuple(1, 9),
case_71_multi[0], case_71_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_72_multi", boost::make_tuple(1, 10.65),
case_72_multi[0], case_72_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_73_multi", boost::make_tuple(1, 3),
case_73_multi[0], case_73_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_74_multi", boost::make_tuple(2, 17),
case_74_multi[0], case_74_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_75_multi", boost::make_tuple(1, 1 /*UU 5, 5 */),
case_75_multi[0], case_75_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_76_multi", boost::make_tuple(2, 5 /*UU 6, 6 */),
case_76_multi[0], case_76_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_80_multi", boost::make_tuple(1, 9.25),
case_80_multi[0], case_80_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_81_multi", boost::make_tuple(1, 3.25),
case_81_multi[0], case_81_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_82_multi", boost::make_tuple(3, 4),
case_82_multi[0], case_82_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_84_multi", boost::make_tuple(1, 4),
case_84_multi[0], case_84_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_85_multi", boost::make_tuple(1, 3.5),
case_85_multi[0], case_85_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_86_multi", boost::make_tuple(1, 4),
case_86_multi[0], case_86_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_87_multi", boost::make_tuple(1, 6),
case_87_multi[0], case_87_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_88_multi", boost::make_tuple(2, 4),
case_88_multi[0], case_88_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_89_multi", boost::make_tuple(1, 6),
case_89_multi[0], case_89_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_90_multi", boost::make_tuple(1, 7.5),
case_90_multi[0], case_90_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_92_multi", boost::make_tuple(2, 6.25),
case_92_multi[0], case_92_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_94_multi", boost::make_tuple(1, 10.0),
case_94_multi[0], case_94_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_95_multi", boost::make_tuple(2, 6.5),
case_95_multi[0], case_95_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_96_multi", boost::make_tuple(1, 3.5),
case_96_multi[0], case_96_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_97_multi", boost::make_tuple(1, 3.75),
case_97_multi[0], case_97_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
+ (
+ "case_101_multi", boost::make_tuple(1, 22.25),
+ case_101_multi[0], case_101_multi[1]
+ );
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_102_multi", boost::make_tuple(3, 24.25),
case_102_multi[0], case_102_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_103_multi", boost::make_tuple(1, 25),
case_103_multi[0], case_103_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_104_multi", boost::make_tuple(1, 25),
case_104_multi[0], case_104_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_105_multi", boost::make_tuple(1, 25),
case_105_multi[0], case_105_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_106_multi", boost::make_tuple(1, 25),
case_106_multi[0], case_106_multi[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_recursive_boxes_1", boost::make_tuple(2, 97),
case_recursive_boxes_1[0], case_recursive_boxes_1[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_union>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_union, Reverse, Reverse>, Tuple>
(
"case_recursive_boxes_3", boost::make_tuple(8, 49.5),
case_recursive_boxes_3[0], case_recursive_boxes_3[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"pie_21_7_21_0_3", boost::make_tuple(2, 818824.56678),
pie_21_7_21_0_3[0], pie_21_7_21_0_3[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"pie_23_19_5_0_2", boost::make_tuple(2, 2948602.3911823),
pie_23_19_5_0_2[0], pie_23_19_5_0_2[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"pie_7_14_5_0_7", boost::make_tuple(2, 490804.56678),
pie_7_14_5_0_7[0], pie_7_14_5_0_7[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"pie_16_16_9_0_2", boost::make_tuple(2, 1146795),
pie_16_16_9_0_2[0], pie_16_16_9_0_2[1]
);
- test_overlay<multi_polygon, multi_polygon,
- test_traverse<ov::operation_intersection>, Tuple>
+ test_overlay<MultiPolygon, MultiPolygon,
+ test_traverse<ov::operation_intersection, Reverse, Reverse>, Tuple>
(
"pie_7_2_1_0_15", boost::make_tuple(2, 490585.5),
pie_7_2_1_0_15[0], pie_7_2_1_0_15[1]
@@ -478,6 +483,25 @@
}
+template <typename T>
+void test_all()
+{
+ typedef bg::model::point<T, 2, bg::cs::cartesian> point_type;
+
+ typedef bg::model::multi_polygon
+ <
+ bg::model::polygon<point_type>
+ > multi_polygon;
+
+ typedef bg::model::multi_polygon
+ <
+ bg::model::polygon<point_type, false>
+ > multi_polygon_ccw;
+
+ test_geometries<multi_polygon, false>();
+ test_geometries<multi_polygon_ccw, true>();
+}
+
int test_main(int, char* [])
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk