]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/relational_operations/overlaps/overlaps.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / relational_operations / overlaps / overlaps.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4
5 // This file was modified by Oracle on 2014, 2015.
6 // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
7
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
13
14 #include "test_overlaps.hpp"
15
16 template <typename P>
17 void test_pp()
18 {
19 typedef bg::model::multi_point<P> mpt;
20
21 test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,3 3,4 4)", true);
22 test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,2 2)", false);
23 }
24
25 template <typename P>
26 void test_ll()
27 {
28 typedef bg::model::linestring<P> ls;
29 typedef bg::model::multi_linestring<ls> mls;
30
31 test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 1)", "LINESTRING(1 1,2 2,4 4)", true);
32 test_geometry<ls, ls>("LINESTRING(0 0,2 2,4 0)", "LINESTRING(0 1,2 1,3 2)", false);
33
34 test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(2 2,4 4))", true);
35 test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(3 3,4 4))", true);
36 test_geometry<ls, mls>("LINESTRING(0 0,3 3,3 1)", "MULTILINESTRING((3 3,2 2),(0 0,1 1))", false);
37 }
38
39 template <typename P>
40 void test_2d()
41 {
42 test_pp<P>();
43 test_ll<P>();
44 }
45
46 int test_main( int , char* [] )
47 {
48 test_2d<bg::model::d2::point_xy<int> >();
49 test_2d<bg::model::d2::point_xy<double> >();
50
51 #if defined(HAVE_TTMATH)
52 test_2d<bg::model::d2::point_xy<ttmath_big> >();
53 #endif
54
55 return 0;
56 }