summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/sections/section_box_policies.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/sections/section_box_policies.hpp')
-rw-r--r--boost/geometry/algorithms/detail/sections/section_box_policies.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/boost/geometry/algorithms/detail/sections/section_box_policies.hpp b/boost/geometry/algorithms/detail/sections/section_box_policies.hpp
new file mode 100644
index 0000000000..cf06700306
--- /dev/null
+++ b/boost/geometry/algorithms/detail/sections/section_box_policies.hpp
@@ -0,0 +1,49 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP
+
+
+#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
+#include <boost/geometry/algorithms/expand.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace section
+{
+
+struct get_section_box
+{
+ template <typename Box, typename Section>
+ static inline void apply(Box& total, Section const& section)
+ {
+ geometry::expand(total, section.bounding_box);
+ }
+};
+
+struct overlaps_section_box
+{
+ template <typename Box, typename Section>
+ static inline bool apply(Box const& box, Section const& section)
+ {
+ return ! detail::disjoint::disjoint_box_box(box, section.bounding_box);
+ }
+};
+
+
+}} // namespace detail::section
+#endif
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTION_BOX_POLICIES_HPP