intersection_strategies.hpp 2.4 KB

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