File indexing completed on 2024-11-15 09:12:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BOOST_GEOMETRY_VIEWS_DETAIL_CLOSED_CLOCKWISE_VIEW_HPP
0020 #define BOOST_GEOMETRY_VIEWS_DETAIL_CLOSED_CLOCKWISE_VIEW_HPP
0021
0022 #include <type_traits>
0023
0024 #include <boost/range/begin.hpp>
0025 #include <boost/range/end.hpp>
0026 #include <boost/range/iterator.hpp>
0027
0028 #include <boost/geometry/views/closeable_view.hpp>
0029 #include <boost/geometry/views/reversible_view.hpp>
0030 #include <boost/geometry/util/order_as_direction.hpp>
0031 #include <boost/geometry/util/type_traits_std.hpp>
0032
0033 namespace boost { namespace geometry
0034 {
0035
0036 #ifndef DOXYGEN_NO_DETAIL
0037 namespace detail
0038 {
0039
0040
0041 template
0042 <
0043 typename Range,
0044 closure_selector Closure = geometry::closure<Range>::value,
0045 order_selector Order = geometry::point_order<Range>::value
0046 >
0047 struct closed_clockwise_view
0048 {
0049 using closed_view = detail::closed_view<Range const, Closure>;
0050 using view = detail::clockwise_view<closed_view const, Order>;
0051
0052 explicit inline closed_clockwise_view(Range const& r)
0053 : m_view(closed_view(r))
0054 {}
0055
0056 using iterator = typename boost::range_iterator<view const>::type;
0057 using const_iterator = typename boost::range_iterator<view const>::type;
0058
0059 inline const_iterator begin() const { return boost::begin(m_view); }
0060 inline const_iterator end() const { return boost::end(m_view); }
0061
0062 private:
0063 view m_view;
0064 };
0065
0066
0067 }
0068 #endif
0069
0070
0071 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0072 namespace traits
0073 {
0074
0075 template <typename Range, closure_selector Closure, order_selector Order>
0076 struct tag<geometry::detail::closed_clockwise_view<Range, Closure, Order> >
0077 : geometry::tag<Range>
0078 {};
0079
0080 template <typename Range, closure_selector Closure, order_selector Order>
0081 struct point_order<geometry::detail::closed_clockwise_view<Range, Closure, Order> >
0082 {
0083 static const order_selector value = clockwise;
0084 };
0085
0086 template <typename Range, closure_selector Closure, order_selector Order>
0087 struct closure<geometry::detail::closed_clockwise_view<Range, Closure, Order> >
0088 {
0089 static const closure_selector value = closed;
0090 };
0091
0092 }
0093 #endif
0094
0095
0096 }}
0097
0098
0099 #endif