point_box.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_POINT_BOX_HPP
  16. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP
  17. #include <cstddef>
  18. #include <boost/geometry/core/access.hpp>
  19. #include <boost/geometry/core/coordinate_dimension.hpp>
  20. #include <boost/geometry/core/tags.hpp>
  21. #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
  22. #include <boost/geometry/strategies/disjoint.hpp>
  23. namespace boost { namespace geometry
  24. {
  25. #ifndef DOXYGEN_NO_DETAIL
  26. namespace detail { namespace disjoint
  27. {
  28. /*!
  29. \brief Internal utility function to detect if point/box are disjoint
  30. */
  31. template <typename Point, typename Box, typename Strategy>
  32. inline bool disjoint_point_box(Point const& point, Box const& box, Strategy const& )
  33. {
  34. // ! covered_by(point, box)
  35. return ! Strategy::apply(point, box);
  36. }
  37. }} // namespace detail::disjoint
  38. #endif // DOXYGEN_NO_DETAIL
  39. #ifndef DOXYGEN_NO_DISPATCH
  40. namespace dispatch
  41. {
  42. template <typename Point, typename Box, std::size_t DimensionCount>
  43. struct disjoint<Point, Box, DimensionCount, point_tag, box_tag, false>
  44. {
  45. template <typename Strategy>
  46. static inline bool apply(Point const& point, Box const& box, Strategy const& )
  47. {
  48. // ! covered_by(point, box)
  49. return ! Strategy::apply(point, box);
  50. }
  51. };
  52. } // namespace dispatch
  53. #endif // DOXYGEN_NO_DISPATCH
  54. }} // namespace boost::geometry
  55. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_BOX_HPP