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_CENTROID_SPHERICAL_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP
0012 
0013 
0014 #include <boost/geometry/strategies/detail.hpp>
0015 #include <boost/geometry/strategies/centroid.hpp>
0016 #include <boost/geometry/strategies/centroid/services.hpp>
0017 
0018 
0019 namespace boost { namespace geometry
0020 {
0021 
0022 namespace strategies { namespace centroid
0023 {
0024 
0025 template
0026 <
0027     typename CalculationType = void
0028 >
0029 class spherical
0030     : public strategies::detail::spherical_base<void>
0031 {
0032     using base_t = strategies::detail::spherical_base<void>;
0033 
0034 public:
0035     spherical() = default;
0036 
0037     // TODO: Box and Segment should have proper strategies.
0038     template <typename Geometry, typename Point>
0039     static auto centroid(Geometry const&, Point const&,
0040                          std::enable_if_t
0041                             <
0042                                 util::is_segment<Geometry>::value
0043                              || util::is_box<Geometry>::value
0044                             > * = nullptr)
0045     {
0046         return strategy::centroid::not_applicable_strategy();
0047     }
0048 };
0049 
0050 
0051 namespace services
0052 {
0053 
0054 template <typename Geometry>
0055 struct default_strategy<Geometry, spherical_equatorial_tag>
0056 {
0057     using type = strategies::centroid::spherical<>;
0058 };
0059 
0060 } // namespace services
0061 
0062 }} // namespace strategies::centroid
0063 
0064 }} // namespace boost::geometry
0065 
0066 #endif // BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP