spherical.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Boost.Geometry
  2. // Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland.
  3. // Copyright (c) 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_CENTROID_SPHERICAL_HPP
  8. #define BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP
  9. #include <boost/geometry/strategies/detail.hpp>
  10. #include <boost/geometry/strategies/centroid.hpp>
  11. #include <boost/geometry/strategies/centroid/services.hpp>
  12. namespace boost { namespace geometry
  13. {
  14. namespace strategies { namespace centroid
  15. {
  16. #ifndef DOXYGEN_NO_DETAIL
  17. namespace detail
  18. {
  19. class spherical
  20. {
  21. public:
  22. // TODO: Box and Segment should have proper strategies.
  23. template <typename Geometry, typename Point>
  24. static auto centroid(Geometry const&, Point const&,
  25. std::enable_if_t
  26. <
  27. util::is_segment<Geometry>::value
  28. || util::is_box<Geometry>::value
  29. > * = nullptr)
  30. {
  31. return strategy::centroid::not_applicable_strategy();
  32. }
  33. };
  34. } // namespace detail
  35. #endif // DOXYGEN_NO_DETAIL
  36. template <typename CalculationType = void>
  37. class spherical
  38. : public strategies::detail::spherical_base<void>
  39. , public strategies::centroid::detail::spherical
  40. {
  41. public:
  42. spherical() = default;
  43. };
  44. namespace services
  45. {
  46. template <typename Geometry>
  47. struct default_strategy<Geometry, spherical_equatorial_tag>
  48. {
  49. using type = strategies::centroid::spherical<>;
  50. };
  51. } // namespace services
  52. }} // namespace strategies::centroid
  53. }} // namespace boost::geometry
  54. #endif // BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP