section_box_policies.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // This file was modified by Oracle on 2018.
  4. // Modifications copyright (c) 2018, Oracle and/or its affiliates.
  5. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  6. // Use, modification and distribution is subject to the Boost Software License,
  7. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
  10. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
  11. #include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
  12. #include <boost/geometry/algorithms/expand.hpp>
  13. namespace boost { namespace geometry
  14. {
  15. #ifndef DOXYGEN_NO_DETAIL
  16. namespace detail { namespace section
  17. {
  18. template <typename ExpandBoxStrategy>
  19. struct get_section_box
  20. {
  21. template <typename Box, typename Section>
  22. static inline void apply(Box& total, Section const& section)
  23. {
  24. geometry::expand(total, section.bounding_box,
  25. ExpandBoxStrategy());
  26. }
  27. };
  28. template <typename DisjointBoxBoxStrategy>
  29. struct overlaps_section_box
  30. {
  31. template <typename Box, typename Section>
  32. static inline bool apply(Box const& box, Section const& section)
  33. {
  34. return ! detail::disjoint::disjoint_box_box(box, section.bounding_box,
  35. DisjointBoxBoxStrategy());
  36. }
  37. };
  38. }} // namespace detail::section
  39. #endif
  40. }} // namespace boost::geometry
  41. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP