// Boost.Geometry // Copyright (c) 2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_STRATEGIES_DISTANCE_CARTESIAN_HPP #define BOOST_GEOMETRY_STRATEGIES_DISTANCE_CARTESIAN_HPP //#include #include #include #include #include #include #include #include #include #include //#include #include #include namespace boost { namespace geometry { namespace strategies { namespace distance { template struct cartesian : public strategies::relate::cartesian { template static auto distance(Geometry1 const&, Geometry2 const&, detail::enable_if_pp_t * = nullptr) { return strategy::distance::pythagoras(); } template static auto distance(Geometry1 const&, Geometry2 const&, detail::enable_if_ps_t * = nullptr) { return strategy::distance::projected_point < CalculationType, strategy::distance::pythagoras >(); } template static auto distance(Geometry1 const&, Geometry2 const&, detail::enable_if_pb_t * = nullptr) { return strategy::distance::pythagoras_point_box(); } template static auto distance(Geometry1 const&, Geometry2 const&, detail::enable_if_sb_t * = nullptr) { return strategy::distance::cartesian_segment_box < CalculationType, strategy::distance::pythagoras >(); } template static auto distance(Geometry1 const&, Geometry2 const&, detail::enable_if_bb_t * = nullptr) { return strategy::distance::pythagoras_box_box(); } }; namespace services { template struct default_strategy { using type = strategies::distance::cartesian<>; }; template struct strategy_converter > { template static auto get(S const&) { return strategies::distance::cartesian(); } }; template struct strategy_converter > : strategy_converter {}; template struct strategy_converter > { static auto get(strategy::distance::pythagoras_point_box const&) { return strategies::distance::cartesian(); } }; template struct strategy_converter > : strategy_converter {}; template struct strategy_converter > { static auto get(strategy::distance::pythagoras_box_box const&) { return strategies::distance::cartesian(); } }; template struct strategy_converter > { template static auto get(S const&) { return strategies::distance::detail::make_comparable( strategies::distance::cartesian()); } }; template struct strategy_converter > { static auto get(strategy::distance::comparable::pythagoras_point_box const&) { return strategies::distance::detail::make_comparable( strategies::distance::cartesian()); } }; template struct strategy_converter > { static auto get(strategy::distance::comparable::pythagoras_box_box const&) { return strategies::distance::detail::make_comparable( strategies::distance::cartesian()); } }; } // namespace services }} // namespace strategies::distance }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGIES_DISTANCE_CARTESIAN_HPP