spherical.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Boost.Geometry
  2. // Copyright (c) 2020-2023, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Licensed under the Boost Software License version 1.0.
  6. // http://www.boost.org/users/license.html
  7. #ifndef BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_SPHERICAL_HPP
  8. #define BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_SPHERICAL_HPP
  9. #include <boost/geometry/strategies/convex_hull/services.hpp>
  10. #include <boost/geometry/strategies/compare.hpp>
  11. #include <boost/geometry/strategies/detail.hpp>
  12. #include <boost/geometry/strategies/spherical/point_in_point.hpp>
  13. #include <boost/geometry/strategies/spherical/ssf.hpp>
  14. #include <boost/geometry/util/type_traits.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. namespace strategies { namespace convex_hull
  18. {
  19. template <typename CalculationType = void>
  20. class spherical : public strategies::detail::spherical_base<void>
  21. {
  22. public:
  23. template <typename Geometry1, typename Geometry2>
  24. static auto relate(Geometry1 const&, Geometry2 const&,
  25. std::enable_if_t
  26. <
  27. util::is_pointlike<Geometry1>::value
  28. && util::is_pointlike<Geometry2>::value
  29. > * = nullptr)
  30. {
  31. return strategy::within::spherical_point_point();
  32. }
  33. static auto side()
  34. {
  35. return strategy::side::spherical_side_formula<CalculationType>();
  36. }
  37. template <typename ComparePolicy, typename EqualsPolicy>
  38. using compare_type = typename strategy::compare::spherical
  39. <
  40. ComparePolicy,
  41. EqualsPolicy,
  42. -1
  43. >;
  44. };
  45. namespace services
  46. {
  47. template <typename Geometry>
  48. struct default_strategy<Geometry, spherical_equatorial_tag>
  49. {
  50. using type = strategies::convex_hull::spherical<>;
  51. };
  52. } // namespace services
  53. }} // namespace strategies::convex_hull
  54. }} // namespace boost::geometry
  55. #endif // BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_SPHERICAL_HPP