Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:03

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2014-2023, Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0006 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Licensed under the Boost Software License version 1.0.
0010 // http://www.boost.org/users/license.html
0011 
0012 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
0013 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP
0014 
0015 #include <algorithm>
0016 
0017 #include <boost/range/begin.hpp>
0018 #include <boost/range/end.hpp>
0019 #include <boost/range/value_type.hpp>
0020 
0021 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
0022 
0023 
0024 namespace boost { namespace geometry
0025 {
0026 
0027 
0028 #ifndef DOXYGEN_NO_DETAIL
0029 namespace detail { namespace disjoint
0030 {
0031 
0032 
0033 template <typename Geometry, typename Strategy, typename BinaryPredicate>
0034 class unary_disjoint_geometry_to_query_geometry
0035 {
0036 public:
0037     unary_disjoint_geometry_to_query_geometry(Geometry const& geometry,
0038                                                   Strategy const& strategy)
0039         : m_geometry(geometry)
0040         , m_strategy(strategy)
0041     {}
0042 
0043     template <typename QueryGeometry>
0044     inline bool operator()(QueryGeometry const& query_geometry) const
0045     {
0046         return BinaryPredicate::apply(query_geometry, m_geometry, m_strategy);
0047     }
0048 
0049 private:
0050     Geometry const& m_geometry;
0051     Strategy const& m_strategy;
0052 };
0053 
0054 
0055 template<typename MultiRange, typename ConstantSizeGeometry>
0056 struct multirange_constant_size_geometry
0057 {
0058     template <typename Strategy>
0059     static inline bool apply(MultiRange const& multirange,
0060                              ConstantSizeGeometry const& constant_size_geometry,
0061                              Strategy const& strategy)
0062     {
0063         using disjoint = unary_disjoint_geometry_to_query_geometry
0064             <
0065                 ConstantSizeGeometry,
0066                 Strategy,
0067                 dispatch::disjoint
0068                     <
0069                         typename boost::range_value<MultiRange>::type,
0070                         ConstantSizeGeometry
0071                     >
0072             >;
0073 
0074         return std::all_of(boost::begin(multirange),
0075                            boost::end(multirange),
0076                            disjoint(constant_size_geometry, strategy));
0077     }
0078 
0079     template <typename Strategy>
0080     static inline bool apply(ConstantSizeGeometry const& constant_size_geometry,
0081                              MultiRange const& multirange,
0082                              Strategy const& strategy)
0083     {
0084         return apply(multirange, constant_size_geometry, strategy);
0085     }
0086 };
0087 
0088 
0089 }} // namespace detail::disjoint
0090 #endif // DOXYGEN_NO_DETAIL
0091 
0092 
0093 }} // namespace boost::geometry
0094 
0095 
0096 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_MULTIRANGE_GEOMETRY_HPP