File indexing completed on 2024-11-15 09:12:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_POINT_IN_POINT_HPP
0023 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_POINT_IN_POINT_HPP
0024
0025 #include <cstddef>
0026
0027 #include <boost/geometry/core/access.hpp>
0028 #include <boost/geometry/core/coordinate_dimension.hpp>
0029 #include <boost/geometry/core/tags.hpp>
0030
0031 #include <boost/geometry/util/math.hpp>
0032
0033 #include <boost/geometry/strategies/covered_by.hpp>
0034 #include <boost/geometry/strategies/within.hpp>
0035
0036
0037 namespace boost { namespace geometry
0038 {
0039
0040 #ifndef DOXYGEN_NO_DETAIL
0041 namespace detail { namespace within
0042 {
0043
0044
0045 template <std::size_t Dimension, std::size_t DimensionCount>
0046 struct point_point_generic
0047 {
0048 template <typename Point1, typename Point2>
0049 static inline bool apply(Point1 const& p1, Point2 const& p2)
0050 {
0051 if (! geometry::math::equals(get<Dimension>(p1), get<Dimension>(p2)))
0052 {
0053 return false;
0054 }
0055 return
0056 point_point_generic<Dimension + 1, DimensionCount>::apply(p1, p2);
0057 }
0058 };
0059
0060 template <std::size_t DimensionCount>
0061 struct point_point_generic<DimensionCount, DimensionCount>
0062 {
0063 template <typename Point1, typename Point2>
0064 static inline bool apply(Point1 const&, Point2 const& )
0065 {
0066 return true;
0067 }
0068 };
0069
0070 }}
0071 #endif
0072
0073
0074 namespace strategy { namespace within
0075 {
0076
0077 struct cartesian_point_point
0078 {
0079 typedef cartesian_tag cs_tag;
0080
0081 template <typename Point1, typename Point2>
0082 static inline bool apply(Point1 const& point1, Point2 const& point2)
0083 {
0084 return geometry::detail::within::point_point_generic
0085 <
0086 0, dimension<Point1>::type::value
0087 >::apply(point1, point2);
0088 }
0089 };
0090
0091
0092 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0093 namespace services
0094 {
0095
0096 template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2>
0097 struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, cartesian_tag, cartesian_tag>
0098 {
0099 typedef strategy::within::cartesian_point_point type;
0100 };
0101
0102 }
0103 #endif
0104
0105
0106 }}
0107
0108
0109 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0110 namespace strategy { namespace covered_by { namespace services
0111 {
0112
0113 template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2>
0114 struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, cartesian_tag, cartesian_tag>
0115 {
0116 typedef strategy::within::cartesian_point_point type;
0117 };
0118
0119 }}}
0120 #endif
0121
0122
0123 }}
0124
0125
0126 #endif