Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:49

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
0004 
0005 // Copyright (c) 2016-2018 Oracle and/or its affiliates.
0006 // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
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 // For backward compatibility
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 } // namespace strategy_detail
0076 #endif // DOXYGEN_NO_DETAIL
0077 
0078 
0079 }} // namespace boost::geometry
0080 
0081 #endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_GET_RADIUS_HPP