disjoint.hpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-2018.
  7. // Modifications copyright (c) 2013-2018, 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_DISPATCH_DISJOINT_HPP
  16. #define BOOST_GEOMETRY_ALGORITHMS_DISPATCH_DISJOINT_HPP
  17. #include <cstddef>
  18. #include <boost/geometry/core/coordinate_dimension.hpp>
  19. #include <boost/geometry/core/tag.hpp>
  20. #include <boost/geometry/core/tag_cast.hpp>
  21. #include <boost/geometry/core/tags.hpp>
  22. #include <boost/geometry/core/reverse_dispatch.hpp>
  23. #include <boost/geometry/algorithms/not_implemented.hpp>
  24. namespace boost { namespace geometry
  25. {
  26. #ifndef DOXYGEN_NO_DISPATCH
  27. namespace dispatch
  28. {
  29. template
  30. <
  31. typename Geometry1, typename Geometry2,
  32. std::size_t DimensionCount = dimension<Geometry1>::type::value,
  33. typename Tag1 = typename tag_cast
  34. <
  35. typename tag<Geometry1>::type,
  36. segment_tag, box_tag, linear_tag, areal_tag
  37. >::type,
  38. typename Tag2 = typename tag_cast
  39. <
  40. typename tag<Geometry2>::type,
  41. segment_tag, box_tag, linear_tag, areal_tag
  42. >::type,
  43. bool Reverse = reverse_dispatch<Geometry1, Geometry2>::type::value
  44. >
  45. struct disjoint
  46. : not_implemented<Geometry1, Geometry2>
  47. {};
  48. // If reversal is needed, perform it
  49. template
  50. <
  51. typename Geometry1, typename Geometry2,
  52. std::size_t DimensionCount,
  53. typename Tag1, typename Tag2
  54. >
  55. struct disjoint<Geometry1, Geometry2, DimensionCount, Tag1, Tag2, true>
  56. {
  57. template <typename Strategy>
  58. static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy)
  59. {
  60. return disjoint
  61. <
  62. Geometry2, Geometry1,
  63. DimensionCount,
  64. Tag2, Tag1
  65. >::apply(g2, g1, strategy);
  66. }
  67. };
  68. } // namespace dispatch
  69. #endif // DOXYGEN_NO_DISPATCH
  70. }} // namespace boost::geometry
  71. #endif // BOOST_GEOMETRY_ALGORITHMS_DISPATCH_DISJOINT_HPP