diff --git a/include/boost/geometry/extensions/index/rtree/node/node.hpp b/include/boost/geometry/extensions/index/rtree/node/node.hpp index 0b87589fb..87f5d9d0a 100644 --- a/include/boost/geometry/extensions/index/rtree/node/node.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/node.hpp @@ -109,9 +109,9 @@ struct destroy_elements } } - inline static void apply(typename leaf::elements_type::iterator first, - typename leaf::elements_type::iterator last, - Allocators &) + inline static void apply(typename leaf::elements_type::iterator /*first*/, + typename leaf::elements_type::iterator /*last*/, + Allocators & /*allocators*/) {} }; diff --git a/include/boost/geometry/extensions/index/rtree/options.hpp b/include/boost/geometry/extensions/index/rtree/options.hpp index 87d26a02f..0893f65c9 100644 --- a/include/boost/geometry/extensions/index/rtree/options.hpp +++ b/include/boost/geometry/extensions/index/rtree/options.hpp @@ -148,19 +148,30 @@ private: size_t min_elements; }; +namespace detail { + +inline size_t default_rstar_reinserted_elements() +{ + return (std::numeric_limits::max)(); +}; + +} // namespace options::detail + class rstar { public: - static const size_t default_reinserted_elements = -1; - rstar(size_t max_elements_, size_t min_elements_, size_t overlap_cost_threshold_ = 0, - size_t reinserted_elements_ = default_reinserted_elements) + size_t reinserted_elements_ = detail::default_rstar_reinserted_elements()) : max_elements(max_elements_) , min_elements(min_elements_) , overlap_cost_threshold(overlap_cost_threshold_) - , reinserted_elements(default_reinserted_elements == reinserted_elements_ ? (max_elements_ * 3) / 10 : reinserted_elements_) + , reinserted_elements( + detail::default_rstar_reinserted_elements() == reinserted_elements_ ? + (max_elements_ * 3) / 10 : + reinserted_elements_ + ) {} size_t get_max_elements() const { return max_elements; } diff --git a/include/boost/geometry/extensions/index/rtree/rtree.hpp b/include/boost/geometry/extensions/index/rtree/rtree.hpp index 8020cdaf5..0c75c9b18 100644 --- a/include/boost/geometry/extensions/index/rtree/rtree.hpp +++ b/include/boost/geometry/extensions/index/rtree/rtree.hpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -346,7 +346,7 @@ public: template inline size_type spatial_query(Predicates const& pred, OutIter out_it) const { - detail::rtree::visitors::query + detail::rtree::visitors::spatial_query find_v(m_translator, pred, out_it); detail::rtree::apply_visitor(find_v, *m_root); @@ -749,7 +749,7 @@ private: typedef typename detail::point_relation::type point_relation; typedef typename detail::relation::value_type point_type; - typedef detail::rtree::visitors::nearest_one< + typedef detail::rtree::visitors::nearest_query_result_one< value_type, translator_type, point_type @@ -757,7 +757,7 @@ private: result_type result; - detail::rtree::visitors::nearest< + detail::rtree::visitors::nearest_query< value_type, options_type, translator_type, @@ -784,7 +784,7 @@ private: typedef typename detail::point_relation::type point_relation; typedef typename detail::relation::value_type point_type; - typedef detail::rtree::visitors::nearest_k< + typedef detail::rtree::visitors::nearest_query_result_k< value_type, translator_type, point_type @@ -792,7 +792,7 @@ private: result_type result(k); - detail::rtree::visitors::nearest< + detail::rtree::visitors::nearest_query< value_type, options_type, translator_type, diff --git a/include/boost/geometry/extensions/index/rtree/visitors/destroy.hpp b/include/boost/geometry/extensions/index/rtree/visitors/destroy.hpp index 567e66d84..0d60fae83 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/destroy.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/destroy.hpp @@ -52,7 +52,7 @@ public: rtree::destroy_node::apply(m_allocators, node_to_destroy); } - inline void operator()(leaf & l) + inline void operator()(leaf & BOOST_GEOMETRY_INDEX_ASSERT_UNUSED_PARAM(l)) { BOOST_GEOMETRY_INDEX_ASSERT(&l == rtree::get(m_current_node), "invalid pointers"); diff --git a/include/boost/geometry/extensions/index/rtree/visitors/nearest.hpp b/include/boost/geometry/extensions/index/rtree/visitors/nearest_query.hpp similarity index 95% rename from include/boost/geometry/extensions/index/rtree/visitors/nearest.hpp rename to include/boost/geometry/extensions/index/rtree/visitors/nearest_query.hpp index f11d64f4b..54b81d8bf 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/nearest.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/nearest_query.hpp @@ -1,6 +1,6 @@ // Boost.Geometry Index // -// R-tree k nearest neighbour querying visitor implementation +// R-tree k nearest neighbour query visitor implementation // // Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. // @@ -8,8 +8,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_HPP -#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_HPP +#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_QUERY_HPP +#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_QUERY_HPP #include @@ -25,7 +25,7 @@ namespace detail { namespace rtree { namespace visitors { // - well not with this algorithm of storing k-th neighbor template -struct nearest_one +struct nearest_query_result_one { public: typedef typename geometry::default_distance_result< @@ -33,7 +33,7 @@ public: typename translator::indexable_type::type >::type distance_type; - inline nearest_one() + inline nearest_query_result_one() : m_comp_dist((std::numeric_limits::max)()) {} @@ -68,7 +68,7 @@ private: }; template -struct nearest_k +struct nearest_query_result_k { public: typedef typename geometry::default_distance_result< @@ -76,7 +76,7 @@ public: typename translator::indexable_type::type >::type distance_type; - inline explicit nearest_k(size_t k) + inline explicit nearest_query_result_k(size_t k) : m_count(k) { BOOST_GEOMETRY_INDEX_ASSERT(0 < m_count, "Number of neighbors should be greater than 0"); @@ -156,7 +156,7 @@ template < typename Predicates, typename Result > -class nearest +class nearest_query : public rtree::visitor::type , index::nonassignable { @@ -183,7 +183,7 @@ public: rtree::value_tag > value_distances_predicates_check; - inline nearest(parameters_type const& parameters, Translator const& translator, DistancesPredicates const& dist_pred, Predicates const& pred, Result & r) + inline nearest_query(parameters_type const& parameters, Translator const& translator, DistancesPredicates const& dist_pred, Predicates const& pred, Result & r) : m_parameters(parameters), m_translator(translator) , m_dist_pred(dist_pred), m_pred(pred) , m_result(r) @@ -337,4 +337,4 @@ private: }}} // namespace boost::geometry::index -#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_HPP +#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_NEAREST_QUERY_HPP diff --git a/include/boost/geometry/extensions/index/rtree/visitors/query.hpp b/include/boost/geometry/extensions/index/rtree/visitors/spatial_query.hpp similarity index 87% rename from include/boost/geometry/extensions/index/rtree/visitors/query.hpp rename to include/boost/geometry/extensions/index/rtree/visitors/spatial_query.hpp index 689e525aa..10926f2f2 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/query.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/spatial_query.hpp @@ -1,6 +1,6 @@ // Boost.Geometry Index // -// R-tree querying visitor implementation +// R-tree spatial query visitor implementation // // Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. // @@ -8,8 +8,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_QUERY_HPP -#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_QUERY_HPP +#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_SPATIAL_QUERY_HPP +#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_SPATIAL_QUERY_HPP #include @@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace visitors { template -struct query +struct spatial_query : public rtree::visitor::type , index::nonassignable { @@ -28,7 +28,7 @@ struct query typedef typename rtree::internal_node::type internal_node; typedef typename rtree::leaf::type leaf; - inline query(Translator const& t, Predicates const& p, OutIter out_it) + inline spatial_query(Translator const& t, Predicates const& p, OutIter out_it) : tr(t), pred(p), out_iter(out_it), found_count(0) {} @@ -78,4 +78,4 @@ struct query }}} // namespace boost::geometry::index -#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_QUERY_HPP +#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_SPATIAL_QUERY_HPP diff --git a/test/rtree/test_rtree.hpp b/test/rtree/test_rtree.hpp index d7bf83b6f..b33468cf3 100644 --- a/test/rtree/test_rtree.hpp +++ b/test/rtree/test_rtree.hpp @@ -327,7 +327,7 @@ template <> struct test_overlap_impl { template - static void apply(bgi::rtree const& tree, std::vector const& input, Box const& qbox) + static void apply(bgi::rtree const& /*tree*/, std::vector const& /*input*/, Box const& /*qbox*/) {} };