Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:12:26

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2020-2023.
0008 // Modifications copyright (c) 2020-2023 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0010 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0011 
0012 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0013 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0014 
0015 // Use, modification and distribution is subject to the Boost Software License,
0016 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0017 // http://www.boost.org/LICENSE_1_0.txt)
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 } // namespace detail
0069 #endif // DOXYGEN_NO_DETAIL
0070 
0071 
0072 /*!
0073 \brief View on a range, reversing direction if necessary
0074 \tparam Range original range
0075 \tparam Direction direction of iteration
0076 \ingroup views
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 // DOXYGEN_NO_SPECIALIZATIONS
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 } // namespace traits
0123 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0124 
0125 
0126 }} // namespace boost::geometry
0127 
0128 
0129 #endif // BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP