File indexing completed on 2025-01-18 09:36:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
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 }
0077 #endif
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 }
0104
0105
0106 #endif
0107
0108
0109 }}}}
0110
0111
0112 #endif