File indexing completed on 2025-01-18 09:35:12
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SEGMENT_AS_SUBRANGE_HPP
0010 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SEGMENT_AS_SUBRANGE_HPP
0011
0012
0013 #include <cstddef>
0014 #include <map>
0015
0016 #include <boost/geometry/core/access.hpp>
0017
0018 namespace boost { namespace geometry
0019 {
0020
0021 #ifndef DOXYGEN_NO_DETAIL
0022 namespace detail
0023 {
0024
0025 template <typename Segment>
0026 struct segment_as_subrange
0027 {
0028 segment_as_subrange(Segment const& s)
0029 : m_segment(s)
0030 {
0031 geometry::set<0>(m_p1, geometry::get<0, 0>(m_segment));
0032 geometry::set<1>(m_p1, geometry::get<0, 1>(m_segment));
0033 geometry::set<0>(m_p2, geometry::get<1, 0>(m_segment));
0034 geometry::set<1>(m_p2, geometry::get<1, 1>(m_segment));
0035 }
0036
0037 typedef typename geometry::point_type<Segment>::type point_type;
0038
0039 point_type const& at(std::size_t index) const
0040 {
0041 return index == 0 ? m_p1 : m_p2;
0042 }
0043
0044 static inline bool is_last_segment()
0045 {
0046 return true;
0047 }
0048
0049 point_type m_p1, m_p2;
0050
0051 Segment const& m_segment;
0052 };
0053
0054 }
0055 #endif
0056
0057 }}
0058
0059 #endif