3 // Copyright (c) 2021, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
14 #include <boost/geometry/strategy/cartesian/area.hpp>
15 #include <boost/geometry/strategy/cartesian/area_box.hpp>
17 #include <boost/geometry/strategies/area/services.hpp>
18 #include <boost/geometry/strategies/detail.hpp>
21 namespace boost { namespace geometry
24 namespace strategies { namespace area
27 template <typename CalculationType = void>
28 struct cartesian : strategies::detail::cartesian_base
30 template <typename Geometry>
31 static auto area(Geometry const&,
32 std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr)
34 return strategy::area::cartesian<CalculationType>();
37 template <typename Geometry>
38 static auto area(Geometry const&,
39 std::enable_if_t<util::is_box<Geometry>::value> * = nullptr)
41 return strategy::area::cartesian_box<CalculationType>();
49 template <typename Geometry>
50 struct default_strategy<Geometry, cartesian_tag>
52 using type = strategies::area::cartesian<>;
56 template <typename CT>
57 struct strategy_converter<strategy::area::cartesian<CT> >
59 static auto get(strategy::area::cartesian<CT> const&)
61 return strategies::area::cartesian<CT>();
66 } // namespace services
68 }} // namespace strategies::area
70 }} // namespace boost::geometry
72 #endif // BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP