]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | ||
3 | // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. | |
4 | ||
b32b8144 FG |
5 | // This file was modified by Oracle on 2014, 2015, 2017. |
6 | // Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. | |
7c673cae FG |
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 | ||
b32b8144 FG |
21 | test_geometry<P, P>("POINT(0 0)", "POINT(0 0)", false); |
22 | test_geometry<P, P>("POINT(0 0)", "POINT(1 1)", false); | |
23 | ||
24 | test_geometry<P, mpt>("POINT(0 0)", "MULTIPOINT(0 0, 1 1)", false); | |
25 | ||
26 | test_geometry<mpt, P>("MULTIPOINT(0 0, 1 1)", "POINT(0 0)", false); | |
27 | ||
7c673cae FG |
28 | test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,3 3,4 4)", true); |
29 | test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,2 2)", false); | |
30 | } | |
31 | ||
32 | template <typename P> | |
33 | void test_ll() | |
34 | { | |
35 | typedef bg::model::linestring<P> ls; | |
36 | typedef bg::model::multi_linestring<ls> mls; | |
37 | ||
38 | test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 1)", "LINESTRING(1 1,2 2,4 4)", true); | |
39 | test_geometry<ls, ls>("LINESTRING(0 0,2 2,4 0)", "LINESTRING(0 1,2 1,3 2)", false); | |
40 | ||
41 | test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(2 2,4 4))", true); | |
42 | test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(3 3,4 4))", true); | |
43 | test_geometry<ls, mls>("LINESTRING(0 0,3 3,3 1)", "MULTILINESTRING((3 3,2 2),(0 0,1 1))", false); | |
44 | } | |
45 | ||
46 | template <typename P> | |
47 | void test_2d() | |
48 | { | |
49 | test_pp<P>(); | |
50 | test_ll<P>(); | |
51 | } | |
52 | ||
53 | int test_main( int , char* [] ) | |
54 | { | |
55 | test_2d<bg::model::d2::point_xy<int> >(); | |
56 | test_2d<bg::model::d2::point_xy<double> >(); | |
57 | ||
58 | #if defined(HAVE_TTMATH) | |
59 | test_2d<bg::model::d2::point_xy<ttmath_big> >(); | |
60 | #endif | |
61 | ||
62 | return 0; | |
63 | } |