]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/strategies/expand/spherical.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / strategies / expand / spherical.hpp
CommitLineData
20effc67
TL
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_SPHERICAL_HPP
11#define BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP
12
13
14#include <type_traits>
15
16#include <boost/geometry/strategy/spherical/expand_box.hpp>
17#include <boost/geometry/strategy/spherical/expand_point.hpp>
18#include <boost/geometry/strategy/spherical/expand_segment.hpp>
19
20#include <boost/geometry/strategies/detail.hpp>
21#include <boost/geometry/strategies/expand/services.hpp>
22
23
24namespace boost { namespace geometry
25{
26
27
28namespace strategies { namespace expand
29{
30
31template
32<
33 typename CalculationType = void
34>
35class spherical : strategies::detail::spherical_base<void>
36{
37 using base_t = strategies::detail::spherical_base<void>;
38
39public:
40 template <typename Box, typename Geometry>
41 static auto expand(Box const&, Geometry const&,
42 typename util::enable_if_point_t<Geometry> * = nullptr)
43 {
44 return strategy::expand::spherical_point();
45 }
46
47 template <typename Box, typename Geometry>
48 static auto expand(Box const&, Geometry const&,
49 typename util::enable_if_box_t<Geometry> * = nullptr)
50 {
51 return strategy::expand::spherical_box();
52 }
53
54 template <typename Box, typename Geometry>
55 static auto expand(Box const&, Geometry const&,
56 typename util::enable_if_segment_t<Geometry> * = nullptr)
57 {
58 return strategy::expand::spherical_segment<CalculationType>();
59 }
60};
61
62
63namespace services
64{
65
66template <typename Box, typename Geometry>
67struct default_strategy<Box, Geometry, spherical_tag>
68{
69 using type = strategies::expand::spherical<>;
70};
71
72template <typename Box, typename Geometry>
73struct default_strategy<Box, Geometry, spherical_equatorial_tag>
74{
75 using type = strategies::expand::spherical<>;
76};
77
78template <typename Box, typename Geometry>
79struct default_strategy<Box, Geometry, spherical_polar_tag>
80{
81 using type = strategies::expand::spherical<>;
82};
83
84
85template <>
86struct strategy_converter<strategy::expand::spherical_point>
87{
88 static auto get(strategy::expand::spherical_point const& )
89 {
90 return strategies::expand::spherical<>();
91 }
92};
93
94template <>
95struct strategy_converter<strategy::expand::spherical_box>
96{
97 static auto get(strategy::expand::spherical_box const& )
98 {
99 return strategies::expand::spherical<>();
100 }
101};
102
103template <typename CT>
104struct strategy_converter<strategy::expand::spherical_segment<CT> >
105{
106 static auto get(strategy::expand::spherical_segment<CT> const&)
107 {
108 return strategies::expand::spherical<CT>();
109 }
110};
111
112
113} // namespace services
114
115}} // namespace strategies::envelope
116
117}} // namespace boost::geometry
118
119#endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP