123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_GET_RADIUS_HPP
- #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_GET_RADIUS_HPP
- #include <boost/geometry/core/coordinate_type.hpp>
- #include <boost/geometry/core/radius.hpp>
- #include <boost/geometry/core/tag.hpp>
- #include <boost/geometry/core/tags.hpp>
- #include <boost/geometry/util/select_most_precise.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace strategy_detail
- {
- template
- <
- typename RadiusTypeOrSphere,
- typename Tag = typename tag<RadiusTypeOrSphere>::type
- >
- struct get_radius
- {
- typedef typename geometry::radius_type<RadiusTypeOrSphere>::type type;
- static type apply(RadiusTypeOrSphere const& sphere)
- {
- return geometry::get_radius<0>(sphere);
- }
- };
- template <typename RadiusTypeOrSphere>
- struct get_radius<RadiusTypeOrSphere, void>
- {
- typedef RadiusTypeOrSphere type;
- static type apply(RadiusTypeOrSphere const& radius)
- {
- return radius;
- }
- };
- template <typename Point>
- struct get_radius<Point, point_tag>
- {
- typedef typename select_most_precise
- <
- typename coordinate_type<Point>::type,
- double
- >::type type;
- template <typename RadiusOrSphere>
- static typename get_radius<RadiusOrSphere>::type
- apply(RadiusOrSphere const& radius_or_sphere)
- {
- return get_radius<RadiusOrSphere>::apply(radius_or_sphere);
- }
- };
- }
- #endif
- }}
- #endif
|