box_box.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
  5. // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
  6. // This file was modified by Oracle on 2013-2018.
  7. // Modifications copyright (c) 2013-2018, Oracle and/or its affiliates.
  8. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  9. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  10. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  11. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  12. // Use, modification and distribution is subject to the Boost Software License,
  13. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP
  16. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP
  17. #include <cstddef>
  18. #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
  19. // For backward compatibility
  20. #include <boost/geometry/strategies/cartesian/disjoint_box_box.hpp>
  21. #include <boost/geometry/strategies/spherical/disjoint_box_box.hpp>
  22. namespace boost { namespace geometry
  23. {
  24. #ifndef DOXYGEN_NO_DETAIL
  25. namespace detail { namespace disjoint
  26. {
  27. /*!
  28. \brief Internal utility function to detect if boxes are disjoint
  29. \note Is used from other algorithms, declared separately
  30. to avoid circular references
  31. */
  32. template <typename Box1, typename Box2, typename Strategy>
  33. inline bool disjoint_box_box(Box1 const& box1, Box2 const& box2, Strategy const&)
  34. {
  35. return Strategy::apply(box1, box2);
  36. }
  37. }} // namespace detail::disjoint
  38. #endif // DOXYGEN_NO_DETAIL
  39. #ifndef DOXYGEN_NO_DISPATCH
  40. namespace dispatch
  41. {
  42. template <typename Box1, typename Box2, std::size_t DimensionCount>
  43. struct disjoint<Box1, Box2, DimensionCount, box_tag, box_tag, false>
  44. {
  45. template <typename Strategy>
  46. static inline bool apply(Box1 const& box1, Box2 const& box2, Strategy const&)
  47. {
  48. return Strategy::apply(box1, box2);
  49. }
  50. };
  51. } // namespace dispatch
  52. #endif // DOXYGEN_NO_DISPATCH
  53. }} // namespace boost::geometry
  54. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP