1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3
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.
7
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10
11 // Use, modification and distribution is subject to the Boost Software License,
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
14
15
16 #include <boost/variant/variant.hpp>
17
18 #include <geometry_test_common.hpp>
19
20 #include <boost/geometry/algorithms/buffer.hpp>
21 #include <boost/geometry/core/coordinate_type.hpp>
22
23 #include <boost/geometry/strategies/strategies.hpp>
24
25 #include <boost/geometry/geometries/point.hpp>
26 #include <boost/geometry/geometries/box.hpp>
27 #include <test_common/test_point.hpp>
28
29
30 template <typename P>
test_all()31 void test_all()
32 {
33 typedef typename bg::coordinate_type<P>::type coordinate_type;
34
35 P p1(0, 0);
36 P p2(2, 2);
37
38 typedef bg::model::box<P> box_type;
39
40 box_type b1(p1, p2);
41 box_type b2;
42 bg::buffer(b1, b2, coordinate_type(2));
43
44 boost::variant<box_type> v(b1);
45 bg::buffer(v, b2, coordinate_type(2));
46
47 // TODO: Check if buffer is correct
48 // using bg::equals to compare boxes
49 // (TODO: implement that)
50 }
51
test_main(int,char * [])52 int test_main(int, char* [])
53 {
54 test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
55 test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
56 test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
57
58 #ifdef HAVE_TTMATH
59 test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();
60 #endif
61 return 0;
62 }
63