File indexing completed on 2025-01-18 09:36:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_GET_RADIUS_HPP
0014 #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_GET_RADIUS_HPP
0015
0016
0017 #include <boost/geometry/core/coordinate_type.hpp>
0018 #include <boost/geometry/core/radius.hpp>
0019 #include <boost/geometry/core/tag.hpp>
0020 #include <boost/geometry/core/tags.hpp>
0021 #include <boost/geometry/util/select_most_precise.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027
0028 #ifndef DOXYGEN_NO_DETAIL
0029 namespace strategy_detail
0030 {
0031
0032 template
0033 <
0034 typename RadiusTypeOrSphere,
0035 typename Tag = typename tag<RadiusTypeOrSphere>::type
0036 >
0037 struct get_radius
0038 {
0039 typedef typename geometry::radius_type<RadiusTypeOrSphere>::type type;
0040 static type apply(RadiusTypeOrSphere const& sphere)
0041 {
0042 return geometry::get_radius<0>(sphere);
0043 }
0044 };
0045
0046 template <typename RadiusTypeOrSphere>
0047 struct get_radius<RadiusTypeOrSphere, void>
0048 {
0049 typedef RadiusTypeOrSphere type;
0050 static type apply(RadiusTypeOrSphere const& radius)
0051 {
0052 return radius;
0053 }
0054 };
0055
0056
0057 template <typename Point>
0058 struct get_radius<Point, point_tag>
0059 {
0060 typedef typename select_most_precise
0061 <
0062 typename coordinate_type<Point>::type,
0063 double
0064 >::type type;
0065
0066 template <typename RadiusOrSphere>
0067 static typename get_radius<RadiusOrSphere>::type
0068 apply(RadiusOrSphere const& radius_or_sphere)
0069 {
0070 return get_radius<RadiusOrSphere>::apply(radius_or_sphere);
0071 }
0072 };
0073
0074
0075 }
0076 #endif
0077
0078
0079 }}
0080
0081 #endif