implementation.hpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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, 2014, 2015, 2017.
  4. // Modifications copyright (c) 2013-2017 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/core/tags.hpp>
  12. #include <boost/geometry/algorithms/detail/relate/interface.hpp>
  13. #include <boost/geometry/algorithms/detail/relate/point_point.hpp>
  14. #include <boost/geometry/algorithms/detail/relate/point_geometry.hpp>
  15. #include <boost/geometry/algorithms/detail/relate/linear_linear.hpp>
  16. #include <boost/geometry/algorithms/detail/relate/linear_areal.hpp>
  17. #include <boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp>
  18. #include <boost/geometry/algorithms/detail/relate/areal_areal.hpp>
  19. #include <boost/geometry/strategies/intersection.hpp>
  20. #include <boost/geometry/strategies/within.hpp>
  21. namespace boost { namespace geometry {
  22. #ifndef DOXYGEN_NO_DISPATCH
  23. namespace dispatch {
  24. template <typename Point1, typename Point2>
  25. struct relate<Point1, Point2, point_tag, point_tag, 0, 0, false>
  26. : detail::relate::point_point<Point1, Point2>
  27. {};
  28. template <typename Point, typename MultiPoint>
  29. struct relate<Point, MultiPoint, point_tag, multi_point_tag, 0, 0, false>
  30. : detail::relate::point_multipoint<Point, MultiPoint>
  31. {};
  32. template <typename MultiPoint, typename Point>
  33. struct relate<MultiPoint, Point, multi_point_tag, point_tag, 0, 0, false>
  34. : detail::relate::multipoint_point<MultiPoint, Point>
  35. {};
  36. template <typename MultiPoint1, typename MultiPoint2>
  37. struct relate<MultiPoint1, MultiPoint2, multi_point_tag, multi_point_tag, 0, 0, false>
  38. : detail::relate::multipoint_multipoint<MultiPoint1, MultiPoint2>
  39. {};
  40. // TODO - for now commented out because before implementing it we must consider:
  41. // 1. how the Box degenerated to a Point should be treated
  42. // 2. what should be the definition of a Box degenerated to a Point
  43. // 3. what fields should the matrix/mask contain for dimension > 2 and dimension > 9
  44. //
  45. //template <typename Point, typename Box, int TopDim2>
  46. //struct relate<Point, Box, point_tag, box_tag, 0, TopDim2, false>
  47. // : detail::relate::point_box<Point, Box>
  48. //{};
  49. //
  50. //template <typename Box, typename Point, int TopDim1>
  51. //struct relate<Box, Point, box_tag, point_tag, TopDim1, 0, false>
  52. // : detail::relate::box_point<Box, Point>
  53. //{};
  54. template <typename Point, typename Geometry, typename Tag2, int TopDim2>
  55. struct relate<Point, Geometry, point_tag, Tag2, 0, TopDim2, true>
  56. : detail::relate::point_geometry<Point, Geometry>
  57. {};
  58. template <typename Geometry, typename Point, typename Tag1, int TopDim1>
  59. struct relate<Geometry, Point, Tag1, point_tag, TopDim1, 0, true>
  60. : detail::relate::geometry_point<Geometry, Point>
  61. {};
  62. template <typename MultiPoint, typename Geometry, typename Tag2, int TopDim2>
  63. struct relate<MultiPoint, Geometry, multi_point_tag, Tag2, 0, TopDim2, false>
  64. : detail::relate::multi_point_geometry<MultiPoint, Geometry>
  65. {};
  66. template <typename Geometry, typename MultiPoint, typename Tag1, int TopDim1>
  67. struct relate<Geometry, MultiPoint, Tag1, multi_point_tag, TopDim1, 0, false>
  68. : detail::relate::geometry_multi_point<Geometry, MultiPoint>
  69. {};
  70. template <typename Linear1, typename Linear2, typename Tag1, typename Tag2>
  71. struct relate<Linear1, Linear2, Tag1, Tag2, 1, 1, true>
  72. : detail::relate::linear_linear<Linear1, Linear2>
  73. {};
  74. template <typename Linear, typename Areal, typename Tag1, typename Tag2>
  75. struct relate<Linear, Areal, Tag1, Tag2, 1, 2, true>
  76. : detail::relate::linear_areal<Linear, Areal>
  77. {};
  78. template <typename Areal, typename Linear, typename Tag1, typename Tag2>
  79. struct relate<Areal, Linear, Tag1, Tag2, 2, 1, true>
  80. : detail::relate::areal_linear<Areal, Linear>
  81. {};
  82. template <typename Areal1, typename Areal2, typename Tag1, typename Tag2>
  83. struct relate<Areal1, Areal2, Tag1, Tag2, 2, 2, true>
  84. : detail::relate::areal_areal<Areal1, Areal2>
  85. {};
  86. } // namespace dispatch
  87. #endif // DOXYGEN_NO_DISPATCH
  88. }} // namespace boost::geometry
  89. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP