]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/expand/cartesian.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / expand / cartesian.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2020, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
6
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
9
10 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
12
13
14 #include <type_traits>
15
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>
19
20 #include <boost/geometry/strategies/detail.hpp>
21 #include <boost/geometry/strategies/expand/services.hpp>
22
23
24 namespace boost { namespace geometry
25 {
26
27
28 namespace strategies { namespace expand
29 {
30
31
32 template <typename CalculationType = void>
33 struct cartesian
34 : strategies::detail::cartesian_base
35 {
36 template <typename Box, typename Geometry>
37 static auto expand(Box const&, Geometry const&,
38 typename util::enable_if_point_t<Geometry> * = nullptr)
39 {
40 return strategy::expand::cartesian_point();
41 }
42
43 template <typename Box, typename Geometry>
44 static auto expand(Box const&, Geometry const&,
45 typename util::enable_if_box_t<Geometry> * = nullptr)
46 {
47 return strategy::expand::cartesian_box();
48 }
49
50 template <typename Box, typename Geometry>
51 static auto expand(Box const&, Geometry const&,
52 typename util::enable_if_segment_t<Geometry> * = nullptr)
53 {
54 return strategy::expand::cartesian_segment();
55 }
56 };
57
58
59 namespace services
60 {
61
62 template <typename Box, typename Geometry>
63 struct default_strategy<Box, Geometry, cartesian_tag>
64 {
65 using type = strategies::expand::cartesian<>;
66 };
67
68
69 template <>
70 struct strategy_converter<strategy::expand::cartesian_point>
71 {
72 static auto get(strategy::expand::cartesian_point const& )
73 {
74 return strategies::expand::cartesian<>();
75 }
76 };
77
78 template <>
79 struct strategy_converter<strategy::expand::cartesian_box>
80 {
81 static auto get(strategy::expand::cartesian_box const& )
82 {
83 return strategies::expand::cartesian<>();
84 }
85 };
86
87 template <>
88 struct strategy_converter<strategy::expand::cartesian_segment>
89 {
90 static auto get(strategy::expand::cartesian_segment const&)
91 {
92 return strategies::expand::cartesian<>();
93 }
94 };
95
96
97 } // namespace services
98
99 }} // namespace strategies::envelope
100
101 }} // namespace boost::geometry
102
103 #endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP