/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. // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
  5. // Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
  6. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  7. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  8. // Use, modification and distribution is subject to the Boost Software License,
  9. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. #include <geometry_test_common.hpp>
  12. #include <boost/geometry/algorithms/buffer.hpp>
  13. #include <boost/geometry/core/coordinate_type.hpp>
  14. #include <boost/geometry/strategies/strategies.hpp>
  15. #include <boost/geometry/geometries/point.hpp>
  16. #include <boost/geometry/geometries/box.hpp>
  17. #include <test_common/test_point.hpp>
  18. template <typename P>
  19. void test_all()
  20. {
  21. typedef typename bg::coordinate_type<P>::type coordinate_type;
  22. P p1(0, 0);
  23. P p2(2, 2);
  24. bg::model::box<P> b1(p1, p2);
  25. bg::model::box<P> b2;
  26. bg::buffer(b1, b2, coordinate_type(2));
  27. // TODO: Check if buffer is correct
  28. // using bg::equals to compare boxes
  29. // (TODO: implement that)
  30. }
  31. int test_main(int, char* [])
  32. {
  33. test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
  34. test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
  35. test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
  36. #ifdef HAVE_TTMATH
  37. test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();
  38. #endif
  39. return 0;
  40. }