1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3
4 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9
10
11 #ifndef GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
12 #define GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
13
14
15 #include <boost/geometry/geometries/multi_linestring.hpp>
16 #include <boost/geometry/geometries/multi_polygon.hpp>
17
18 #include <boost/geometry/io/wkt/read.hpp>
19 //#include <boost/geometry/io/svg/write.hpp>
20
21
22
23 template <typename P, typename Functor, typename T>
test_all(std::vector<T> const & expected,double precision=0.01)24 void test_all(std::vector<T> const& expected, double precision = 0.01)
25 {
26 typename boost::range_const_iterator<std::vector<T> >::type iterator
27 = boost::begin(expected);
28
29 typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
30 typedef bg::model::box<P> box;
31
32 BOOST_ASSERT(iterator != boost::end(expected));
33 test_overlay<mp, mp, Functor>("1", *iterator,
34 "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))",
35 "MULTIPOLYGON(((3 0,0 3,4 5,3 0)))", precision);
36 iterator++;
37 }
38
39
40 #endif // GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
41