Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:42

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-2018.
0009 // Modifications copyright (c) 2013-2018, 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_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP
0022 #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP
0023 
0024 #include <cstddef>
0025 
0026 #include <boost/geometry/core/access.hpp>
0027 #include <boost/geometry/core/coordinate_dimension.hpp>
0028 #include <boost/geometry/core/tags.hpp>
0029 
0030 #include <boost/geometry/strategies/disjoint.hpp>
0031 
0032 
0033 namespace boost { namespace geometry { namespace strategy { namespace disjoint
0034 {
0035 
0036 #ifndef DOXYGEN_NO_DETAIL
0037 namespace detail
0038 {
0039 
0040 template
0041 <
0042     typename Box1, typename Box2,
0043     std::size_t Dimension = 0,
0044     std::size_t DimensionCount = dimension<Box1>::value
0045 >
0046 struct box_box
0047 {
0048     static inline bool apply(Box1 const& box1, Box2 const& box2)
0049     {
0050         if (get<max_corner, Dimension>(box1) < get<min_corner, Dimension>(box2))
0051         {
0052             return true;
0053         }
0054         if (get<min_corner, Dimension>(box1) > get<max_corner, Dimension>(box2))
0055         {
0056             return true;
0057         }
0058         return box_box
0059             <
0060                 Box1, Box2,
0061                 Dimension + 1, DimensionCount
0062             >::apply(box1, box2);
0063     }
0064 };
0065 
0066 
0067 template <typename Box1, typename Box2, std::size_t DimensionCount>
0068 struct box_box<Box1, Box2, DimensionCount, DimensionCount>
0069 {
0070     static inline bool apply(Box1 const& , Box2 const& )
0071     {
0072         return false;
0073     }
0074 };
0075 
0076 } // namespace detail
0077 #endif // DOXYGEN_NO_DETAIL
0078 
0079 
0080 struct cartesian_box_box
0081 {
0082     template <typename Box1, typename Box2>
0083     static inline bool apply(Box1 const& box1, Box2 const& box2)
0084     {
0085         return detail::box_box<Box1, Box2>::apply(box1, box2);
0086     }
0087 };
0088 
0089 
0090 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0091 
0092 
0093 namespace services
0094 {
0095 
0096 template <typename Box1, typename Box2, int TopDim1, int TopDim2>
0097 struct default_strategy<Box1, Box2, box_tag, box_tag, TopDim1, TopDim2, cartesian_tag, cartesian_tag>
0098 {
0099     typedef disjoint::cartesian_box_box type;
0100 };
0101 
0102 
0103 } // namespace services
0104 
0105 
0106 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0107 
0108 
0109 }}}} // namespace boost::geometry::strategy::disjoint
0110 
0111 
0112 #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP