get_turns_areal_areal.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Boost.Geometry
  2. // Unit Test
  3. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  5. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  6. // This file was modified by Oracle on 2015.
  7. // Modifications copyright (c) 2015 Oracle and/or its affiliates.
  8. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  9. // Use, modification and distribution is subject to the Boost Software License,
  10. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  11. // http://www.boost.org/LICENSE_1_0.txt)
  12. #include "test_get_turns.hpp"
  13. #include <boost/geometry/geometries/geometries.hpp>
  14. //TEST
  15. //#include <to_svg.hpp>
  16. template <typename T>
  17. void test_all()
  18. {
  19. typedef bg::model::point<T, 2, bg::cs::cartesian> pt;
  20. //typedef bg::model::ring<pt> ring;
  21. typedef bg::model::polygon<pt> poly;
  22. //typedef bg::model::multi_polygon<polygon> mpoly;
  23. // mailing list report 17.03.2015
  24. // operations ok but wrong IPs for int
  25. // (the coordinates are generates at endpoints only)
  26. {
  27. // cw(duplicated point)
  28. test_geometry<poly, poly>("POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))",
  29. "POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))",
  30. expected("iiu")("iui")("mcc")("cui"));
  31. //to_svg<poly, poly>("POLYGON((-8042 -1485,-8042 250,15943 254,15943 -1485,-8042 -1485))",
  32. // "POLYGON((-7901 -1485,-7901 529,15802 544, 15802 -1485, -7901 -1485))",
  33. // "poly_poly_1.svg");
  34. test_geometry<poly, poly>("POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))",
  35. "POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))",
  36. expected("iui")("iiu")("mcc")("ciu"));
  37. }
  38. }
  39. int test_main(int, char* [])
  40. {
  41. test_all<int>();
  42. test_all<float>();
  43. test_all<double>();
  44. #if ! defined(_MSC_VER)
  45. test_all<long double>();
  46. #endif
  47. #if defined(HAVE_TTMATH)
  48. test_all<ttmath_big>();
  49. #endif
  50. return 0;
  51. }