Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_AS_RANGE_HPP Chris@16: #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_AS_RANGE_HPP Chris@16: Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { namespace geometry Chris@16: { Chris@16: Chris@16: Chris@16: #ifndef DOXYGEN_NO_DISPATCH Chris@16: namespace dispatch Chris@16: { Chris@16: Chris@16: Chris@16: template Chris@16: struct as_range Chris@16: { Chris@16: static inline typename add_const_if_c::type& get( Chris@16: typename add_const_if_c::type& input) Chris@16: { Chris@16: return input; Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: template Chris@16: struct as_range Chris@16: { Chris@16: static inline typename add_const_if_c::type& get( Chris@16: typename add_const_if_c::type& input) Chris@16: { Chris@16: return exterior_ring(input); Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: } // namespace dispatch Chris@16: #endif // DOXYGEN_NO_DISPATCH Chris@16: Chris@16: // Will probably be replaced by the more generic "view_as", therefore in detail Chris@16: namespace detail Chris@16: { Chris@16: Chris@16: /*! Chris@16: \brief Function getting either the range (ring, linestring) itself Chris@16: or the outer ring (polygon) Chris@16: \details Utility to handle polygon's outer ring as a range Chris@16: \ingroup utility Chris@16: */ Chris@16: template Chris@16: inline Range& as_range(Geometry& input) Chris@16: { Chris@16: return dispatch::as_range Chris@16: < Chris@16: typename tag::type, Chris@16: Geometry, Chris@16: Range, Chris@16: false Chris@16: >::get(input); Chris@16: } Chris@16: Chris@16: Chris@16: /*! Chris@16: \brief Function getting either the range (ring, linestring) itself Chris@16: or the outer ring (polygon), const version Chris@16: \details Utility to handle polygon's outer ring as a range Chris@16: \ingroup utility Chris@16: */ Chris@16: template Chris@16: inline Range const& as_range(Geometry const& input) Chris@16: { Chris@16: return dispatch::as_range Chris@16: < Chris@16: typename tag::type, Chris@16: Geometry, Chris@16: Range, Chris@16: true Chris@16: >::get(input); Chris@16: } Chris@16: Chris@16: } Chris@16: Chris@16: }} // namespace boost::geometry Chris@16: Chris@16: Chris@16: #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_AS_RANGE_HPP