Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/geometry/views/segment_view.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
26 { | 26 { |
27 | 27 |
28 | 28 |
29 /*! | 29 /*! |
30 \brief Makes a segment behave like a linestring or a range | 30 \brief Makes a segment behave like a linestring or a range |
31 \details Adapts a segment to the Boost.Range concept, enabling the user to | 31 \details Adapts a segment to the Boost.Range concept, enabling the user to |
32 iterate the two segment points. The segment_view is registered as a LineString Concept | 32 iterate the two segment points. The segment_view is registered as a LineString Concept |
33 \tparam Segment \tparam_geometry{Segment} | 33 \tparam Segment \tparam_geometry{Segment} |
34 \ingroup views | 34 \ingroup views |
35 | 35 |
36 \qbk{before.synopsis, | 36 \qbk{before.synopsis, |
43 */ | 43 */ |
44 template <typename Segment> | 44 template <typename Segment> |
45 struct segment_view | 45 struct segment_view |
46 : public detail::points_view | 46 : public detail::points_view |
47 < | 47 < |
48 typename geometry::point_type<Segment>::type, | 48 typename geometry::point_type<Segment>::type, |
49 2 | 49 2 |
50 > | 50 > |
51 { | 51 { |
52 typedef typename geometry::point_type<Segment>::type point_type; | 52 typedef typename geometry::point_type<Segment>::type point_type; |
53 | 53 |
54 /// Constructor accepting the segment to adapt | 54 /// Constructor accepting the segment to adapt |
55 explicit segment_view(Segment const& segment) | 55 explicit segment_view(Segment const& segment) |
56 : detail::points_view<point_type, 2>(copy_policy(segment)) | 56 : detail::points_view<point_type, 2>(copy_policy(segment)) |
57 {} | 57 {} |
58 | 58 |
59 private : | 59 private : |
60 | 60 |
61 class copy_policy | 61 class copy_policy |
62 { | 62 { |
63 public : | 63 public : |
64 inline copy_policy(Segment const& segment) | 64 inline copy_policy(Segment const& segment) |
65 : m_segment(segment) | 65 : m_segment(segment) |
66 {} | 66 {} |
67 | 67 |
68 inline void apply(point_type* points) const | 68 inline void apply(point_type* points) const |
69 { | 69 { |
70 geometry::detail::assign_point_from_index<0>(m_segment, points[0]); | 70 geometry::detail::assign_point_from_index<0>(m_segment, points[0]); |
71 geometry::detail::assign_point_from_index<1>(m_segment, points[1]); | 71 geometry::detail::assign_point_from_index<1>(m_segment, points[1]); |
72 } | 72 } |