PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/geometry/test/algorithms/buffer.cpp

http://hadesmem.googlecode.com/
C++ | 55 lines | 27 code | 15 blank | 13 comment | 0 complexity | e9bedbb86f93ecf0f03eafb88fa489a6 MD5 | raw file
 1// Boost.Geometry (aka GGL, Generic Geometry Library)
 2// Unit Test
 3
 4// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
 5// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
 6// Copyright (c) 2009-2011 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 <geometry_test_common.hpp>
17
18#include <boost/geometry/algorithms/buffer.hpp>
19#include <boost/geometry/core/coordinate_type.hpp>
20
21#include <boost/geometry/strategies/strategies.hpp>
22
23#include <boost/geometry/geometries/point.hpp>
24#include <boost/geometry/geometries/box.hpp>
25#include <test_common/test_point.hpp>
26
27
28template <typename P>
29void test_all()
30{
31    typedef typename bg::coordinate_type<P>::type coordinate_type;
32
33    P p1(0, 0);
34    P p2(2, 2);
35    bg::model::box<P> b1(p1, p2);
36
37    bg::model::box<P> b2;
38    bg::buffer(b1, b2, coordinate_type(2));
39
40    // TODO: Check if buffer is correct
41    // using bg::equals to compare boxes
42    // (TODO: implement that)
43}
44
45int test_main(int, char* [])
46{
47    test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
48    test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
49    test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
50
51#ifdef HAVE_TTMATH
52    test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();
53#endif
54    return 0;
55}