point_point.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
  5. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland
  6. // This file was modified by Oracle on 2013-2020.
  7. // Modifications copyright (c) 2013-2020, 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_EQUALS_POINT_POINT_HPP
  16. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_POINT_POINT_HPP
  17. #include <type_traits>
  18. #include <boost/geometry/strategies/detail.hpp>
  19. namespace boost { namespace geometry
  20. {
  21. #ifndef DOXYGEN_NO_DETAIL
  22. namespace detail { namespace equals
  23. {
  24. /*!
  25. \brief Internal utility function to detect of points are disjoint
  26. \note To avoid circular references
  27. */
  28. template
  29. <
  30. typename Point1, typename Point2, typename Strategy,
  31. std::enable_if_t<strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
  32. >
  33. inline bool equals_point_point(Point1 const& point1, Point2 const& point2,
  34. Strategy const& strategy)
  35. {
  36. typedef decltype(strategy.relate(point1, point2)) strategy_type;
  37. return strategy_type::apply(point1, point2);
  38. }
  39. template
  40. <
  41. typename Point1, typename Point2, typename Strategy,
  42. std::enable_if_t<! strategies::detail::is_umbrella_strategy<Strategy>::value, int> = 0
  43. >
  44. inline bool equals_point_point(Point1 const& point1, Point2 const& point2,
  45. Strategy const& )
  46. {
  47. return Strategy::apply(point1, point2);
  48. }
  49. }} // namespace detail::equals
  50. #endif // DOXYGEN_NO_DETAIL
  51. }} // namespace boost::geometry
  52. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_POINT_POINT_HPP