perimeter_multi.cpp 1013 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. //
  3. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <geometry_test_common.hpp>
  8. #include <boost/geometry/algorithms/perimeter.hpp>
  9. #include <boost/geometry/io/wkt/wkt.hpp>
  10. #include <boost/geometry/geometries/point_xy.hpp>
  11. #include <boost/geometry/geometries/polygon.hpp>
  12. #include <boost/geometry/geometries/multi_polygon.hpp>
  13. #include <algorithms/test_perimeter.hpp>
  14. template <typename P>
  15. void test_all()
  16. {
  17. test_geometry<bg::model::multi_polygon<bg::model::polygon<P> > >(
  18. "MULTIPOLYGON(((0 0,0 1,1 0,0 0)))", 1.0 + 1.0 + sqrt(2.0));
  19. }
  20. int test_main( int , char* [] )
  21. {
  22. test_all<bg::model::d2::point_xy<double> >();
  23. #ifdef HAVE_TTMATH
  24. test_all<bg::model::d2::point_xy<ttmath_big> >();
  25. #endif
  26. return 0;
  27. }