reverse_multi.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/reverse.hpp>
  9. #include <boost/geometry/io/wkt/wkt.hpp>
  10. #include <boost/geometry/geometries/geometries.hpp>
  11. #include <boost/geometry/geometries/point_xy.hpp>
  12. #include <algorithms/test_reverse.hpp>
  13. template <typename P>
  14. void test_all()
  15. {
  16. // Multi point, should happen nothing.
  17. test_geometry<bg::model::multi_point<P> >(
  18. "MULTIPOINT((0 0),(1 1))",
  19. "MULTIPOINT((0 0),(1 1))");
  20. test_geometry<bg::model::multi_linestring<bg::model::linestring<P> > >(
  21. "MULTILINESTRING((0 0,1 1),(3 3,4 4))",
  22. "MULTILINESTRING((1 1,0 0),(4 4,3 3))");
  23. typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
  24. test_geometry<mp>(
  25. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))",
  26. "MULTIPOLYGON(((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0)))");
  27. test_geometry<mp>(
  28. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3)))",
  29. "MULTIPOLYGON(((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0),(7 3,4 3,1 3,1 6,7 6,7 3)))");
  30. }
  31. int test_main( int , char* [] )
  32. {
  33. test_all<bg::model::d2::point_xy<int> >();
  34. test_all<bg::model::d2::point_xy<double> >();
  35. #ifdef HAVE_TTMATH
  36. test_all<bg::model::d2::point_xy<ttmath_big> >();
  37. #endif
  38. return 0;
  39. }