intersection_strategies.hpp 3.0 KB

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