Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2021, Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0006 
0007 // Licensed under the Boost Software License version 1.0.
0008 // http://www.boost.org/users/license.html
0009 
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_DENSIFY_SPHERICAL_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_DENSIFY_SPHERICAL_HPP
0012 
0013 
0014 #include <boost/geometry/strategies/detail.hpp>
0015 #include <boost/geometry/strategies/densify/services.hpp>
0016 
0017 #include <boost/geometry/strategies/spherical/densify.hpp>
0018 
0019 
0020 namespace boost { namespace geometry
0021 {
0022 
0023 namespace strategies { namespace densify
0024 {
0025 
0026 template
0027 <
0028     typename RadiusTypeOrSphere = double,
0029     typename CalculationType = void
0030 >
0031 class spherical
0032     : public strategies::detail::spherical_base<RadiusTypeOrSphere>
0033 {
0034     using base_t = strategies::detail::spherical_base<RadiusTypeOrSphere>;
0035 
0036 public:
0037     spherical() = default;
0038 
0039     template <typename RadiusOrSphere>
0040     explicit spherical(RadiusOrSphere const& radius_or_sphere)
0041         : base_t(radius_or_sphere)
0042     {}
0043 
0044     template <typename Geometry>
0045     auto densify(Geometry const&) const
0046     {
0047         return strategy::densify::spherical
0048                 <
0049                     typename base_t::radius_type, CalculationType
0050                 >(base_t::radius());
0051     }
0052 };
0053 
0054 
0055 namespace services
0056 {
0057 
0058 template <typename Geometry>
0059 struct default_strategy<Geometry, spherical_equatorial_tag>
0060 {
0061     using type = strategies::densify::spherical<>;
0062 };
0063 
0064 
0065 template <typename R, typename CT>
0066 struct strategy_converter<strategy::densify::spherical<R, CT> >
0067 {
0068     static auto get(strategy::densify::spherical<R, CT> const& s)
0069     {
0070         return strategies::densify::spherical<R, CT>(s.radius());
0071     }
0072 };
0073 
0074 
0075 } // namespace services
0076 
0077 }} // namespace strategies::densify
0078 
0079 }} // namespace boost::geometry
0080 
0081 #endif // BOOST_GEOMETRY_STRATEGIES_DENSIFY_SPHERICAL_HPP