expand_segment.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
  5. // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
  6. // This file was modified by Oracle on 2015, 2016, 2017, 2018.
  7. // Modifications copyright (c) 2015-2018, Oracle and/or its affiliates.
  8. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  9. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  10. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // (See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_EXPAND_SEGMENT_HPP
  15. #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_EXPAND_SEGMENT_HPP
  16. #include <boost/geometry/core/tags.hpp>
  17. #include <boost/geometry/algorithms/detail/expand/indexed.hpp>
  18. #include <boost/geometry/strategies/expand.hpp>
  19. namespace boost { namespace geometry
  20. {
  21. namespace strategy { namespace expand
  22. {
  23. class cartesian_segment
  24. {
  25. public:
  26. template <typename Box, typename Segment>
  27. static void apply(Box & box, Segment const& segment)
  28. {
  29. geometry::detail::expand::expand_indexed
  30. <
  31. 0, dimension<Segment>::value
  32. >::apply(box, segment);
  33. }
  34. };
  35. #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  36. namespace services
  37. {
  38. template <typename CalculationType>
  39. struct default_strategy<segment_tag, cartesian_tag, CalculationType>
  40. {
  41. typedef cartesian_segment type;
  42. };
  43. } // namespace services
  44. #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  45. }} // namespace strategy::expand
  46. }} // namespace boost::geometry
  47. #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_EXPAND_SEGMENT_HPP