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>
33 struct cartesian : strategies::detail::cartesian_base
35 template <typename Box, typename Geometry>
36 static auto expand(Box const&, Geometry const&,
37 typename util::enable_if_point_t<Geometry> * = nullptr)
39 return strategy::expand::cartesian_point();
42 template <typename Box, typename Geometry>
43 static auto expand(Box const&, Geometry const&,
44 typename util::enable_if_box_t<Geometry> * = nullptr)
46 return strategy::expand::cartesian_box();
49 template <typename Box, typename Geometry>
50 static auto expand(Box const&, Geometry const&,
51 typename util::enable_if_segment_t<Geometry> * = nullptr)
53 return strategy::expand::cartesian_segment();
61 template <typename Box, typename Geometry>
62 struct default_strategy<Box, Geometry, cartesian_tag>
64 using type = strategies::expand::cartesian<>;
69 struct strategy_converter<strategy::expand::cartesian_point>
71 static auto get(strategy::expand::cartesian_point const& )
73 return strategies::expand::cartesian<>();
78 struct strategy_converter<strategy::expand::cartesian_box>
80 static auto get(strategy::expand::cartesian_box const& )
82 return strategies::expand::cartesian<>();
87 struct strategy_converter<strategy::expand::cartesian_segment>
89 static auto get(strategy::expand::cartesian_segment const&)
91 return strategies::expand::cartesian<>();
96 } // namespace services
98 }} // namespace strategies::envelope
100 }} // namespace boost::geometry
102 #endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP