]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry Index |
2 | // | |
3 | // boxes union/sum area/volume | |
4 | // | |
5 | // Copyright (c) 2008 Federico J. Fernandez. | |
6 | // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. | |
7 | // | |
8 | // Use, modification and distribution is subject to the Boost Software License, | |
9 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
10 | // http://www.boost.org/LICENSE_1_0.txt) | |
11 | ||
12 | #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_UNION_CONTENT_HPP | |
13 | #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_UNION_CONTENT_HPP | |
14 | ||
15 | #include <boost/geometry/algorithms/expand.hpp> | |
16 | #include <boost/geometry/index/detail/algorithms/content.hpp> | |
17 | ||
18 | namespace boost { namespace geometry { namespace index { namespace detail { | |
19 | ||
20 | /** | |
21 | * \brief Compute the area of the union of b1 and b2 | |
22 | */ | |
23 | template <typename Box, typename Geometry> | |
24 | inline typename default_content_result<Box>::type union_content(Box const& b, Geometry const& g) | |
25 | { | |
26 | Box expanded_box(b); | |
27 | geometry::expand(expanded_box, g); | |
28 | return detail::content(expanded_box); | |
29 | } | |
30 | ||
31 | }}}} // namespace boost::geometry::index::detail | |
32 | ||
33 | #endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_UNION_CONTENT_HPP |