3 // Copyright (c) 2020, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
14 #include <type_traits>
16 #include <boost/geometry/strategy/cartesian/expand_box.hpp>
17 #include <boost/geometry/strategy/cartesian/expand_point.hpp>
18 #include <boost/geometry/strategy/cartesian/expand_segment.hpp>
20 #include <boost/geometry/strategies/detail.hpp>
21 #include <boost/geometry/strategies/expand/services.hpp>
24 namespace boost { namespace geometry
28 namespace strategies { namespace expand
32 template <typename CalculationType = void>
34 : strategies::detail::cartesian_base
36 template <typename Box, typename Geometry>
37 static auto expand(Box const&, Geometry const&,
38 typename util::enable_if_point_t<Geometry> * = nullptr)
40 return strategy::expand::cartesian_point();
43 template <typename Box, typename Geometry>
44 static auto expand(Box const&, Geometry const&,
45 typename util::enable_if_box_t<Geometry> * = nullptr)
47 return strategy::expand::cartesian_box();
50 template <typename Box, typename Geometry>
51 static auto expand(Box const&, Geometry const&,
52 typename util::enable_if_segment_t<Geometry> * = nullptr)
54 return strategy::expand::cartesian_segment();
62 template <typename Box, typename Geometry>
63 struct default_strategy<Box, Geometry, cartesian_tag>
65 using type = strategies::expand::cartesian<>;
70 struct strategy_converter<strategy::expand::cartesian_point>
72 static auto get(strategy::expand::cartesian_point const& )
74 return strategies::expand::cartesian<>();
79 struct strategy_converter<strategy::expand::cartesian_box>
81 static auto get(strategy::expand::cartesian_box const& )
83 return strategies::expand::cartesian<>();
88 struct strategy_converter<strategy::expand::cartesian_segment>
90 static auto get(strategy::expand::cartesian_segment const&)
92 return strategies::expand::cartesian<>();
97 } // namespace services
99 }} // namespace strategies::envelope
101 }} // namespace boost::geometry
103 #endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP