multi_overlay_common.hpp 1.3 KB

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