]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/expand/cartesian.hpp
import quincy beta 17.1.0
[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 : strategies::detail::cartesian_base
34 {
35 template <typename Box, typename Geometry>
36 static auto expand(Box const&, Geometry const&,
37 typename util::enable_if_point_t<Geometry> * = nullptr)
38 {
39 return strategy::expand::cartesian_point();
40 }
41
42 template <typename Box, typename Geometry>
43 static auto expand(Box const&, Geometry const&,
44 typename util::enable_if_box_t<Geometry> * = nullptr)
45 {
46 return strategy::expand::cartesian_box();
47 }
48
49 template <typename Box, typename Geometry>
50 static auto expand(Box const&, Geometry const&,
51 typename util::enable_if_segment_t<Geometry> * = nullptr)
52 {
53 return strategy::expand::cartesian_segment();
54 }
55 };
56
57
58 namespace services
59 {
60
61 template <typename Box, typename Geometry>
62 struct default_strategy<Box, Geometry, cartesian_tag>
63 {
64 using type = strategies::expand::cartesian<>;
65 };
66
67
68 template <>
69 struct strategy_converter<strategy::expand::cartesian_point>
70 {
71 static auto get(strategy::expand::cartesian_point const& )
72 {
73 return strategies::expand::cartesian<>();
74 }
75 };
76
77 template <>
78 struct strategy_converter<strategy::expand::cartesian_box>
79 {
80 static auto get(strategy::expand::cartesian_box const& )
81 {
82 return strategies::expand::cartesian<>();
83 }
84 };
85
86 template <>
87 struct strategy_converter<strategy::expand::cartesian_segment>
88 {
89 static auto get(strategy::expand::cartesian_segment const&)
90 {
91 return strategies::expand::cartesian<>();
92 }
93 };
94
95
96 } // namespace services
97
98 }} // namespace strategies::envelope
99
100 }} // namespace boost::geometry
101
102 #endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP