point_in_point.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2014-2017 Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
  8. #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
  9. #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
  10. #include <boost/geometry/strategies/covered_by.hpp>
  11. #include <boost/geometry/strategies/within.hpp>
  12. namespace boost { namespace geometry
  13. {
  14. namespace strategy { namespace within
  15. {
  16. template
  17. <
  18. typename Point1, typename Point2
  19. >
  20. struct point_in_point
  21. {
  22. static inline bool apply(Point1 const& point1, Point2 const& point2)
  23. {
  24. return geometry::detail::equals::equals_point_point(point1, point2);
  25. }
  26. };
  27. #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  28. namespace services
  29. {
  30. template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2, typename AnyCS1, typename AnyCS2>
  31. struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, AnyCS1, AnyCS2>
  32. {
  33. typedef strategy::within::point_in_point
  34. <
  35. typename point_type<PointLike1>::type,
  36. typename point_type<PointLike2>::type
  37. > type;
  38. };
  39. } // namespace services
  40. #endif
  41. }} // namespace strategy::within
  42. #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  43. namespace strategy { namespace covered_by { namespace services
  44. {
  45. template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2, typename AnyCS1, typename AnyCS2>
  46. struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, AnyCS1, AnyCS2>
  47. {
  48. typedef strategy::within::point_in_point
  49. <
  50. typename point_type<PointLike1>::type,
  51. typename point_type<PointLike2>::type
  52. > type;
  53. };
  54. }}} // namespace strategy::covered_by::services
  55. #endif
  56. }} // namespace boost::geometry
  57. #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP