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-2020.
0009 // Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
0010 
0011 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0012 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0013 
0014 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0015 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0016 
0017 // Use, modification and distribution is subject to the Boost Software License,
0018 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0019 // http://www.boost.org/LICENSE_1_0.txt)
0020 
0021 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_POINT_HPP
0022 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_POINT_HPP
0023 
0024 #include <cstddef>
0025 #include <type_traits>
0026 
0027 #include <boost/geometry/core/tags.hpp>
0028 
0029 #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
0030 
0031 #include <boost/geometry/strategies/detail.hpp>
0032 
0033 // For backward compatibility
0034 #include <boost/geometry/strategies/disjoint.hpp>
0035 #include <boost/geometry/strategies/cartesian/point_in_point.hpp>
0036 #include <boost/geometry/strategies/spherical/point_in_point.hpp>
0037 
0038 
0039 namespace boost { namespace geometry
0040 {
0041 
0042 
0043 #ifndef DOXYGEN_NO_DETAIL
0044 namespace detail { namespace disjoint
0045 {
0046 
0047 
0048 /*!
0049     \brief Internal utility function to detect of points are disjoint
0050     \note To avoid circular references
0051  */
0052 template
0053 <
0054     typename Point1, typename Point2, typename Strategy,
0055     std::enable_if_t<strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0056 >
0057 inline bool disjoint_point_point(Point1 const& point1, Point2 const& point2,
0058                                  Strategy const& strategy)
0059 {
0060     typedef decltype(strategy.relate(point1, point2)) strategy_type;
0061     // ! within(point1, point2)
0062     return ! strategy_type::apply(point1, point2);
0063 }
0064 
0065 template
0066 <
0067     typename Point1, typename Point2, typename Strategy,
0068     std::enable_if_t<! strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
0069 >
0070 inline bool disjoint_point_point(Point1 const& point1, Point2 const& point2,
0071                                  Strategy const& )
0072 {
0073     // ! within(point1, point2)
0074     return ! Strategy::apply(point1, point2);
0075 }
0076 
0077 
0078 }} // namespace detail::disjoint
0079 #endif // DOXYGEN_NO_DETAIL
0080 
0081 
0082 #ifndef DOXYGEN_NO_DISPATCH
0083 namespace dispatch
0084 {
0085 
0086 
0087 template <typename Point1, typename Point2, std::size_t DimensionCount>
0088 struct disjoint<Point1, Point2, DimensionCount, point_tag, point_tag, false>
0089 {
0090     template <typename Strategy>
0091     static inline bool apply(Point1 const& point1, Point2 const& point2,
0092                              Strategy const& strategy)
0093     {
0094         typedef decltype(strategy.relate(point1, point2)) strategy_type;
0095         // ! within(point1, point2)
0096         return ! strategy_type::apply(point1, point2);
0097     }
0098 };
0099 
0100 
0101 } // namespace dispatch
0102 #endif // DOXYGEN_NO_DISPATCH
0103 
0104 }} // namespace boost::geometry
0105 
0106 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_POINT_HPP