]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/reverse.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <algorithms/test_reverse.hpp>
12 #include <boost/geometry/geometries/geometries.hpp>
13 #include <boost/geometry/geometries/point_xy.hpp>
15 #include <test_common/test_point.hpp>
16 #include <test_geometries/all_custom_linestring.hpp>
17 #include <test_geometries/all_custom_ring.hpp>
18 #include <test_geometries/wrapped_boost_array.hpp>
20 template <typename LineString
>
21 void test_linestring()
24 test_geometry
<LineString
>(
25 "LINESTRING(0 0,1 1)",
26 "LINESTRING(1 1,0 0)");
28 // Three points, middle should stay the same
29 test_geometry
<LineString
>(
30 "LINESTRING(0 0,1 1,2 2)",
31 "LINESTRING(2 2,1 1,0 0)");
34 test_geometry
<LineString
>(
35 "LINESTRING(0 0,1 1,2 2,3 3)",
36 "LINESTRING(3 3,2 2,1 1,0 0)");
39 template <typename Ring
>
43 "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))",
44 "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0))");
47 template <typename Point
>
50 test_linestring
<bg::model::linestring
<Point
> >();
51 test_linestring
<all_custom_linestring
<Point
> >();
54 test_geometry
<bg::model::polygon
<Point
> >(
55 "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3))",
56 "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0),(7 3,4 3,1 3,1 6,7 6,7 3))");
59 test_geometry
<Point
>("POINT(0 0)", "POINT(0 0)");
61 test_ring
<bg::model::ring
<Point
> >();
62 test_ring
<all_custom_ring
<Point
> >();
65 int test_main(int, char* [])
67 test_all
<bg::model::d2::point_xy
<int> >();
68 test_all
<bg::model::d2::point_xy
<double> >();
70 #if defined(HAVE_TTMATH)
71 test_all
<bg::model::d2::point_xy
<ttmath_big
> >();