Back to home page

EIC code displayed by LXR

 
 

    


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

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_AREA_CARTESIAN_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
0012 
0013 
0014 #include <boost/geometry/strategy/cartesian/area.hpp>
0015 #include <boost/geometry/strategy/cartesian/area_box.hpp>
0016 
0017 #include <boost/geometry/strategies/area/services.hpp>
0018 #include <boost/geometry/strategies/detail.hpp>
0019 
0020 
0021 namespace boost { namespace geometry
0022 {
0023 
0024 namespace strategies { namespace area
0025 {
0026 
0027 template <typename CalculationType = void>
0028 struct cartesian : strategies::detail::cartesian_base
0029 {
0030     template <typename Geometry>
0031     static auto area(Geometry const&,
0032                      std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr)
0033     {
0034         return strategy::area::cartesian<CalculationType>();
0035     }
0036 
0037     template <typename Geometry>
0038     static auto area(Geometry const&,
0039                      std::enable_if_t<util::is_box<Geometry>::value> * = nullptr)
0040     {
0041         return strategy::area::cartesian_box<CalculationType>();
0042     }
0043 };
0044 
0045 
0046 namespace services
0047 {
0048 
0049 template <typename Geometry>
0050 struct default_strategy<Geometry, cartesian_tag>
0051 {
0052     using type = strategies::area::cartesian<>;
0053 };
0054 
0055 
0056 template <typename CT>
0057 struct strategy_converter<strategy::area::cartesian<CT> >
0058 {
0059     static auto get(strategy::area::cartesian<CT> const&)
0060     {
0061         return strategies::area::cartesian<CT>();
0062     }
0063 };
0064 
0065 
0066 } // namespace services
0067 
0068 }} // namespace strategies::area
0069 
0070 }} // namespace boost::geometry
0071 
0072 #endif // BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP