/Src/Dependencies/Boost/libs/geometry/test/algorithms/test_overlaps.hpp

http://hadesmem.googlecode.com/ · C++ Header · 44 lines · 25 code · 13 blank · 6 comment · 1 complexity · 7e5fca7e3c686b6558ca88e109d56ef7 MD5 · raw file

  1. // Generic Geometry2 Library
  2. // Unit Test
  3. // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_TEST_OVERLAPS_HPP
  8. #define BOOST_GEOMETRY_TEST_OVERLAPS_HPP
  9. #include <geometry_test_common.hpp>
  10. #include <boost/geometry/core/ring_type.hpp>
  11. #include <boost/geometry/algorithms/overlaps.hpp>
  12. #include <boost/geometry/strategies/strategies.hpp>
  13. #include <boost/geometry/geometries/ring.hpp>
  14. #include <boost/geometry/geometries/polygon.hpp>
  15. #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>
  16. template <typename Geometry1, typename Geometry2>
  17. void test_geometry(std::string const& wkt1,
  18. std::string const& wkt2, bool expected)
  19. {
  20. Geometry1 geometry1;
  21. Geometry2 geometry2;
  22. bg::read_wkt(wkt1, geometry1);
  23. bg::read_wkt(wkt2, geometry2);
  24. bool detected = bg::overlaps(geometry1, geometry2);
  25. BOOST_CHECK_MESSAGE(detected == expected,
  26. "overlaps: " << wkt1
  27. << " with " << wkt2
  28. << " -> Expected: " << expected
  29. << " detected: " << detected);
  30. }
  31. #endif