1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014-2017, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
11 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
12 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
14 #include <boost/range.hpp>
16 #include <boost/geometry/algorithms/detail/check_iterator_range.hpp>
17 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
20 namespace boost { namespace geometry
24 #ifndef DOXYGEN_NO_DETAIL
25 namespace detail { namespace disjoint
29 template <typename Geometry, typename Strategy, typename BinaryPredicate>
30 class unary_disjoint_geometry_to_query_geometry
33 unary_disjoint_geometry_to_query_geometry(Geometry const& geometry,
34 Strategy const& strategy)
35 : m_geometry(geometry)
36 , m_strategy(strategy)
39 template <typename QueryGeometry>
40 inline bool apply(QueryGeometry const& query_geometry) const
42 return BinaryPredicate::apply(query_geometry, m_geometry, m_strategy);
46 Geometry const& m_geometry;
47 Strategy const& m_strategy;
51 template<typename MultiRange, typename ConstantSizeGeometry>
52 struct multirange_constant_size_geometry
54 template <typename Strategy>
55 static inline bool apply(MultiRange const& multirange,
56 ConstantSizeGeometry const& constant_size_geometry,
57 Strategy const& strategy)
59 typedef unary_disjoint_geometry_to_query_geometry
65 typename boost::range_value<MultiRange>::type,
68 > unary_predicate_type;
70 return detail::check_iterator_range
73 >::apply(boost::begin(multirange), boost::end(multirange),
74 unary_predicate_type(constant_size_geometry, strategy));
77 template <typename Strategy>
78 static inline bool apply(ConstantSizeGeometry const& constant_size_geometry,
79 MultiRange const& multirange,
80 Strategy const& strategy)
82 return apply(multirange, constant_size_geometry, strategy);
87 }} // namespace detail::disjoint
88 #endif // DOXYGEN_NO_DETAIL
91 }} // namespace boost::geometry
94 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP