spherical.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Boost.Geometry
  2. // Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland.
  3. // Copyright (c) 2020-2021, Oracle and/or its affiliates.
  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_INDEX_SPHERICAL_HPP
  8. #define BOOST_GEOMETRY_STRATEGIES_INDEX_SPHERICAL_HPP
  9. #include <boost/geometry/strategies/centroid/spherical.hpp>
  10. #include <boost/geometry/strategies/distance/spherical.hpp>
  11. #include <boost/geometry/strategies/index/services.hpp>
  12. namespace boost { namespace geometry
  13. {
  14. namespace strategies { namespace index
  15. {
  16. #ifndef DOXYGEN_NO_DETAIL
  17. namespace detail
  18. {
  19. template <typename RadiusTypeOrSphere, typename CalculationType>
  20. class spherical
  21. : public strategies::distance::detail::spherical<RadiusTypeOrSphere, CalculationType>
  22. , public strategies::centroid::detail::spherical
  23. {
  24. using base_t = strategies::distance::detail::spherical<RadiusTypeOrSphere, CalculationType>;
  25. public:
  26. spherical() = default;
  27. template <typename RadiusOrSphere>
  28. explicit spherical(RadiusOrSphere const& radius_or_sphere)
  29. : base_t(radius_or_sphere)
  30. {}
  31. };
  32. } // namespace detail
  33. #endif // DOXYGEN_NO_DETAIL
  34. template <typename CalculationType = void>
  35. class spherical
  36. : public strategies::index::detail::spherical<void, CalculationType>
  37. {};
  38. namespace services
  39. {
  40. template <typename Geometry>
  41. struct default_strategy<Geometry, spherical_tag>
  42. {
  43. using type = strategies::index::spherical<>;
  44. };
  45. template <typename Geometry>
  46. struct default_strategy<Geometry, spherical_equatorial_tag>
  47. {
  48. using type = strategies::index::spherical<>;
  49. };
  50. template <typename Geometry>
  51. struct default_strategy<Geometry, spherical_polar_tag>
  52. {
  53. using type = strategies::index::spherical<>;
  54. };
  55. } // namespace services
  56. }}}} // namespace boost::geometry::strategy::index
  57. #endif // BOOST_GEOMETRY_STRATEGIES_INDEX_SPHERICAL_HPP