File indexing completed on 2025-01-18 09:36:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP
0012
0013
0014 #include <type_traits>
0015
0016 #include <boost/geometry/strategy/spherical/expand_box.hpp>
0017 #include <boost/geometry/strategy/spherical/expand_point.hpp>
0018 #include <boost/geometry/strategy/spherical/expand_segment.hpp>
0019
0020 #include <boost/geometry/strategies/detail.hpp>
0021 #include <boost/geometry/strategies/expand/services.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027
0028 namespace strategies { namespace expand
0029 {
0030
0031
0032 #ifndef DOXYGEN_NO_DETAIL
0033 namespace detail
0034 {
0035
0036
0037 template <typename RadiusTypeOrSphere, typename CalculationType>
0038 struct spherical
0039 : strategies::detail::spherical_base<RadiusTypeOrSphere>
0040 {
0041 spherical() = default;
0042
0043 template <typename RadiusOrSphere>
0044 explicit spherical(RadiusOrSphere const& radius_or_sphere)
0045 : strategies::detail::spherical_base<RadiusTypeOrSphere>(radius_or_sphere)
0046 {}
0047
0048 template <typename Box, typename Geometry>
0049 static auto expand(Box const&, Geometry const&,
0050 typename util::enable_if_point_t<Geometry> * = nullptr)
0051 {
0052 return strategy::expand::spherical_point();
0053 }
0054
0055 template <typename Box, typename Geometry>
0056 static auto expand(Box const&, Geometry const&,
0057 typename util::enable_if_box_t<Geometry> * = nullptr)
0058 {
0059 return strategy::expand::spherical_box();
0060 }
0061
0062 template <typename Box, typename Geometry>
0063 static auto expand(Box const&, Geometry const&,
0064 typename util::enable_if_segment_t<Geometry> * = nullptr)
0065 {
0066 return strategy::expand::spherical_segment<CalculationType>();
0067 }
0068 };
0069
0070
0071 }
0072 #endif
0073
0074
0075 template <typename CalculationType = void>
0076 class spherical
0077 : public strategies::expand::detail::spherical<void, CalculationType>
0078 {};
0079
0080
0081 namespace services
0082 {
0083
0084 template <typename Box, typename Geometry>
0085 struct default_strategy<Box, Geometry, spherical_tag>
0086 {
0087 using type = strategies::expand::spherical<>;
0088 };
0089
0090 template <typename Box, typename Geometry>
0091 struct default_strategy<Box, Geometry, spherical_equatorial_tag>
0092 {
0093 using type = strategies::expand::spherical<>;
0094 };
0095
0096 template <typename Box, typename Geometry>
0097 struct default_strategy<Box, Geometry, spherical_polar_tag>
0098 {
0099 using type = strategies::expand::spherical<>;
0100 };
0101
0102
0103 template <>
0104 struct strategy_converter<strategy::expand::spherical_point>
0105 {
0106 static auto get(strategy::expand::spherical_point const& )
0107 {
0108 return strategies::expand::spherical<>();
0109 }
0110 };
0111
0112 template <>
0113 struct strategy_converter<strategy::expand::spherical_box>
0114 {
0115 static auto get(strategy::expand::spherical_box const& )
0116 {
0117 return strategies::expand::spherical<>();
0118 }
0119 };
0120
0121 template <typename CT>
0122 struct strategy_converter<strategy::expand::spherical_segment<CT> >
0123 {
0124 static auto get(strategy::expand::spherical_segment<CT> const&)
0125 {
0126 return strategies::expand::spherical<CT>();
0127 }
0128 };
0129
0130
0131 }
0132
0133 }}
0134
0135 }}
0136
0137 #endif