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_GEOGRAPHIC_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_CENTROID_GEOGRAPHIC_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 FormulaPolicy = strategy::andoyer,
0028     typename Spheroid = srs::spheroid<double>,
0029     typename CalculationType = void
0030 >
0031 class geographic
0032     : public strategies::detail::geographic_base<Spheroid>
0033 {
0034     using base_t = strategies::detail::geographic_base<Spheroid>;
0035 
0036 public:
0037     geographic() = default;
0038 
0039     explicit geographic(Spheroid const& spheroid)
0040         : base_t(spheroid)
0041     {}
0042 
0043     // TODO: Box and Segment should have proper strategies.
0044     template <typename Geometry, typename Point>
0045     static auto centroid(Geometry const&, Point const&,
0046                          std::enable_if_t
0047                             <
0048                                 util::is_segment<Geometry>::value
0049                              || util::is_box<Geometry>::value
0050                             > * = nullptr)
0051     {
0052         return strategy::centroid::not_applicable_strategy();
0053     }
0054 };
0055 
0056 namespace services
0057 {
0058 
0059 template <typename Geometry>
0060 struct default_strategy<Geometry, geographic_tag>
0061 {
0062     using type = strategies::centroid::geographic<>;
0063 };
0064 
0065 } // namespace services
0066 
0067 }} // namespace strategies::centroid
0068 
0069 }} // namespace boost::geometry
0070 
0071 #endif // BOOST_GEOMETRY_STRATEGIES_CENTROID_GEOGRAPHIC_HPP