spherical.hpp 1.8 KB

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