1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2014.
8 // Modifications copyright (c) 2014 Oracle and/or its affiliates.
10 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
11 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13 // Use, modification and distribution is subject to the Boost Software License,
14 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
19 #ifndef BOOST_GEOMETRY_VIEWS_DETAIL_NORMALIZED_VIEW_HPP
20 #define BOOST_GEOMETRY_VIEWS_DETAIL_NORMALIZED_VIEW_HPP
23 #include <boost/range/begin.hpp>
24 #include <boost/range/end.hpp>
25 #include <boost/range/iterator.hpp>
26 #include <boost/mpl/if.hpp>
27 #include <boost/type_traits/is_const.hpp>
28 #include <boost/geometry/views/detail/range_type.hpp>
29 #include <boost/geometry/views/reversible_view.hpp>
30 #include <boost/geometry/views/closeable_view.hpp>
31 #include <boost/geometry/util/order_as_direction.hpp>
33 namespace boost { namespace geometry {
36 #ifndef DOXYGEN_NO_DETAIL
40 template <typename Geometry>
41 struct normalized_view
43 static const bool is_const = boost::is_const<Geometry>::value;
45 //typedef typename ring_type<Geometry>::type ring_type;
47 typedef typename detail::range_type<Geometry>::type range_type;
63 geometry::point_order<Geometry>::value
65 >::type reversible_type;
71 reversible_type const,
79 geometry::closure<Geometry>::value
80 >::type closeable_type;
90 explicit inline normalized_view(range & r)
92 , m_closeable(m_reversible)
95 typedef typename boost::range_iterator<closeable>::type iterator;
96 typedef typename boost::range_const_iterator<closeable>::type const_iterator;
98 inline const_iterator begin() const { return boost::begin(m_closeable); }
99 inline const_iterator end() const { return boost::end(m_closeable); }
101 inline iterator begin() { return boost::begin(m_closeable); }
102 inline iterator end() { return boost::end(m_closeable); }
105 reversible_type m_reversible;
106 closeable_type m_closeable;
109 } // namespace detail
111 #endif // DOXYGEN_NO_DETAIL
114 }} // namespace boost::geometry
117 #endif // BOOST_GEOMETRY_VIEWS_DETAIL_NORMALIZED_VIEW_HPP