Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:50:02

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2018-2020.
0006 // Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
0012 
0013 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
0014 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
0015 
0016 
0017 #include <boost/geometry/core/coordinate_type.hpp>
0018 #include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
0019 #include <boost/geometry/algorithms/expand.hpp>
0020 
0021 
0022 namespace boost { namespace geometry
0023 {
0024 
0025 #ifndef DOXYGEN_NO_DETAIL
0026 namespace detail { namespace section
0027 {
0028 
0029 template <typename Strategy>
0030 struct get_section_box
0031 {
0032     get_section_box(Strategy const& strategy)
0033         : m_strategy(strategy)
0034     {}
0035 
0036     template <typename Box, typename Section>
0037     inline void apply(Box& total, Section const& section) const
0038     {
0039         assert_coordinate_type_equal(total, section.bounding_box);
0040         geometry::expand(total, section.bounding_box, m_strategy);
0041     }
0042 
0043     Strategy const& m_strategy;
0044 };
0045 
0046 template <typename Strategy>
0047 struct overlaps_section_box
0048 {
0049     overlaps_section_box(Strategy const& strategy)
0050         : m_strategy(strategy)
0051     {}
0052 
0053     template <typename Box, typename Section>
0054     inline bool apply(Box const& box, Section const& section) const
0055     {
0056         assert_coordinate_type_equal(box, section.bounding_box);
0057         return ! detail::disjoint::disjoint_box_box(box, section.bounding_box,
0058                                                     m_strategy);
0059     }
0060 
0061     Strategy const& m_strategy;
0062 };
0063 
0064 
0065 }} // namespace detail::section
0066 #endif
0067 
0068 
0069 }} // namespace boost::geometry
0070 
0071 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP