Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:44:42

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland.
0004 
0005 // Copyright (c) 2021, Oracle and/or its affiliates.
0006 
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Licensed under the Boost Software License version 1.0.
0010 // http://www.boost.org/users/license.html
0011 
0012 #ifndef BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP
0013 #define BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP
0014 
0015 
0016 #include <boost/geometry/strategies/detail.hpp>
0017 #include <boost/geometry/strategies/centroid.hpp>
0018 #include <boost/geometry/strategies/centroid/services.hpp>
0019 
0020 
0021 namespace boost { namespace geometry
0022 {
0023 
0024 namespace strategies { namespace centroid
0025 {
0026 
0027 #ifndef DOXYGEN_NO_DETAIL
0028 namespace detail
0029 {
0030 
0031 class spherical
0032 {
0033 public:
0034     // TODO: Box and Segment should have proper strategies.
0035     template <typename Geometry, typename Point>
0036     static auto centroid(Geometry const&, Point const&,
0037                          std::enable_if_t
0038                             <
0039                                 util::is_segment<Geometry>::value
0040                              || util::is_box<Geometry>::value
0041                             > * = nullptr)
0042     {
0043         return strategy::centroid::not_applicable_strategy();
0044     }
0045 };
0046 
0047 
0048 } // namespace detail
0049 #endif // DOXYGEN_NO_DETAIL
0050 
0051 
0052 template <typename CalculationType = void>
0053 class spherical
0054     : public strategies::detail::spherical_base<void>
0055     , public strategies::centroid::detail::spherical
0056 {
0057 public:
0058     spherical() = default;
0059 };
0060 
0061 
0062 namespace services
0063 {
0064 
0065 template <typename Geometry>
0066 struct default_strategy<Geometry, spherical_equatorial_tag>
0067 {
0068     using type = strategies::centroid::spherical<>;
0069 };
0070 
0071 } // namespace services
0072 
0073 }} // namespace strategies::centroid
0074 
0075 }} // namespace boost::geometry
0076 
0077 #endif // BOOST_GEOMETRY_STRATEGIES_CENTROID_SPHERICAL_HPP