Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:49:49

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
0007 
0008 // This file was modified by Oracle on 2013-2021.
0009 // Modifications copyright (c) 2013-2021, Oracle and/or its affiliates.
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0012 
0013 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0014 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0015 
0016 // Use, modification and distribution is subject to the Boost Software License,
0017 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0018 // http://www.boost.org/LICENSE_1_0.txt)
0019 
0020 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP
0021 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP
0022 
0023 #include <cstddef>
0024 
0025 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
0026 
0027 #include <boost/geometry/strategies/detail.hpp>
0028 
0029 namespace boost { namespace geometry
0030 {
0031 
0032 
0033 #ifndef DOXYGEN_NO_DETAIL
0034 namespace detail { namespace disjoint
0035 {
0036 
0037 
0038 /*!
0039     \brief Internal utility function to detect if boxes are disjoint
0040     \note Is used from other algorithms, declared separately
0041         to avoid circular references
0042  */
0043 template
0044 <
0045     typename Box1, typename Box2, typename Strategy,
0046     std::enable_if_t<strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0047 >
0048 inline bool disjoint_box_box(Box1 const& box1, Box2 const& box2, Strategy const& strategy)
0049 {
0050     typedef decltype(strategy.disjoint(box1, box2)) strategy_type;
0051     return strategy_type::apply(box1, box2);
0052 }
0053 
0054 template
0055 <
0056     typename Box1, typename Box2, typename Strategy,
0057     std::enable_if_t<! strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0058 >
0059 inline bool disjoint_box_box(Box1 const& box1, Box2 const& box2, Strategy const& )
0060 {
0061     return Strategy::apply(box1, box2);
0062 }
0063 
0064 
0065 }} // namespace detail::disjoint
0066 #endif // DOXYGEN_NO_DETAIL
0067 
0068 
0069 #ifndef DOXYGEN_NO_DISPATCH
0070 namespace dispatch
0071 {
0072 
0073 
0074 template <typename Box1, typename Box2, std::size_t DimensionCount>
0075 struct disjoint<Box1, Box2, DimensionCount, box_tag, box_tag, false>
0076 {
0077     template <typename Strategy>
0078     static inline bool apply(Box1 const& box1, Box2 const& box2, Strategy const& strategy)
0079     {
0080         typedef decltype(strategy.disjoint(box1, box2)) strategy_type;
0081         return strategy_type::apply(box1, box2);
0082     }
0083 };
0084 
0085 
0086 } // namespace dispatch
0087 #endif // DOXYGEN_NO_DISPATCH
0088 
0089 
0090 }} // namespace boost::geometry
0091 
0092 
0093 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP