intersection_strategies.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 2016-2020.
  4. // Modifications copyright (c) 2016-2020, 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_STRATEGIES_INTERSECTION_HPP
  10. #define BOOST_GEOMETRY_STRATEGIES_INTERSECTION_HPP
  11. //#include <type_traits>
  12. #include <boost/geometry/policies/relate/intersection_policy.hpp>
  13. #include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
  14. #include <boost/geometry/strategies/intersection.hpp>
  15. #include <boost/geometry/strategies/intersection_result.hpp>
  16. #include <boost/geometry/strategies/side.hpp>
  17. #include <boost/geometry/strategies/cartesian/intersection.hpp>
  18. #include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>
  19. #include <boost/geometry/strategies/spherical/intersection.hpp>
  20. #include <boost/geometry/strategies/spherical/ssf.hpp>
  21. namespace boost { namespace geometry
  22. {
  23. /*!
  24. \brief "compound strategy", containing a segment-intersection-strategy
  25. and a side-strategy
  26. */
  27. template
  28. <
  29. typename Tag,
  30. typename Geometry1,
  31. typename Geometry2,
  32. typename IntersectionPoint,
  33. typename RobustPolicy,
  34. typename CalculationType = void
  35. >
  36. struct intersection_strategies
  37. {
  38. private :
  39. // for development BOOST_STATIC_ASSERT((! std::is_same<RobustPolicy, void>::type::value));
  40. typedef segment_intersection_points
  41. <
  42. IntersectionPoint,
  43. typename detail::segment_ratio_type
  44. <
  45. IntersectionPoint, RobustPolicy
  46. >::type
  47. > ip_type;
  48. public:
  49. typedef policies::relate::segments_intersection_policy
  50. <
  51. ip_type
  52. > intersection_policy_type;
  53. typedef typename strategy::intersection::services::default_strategy
  54. <
  55. Tag,
  56. CalculationType
  57. >::type segment_intersection_strategy_type;
  58. typedef typename strategy::side::services::default_strategy
  59. <
  60. Tag,
  61. CalculationType
  62. >::type side_strategy_type;
  63. typedef RobustPolicy rescale_policy_type;
  64. };
  65. }} // namespace boost::geometry
  66. #endif // BOOST_GEOMETRY_STRATEGIES_INTERSECTION_HPP