/Src/Dependencies/Boost/libs/geometry/test/multi/algorithms/overlay/multi_overlay_common.hpp

http://hadesmem.googlecode.com/ · C++ Header · 40 lines · 19 code · 13 blank · 8 comment · 1 complexity · a8b90f3ec172e7e66fdebfd3f50fae5a MD5 · raw file

  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2008-2011 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/multi/geometries/multi_linestring.hpp>
  11. #include <boost/geometry/multi/geometries/multi_polygon.hpp>
  12. #include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp>
  13. //#include <boost/geometry/multi/io/svg/write_svg.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