• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry
2 // Unit Test
3 
4 // Copyright (c) 2016-2017, Oracle and/or its affiliates.
5 
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 
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)
11 
12 
13 #include "test_get_turns.hpp"
14 #include <boost/geometry/geometries/geometries.hpp>
15 
16 #include <algorithms/overlay/overlay_cases.hpp>
17 
18 
19 template <typename T>
test_all()20 void test_all()
21 {
22     typedef bg::model::point<T, 2, bg::cs::spherical_equatorial<bg::degree> > pt;
23     //typedef bg::model::ring<pt> ring;
24     typedef bg::model::polygon<pt> poly;
25     //typedef bg::model::multi_polygon<poly> mpoly;
26 
27     test_geometry<poly, poly>(case_1[0], case_1[1],
28                               expected("iiu")("iui")("iiu")("iui")("iiu")("iui"));
29     test_geometry<poly, poly>(case_2[0], case_2[1],
30                               expected("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu"));
31     test_geometry<poly, poly>(case_3_sph[0], case_3_sph[1],
32                               expected("miu")("miu")("miu")("miu"));
33     test_geometry<poly, poly>(case_4[0], case_4[1],
34                               expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui"));
35     test_geometry<poly, poly>(case_5[0], case_5[1],
36                               expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui"));
37     test_geometry<poly, poly>(case_6_sph[0], case_6_sph[1],
38                               expected("ccc")("eui")("mcc"));
39 
40     test_geometry<poly, poly>(case_7[0], case_7[1],
41                               expected("txu")("tux"));
42     test_geometry<poly, poly>(case_8_sph[0], case_8_sph[1],
43                               expected("mux")("cxu"));
44     test_geometry<poly, poly>(case_9_sph[0], case_9_sph[1],
45                               expected("muu"));
46     test_geometry<poly, poly>(case_10_sph[0], case_10_sph[1],
47                               expected("cxu")("mux")("txx"));
48     test_geometry<poly, poly>(case_11_sph[0], case_11_sph[1],
49                               expected("mui"));
50     test_geometry<poly, poly>(case_12[0], case_12[1],
51                               expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui"));
52 
53     test_geometry<poly, poly>(case_13_sph[0], case_13_sph[1],
54                               expected("mxu")("mux"));
55     test_geometry<poly, poly>(case_14_sph[0], case_14_sph[1],
56                               expected("cxu")("mux"));
57     test_geometry<poly, poly>(case_15_sph[0], case_15_sph[1],
58                               expected("cxu")("mux"));
59     test_geometry<poly, poly>(case_16_sph[0], case_16_sph[1],
60                               expected("txx")("txx")("tux")("cxu"));
61     test_geometry<poly, poly>(case_17_sph[0], case_17_sph[1],
62                               expected("mcc")("cui"));
63     test_geometry<poly, poly>(case_18_sph[0], case_18_sph[1],
64                               expected("mcc")("ccc")("ccc")("cui"));
65 
66     test_geometry<poly, poly>("POLYGON((16 15,-132 10,-56 89,67 5,16 15))",
67                               "POLYGON((101 49,12 40,-164 10,117 0,101 49))",
68                               expected("iiu")("iui"));
69 }
70 
test_main(int,char * [])71 int test_main(int, char* [])
72 {
73     test_all<float>();
74     test_all<double>();
75 
76 //#if ! defined(_MSC_VER)
77 //    test_all<long double>();
78 //#endif
79 
80 //#if defined(HAVE_TTMATH)
81 //    test_all<ttmath_big>();
82 //#endif
83     return 0;
84 }
85