// Boost.Geometry // Copyright (c) 2020, 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_ENVELOPE_CARTESIAN_HPP #define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_CARTESIAN_HPP #include #include // Not used, for backward compatibility #include #include #include #include #include #include #include #include namespace boost { namespace geometry { namespace strategies { namespace envelope { template struct cartesian : strategies::expand::cartesian { template static auto envelope(Geometry const&, Box const&, util::enable_if_point_t * = nullptr) { return strategy::envelope::cartesian_point(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_multi_point_t * = nullptr) { return strategy::envelope::cartesian_multipoint(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_box_t * = nullptr) { return strategy::envelope::cartesian_box(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_segment_t * = nullptr) { return strategy::envelope::cartesian_segment(); } template static auto envelope(Geometry const&, Box const&, std::enable_if_t < util::is_linestring::value || util::is_ring::value || util::is_polygon::value > * = nullptr) { return strategy::envelope::cartesian_range(); } template static auto envelope(Geometry const&, Box const&, std::enable_if_t < util::is_multi_linestring::value || util::is_multi_polygon::value || util::is_geometry_collection::value > * = nullptr) { return strategy::envelope::cartesian_boxes(); } }; namespace services { template struct default_strategy { using type = strategies::envelope::cartesian<>; }; template <> struct strategy_converter { static auto get(strategy::envelope::cartesian_point const& ) { return strategies::envelope::cartesian<>(); } }; template <> struct strategy_converter { static auto get(strategy::envelope::cartesian_multipoint const&) { return strategies::envelope::cartesian<>(); } }; template <> struct strategy_converter { static auto get(strategy::envelope::cartesian_box const& ) { return strategies::envelope::cartesian<>(); } }; template struct strategy_converter > { static auto get(strategy::envelope::cartesian_segment const&) { return strategies::envelope::cartesian(); } }; template struct strategy_converter > { static auto get(strategy::envelope::cartesian const&) { return strategies::envelope::cartesian(); } }; } // namespace services }} // namespace strategies::envelope }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_CARTESIAN_HPP