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_REVERSIBLE_VIEW_HPP
0020 #define BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP
0021
0022
0023 #include <boost/version.hpp>
0024 #include <boost/range/adaptor/reversed.hpp>
0025
0026 #include <boost/geometry/core/closure.hpp>
0027 #include <boost/geometry/core/point_order.hpp>
0028 #include <boost/geometry/core/ring_type.hpp>
0029 #include <boost/geometry/core/tag.hpp>
0030 #include <boost/geometry/core/tags.hpp>
0031
0032 #include <boost/geometry/util/order_as_direction.hpp>
0033
0034 #include <boost/geometry/views/identity_view.hpp>
0035
0036 namespace boost { namespace geometry
0037 {
0038
0039
0040 #ifndef DOXYGEN_NO_DETAIL
0041 namespace detail
0042 {
0043
0044
0045 template
0046 <
0047 typename Range,
0048 order_selector Order = geometry::point_order<Range>::value
0049 >
0050 struct clockwise_view
0051 : identity_view<Range>
0052 {
0053 explicit inline clockwise_view(Range& r)
0054 : identity_view<Range>(r)
0055 {}
0056 };
0057
0058 template <typename Range>
0059 struct clockwise_view<Range, counterclockwise>
0060 : boost::reversed_range<Range>
0061 {
0062 explicit inline clockwise_view(Range& r)
0063 : boost::reversed_range<Range>(r)
0064 {}
0065 };
0066
0067
0068 }
0069 #endif
0070
0071
0072
0073
0074
0075
0076
0077
0078 template <typename Range, iterate_direction Direction>
0079 struct reversible_view {};
0080
0081
0082 #ifndef DOXYGEN_NO_SPECIALIZATIONS
0083
0084 template <typename Range>
0085 struct reversible_view<Range, iterate_forward>
0086 {
0087 using type = identity_view<Range>;
0088 };
0089
0090
0091 template <typename Range>
0092 struct reversible_view<Range, iterate_reverse>
0093 {
0094 using type = boost::reversed_range<Range>;
0095 };
0096
0097 #endif
0098
0099
0100 #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0101 namespace traits
0102 {
0103
0104
0105 template <typename Range, order_selector Order>
0106 struct tag<geometry::detail::clockwise_view<Range, Order> >
0107 : geometry::tag<Range>
0108 {};
0109
0110 template <typename Range, order_selector Order>
0111 struct point_order<geometry::detail::clockwise_view<Range, Order> >
0112 {
0113 static const order_selector value = clockwise;
0114 };
0115
0116 template <typename Range, order_selector Order>
0117 struct closure<geometry::detail::clockwise_view<Range, Order> >
0118 : geometry::closure<Range>
0119 {};
0120
0121
0122 }
0123 #endif
0124
0125
0126 }}
0127
0128
0129 #endif