File indexing completed on 2025-01-18 09:36:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
0012
0013
0014 #include <type_traits>
0015
0016 #include <boost/geometry/strategy/cartesian/expand_box.hpp>
0017 #include <boost/geometry/strategy/cartesian/expand_point.hpp>
0018 #include <boost/geometry/strategy/cartesian/expand_segment.hpp>
0019
0020 #include <boost/geometry/strategies/detail.hpp>
0021 #include <boost/geometry/strategies/expand/services.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027
0028 namespace strategies { namespace expand
0029 {
0030
0031
0032 template <typename CalculationType = void>
0033 struct cartesian
0034 : strategies::detail::cartesian_base
0035 {
0036 template <typename Box, typename Geometry>
0037 static auto expand(Box const&, Geometry const&,
0038 typename util::enable_if_point_t<Geometry> * = nullptr)
0039 {
0040 return strategy::expand::cartesian_point();
0041 }
0042
0043 template <typename Box, typename Geometry>
0044 static auto expand(Box const&, Geometry const&,
0045 typename util::enable_if_box_t<Geometry> * = nullptr)
0046 {
0047 return strategy::expand::cartesian_box();
0048 }
0049
0050 template <typename Box, typename Geometry>
0051 static auto expand(Box const&, Geometry const&,
0052 typename util::enable_if_segment_t<Geometry> * = nullptr)
0053 {
0054 return strategy::expand::cartesian_segment();
0055 }
0056 };
0057
0058
0059 namespace services
0060 {
0061
0062 template <typename Box, typename Geometry>
0063 struct default_strategy<Box, Geometry, cartesian_tag>
0064 {
0065 using type = strategies::expand::cartesian<>;
0066 };
0067
0068
0069 template <>
0070 struct strategy_converter<strategy::expand::cartesian_point>
0071 {
0072 static auto get(strategy::expand::cartesian_point const& )
0073 {
0074 return strategies::expand::cartesian<>();
0075 }
0076 };
0077
0078 template <>
0079 struct strategy_converter<strategy::expand::cartesian_box>
0080 {
0081 static auto get(strategy::expand::cartesian_box const& )
0082 {
0083 return strategies::expand::cartesian<>();
0084 }
0085 };
0086
0087 template <>
0088 struct strategy_converter<strategy::expand::cartesian_segment>
0089 {
0090 static auto get(strategy::expand::cartesian_segment const&)
0091 {
0092 return strategies::expand::cartesian<>();
0093 }
0094 };
0095
0096
0097 }
0098
0099 }}
0100
0101 }}
0102
0103 #endif