cartesian.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Boost.Geometry
  2. // Copyright (c) 2020, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #ifndef BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
  7. #define BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
  8. #include <boost/geometry/strategy/cartesian/area.hpp>
  9. #include <boost/geometry/strategies/area/services.hpp>
  10. #include <boost/geometry/strategies/detail.hpp>
  11. namespace boost { namespace geometry
  12. {
  13. namespace strategies { namespace area
  14. {
  15. template <typename CalculationType = void>
  16. struct cartesian : strategies::detail::cartesian_base
  17. {
  18. template <typename Geometry>
  19. static auto area(Geometry const&)
  20. {
  21. return strategy::area::cartesian<CalculationType>();
  22. }
  23. };
  24. namespace services
  25. {
  26. template <typename Geometry>
  27. struct default_strategy<Geometry, cartesian_tag>
  28. {
  29. using type = strategies::area::cartesian<>;
  30. };
  31. template <typename CT>
  32. struct strategy_converter<strategy::area::cartesian<CT> >
  33. {
  34. static auto get(strategy::area::cartesian<CT> const&)
  35. {
  36. return strategies::area::cartesian<CT>();
  37. }
  38. };
  39. } // namespace services
  40. }} // namespace strategies::area
  41. }} // namespace boost::geometry
  42. #endif // BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP