]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/convex_hull/convex_hull.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
8 // This file was modified by Oracle on 2015.
9 // Modifications copyright (c) 2015 Oracle and/or its affiliates.
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
13 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
14 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
16 // Use, modification and distribution is subject to the Boost Software License,
17 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
18 // http://www.boost.org/LICENSE_1_0.txt)
23 #include "test_convex_hull.hpp"
25 #include <boost/geometry/geometries/geometries.hpp>
26 #include <boost/geometry/geometries/point_xy.hpp>
32 typedef boost::geometry::strategies::convex_hull::cartesian
<> strategy
;
34 // from sample linestring
35 test_geometry
<bg::model::linestring
<P
>, strategy
>(
36 "linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", 5, 4, 3.8);
38 // rectangular, with concavity
39 test_geometry
<bg::model::polygon
<P
>, strategy
>(
40 "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))",
43 // from sample polygon, with concavity
44 test_geometry
<bg::model::polygon
<P
>, strategy
>(
45 "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0"
46 ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))",
49 test_geometry
<bg::model::ring
<P
>, strategy
>(
50 "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0"
51 ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))",
54 test_geometry
<bg::model::box
<P
>, strategy
>("box(0 0,2 2)", 4, 5, 4);
56 // https://svn.boost.org/trac/boost/ticket/6443
58 test_geometry
<bg::model::ring
<P
>, strategy
>(
59 "polygon((0 0, 2 0))", // note that this polygon is very invalid
64 test_geometry
<bg::model::multi_point
<P
>, strategy
>(
67 test_geometry
<bg::model::multi_point
<P
>, strategy
>(
68 "multipoint(0 0, 2 0)",
70 test_geometry
<bg::model::linestring
<P
>, strategy
>(
71 "linestring(0 0, 2 0)",
74 test_empty_input
<bg::model::linestring
<P
> >();
75 test_empty_input
<bg::model::ring
<P
> >();
76 test_empty_input
<bg::model::polygon
<P
> >();
80 int test_main(int, char* [])
82 //test_all<bg::model::d2::point_xy<int> >();
83 test_all
<bg::model::d2::point_xy
<float> >();
84 test_all
<bg::model::d2::point_xy
<double> >();