]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/include/boost/geometry/algorithms/detail/disjoint/multirange_geometry.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / include / boost / geometry / algorithms / detail / disjoint / multirange_geometry.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2014, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Menelaos Karavelas, 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_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
11 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
12
13 #include <boost/range.hpp>
14
15 #include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
16 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
17
18
19 namespace boost { namespace geometry
20 {
21
22
23 #ifndef DOXYGEN_NO_DETAIL
24 namespace detail { namespace disjoint
25 {
26
27
28 template <typename Geometry, typename BinaryPredicate>
29 class unary_disjoint_geometry_to_query_geometry
30 {
31 public:
32 unary_disjoint_geometry_to_query_geometry(Geometry const& geometry)
33 : m_geometry(geometry)
34 {}
35
36 template <typename QueryGeometry>
37 inline bool apply(QueryGeometry const& query_geometry) const
38 {
39 return BinaryPredicate::apply(query_geometry, m_geometry);
40 }
41
42 private:
43 Geometry const& m_geometry;
44 };
45
46
47 template<typename MultiRange, typename ConstantSizeGeometry>
48 struct multirange_constant_size_geometry
49 {
50 static inline bool apply(MultiRange const& multirange,
51 ConstantSizeGeometry const& constant_size_geometry)
52 {
53 typedef unary_disjoint_geometry_to_query_geometry
54 <
55 ConstantSizeGeometry,
56 dispatch::disjoint
57 <
58 typename boost::range_value<MultiRange>::type,
59 ConstantSizeGeometry
60 >
61 > unary_predicate_type;
62
63 return detail::check_iterator_range
64 <
65 unary_predicate_type
66 >::apply(boost::begin(multirange), boost::end(multirange),
67 unary_predicate_type(constant_size_geometry));
68 }
69
70 static inline bool apply(ConstantSizeGeometry const& constant_size_geometry,
71 MultiRange const& multirange)
72 {
73 return apply(multirange, constant_size_geometry);
74 }
75 };
76
77
78 }} // namespace detail::disjoint
79 #endif // DOXYGEN_NO_DETAIL
80
81
82 }} // namespace boost::geometry
83
84
85 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP