1 // Boost.Geometry Index
3 // boxes union/intersection area/volume
5 // Copyright (c) 2011-2016 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
12 #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
14 #include <boost/geometry/algorithms/intersection.hpp>
15 #include <boost/geometry/strategies/intersection_strategies.hpp>
16 #include <boost/geometry/index/detail/algorithms/content.hpp>
18 namespace boost { namespace geometry { namespace index { namespace detail {
21 * \brief Compute the area of the intersection of b1 and b2
23 template <typename Box>
24 inline typename default_content_result<Box>::type intersection_content(Box const& box1, Box const& box2)
26 if ( geometry::intersects(box1, box2) )
29 if ( geometry::intersection(box1, box2, box_intersection) )
30 return detail::content(box_intersection);
35 }}}} // namespace boost::geometry::index::detail
37 #endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP