Chris@102
|
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
|
Chris@102
|
2
|
Chris@102
|
3 // Copyright (c) 2014 Oracle and/or its affiliates.
|
Chris@102
|
4
|
Chris@102
|
5 // Use, modification and distribution is subject to the Boost Software License,
|
Chris@102
|
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@102
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@102
|
8
|
Chris@102
|
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
Chris@102
|
10
|
Chris@102
|
11 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
|
Chris@102
|
12 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
|
Chris@102
|
13
|
Chris@102
|
14 #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
Chris@102
|
15
|
Chris@102
|
16 #include <boost/geometry/strategies/covered_by.hpp>
|
Chris@102
|
17 #include <boost/geometry/strategies/within.hpp>
|
Chris@102
|
18
|
Chris@102
|
19
|
Chris@102
|
20 namespace boost { namespace geometry
|
Chris@102
|
21 {
|
Chris@102
|
22
|
Chris@102
|
23 namespace strategy { namespace within
|
Chris@102
|
24 {
|
Chris@102
|
25
|
Chris@102
|
26 template
|
Chris@102
|
27 <
|
Chris@102
|
28 typename Point1, typename Point2
|
Chris@102
|
29 >
|
Chris@102
|
30 struct point_in_point
|
Chris@102
|
31 {
|
Chris@102
|
32 static inline bool apply(Point1 const& point1, Point2 const& point2)
|
Chris@102
|
33 {
|
Chris@102
|
34 return detail::equals::equals_point_point(point1, point2);
|
Chris@102
|
35 }
|
Chris@102
|
36 };
|
Chris@102
|
37
|
Chris@102
|
38
|
Chris@102
|
39 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
|
Chris@102
|
40
|
Chris@102
|
41 namespace services
|
Chris@102
|
42 {
|
Chris@102
|
43
|
Chris@102
|
44 template <typename Point1, typename Point2>
|
Chris@102
|
45 struct default_strategy<point_tag, point_tag, point_tag, point_tag, cartesian_tag, cartesian_tag, Point1, Point2>
|
Chris@102
|
46 {
|
Chris@102
|
47 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
48 };
|
Chris@102
|
49
|
Chris@102
|
50 template <typename Point1, typename Point2>
|
Chris@102
|
51 struct default_strategy<point_tag, point_tag, point_tag, point_tag, spherical_tag, spherical_tag, Point1, Point2>
|
Chris@102
|
52 {
|
Chris@102
|
53 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
54 };
|
Chris@102
|
55
|
Chris@102
|
56 template <typename Point1, typename Point2, typename AnyCS1, typename AnyCS2>
|
Chris@102
|
57 struct default_strategy<point_tag, point_tag, point_tag, point_tag, AnyCS1, AnyCS2, Point1, Point2>
|
Chris@102
|
58 {
|
Chris@102
|
59 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
60 };
|
Chris@102
|
61
|
Chris@102
|
62 template <typename Point, typename MultiPoint>
|
Chris@102
|
63 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, cartesian_tag, cartesian_tag, Point, MultiPoint>
|
Chris@102
|
64 {
|
Chris@102
|
65 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
66 };
|
Chris@102
|
67
|
Chris@102
|
68 template <typename Point, typename MultiPoint>
|
Chris@102
|
69 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, spherical_tag, spherical_tag, Point, MultiPoint>
|
Chris@102
|
70 {
|
Chris@102
|
71 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
72 };
|
Chris@102
|
73
|
Chris@102
|
74 template <typename Point, typename MultiPoint, typename AnyCS1, typename AnyCS2>
|
Chris@102
|
75 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, AnyCS1, AnyCS2, Point, MultiPoint>
|
Chris@102
|
76 {
|
Chris@102
|
77 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
78 };
|
Chris@102
|
79
|
Chris@102
|
80 } // namespace services
|
Chris@102
|
81
|
Chris@102
|
82 #endif
|
Chris@102
|
83
|
Chris@102
|
84
|
Chris@102
|
85 }} // namespace strategy::within
|
Chris@102
|
86
|
Chris@102
|
87
|
Chris@102
|
88
|
Chris@102
|
89 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
|
Chris@102
|
90 namespace strategy { namespace covered_by { namespace services
|
Chris@102
|
91 {
|
Chris@102
|
92
|
Chris@102
|
93 template <typename Point1, typename Point2>
|
Chris@102
|
94 struct default_strategy<point_tag, point_tag, point_tag, point_tag, cartesian_tag, cartesian_tag, Point1, Point2>
|
Chris@102
|
95 {
|
Chris@102
|
96 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
97 };
|
Chris@102
|
98
|
Chris@102
|
99 template <typename Point1, typename Point2>
|
Chris@102
|
100 struct default_strategy<point_tag, point_tag, point_tag, point_tag, spherical_tag, spherical_tag, Point1, Point2>
|
Chris@102
|
101 {
|
Chris@102
|
102 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
103 };
|
Chris@102
|
104
|
Chris@102
|
105 template <typename Point1, typename Point2, typename AnyCS1, typename AnyCS2>
|
Chris@102
|
106 struct default_strategy<point_tag, point_tag, point_tag, point_tag, AnyCS1, AnyCS2, Point1, Point2>
|
Chris@102
|
107 {
|
Chris@102
|
108 typedef strategy::within::point_in_point<Point1, Point2> type;
|
Chris@102
|
109 };
|
Chris@102
|
110
|
Chris@102
|
111 template <typename Point, typename MultiPoint>
|
Chris@102
|
112 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, cartesian_tag, cartesian_tag, Point, MultiPoint>
|
Chris@102
|
113 {
|
Chris@102
|
114 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
115 };
|
Chris@102
|
116
|
Chris@102
|
117 template <typename Point, typename MultiPoint>
|
Chris@102
|
118 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, spherical_tag, spherical_tag, Point, MultiPoint>
|
Chris@102
|
119 {
|
Chris@102
|
120 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
121 };
|
Chris@102
|
122
|
Chris@102
|
123 template <typename Point, typename MultiPoint, typename AnyCS1, typename AnyCS2>
|
Chris@102
|
124 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, AnyCS1, AnyCS2, Point, MultiPoint>
|
Chris@102
|
125 {
|
Chris@102
|
126 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
|
Chris@102
|
127 };
|
Chris@102
|
128
|
Chris@102
|
129 }}} // namespace strategy::covered_by::services
|
Chris@102
|
130 #endif
|
Chris@102
|
131
|
Chris@102
|
132
|
Chris@102
|
133 }} // namespace boost::geometry
|
Chris@102
|
134
|
Chris@102
|
135
|
Chris@102
|
136 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
|