]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/convex_hull_multi.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
8 // This file was modified by Oracle on 2014, 2015.
9 // Modifications copyright (c) 2014-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)
24 #include <algorithms/test_convex_hull.hpp>
26 #include <boost/geometry/geometries/geometries.hpp>
27 #include <boost/geometry/geometries/point_xy.hpp>
29 #include <boost/geometry/core/point_order.hpp>
30 #include <boost/geometry/core/point_type.hpp>
32 #include <boost/geometry/views/detail/range_type.hpp>
34 #include <boost/geometry/algorithms/detail/for_each_range.hpp>
36 #include <boost/geometry/geometries/multi_point.hpp>
37 #include <boost/geometry/geometries/multi_linestring.hpp>
38 #include <boost/geometry/geometries/multi_polygon.hpp>
46 typedef bg::model::multi_point
<P
> mp
;
47 typedef bg::model::multi_linestring
<bg::model::linestring
<P
> > ml
;
48 typedef bg::model::multi_polygon
<bg::model::polygon
<P
> > mpoly
;
50 // All points below in upper-points and lower-points
51 test_geometry
<mp
>("MULTIPOINT((0 0),(5 0),(1 1),(4 1))", 0, 5, 4.0);
52 test_geometry
<mp
>("MULTIPOINT((0 1),(5 1),(1 0),(4 0))", 0, 5, 4.0);
54 // All points in vertical line (this delivers an empty polygon with 3 points and closing point for closed)
55 test_geometry
<mp
>("MULTIPOINT((1 0),(5 0),(3 0),(4 0),(2 0))", 0, 4, 0.0);
58 test_geometry
<mp
>("MULTIPOINT((1 0))", 0, 4, 0.0);
60 // Problem of 6019, reproduced by the convex hull robustness test:
61 test_geometry
<mp
>("MULTIPOINT((2 9),(1 3),(9 4),(1 1),(1 0),(7 9),(2 5),(3 7),(3 6),(2 4))",
65 test_geometry
<mp
>("MULTIPOINT((0 53),(0 103),(0 53),(0 3),(0 3),(0 0),(1 0),(1 1),(2 1),(2 0),(2 0),(2 0),(3 0),(3 1),(4 1),(4 0),(5 0),(0 3),(10 3),(10 2),(10 2),(10 2),(5 2),(5 0),(5 0),(55 0),(105 0))",
68 test_geometry
<mp
>("multipoint((0 53), (0 103), (1 53))", 3, 4, 25);
70 test_geometry
<mp
>("multipoint((1.1 1.1), (2.5 2.1), (3.1 3.1), (4.9 1.1), (3.1 1.9))", 5, 4, 3.8);
71 test_geometry
<ml
>("multilinestring((2 4, 3 4, 3 5), (4 3,4 4,5 4))", 6, 5, 3.0);
72 test_geometry
<mpoly
>("multipolygon(((1 4,1 6,2 5,3 5,4 6,4 4,1 4)), ((4 2,4 3,6 3,6 2,4 2)))", 12, 7, 14.0);
74 test_empty_input
<mp
>();
75 test_empty_input
<ml
>();
76 test_empty_input
<mpoly
>();
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> >();