point_point.hpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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, 2014, 2015, 2017, 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_POINT_HPP
  16. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_POINT_HPP
  17. #include <cstddef>
  18. #include <boost/geometry/core/tags.hpp>
  19. #include <boost/geometry/algorithms/dispatch/disjoint.hpp>
  20. // For backward compatibility
  21. #include <boost/geometry/strategies/disjoint.hpp>
  22. #include <boost/geometry/strategies/cartesian/point_in_point.hpp>
  23. #include <boost/geometry/strategies/spherical/point_in_point.hpp>
  24. namespace boost { namespace geometry
  25. {
  26. #ifndef DOXYGEN_NO_DETAIL
  27. namespace detail { namespace disjoint
  28. {
  29. /*!
  30. \brief Internal utility function to detect of points are disjoint
  31. \note To avoid circular references
  32. */
  33. template <typename Point1, typename Point2, typename Strategy>
  34. inline bool disjoint_point_point(Point1 const& point1, Point2 const& point2,
  35. Strategy const& )
  36. {
  37. return ! Strategy::apply(point1, point2);
  38. }
  39. }} // namespace detail::disjoint
  40. #endif // DOXYGEN_NO_DETAIL
  41. #ifndef DOXYGEN_NO_DISPATCH
  42. namespace dispatch
  43. {
  44. template <typename Point1, typename Point2, std::size_t DimensionCount>
  45. struct disjoint<Point1, Point2, DimensionCount, point_tag, point_tag, false>
  46. {
  47. template <typename Strategy>
  48. static inline bool apply(Point1 const& point1, Point2 const& point2,
  49. Strategy const& )
  50. {
  51. return ! Strategy::apply(point1, point2);
  52. }
  53. };
  54. } // namespace dispatch
  55. #endif // DOXYGEN_NO_DISPATCH
  56. }} // namespace boost::geometry
  57. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_POINT_POINT_HPP