envelope_multi.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  5. // Copyright (c) 2009-2015 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 "test_envelope.hpp"
  12. #include <boost/geometry/geometries/geometries.hpp>
  13. #include <boost/geometry/geometries/point_xy.hpp>
  14. #include <boost/geometry/geometries/adapted/c_array.hpp>
  15. #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
  16. #include <test_common/test_point.hpp>
  17. BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
  18. BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
  19. template <typename P>
  20. void test_2d()
  21. {
  22. /*test_envelope<bg::model::multi_point<P> >(
  23. "MULTIPOINT((1 1),(1 0),(1 2))", 1, 1, 0, 2);
  24. test_envelope<bg::model::multi_linestring<bg::model::linestring<P> > >(
  25. "MULTILINESTRING((0 0,1 1),(1 1,2 2),(2 2,3 3))", 0, 3, 0, 3);
  26. */
  27. test_envelope<bg::model::multi_polygon<bg::model::polygon<P> > >(
  28. "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 4,4 6,6 6,6 4,4 4)))", 1, 6, 1, 6);
  29. }
  30. template <typename P>
  31. void test_3d()
  32. {
  33. //typedef bg::model::multi_point<P> mp;
  34. }
  35. int test_main( int , char* [] )
  36. {
  37. test_2d<boost::tuple<float, float> >();
  38. test_2d<bg::model::d2::point_xy<float> >();
  39. test_2d<bg::model::d2::point_xy<double> >();
  40. test_3d<boost::tuple<float, float, float> >();
  41. test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
  42. #ifdef HAVE_TTMATH
  43. test_2d<bg::model::d2::point_xy<ttmath_big> >();
  44. test_2d<bg::model::point<ttmath_big, 3, bg::cs::cartesian> >();
  45. #endif
  46. return 0;
  47. }