comparison DEPENDENCIES/generic/include/boost/geometry/views/box_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
41 } 41 }
42 42
43 \qbk{[include reference/views/box_view.qbk]} 43 \qbk{[include reference/views/box_view.qbk]}
44 */ 44 */
45 template <typename Box, bool Clockwise = true> 45 template <typename Box, bool Clockwise = true>
46 struct box_view 46 struct box_view
47 : public detail::points_view 47 : public detail::points_view
48 < 48 <
49 typename geometry::point_type<Box>::type, 49 typename geometry::point_type<Box>::type,
50 5 50 5
51 > 51 >
52 { 52 {
53 typedef typename geometry::point_type<Box>::type point_type; 53 typedef typename geometry::point_type<Box>::type point_type;
54 54
55 /// Constructor accepting the box to adapt 55 /// Constructor accepting the box to adapt
56 explicit box_view(Box const& box) 56 explicit box_view(Box const& box)
57 : detail::points_view<point_type, 5>(copy_policy(box)) 57 : detail::points_view<point_type, 5>(copy_policy(box))
58 {} 58 {}
59 59
60 private : 60 private :
61 61
62 class copy_policy 62 class copy_policy
63 { 63 {
64 public : 64 public :
65 inline copy_policy(Box const& box) 65 inline copy_policy(Box const& box)
66 : m_box(box) 66 : m_box(box)
67 {} 67 {}
68 68
69 inline void apply(point_type* points) const 69 inline void apply(point_type* points) const
70 { 70 {
71 detail::assign_box_corners_oriented<!Clockwise>(m_box, points); 71 // assign_box_corners_oriented requires a range
72 // an alternative for this workaround would be to pass a range here,
73 // e.g. use boost::array in points_view instead of c-array
74 std::pair<point_type*, point_type*> rng = std::make_pair(points, points + 5);
75 detail::assign_box_corners_oriented<!Clockwise>(m_box, rng);
72 points[4] = points[0]; 76 points[4] = points[0];
73 } 77 }
74 private : 78 private :
75 Box const& m_box; 79 Box const& m_box;
76 }; 80 };