]> git.sesse.net Git - casparcg/blob - dependencies/boost/boost/geometry/strategies/intersection.hpp
Manually merged pull request #222
[casparcg] / dependencies / boost / boost / geometry / strategies / intersection.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
4
5 // Use, modification and distribution is subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9 #ifndef BOOST_GEOMETRY_STRATEGIES_INTERSECTION_HPP
10 #define BOOST_GEOMETRY_STRATEGIES_INTERSECTION_HPP
11
12 #include <boost/geometry/core/point_type.hpp>
13 #include <boost/geometry/geometries/segment.hpp>
14
15 #include <boost/geometry/policies/relate/intersection_points.hpp>
16 #include <boost/geometry/policies/relate/direction.hpp>
17 #include <boost/geometry/policies/relate/tupled.hpp>
18
19 #include <boost/geometry/strategies/side.hpp>
20 #include <boost/geometry/strategies/intersection.hpp>
21 #include <boost/geometry/strategies/intersection_result.hpp>
22
23 #include <boost/geometry/strategies/cartesian/cart_intersect.hpp>
24
25
26 namespace boost { namespace geometry
27 {
28
29
30 // The intersection strategy is a "compound strategy",
31 // it contains a segment-intersection-strategy
32 // and a side-strategy
33 /*!
34 \tparam CalculationType \tparam_calculation
35 */
36 template
37 <
38     typename Tag,
39     typename Geometry1,
40     typename Geometry2,
41     typename IntersectionPoint,
42     typename CalculationType = void
43 >
44 struct strategy_intersection
45 {
46 private :
47     typedef typename geometry::point_type<Geometry1>::type point1_type;
48     typedef typename geometry::point_type<Geometry2>::type point2_type;
49     typedef typename model::referring_segment<point1_type const> segment1_type;
50     typedef typename model::referring_segment<point2_type const> segment2_type;
51
52     typedef segment_intersection_points
53         <
54             IntersectionPoint
55         > ip_type;
56
57 public:
58     typedef strategy::intersection::relate_cartesian_segments
59             <
60                 policies::relate::segments_tupled
61                     <
62                         policies::relate::segments_intersection_points
63                             <
64                                 segment1_type,
65                                 segment2_type,
66                                 ip_type,
67                                 CalculationType
68                             > ,
69                         policies::relate::segments_direction
70                             <
71                                 segment1_type,
72                                 segment2_type,
73                                 CalculationType
74                             >,
75                         CalculationType
76                     >,
77                 CalculationType
78             > segment_intersection_strategy_type;
79
80     typedef typename strategy::side::services::default_strategy
81         <
82             Tag,
83             CalculationType
84         >::type side_strategy_type;
85 };
86
87
88
89
90 }} // namespace boost::geometry
91
92
93 #endif // BOOST_GEOMETRY_STRATEGIES_INTERSECTION_HPP