1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
11 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
13 #include <boost/range.hpp>
15 #include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
16 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
19 namespace boost { namespace geometry
23 #ifndef DOXYGEN_NO_DETAIL
24 namespace detail { namespace disjoint
28 template <typename Geometry, typename BinaryPredicate>
29 class unary_disjoint_geometry_to_query_geometry
32 unary_disjoint_geometry_to_query_geometry(Geometry const& geometry)
33 : m_geometry(geometry)
36 template <typename QueryGeometry>
37 inline bool apply(QueryGeometry const& query_geometry) const
39 return BinaryPredicate::apply(query_geometry, m_geometry);
43 Geometry const& m_geometry;
47 template<typename MultiRange, typename ConstantSizeGeometry>
48 struct multirange_constant_size_geometry
50 static inline bool apply(MultiRange const& multirange,
51 ConstantSizeGeometry const& constant_size_geometry)
53 typedef unary_disjoint_geometry_to_query_geometry
58 typename boost::range_value<MultiRange>::type,
61 > unary_predicate_type;
63 return detail::check_iterator_range
66 >::apply(boost::begin(multirange), boost::end(multirange),
67 unary_predicate_type(constant_size_geometry));
70 static inline bool apply(ConstantSizeGeometry const& constant_size_geometry,
71 MultiRange const& multirange)
73 return apply(multirange, constant_size_geometry);
78 }} // namespace detail::disjoint
79 #endif // DOXYGEN_NO_DETAIL
82 }} // namespace boost::geometry
85 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP