3 // Copyright (c) 2016-2017 Oracle and/or its affiliates.
5 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
8 // Use, modification and distribution is subject to the Boost Software License,
9 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/geometry/algorithms/disjoint.hpp>
13 #include <boost/geometry/algorithms/make.hpp>
15 #include <boost/geometry/io/wkt/read.hpp>
17 template <typename Geometry1, typename Geometry2>
18 inline void test_disjoint_check(bool result, bool expected_result,
19 Geometry1 const& geometry1, Geometry2 const& geometry2)
21 BOOST_CHECK_MESSAGE((result == expected_result),
22 "result {" << result << "} different than expected result {"
23 << expected_result << "} for geometries "
24 << bg::wkt(geometry1) << " and " << bg::wkt(geometry2));
27 template <typename Geometry1, typename Geometry2>
28 inline void test_disjoint(std::string const& wkt1,
29 std::string const& wkt2,
30 bool const expected_result)
33 bg::read_wkt(wkt1, geometry1);
36 bg::read_wkt(wkt2, geometry2);
38 test_disjoint_check(bg::disjoint(geometry1, geometry2), expected_result,
39 geometry1, geometry2);
41 test_disjoint_check(bg::disjoint(geometry2, geometry1), expected_result,
42 geometry2, geometry1);
45 template <typename Geometry1, typename Geometry2, typename Strategy>
46 inline void test_disjoint_strategy(std::string const& wkt1,
47 std::string const& wkt2,
48 bool const expected_result,
52 bg::read_wkt(wkt1, geometry1);
55 bg::read_wkt(wkt2, geometry2);
57 test_disjoint_check(bg::disjoint(geometry1, geometry2, strategy), expected_result,
58 geometry1, geometry2);
60 test_disjoint_check(bg::disjoint(geometry2, geometry1, strategy), expected_result,
61 geometry2, geometry1);