1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014 Oracle and/or its affiliates.
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)
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
12 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP
14 #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
16 #include <boost/geometry/strategies/covered_by.hpp>
17 #include <boost/geometry/strategies/within.hpp>
20 namespace boost { namespace geometry
23 namespace strategy { namespace within
28 typename Point1, typename Point2
32 static inline bool apply(Point1 const& point1, Point2 const& point2)
34 return detail::equals::equals_point_point(point1, point2);
39 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
44 template <typename Point1, typename Point2>
45 struct default_strategy<point_tag, point_tag, point_tag, point_tag, cartesian_tag, cartesian_tag, Point1, Point2>
47 typedef strategy::within::point_in_point<Point1, Point2> type;
50 template <typename Point1, typename Point2>
51 struct default_strategy<point_tag, point_tag, point_tag, point_tag, spherical_tag, spherical_tag, Point1, Point2>
53 typedef strategy::within::point_in_point<Point1, Point2> type;
56 template <typename Point1, typename Point2, typename AnyCS1, typename AnyCS2>
57 struct default_strategy<point_tag, point_tag, point_tag, point_tag, AnyCS1, AnyCS2, Point1, Point2>
59 typedef strategy::within::point_in_point<Point1, Point2> type;
62 template <typename Point, typename MultiPoint>
63 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, cartesian_tag, cartesian_tag, Point, MultiPoint>
65 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
68 template <typename Point, typename MultiPoint>
69 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, spherical_tag, spherical_tag, Point, MultiPoint>
71 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
74 template <typename Point, typename MultiPoint, typename AnyCS1, typename AnyCS2>
75 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, AnyCS1, AnyCS2, Point, MultiPoint>
77 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
80 } // namespace services
85 }} // namespace strategy::within
89 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
90 namespace strategy { namespace covered_by { namespace services
93 template <typename Point1, typename Point2>
94 struct default_strategy<point_tag, point_tag, point_tag, point_tag, cartesian_tag, cartesian_tag, Point1, Point2>
96 typedef strategy::within::point_in_point<Point1, Point2> type;
99 template <typename Point1, typename Point2>
100 struct default_strategy<point_tag, point_tag, point_tag, point_tag, spherical_tag, spherical_tag, Point1, Point2>
102 typedef strategy::within::point_in_point<Point1, Point2> type;
105 template <typename Point1, typename Point2, typename AnyCS1, typename AnyCS2>
106 struct default_strategy<point_tag, point_tag, point_tag, point_tag, AnyCS1, AnyCS2, Point1, Point2>
108 typedef strategy::within::point_in_point<Point1, Point2> type;
111 template <typename Point, typename MultiPoint>
112 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, cartesian_tag, cartesian_tag, Point, MultiPoint>
114 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
117 template <typename Point, typename MultiPoint>
118 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, spherical_tag, spherical_tag, Point, MultiPoint>
120 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
123 template <typename Point, typename MultiPoint, typename AnyCS1, typename AnyCS2>
124 struct default_strategy<point_tag, multi_point_tag, point_tag, multi_point_tag, AnyCS1, AnyCS2, Point, MultiPoint>
126 typedef strategy::within::point_in_point<Point, typename point_type<MultiPoint>::type> type;
129 }}} // namespace strategy::covered_by::services
133 }} // namespace boost::geometry
136 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_POINT_IN_POINT_HPP