multi_modify.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2017.
  6. // Modifications copyright (c) 2017 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP
  14. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP
  15. #include <boost/range.hpp>
  16. namespace boost { namespace geometry
  17. {
  18. #ifndef DOXYGEN_NO_DETAIL
  19. namespace detail
  20. {
  21. template <typename MultiGeometry, typename Policy>
  22. struct multi_modify
  23. {
  24. static inline void apply(MultiGeometry& multi)
  25. {
  26. typedef typename boost::range_iterator<MultiGeometry>::type iterator_type;
  27. for (iterator_type it = boost::begin(multi);
  28. it != boost::end(multi);
  29. ++it)
  30. {
  31. Policy::apply(*it);
  32. }
  33. }
  34. template <typename Strategy>
  35. static inline void apply(MultiGeometry& multi, Strategy const& strategy)
  36. {
  37. typedef typename boost::range_iterator<MultiGeometry>::type iterator_type;
  38. for (iterator_type it = boost::begin(multi);
  39. it != boost::end(multi);
  40. ++it)
  41. {
  42. Policy::apply(*it, strategy);
  43. }
  44. }
  45. };
  46. } // namespace detail
  47. #endif
  48. }} // namespace boost::geometry
  49. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_HPP