warnings fixed, query and nearest visitors renamed

[SVN r81482]
This commit is contained in:
Adam Wulkiewicz
2012-11-22 11:31:58 +00:00
parent 1ef9d77894
commit 52e8317c3b
7 changed files with 43 additions and 32 deletions

View File

@@ -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*/)
{}
};

View File

@@ -148,19 +148,30 @@ private:
size_t min_elements;
};
namespace detail {
inline size_t default_rstar_reinserted_elements()
{
return (std::numeric_limits<size_t>::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; }

View File

@@ -36,8 +36,8 @@
#include <boost/geometry/extensions/index/rtree/visitors/remove.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/copy.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/destroy.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/query.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/nearest.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/spatial_query.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/nearest_query.hpp>
#include <boost/geometry/extensions/index/rtree/visitors/children_box.hpp>
#include <boost/geometry/extensions/index/rtree/linear/linear.hpp>
@@ -346,7 +346,7 @@ public:
template <typename Predicates, typename OutIter>
inline size_type spatial_query(Predicates const& pred, OutIter out_it) const
{
detail::rtree::visitors::query<value_type, options_type, translator_type, box_type, allocators_type, Predicates, OutIter>
detail::rtree::visitors::spatial_query<value_type, options_type, translator_type, box_type, allocators_type, Predicates, OutIter>
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<DistancesPredicates>::type point_relation;
typedef typename detail::relation<point_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<DistancesPredicates>::type point_relation;
typedef typename detail::relation<point_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,

View File

@@ -52,7 +52,7 @@ public:
rtree::destroy_node<Allocators, internal_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<leaf>(m_current_node), "invalid pointers");

View File

@@ -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 <boost/geometry/extensions/index/rtree/distance_predicates.hpp>
@@ -25,7 +25,7 @@ namespace detail { namespace rtree { namespace visitors {
// - well not with this algorithm of storing k-th neighbor
template <typename Value, typename Translator, typename Point>
struct nearest_one
struct nearest_query_result_one
{
public:
typedef typename geometry::default_distance_result<
@@ -33,7 +33,7 @@ public:
typename translator::indexable_type<Translator>::type
>::type distance_type;
inline nearest_one()
inline nearest_query_result_one()
: m_comp_dist((std::numeric_limits<distance_type>::max)())
{}
@@ -68,7 +68,7 @@ private:
};
template <typename Value, typename Translator, typename Point>
struct nearest_k
struct nearest_query_result_k
{
public:
typedef typename geometry::default_distance_result<
@@ -76,7 +76,7 @@ public:
typename translator::indexable_type<Translator>::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<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::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

View File

@@ -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 <boost/geometry/extensions/index/rtree/predicates.hpp>
@@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace index {
namespace detail { namespace rtree { namespace visitors {
template <typename Value, typename Options, typename Translator, typename Box, typename Allocators, typename Predicates, typename OutIter>
struct query
struct spatial_query
: public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
, index::nonassignable
{
@@ -28,7 +28,7 @@ struct query
typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::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

View File

@@ -327,7 +327,7 @@ template <>
struct test_overlap_impl<bg::point_tag>
{
template <typename Value, typename Algo, typename Box>
static void apply(bgi::rtree<Value, Algo> const& tree, std::vector<Value> const& input, Box const& qbox)
static void apply(bgi::rtree<Value, Algo> const& /*tree*/, std::vector<Value> const& /*input*/, Box const& /*qbox*/)
{}
};