spherical.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_SPHERICAL_HPP
  7. #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_HPP
  8. #include <boost/geometry/strategies/area/spherical.hpp>
  9. #include <boost/geometry/strategies/azimuth/spherical.hpp>
  10. #include <boost/geometry/strategies/convex_hull/spherical.hpp>
  11. #include <boost/geometry/strategies/envelope/spherical.hpp>
  12. #include <boost/geometry/strategies/expand/spherical.hpp>
  13. #include <boost/geometry/strategies/io/spherical.hpp>
  14. #include <boost/geometry/strategies/index/spherical.hpp>
  15. #include <boost/geometry/strategies/relate/spherical.hpp>
  16. namespace boost { namespace geometry
  17. {
  18. namespace strategies
  19. {
  20. template
  21. <
  22. typename RadiusTypeOrSphere = double,
  23. typename CalculationType = void
  24. >
  25. class spherical
  26. // derived from the umbrella strategy defining the most strategies
  27. : public strategies::index::detail::spherical<RadiusTypeOrSphere, CalculationType>
  28. {
  29. using base_t = strategies::index::detail::spherical<RadiusTypeOrSphere, CalculationType>;
  30. public:
  31. spherical() = default;
  32. template <typename RadiusOrSphere>
  33. explicit spherical(RadiusOrSphere const& radius_or_sphere)
  34. //: base_t(radius_or_sphere)
  35. {
  36. // TODO: pass into the constructor
  37. base_t::m_radius = strategy_detail::get_radius
  38. <
  39. RadiusOrSphere
  40. >::apply(radius_or_sphere);
  41. }
  42. static auto azimuth()
  43. {
  44. return strategy::azimuth::spherical<CalculationType>();
  45. }
  46. static auto point_order()
  47. {
  48. return strategy::point_order::spherical<CalculationType>();
  49. }
  50. };
  51. } // namespace strategies
  52. }} // namespace boost::geometry
  53. #endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_HPP