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 2014-2021.
0008 // Modifications copyright (c) 2014-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_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 } // namespace detail
0068 #endif // DOXYGEN_NO_DETAIL
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 } // namespace traits
0093 #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
0094 
0095 
0096 }} // namespace boost::geometry
0097 
0098 
0099 #endif // BOOST_GEOMETRY_VIEWS_DETAIL_CLOSED_CLOCKWISE_VIEW_HPP