// Boost.Geometry Index // // R-tree node children box calculating visitor implementation // // Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland. // // 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_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace visitors { template class children_box : public rtree::visitor::type { typedef typename rtree::internal_node::type internal_node; typedef typename rtree::leaf::type leaf; public: inline children_box(Box & result, Translator const& tr) : m_result(result), m_tr(tr) {} inline void operator()(internal_node const& n) { typedef typename rtree::elements_type::type elements_type; elements_type const& elements = rtree::elements(n); m_result = rtree::elements_box(elements.begin(), elements.end(), m_tr); } inline void operator()(leaf const& n) { typedef typename rtree::elements_type::type elements_type; elements_type const& elements = rtree::elements(n); m_result = rtree::values_box(elements.begin(), elements.end(), m_tr); } private: Box & m_result; Translator const& m_tr; }; }}} // namespace detail::rtree::visitors }}} // namespace boost::geometry::index #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP