Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:04

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2014, Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0006 
0007 // Licensed under the Boost Software License version 1.0.
0008 // http://www.boost.org/users/license.html
0009 
0010 #ifndef BOOST_GEOMETRY_ALGORITHS_DETAIL_DISTANCE_ITERATOR_SELECTOR_HPP
0011 #define BOOST_GEOMETRY_ALGORITHS_DETAIL_DISTANCE_ITERATOR_SELECTOR_HPP
0012 
0013 #include <boost/geometry/core/tag.hpp>
0014 #include <boost/geometry/core/tags.hpp>
0015 
0016 #include <boost/geometry/iterators/point_iterator.hpp>
0017 #include <boost/geometry/iterators/segment_iterator.hpp>
0018 
0019 
0020 namespace boost { namespace geometry
0021 {
0022 
0023 
0024 #ifndef DOXYGEN_NO_DETAIL
0025 namespace detail { namespace distance
0026 {
0027 
0028 
0029 // class to choose between point_iterator and segment_iterator
0030 template <typename Geometry, typename Tag = typename tag<Geometry>::type>
0031 struct iterator_selector
0032 {
0033     typedef geometry::segment_iterator<Geometry> iterator_type;
0034 
0035     static inline iterator_type begin(Geometry& geometry)
0036     {
0037         return segments_begin(geometry);
0038     }
0039 
0040     static inline iterator_type end(Geometry& geometry)
0041     {
0042         return segments_end(geometry);
0043     }
0044 };
0045 
0046 template <typename MultiPoint>
0047 struct iterator_selector<MultiPoint, multi_point_tag>
0048 {
0049     typedef geometry::point_iterator<MultiPoint> iterator_type;
0050 
0051     static inline iterator_type begin(MultiPoint& multipoint)
0052     {
0053         return points_begin(multipoint);
0054     }
0055 
0056     static inline iterator_type end(MultiPoint& multipoint)
0057     {
0058         return points_end(multipoint);
0059     }
0060 };
0061 
0062 
0063 }} // namespace detail::distance
0064 #endif // DOXYGEN_NO_DETAIL
0065 
0066 
0067 }} // namespace boost::geometry
0068 
0069 
0070 #endif // BOOST_GEOMETRY_ALGORITHS_DETAIL_DISTANCE_ITERATOR_SELECTOR_HPP