]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/line_interpolate/cartesian.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / line_interpolate / cartesian.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2021, 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_LINE_INTERPOLATE_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_LINE_INTERPOLATE_CARTESIAN_HPP
12
13
14 #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
15 #include <boost/geometry/strategies/cartesian/line_interpolate.hpp>
16
17 #include <boost/geometry/strategies/detail.hpp>
18 #include <boost/geometry/strategies/distance/detail.hpp>
19 #include <boost/geometry/strategies/line_interpolate/services.hpp>
20
21 #include <boost/geometry/util/type_traits.hpp>
22
23
24 namespace boost { namespace geometry
25 {
26
27 namespace strategies { namespace line_interpolate
28 {
29
30 template <typename CalculationType = void>
31 struct cartesian
32 : public strategies::detail::cartesian_base
33 {
34 template <typename Geometry1, typename Geometry2>
35 static auto distance(Geometry1 const&, Geometry2 const&,
36 distance::detail::enable_if_pp_t<Geometry1, Geometry2> * = nullptr)
37 {
38 return strategy::distance::pythagoras<CalculationType>();
39 }
40
41 template <typename Geometry>
42 static auto line_interpolate(Geometry const&)
43 {
44 return strategy::line_interpolate::cartesian<CalculationType>();
45 }
46 };
47
48
49 namespace services
50 {
51
52 template <typename Geometry>
53 struct default_strategy<Geometry, cartesian_tag>
54 {
55 using type = strategies::line_interpolate::cartesian<>;
56 };
57
58
59 template <typename CT, typename DS>
60 struct strategy_converter<strategy::line_interpolate::cartesian<CT, DS> >
61 {
62 static auto get(strategy::line_interpolate::cartesian<CT, DS> const&)
63 {
64 return strategies::line_interpolate::cartesian<CT>();
65 }
66 };
67
68
69 } // namespace services
70
71 }} // namespace strategies::line_interpolate
72
73 }} // namespace boost::geometry
74
75 #endif // BOOST_GEOMETRY_STRATEGIES_LINE_INTERPOLATE_CARTESIAN_HPP