Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:10:18

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_POINT_BOX_HPP
0021 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP
0022 
0023 #include <cstddef>
0024 
0025 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
0026 
0027 #include <boost/geometry/core/access.hpp>
0028 #include <boost/geometry/core/coordinate_dimension.hpp>
0029 #include <boost/geometry/core/tags.hpp>
0030 
0031 #include <boost/geometry/strategies/detail.hpp>
0032 
0033 namespace boost { namespace geometry
0034 {
0035 
0036 #ifndef DOXYGEN_NO_DETAIL
0037 namespace detail { namespace disjoint
0038 {
0039 
0040 
0041 /*!
0042     \brief Internal utility function to detect if point/box are disjoint
0043  */
0044 template
0045 <
0046     typename Point, typename Box, typename Strategy,
0047     std::enable_if_t<strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0048 >
0049 inline bool disjoint_point_box(Point const& point, Box const& box,
0050                                Strategy const& strategy)
0051 {
0052     typedef decltype(strategy.covered_by(point, box)) strategy_type;
0053     // ! covered_by(point, box)
0054     return ! strategy_type::apply(point, box);
0055 }
0056 
0057 template
0058 <
0059     typename Point, typename Box, typename Strategy,
0060     std::enable_if_t<! strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0061 >
0062 inline bool disjoint_point_box(Point const& point, Box const& box,
0063                                Strategy const& )
0064 {
0065     // ! covered_by(point, box)
0066     return ! Strategy::apply(point, box);
0067 }
0068 
0069 
0070 }} // namespace detail::disjoint
0071 #endif // DOXYGEN_NO_DETAIL
0072 
0073 
0074 #ifndef DOXYGEN_NO_DISPATCH
0075 namespace dispatch
0076 {
0077 
0078 
0079 template <typename Point, typename Box, std::size_t DimensionCount>
0080 struct disjoint<Point, Box, DimensionCount, point_tag, box_tag, false>
0081 {
0082     template <typename Strategy>
0083     static inline bool apply(Point const& point, Box const& box,
0084                              Strategy const& strategy)
0085     {
0086         typedef decltype(strategy.covered_by(point, box)) strategy_type;
0087         // ! covered_by(point, box)
0088         return ! strategy_type::apply(point, box);
0089     }
0090 };
0091 
0092 
0093 } // namespace dispatch
0094 #endif // DOXYGEN_NO_DISPATCH
0095 
0096 }} // namespace boost::geometry
0097 
0098 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP