]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/buffer/buffer.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2019 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 2016.
9 // Modifications copyright (c) 2016, Oracle and/or its affiliates.
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
15 // Use, modification and distribution is subject to the Boost Software License,
16 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
20 #include <boost/variant/variant.hpp>
22 #include "geometry_test_common.hpp"
24 #include <boost/geometry/algorithms/buffer.hpp>
25 #include <boost/geometry/algorithms/equals.hpp>
26 #include <boost/geometry/core/coordinate_type.hpp>
28 #include <boost/geometry/strategies/strategies.hpp>
30 #include <boost/geometry/geometries/point.hpp>
31 #include <boost/geometry/geometries/box.hpp>
32 #include "test_common/test_point.hpp"
38 typedef typename
bg::coordinate_type
<P
>::type coordinate_type
;
43 typedef bg::model::box
<P
> box_type
;
47 bg::buffer(b1
, b2
, coordinate_type(2));
49 box_type
expected(P(-2, -2), P(4, 4));
50 BOOST_CHECK(bg::equals(b2
, expected
));
52 boost::variant
<box_type
> v(b1
);
53 bg::buffer(v
, b2
, coordinate_type(2));
55 BOOST_CHECK(bg::equals(b2
, expected
));
58 int test_main(int, char* [])
60 BoostGeometryWriteTestConfiguration();
62 test_all
<bg::model::point
<default_test_type
, 2, bg::cs::cartesian
> >();
64 #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
65 test_all
<bg::model::point
<int, 2, bg::cs::cartesian
> >();
66 test_all
<bg::model::point
<float, 2, bg::cs::cartesian
> >();
70 test_all
<bg::model::point
<ttmath_big
, 2, bg::cs::cartesian
> >();