implementation_gc.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Boost.Geometry
  2. // Copyright (c) 2022 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_ALGORITHMS_DETAIL_EQUALS_IMPLEMENTATION_GC_HPP
  8. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_IMPLEMENTATION_GC_HPP
  9. #include <boost/geometry/algorithms/detail/equals/implementation.hpp>
  10. #include <boost/geometry/algorithms/detail/relate/implementation_gc.hpp>
  11. namespace boost { namespace geometry
  12. {
  13. #ifndef DOXYGEN_NO_DISPATCH
  14. namespace dispatch
  15. {
  16. template <typename Geometry1, typename Geometry2, std::size_t DimensionCount>
  17. struct equals
  18. <
  19. Geometry1, Geometry2,
  20. geometry_collection_tag, geometry_collection_tag,
  21. geometry_collection_tag, geometry_collection_tag,
  22. DimensionCount, false
  23. >
  24. {
  25. template <typename Strategy>
  26. static inline bool apply(Geometry1 const& geometry1,
  27. Geometry2 const& geometry2,
  28. Strategy const& strategy)
  29. {
  30. return detail::relate::relate_impl
  31. <
  32. detail::de9im::static_mask_equals_type,
  33. Geometry1,
  34. Geometry2
  35. >::apply(geometry1, geometry2, strategy);
  36. }
  37. };
  38. template
  39. <
  40. typename Geometry1, typename Geometry2,
  41. typename Tag1, typename CastedTag1,
  42. std::size_t DimensionCount
  43. >
  44. struct equals
  45. <
  46. Geometry1, Geometry2,
  47. Tag1, geometry_collection_tag,
  48. CastedTag1, geometry_collection_tag,
  49. DimensionCount, false
  50. >
  51. {
  52. template <typename Strategy>
  53. static inline bool apply(Geometry1 const& geometry1,
  54. Geometry2 const& geometry2,
  55. Strategy const& strategy)
  56. {
  57. using gc1_view_t = detail::geometry_collection_view<Geometry1>;
  58. return equals
  59. <
  60. gc1_view_t, Geometry2
  61. >::apply(gc1_view_t(geometry1), geometry2, strategy);
  62. }
  63. };
  64. template
  65. <
  66. typename Geometry1, typename Geometry2,
  67. typename Tag2, typename CastedTag2,
  68. std::size_t DimensionCount
  69. >
  70. struct equals
  71. <
  72. Geometry1, Geometry2,
  73. geometry_collection_tag, Tag2,
  74. geometry_collection_tag, CastedTag2,
  75. DimensionCount, false
  76. >
  77. {
  78. template <typename Strategy>
  79. static inline bool apply(Geometry1 const& geometry1,
  80. Geometry2 const& geometry2,
  81. Strategy const& strategy)
  82. {
  83. using gc2_view_t = detail::geometry_collection_view<Geometry2>;
  84. return equals
  85. <
  86. Geometry1, gc2_view_t
  87. >::apply(geometry1, gc2_view_t(geometry2), strategy);
  88. }
  89. };
  90. } // namespace dispatch
  91. #endif // DOXYGEN_NO_DISPATCH
  92. }} // namespace boost::geometry
  93. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_IMPLEMENTATION_GC_HPP