Back to home page

EIC code displayed by LXR

 
 

    


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

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