File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_PAIR_AS_SEGMENT_HPP
0015 #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_PAIR_AS_SEGMENT_HPP
0016
0017
0018
0019
0020
0021 #ifdef BOOST_GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
0022 #error Include only one headerfile to register tag for adapted std:: containers or iterator pair
0023 #endif
0024
0025 #define BOOST_GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
0026
0027
0028 #include <cstddef>
0029
0030
0031 #include <boost/geometry/core/access.hpp>
0032 #include <boost/geometry/core/tag.hpp>
0033 #include <boost/geometry/core/tags.hpp>
0034
0035
0036 namespace boost { namespace geometry
0037 {
0038
0039
0040 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0041 namespace traits
0042 {
0043
0044
0045 template <typename Point>
0046 struct tag<std::pair<Point, Point> >
0047 {
0048 typedef segment_tag type;
0049 };
0050
0051 template <typename Point>
0052 struct point_type<std::pair<Point, Point> >
0053 {
0054 typedef Point type;
0055 };
0056
0057 template <typename Point, std::size_t Dimension>
0058 struct indexed_access<std::pair<Point, Point>, 0, Dimension>
0059 {
0060 typedef typename geometry::coordinate_type<Point>::type coordinate_type;
0061
0062 static inline coordinate_type get(std::pair<Point, Point> const& s)
0063 {
0064 return geometry::get<Dimension>(s.first);
0065 }
0066
0067 static inline void set(std::pair<Point, Point>& s, coordinate_type const& value)
0068 {
0069 geometry::set<Dimension>(s.first, value);
0070 }
0071 };
0072
0073
0074 template <typename Point, std::size_t Dimension>
0075 struct indexed_access<std::pair<Point, Point>, 1, Dimension>
0076 {
0077 typedef typename geometry::coordinate_type<Point>::type coordinate_type;
0078
0079 static inline coordinate_type get(std::pair<Point, Point> const& s)
0080 {
0081 return geometry::get<Dimension>(s.second);
0082 }
0083
0084 static inline void set(std::pair<Point, Point>& s, coordinate_type const& value)
0085 {
0086 geometry::set<Dimension>(s.second, value);
0087 }
0088 };
0089
0090
0091 }
0092 #endif
0093
0094
0095 }}
0096
0097
0098 #endif