order_as_direction.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 2021.
  6. // Modifications copyright (c) 2021 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_UTIL_ORDER_AS_DIRECTION_HPP
  14. #define BOOST_GEOMETRY_UTIL_ORDER_AS_DIRECTION_HPP
  15. #include <boost/geometry/core/point_order.hpp>
  16. namespace boost { namespace geometry
  17. {
  18. /*!
  19. \brief Flag for iterating a reversible_view in forward or reverse direction
  20. \ingroup views
  21. */
  22. enum iterate_direction { iterate_forward, iterate_reverse };
  23. template<order_selector Order>
  24. struct order_as_direction
  25. {};
  26. template<>
  27. struct order_as_direction<clockwise>
  28. {
  29. static const iterate_direction value = iterate_forward;
  30. };
  31. template<>
  32. struct order_as_direction<counterclockwise>
  33. {
  34. static const iterate_direction value = iterate_reverse;
  35. };
  36. }} // namespace boost::geometry
  37. #endif // BOOST_GEOMETRY_UTIL_ORDER_AS_DIRECTION_HPP