1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
6 // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
8 // This file was modified by Oracle on 2013-2018.
9 // Modifications copyright (c) 2013-2018, Oracle and/or its affiliates.
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
14 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
17 // Use, modification and distribution is subject to the Boost Software License,
18 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
21 #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP
22 #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP
26 #include <boost/geometry/core/access.hpp>
27 #include <boost/geometry/core/coordinate_dimension.hpp>
28 #include <boost/geometry/core/tags.hpp>
30 #include <boost/geometry/strategies/disjoint.hpp>
33 namespace boost { namespace geometry { namespace strategy { namespace disjoint
36 #ifndef DOXYGEN_NO_DETAIL
42 typename Box1, typename Box2,
43 std::size_t Dimension = 0,
44 std::size_t DimensionCount = dimension<Box1>::value
48 static inline bool apply(Box1 const& box1, Box2 const& box2)
50 if (get<max_corner, Dimension>(box1) < get<min_corner, Dimension>(box2))
54 if (get<min_corner, Dimension>(box1) > get<max_corner, Dimension>(box2))
61 Dimension + 1, DimensionCount
67 template <typename Box1, typename Box2, std::size_t DimensionCount>
68 struct box_box<Box1, Box2, DimensionCount, DimensionCount>
70 static inline bool apply(Box1 const& , Box2 const& )
77 #endif // DOXYGEN_NO_DETAIL
80 struct cartesian_box_box
82 template <typename Box1, typename Box2>
83 static inline bool apply(Box1 const& box1, Box2 const& box2)
85 return detail::box_box<Box1, Box2>::apply(box1, box2);
90 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
96 template <typename Box1, typename Box2, int TopDim1, int TopDim2>
97 struct default_strategy<Box1, Box2, box_tag, box_tag, TopDim1, TopDim2, cartesian_tag, cartesian_tag>
99 typedef disjoint::cartesian_box_box type;
103 } // namespace services
106 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
109 }}}} // namespace boost::geometry::strategy::disjoint
112 #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISJOINT_BOX_BOX_HPP