is.cpp 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Boost.Geometry
  2. // Copyright (c) 2019, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #include "common.hpp"
  7. #include <boost/geometry/algorithms/is_simple.hpp>
  8. #include <boost/geometry/algorithms/is_valid.hpp>
  9. template <typename G, typename S>
  10. inline void is(G const& g, S const& s)
  11. {
  12. bg::is_simple(g, s);
  13. bg::is_valid(g, s);
  14. }
  15. template <typename G>
  16. inline void is_x(G const& g)
  17. {
  18. ::is(g, bg::strategy::intersection::cartesian_segments<>());
  19. ::is(g, bg::strategy::intersection::spherical_segments<>());
  20. ::is(g, bg::strategy::intersection::geographic_segments<>());
  21. }
  22. int test_main(int, char*[])
  23. {
  24. geom g;
  25. ::is_x(g.pt);
  26. ::is_x(g.mpt);
  27. ::is_x(g.s);
  28. ::is_x(g.ls);
  29. ::is_x(g.mls);
  30. ::is_x(g.r);
  31. ::is_x(g.po);
  32. ::is_x(g.mpo);
  33. return 0;
  34. }