Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:12:14

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland
0007 
0008 // This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019.
0009 // Modifications copyright (c) 2013-2019, Oracle and/or its affiliates.
0010 
0011 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0012 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0013 
0014 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0015 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0016 
0017 // Use, modification and distribution is subject to the Boost Software License,
0018 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0019 // http://www.boost.org/LICENSE_1_0.txt)
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 }} // namespace detail::within
0071 #endif // DOXYGEN_NO_DETAIL
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 } // namespace services
0103 #endif
0104 
0105 
0106 }} // namespace strategy::within
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 }}} // namespace strategy::covered_by::services
0120 #endif
0121 
0122 
0123 }} // namespace boost::geometry
0124 
0125 
0126 #endif // BOOST_GEOMETRY_STRATEGY_CARTESIAN_POINT_IN_POINT_HPP