interior_iterator.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Boost.Geometry
  2. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
  3. // Use, modification and distribution is subject to the Boost Software License,
  4. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP
  7. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP
  8. #include <boost/range/iterator.hpp>
  9. #include <boost/range/value_type.hpp>
  10. #include <boost/geometry/core/interior_type.hpp>
  11. namespace boost { namespace geometry
  12. {
  13. #ifndef DOXYGEN_NO_DETAIL
  14. namespace detail
  15. {
  16. /*!
  17. \brief Structure defining the type of interior rings iterator
  18. \note If the Geometry is const, const iterator is defined.
  19. \tparam Geometry \tparam_geometry
  20. */
  21. template <typename Geometry>
  22. struct interior_iterator
  23. {
  24. typedef typename boost::range_iterator
  25. <
  26. typename geometry::interior_type<Geometry>::type
  27. >::type type;
  28. };
  29. template <typename BaseT, typename T>
  30. struct copy_const
  31. {
  32. typedef T type;
  33. };
  34. template <typename BaseT, typename T>
  35. struct copy_const<BaseT const, T>
  36. {
  37. typedef T const type;
  38. };
  39. template <typename Geometry>
  40. struct interior_ring_iterator
  41. {
  42. typedef typename boost::range_iterator
  43. <
  44. typename copy_const
  45. <
  46. typename geometry::interior_type<Geometry>::type,
  47. typename boost::range_value
  48. <
  49. typename geometry::interior_type<Geometry>::type
  50. >::type
  51. >::type
  52. >::type type;
  53. };
  54. } // namespace detail
  55. #endif // DOXYGEN_NO_DETAIL
  56. }} // namespace boost::geometry
  57. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP