]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/io/cartesian.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / io / cartesian.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2019-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_IO_CARTESIAN_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_IO_CARTESIAN_HPP
12
13
14 #include <boost/geometry/strategies/detail.hpp>
15 #include <boost/geometry/strategies/io/services.hpp>
16
17 #include <boost/geometry/strategies/cartesian/point_order.hpp>
18 #include <boost/geometry/strategies/cartesian/point_in_point.hpp>
19 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
20
21
22 namespace boost { namespace geometry
23 {
24
25 namespace strategies { namespace io
26 {
27
28 template <typename CalculationType = void>
29 class cartesian
30 : public strategies::detail::cartesian_base
31 {
32 public:
33 static auto point_order()
34 {
35 return strategy::point_order::cartesian<CalculationType>();
36 }
37
38 template <typename Geometry1, typename Geometry2>
39 static auto relate(Geometry1 const&, Geometry2 const&,
40 std::enable_if_t
41 <
42 util::is_pointlike<Geometry1>::value
43 && util::is_pointlike<Geometry2>::value
44 > * = nullptr)
45 {
46 return strategy::within::cartesian_point_point();
47 }
48
49 template <typename Geometry1, typename Geometry2>
50 static auto relate(Geometry1 const&, Geometry2 const&,
51 std::enable_if_t
52 <
53 util::is_pointlike<Geometry1>::value
54 && ( util::is_linear<Geometry2>::value
55 || util::is_polygonal<Geometry2>::value )
56 > * = nullptr)
57 {
58 return strategy::within::cartesian_winding<void, void, CalculationType>();
59 }
60 };
61
62 namespace services
63 {
64
65 template <typename Geometry>
66 struct default_strategy<Geometry, cartesian_tag>
67 {
68 typedef cartesian<> type;
69 };
70
71 } // namespace services
72
73 }} // namespace strategies::io
74
75 }} // namespace boost::geometry
76
77 #endif // BOOST_GEOMETRY_STRATEGIES_IO_CARTESIAN_HPP