implementation.hpp 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // This file was modified by Oracle on 2013-2022.
  4. // Modifications copyright (c) 2013-2022 Oracle and/or its affiliates.
  5. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  6. // Use, modification and distribution is subject to the Boost Software License,
  7. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP
  10. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP
  11. #include <boost/geometry/algorithms/detail/relate/areal_areal.hpp>
  12. #include <boost/geometry/algorithms/detail/relate/box_areal.hpp>
  13. #include <boost/geometry/algorithms/detail/relate/interface.hpp>
  14. #include <boost/geometry/algorithms/detail/relate/linear_areal.hpp>
  15. #include <boost/geometry/algorithms/detail/relate/linear_linear.hpp>
  16. #include <boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp>
  17. #include <boost/geometry/algorithms/detail/relate/point_geometry.hpp>
  18. #include <boost/geometry/algorithms/detail/relate/point_point.hpp>
  19. #include <boost/geometry/core/tags.hpp>
  20. #include <boost/geometry/strategies/relate/cartesian.hpp>
  21. #include <boost/geometry/strategies/relate/geographic.hpp>
  22. #include <boost/geometry/strategies/relate/spherical.hpp>
  23. namespace boost { namespace geometry {
  24. #ifndef DOXYGEN_NO_DISPATCH
  25. namespace dispatch {
  26. template <typename Point1, typename Point2>
  27. struct relate<Point1, Point2, point_tag, point_tag, 0, 0, false>
  28. : detail::relate::point_point<Point1, Point2>
  29. {};
  30. template <typename Point, typename MultiPoint>
  31. struct relate<Point, MultiPoint, point_tag, multi_point_tag, 0, 0, false>
  32. : detail::relate::point_multipoint<Point, MultiPoint>
  33. {};
  34. template <typename MultiPoint, typename Point>
  35. struct relate<MultiPoint, Point, multi_point_tag, point_tag, 0, 0, false>
  36. : detail::relate::multipoint_point<MultiPoint, Point>
  37. {};
  38. template <typename MultiPoint1, typename MultiPoint2>
  39. struct relate<MultiPoint1, MultiPoint2, multi_point_tag, multi_point_tag, 0, 0, false>
  40. : detail::relate::multipoint_multipoint<MultiPoint1, MultiPoint2>
  41. {};
  42. // TODO - for now commented out because before implementing it we must consider:
  43. // 1. how the Box degenerated to a Point should be treated
  44. // 2. what should be the definition of a Box degenerated to a Point
  45. // 3. what fields should the matrix/mask contain for dimension > 2 and dimension > 9
  46. //
  47. //template <typename Point, typename Box, int TopDim2>
  48. //struct relate<Point, Box, point_tag, box_tag, 0, TopDim2, false>
  49. // : detail::relate::point_box<Point, Box>
  50. //{};
  51. //
  52. //template <typename Box, typename Point, int TopDim1>
  53. //struct relate<Box, Point, box_tag, point_tag, TopDim1, 0, false>
  54. // : detail::relate::box_point<Box, Point>
  55. //{};
  56. template <typename Point, typename Geometry, typename Tag2, int TopDim2>
  57. struct relate<Point, Geometry, point_tag, Tag2, 0, TopDim2, true>
  58. : detail::relate::point_geometry<Point, Geometry>
  59. {};
  60. template <typename Geometry, typename Point, typename Tag1, int TopDim1>
  61. struct relate<Geometry, Point, Tag1, point_tag, TopDim1, 0, true>
  62. : detail::relate::geometry_point<Geometry, Point>
  63. {};
  64. template <typename MultiPoint, typename Geometry, typename Tag2, int TopDim2>
  65. struct relate<MultiPoint, Geometry, multi_point_tag, Tag2, 0, TopDim2, false>
  66. : detail::relate::multi_point_geometry<MultiPoint, Geometry>
  67. {};
  68. template <typename Geometry, typename MultiPoint, typename Tag1, int TopDim1>
  69. struct relate<Geometry, MultiPoint, Tag1, multi_point_tag, TopDim1, 0, false>
  70. : detail::relate::geometry_multi_point<Geometry, MultiPoint>
  71. {};
  72. template <typename Linear1, typename Linear2, typename Tag1, typename Tag2>
  73. struct relate<Linear1, Linear2, Tag1, Tag2, 1, 1, true>
  74. : detail::relate::linear_linear<Linear1, Linear2>
  75. {};
  76. template <typename Linear, typename Areal, typename Tag1, typename Tag2>
  77. struct relate<Linear, Areal, Tag1, Tag2, 1, 2, true>
  78. : detail::relate::linear_areal<Linear, Areal>
  79. {};
  80. template <typename Areal, typename Linear, typename Tag1, typename Tag2>
  81. struct relate<Areal, Linear, Tag1, Tag2, 2, 1, true>
  82. : detail::relate::areal_linear<Areal, Linear>
  83. {};
  84. template <typename Areal1, typename Areal2, typename Tag1, typename Tag2>
  85. struct relate<Areal1, Areal2, Tag1, Tag2, 2, 2, true>
  86. : detail::relate::areal_areal<Areal1, Areal2>
  87. {};
  88. template <typename Box, typename Ring>
  89. struct relate<Box, Ring, box_tag, ring_tag, 2, 2, false>
  90. : detail::relate::box_areal<Box, Ring>
  91. {};
  92. template <typename Box, typename Polygon>
  93. struct relate<Box, Polygon, box_tag, polygon_tag, 2, 2, false>
  94. : detail::relate::box_areal<Box, Polygon>
  95. {};
  96. template <typename Box, typename MultiPolygon>
  97. struct relate<Box, MultiPolygon, box_tag, multi_polygon_tag, 2, 2, false>
  98. : detail::relate::box_areal<Box, MultiPolygon>
  99. {};
  100. } // namespace dispatch
  101. #endif // DOXYGEN_NO_DISPATCH
  102. }} // namespace boost::geometry
  103. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP