// Boost.Geometry // Copyright (c) 2020-2022, 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_SPHERICAL_HPP #define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SPHERICAL_HPP #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { namespace strategies { namespace envelope { #ifndef DOXYGEN_NO_DETAIL namespace detail { template struct spherical : strategies::expand::detail::spherical { spherical() = default; template explicit spherical(RadiusOrSphere const& radius_or_sphere) : strategies::expand::detail::spherical(radius_or_sphere) {} template static auto envelope(Geometry const&, Box const&, util::enable_if_point_t * = nullptr) { return strategy::envelope::spherical_point(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_multi_point_t * = nullptr) { return strategy::envelope::spherical_multipoint(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_box_t * = nullptr) { return strategy::envelope::spherical_box(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_segment_t * = nullptr) { return strategy::envelope::spherical_segment(); } template static auto envelope(Geometry const&, Box const&, util::enable_if_linestring_t * = nullptr) { return strategy::envelope::spherical_linestring(); } template static auto envelope(Geometry const&, Box const&, std::enable_if_t < util::is_ring::value || util::is_polygon::value > * = nullptr) { return strategy::envelope::spherical_ring(); } 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::spherical_boxes(); } }; } // namespace detail #endif // DOXYGEN_NO_DETAIL template class spherical : public strategies::envelope::detail::spherical {}; namespace services { template struct default_strategy { using type = strategies::envelope::spherical<>; }; template struct default_strategy { using type = strategies::envelope::spherical<>; }; template struct default_strategy { using type = strategies::envelope::spherical<>; }; template <> struct strategy_converter { static auto get(strategy::envelope::spherical_point const& ) { return strategies::envelope::spherical<>(); } }; template <> struct strategy_converter { static auto get(strategy::envelope::spherical_multipoint const&) { return strategies::envelope::spherical<>(); } }; template <> struct strategy_converter { static auto get(strategy::envelope::spherical_box const& ) { return strategies::envelope::spherical<>(); } }; template struct strategy_converter > { static auto get(strategy::envelope::spherical_segment const&) { return strategies::envelope::spherical(); } }; template struct strategy_converter > { static auto get(strategy::envelope::spherical const&) { return strategies::envelope::spherical(); } }; } // namespace services }} // namespace strategies::envelope }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SPHERICAL_HPP