cartesian.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Boost.Geometry
  2. // Copyright (c) 2021, 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. #ifndef BOOST_GEOMETRY_STRATEGIES_IS_CONVEX_CARTESIAN_HPP
  7. #define BOOST_GEOMETRY_STRATEGIES_IS_CONVEX_CARTESIAN_HPP
  8. #include <boost/geometry/strategies/convex_hull/cartesian.hpp>
  9. #include <boost/geometry/strategies/detail.hpp>
  10. #include <boost/geometry/strategies/is_convex/services.hpp>
  11. #include <boost/geometry/strategy/cartesian/side_by_triangle.hpp>
  12. #include <boost/geometry/strategy/cartesian/side_robust.hpp>
  13. namespace boost { namespace geometry
  14. {
  15. namespace strategies { namespace is_convex
  16. {
  17. template <typename CalculationType = void>
  18. using cartesian = strategies::convex_hull::cartesian<CalculationType>;
  19. namespace services
  20. {
  21. template <typename Geometry>
  22. struct default_strategy<Geometry, cartesian_tag>
  23. {
  24. using type = strategies::is_convex::cartesian<>;
  25. };
  26. template <typename CT>
  27. struct strategy_converter<strategy::side::side_robust<CT>>
  28. {
  29. static auto get(strategy::side::side_robust<CT> const& )
  30. {
  31. return strategies::is_convex::cartesian<CT>();
  32. }
  33. };
  34. template <typename CT>
  35. struct strategy_converter<strategy::side::side_by_triangle<CT>>
  36. {
  37. static auto get(strategy::side::side_by_triangle<CT> const& )
  38. {
  39. return strategies::is_convex::cartesian<CT>();
  40. }
  41. };
  42. } // namespace services
  43. }} // namespace strategies::is_convex
  44. }} // namespace boost::geometry
  45. #endif // BOOST_GEOMETRY_STRATEGIES_IS_CONVEX_CARTESIAN_HPP