Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72562 - in sandbox-branches/geometry/index_080_new: boost/geometry/extensions/index/rtree boost/geometry/extensions/index/rtree/linear boost/geometry/extensions/index/rtree/quadratic boost/geometry/extensions/index/rtree/rstar boost/geometry/extensions/index/rtree/visitors tests
From: adam.wulkiewicz_at_[hidden]
Date: 2011-06-12 20:26:40


Author: awulkiew
Date: 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
New Revision: 72562
URL: http://svn.boost.org/trac/boost/changeset/72562

Log:
simple Tag template parameter replaced by Algo traits containing tags of some number of algorithms. User now may use a combination of implemented algorithms or just use one of the predefined.
Added:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/algo.hpp (contents, props changed)
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/algo.hpp (contents, props changed)
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/algo.hpp (contents, props changed)
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/algo.hpp (contents, props changed)
Text files modified:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp | 2
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/linear.hpp | 7 --
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp | 10 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/quadratic.hpp | 7 --
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp | 22 ++++----
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp | 10 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp | 97 +++++++++++++++++++--------------------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp | 10 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rstar.hpp | 7 --
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp | 33 +++++++------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp | 18 +++---
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp | 18 +++---
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp | 8 +-
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp | 10 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp | 24 ++++----
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 46 +++++++++++-------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp | 8 +-
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/print.hpp | 22 ++++----
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp | 14 ++--
   sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp | 4 +
   sandbox-branches/geometry/index_080_new/tests/translators.hpp | 1
   21 files changed, 189 insertions(+), 189 deletions(-)

Added: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/algo.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/algo.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Boost.SpatialIndex - rtree variants algorithms
+//
+// Copyright 2011 Adam Wulkiewicz.
+// 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_EXTENSIONS_INDEX_RTREE_ALGO_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_ALGO_HPP
+
+namespace boost { namespace geometry { namespace index {
+
+struct default_tag {};
+struct analyze_area_tag {};
+
+namespace detail { namespace rtree {
+
+template <typename InsertTag, typename ChooseNextNodeTag, typename RedistributeTag, typename NodeTag>
+struct algo
+{
+ typedef InsertTag insert_tag;
+ typedef ChooseNextNodeTag choose_next_node_tag;
+ typedef RedistributeTag redistribute_tag;
+ typedef NodeTag node_tag;
+};
+
+template <typename Tag>
+struct algo_type
+{
+ typedef void type;
+};
+
+template <typename InsertTag, typename ChooseNextNodeTag, typename RedistributeTag, typename NodeTag>
+struct algo_type< algo<InsertTag, ChooseNextNodeTag, RedistributeTag, NodeTag> >
+{
+ typedef algo<InsertTag, ChooseNextNodeTag, RedistributeTag, NodeTag> type;
+};
+
+}} // namespace detail::rtree
+
+}}} // namespace boost::geometry::index
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_ALGO_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -20,7 +20,7 @@
 
 namespace boost { namespace geometry { namespace index {
 
-template <typename Value, typename Translator, typename Tag>
+template <typename Value, typename Tag, typename Translator>
 class rtree;
 
 namespace filters {

Added: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/algo.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/algo.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -0,0 +1,29 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Boost.SpatialIndex - rtree variants algorithms
+//
+// Copyright 2011 Adam Wulkiewicz.
+// 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_EXTENSIONS_INDEX_RTREE_LINEAR_ALGO_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_LINEAR_ALGO_HPP
+
+namespace boost { namespace geometry { namespace index {
+
+struct linear_tag {};
+
+namespace detail { namespace rtree {
+
+template <>
+struct algo_type<linear_tag>
+{
+ typedef algo<default_tag, analyze_area_tag, linear_tag, default_tag> type;
+};
+
+}} // namespace detail::rtree
+
+}}} // namespace boost::geometry::index
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_LINEAR_ALGO_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/linear.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/linear.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/linear.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -10,12 +10,7 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_LINEAR_LINEAR_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_LINEAR_LINEAR_HPP
 
-namespace boost { namespace geometry { namespace index {
-
-struct linear_tag {};
-
-}}} // namespace boost::geometry::index
-
+#include <boost/geometry/extensions/index/rtree/linear/algo.hpp>
 #include <boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp>
 
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_LINEAR_LINEAR_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -172,12 +172,12 @@
 
 // from void split_node(node_pointer const& n, node_pointer& n1, node_pointer& n2) const
 
-template <typename Value, typename Translator, typename Box>
-struct redistribute_elements<Value, Translator, Box, linear_tag>
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct redistribute_elements<Value, Algo, Translator, Box, linear_tag>
 {
- typedef typename rtree::node<Value, Box, linear_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, linear_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, linear_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     template <typename Node>
     static inline void apply(Node & n,

Added: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/algo.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/algo.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -0,0 +1,29 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Boost.SpatialIndex - rtree variants algorithms
+//
+// Copyright 2011 Adam Wulkiewicz.
+// 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_EXTENSIONS_INDEX_RTREE_QUADRATIC_ALGO_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_QUADRATIC_ALGO_HPP
+
+namespace boost { namespace geometry { namespace index {
+
+struct quadratic_tag {};
+
+namespace detail { namespace rtree {
+
+template <>
+struct algo_type<quadratic_tag>
+{
+ typedef algo<default_tag, analyze_area_tag, quadratic_tag, default_tag> type;
+};
+
+}} // namespace detail::rtree
+
+}}} // namespace boost::geometry::index
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_QUADRATIC_ALGO_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/quadratic.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/quadratic.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/quadratic.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -10,12 +10,7 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_QUADRATIC_QUADRATIC_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_QUADRATIC_QUADRATIC_HPP
 
-namespace boost { namespace geometry { namespace index {
-
-struct quadratic_tag {};
-
-}}} // namespace boost::geometry::index
-
+#include <boost/geometry/extensions/index/rtree/quadratic/algo.hpp>
 #include <boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp>
 
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_QUADRATIC_QUADRATIC_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -75,23 +75,23 @@
 
 } // namespace quadratic
 
-template <typename Value, typename Translator, typename Box>
-struct redistribute_elements<Value, Translator, Box, quadratic_tag>
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct redistribute_elements<Value, Algo, Translator, Box, quadratic_tag>
 {
- typedef typename rtree::node<Value, Box, quadratic_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, quadratic_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, quadratic_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     typedef typename index::default_area_result<Box>::type area_type;
 
     template <typename Node>
     static inline void apply(Node & n,
- Node & second_node,
- Box & box1,
- Box & box2,
- size_t min_elems,
- size_t max_elems,
- Translator const& tr)
+ Node & second_node,
+ Box & box1,
+ Box & box2,
+ size_t min_elems,
+ size_t max_elems,
+ Translator const& tr)
     {
         typedef typename rtree::elements_type<Node>::type elements_type;
         typedef typename elements_type::value_type element_type;

Added: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/algo.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/algo.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -0,0 +1,31 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Boost.SpatialIndex - rtree variants algorithms
+//
+// Copyright 2011 Adam Wulkiewicz.
+// 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_EXTENSIONS_INDEX_RTREE_RSTAR_ALGO_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_ALGO_HPP
+
+namespace boost { namespace geometry { namespace index {
+
+struct with_reinsert_tag {};
+struct find_minimum_cost_tag {};
+struct rstar_tag {};
+
+namespace detail { namespace rtree {
+
+template <>
+struct algo_type<rstar_tag>
+{
+ typedef algo<with_reinsert_tag, find_minimum_cost_tag, rstar_tag, default_tag> type;
+};
+
+}} // namespace detail::rtree
+
+}}} // namespace boost::geometry::index
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_ALGO_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -27,12 +27,12 @@
 
 namespace detail {
 
-template <typename Value, typename Box>
-class choose_next_node<Value, Box, rstar_tag>
+template <typename Value, typename Algo, typename Box>
+class choose_next_node<Value, Algo, Box, find_minimum_cost_tag>
 {
- typedef typename rtree::node<Value, Box, rstar_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, rstar_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     typedef typename rtree::elements_type<internal_node>::type children_type;
 

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -25,23 +25,22 @@
 
 namespace rstar {
 
-template <typename Value, typename Translator, typename Box>
+template <typename Value, typename Algo, typename Translator, typename Box>
 class remove_elements_to_reinsert
 {
 public:
- typedef typename rtree::node<Value, Box, rstar_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, rstar_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     template <typename Node>
- static inline void apply(
- typename rtree::elements_type<Node>::type & result_elements,
- Node & n,
- internal_node *parent,
- size_t current_child_index,
- size_t min_elems,
- size_t max_elems,
- Translator const& tr)
+ static inline void apply(typename rtree::elements_type<Node>::type & result_elements,
+ Node & n,
+ internal_node *parent,
+ size_t current_child_index,
+ size_t min_elems,
+ size_t max_elems,
+ Translator const& tr)
     {
         typedef typename rtree::elements_type<Node>::type elements_type;
         typedef typename elements_type::value_type element_type;
@@ -107,32 +106,32 @@
     }
 };
 
-template <size_t InsertIndex, typename Element, typename Value, typename Box>
+template <size_t InsertIndex, typename Element, typename Value, typename Algo, typename Box>
 struct level_insert_result_type
 {
         typedef typename rtree::elements_type<
- typename rtree::internal_node<Value, Box, rstar_tag>::type
+ typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type
>::type type;
 };
 
-template <typename Value, typename Box>
-struct level_insert_result_type<0, Value, Value, Box>
+template <typename Value, typename Algo, typename Box>
+struct level_insert_result_type<0, Value, Value, Algo, Box>
 {
         typedef typename rtree::elements_type<
- typename rtree::leaf<Value, Box, rstar_tag>::type
+ typename rtree::leaf<Value, Box, typename Algo::node_tag>::type
>::type type;
 };
 
-template <size_t InsertIndex, typename Element, typename Value, typename Translator, typename Box>
+template <size_t InsertIndex, typename Element, typename Value, typename Algo, typename Translator, typename Box>
 struct level_insert_base
- : public detail::insert<Element, Value, Translator, Box, rstar_tag>
+ : public detail::insert<Element, Value, Algo, Translator, Box>
 {
- typedef detail::insert<Element, Value, Translator, Box, rstar_tag> base;
+ typedef detail::insert<Element, Value, Algo, Translator, Box> base;
         typedef typename base::node node;
         typedef typename base::internal_node internal_node;
         typedef typename base::leaf leaf;
 
- typedef typename level_insert_result_type<InsertIndex, Element, Value, Box>::type result_type;
+ typedef typename level_insert_result_type<InsertIndex, Element, Value, Algo, Box>::type result_type;
 
         inline level_insert_base(node* & root,
                                                           size_t & leafs_level,
@@ -159,7 +158,7 @@
                         // node isn't root node
                         if ( base::m_parent )
                         {
- rstar::remove_elements_to_reinsert<Value, Translator, Box>::apply(
+ rstar::remove_elements_to_reinsert<Value, Algo, Translator, Box>::apply(
                                         result_elements, n,
                                         base::m_parent, base::m_current_child_index,
                                         base::m_min_elems_per_node, base::m_max_elems_per_node, base::m_tr);
@@ -199,11 +198,11 @@
         result_type result_elements;
 };
 
-template <size_t InsertIndex, typename Element, typename Value, typename Translator, typename Box>
+template <size_t InsertIndex, typename Element, typename Value, typename Algo, typename Translator, typename Box>
 struct level_insert
- : public level_insert_base<InsertIndex, Element, Value, Translator, Box>
+ : public level_insert_base<InsertIndex, Element, Value, Algo, Translator, Box>
 {
- typedef level_insert_base<InsertIndex, Element, Value, Translator, Box> base;
+ typedef level_insert_base<InsertIndex, Element, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
     typedef typename base::internal_node internal_node;
     typedef typename base::leaf leaf;
@@ -268,11 +267,11 @@
     }
 };
 
-template <size_t InsertIndex, typename Value, typename Translator, typename Box>
-struct level_insert<InsertIndex, Value, Value, Translator, Box>
- : public level_insert_base<InsertIndex, Value, Value, Translator, Box>
+template <size_t InsertIndex, typename Value, typename Algo, typename Translator, typename Box>
+struct level_insert<InsertIndex, Value, Value, Algo, Translator, Box>
+ : public level_insert_base<InsertIndex, Value, Value, Algo, Translator, Box>
 {
- typedef level_insert_base<InsertIndex, Value, Value, Translator, Box> base;
+ typedef level_insert_base<InsertIndex, Value, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
     typedef typename base::internal_node internal_node;
     typedef typename base::leaf leaf;
@@ -319,11 +318,11 @@
     }
 };
 
-template <typename Value, typename Translator, typename Box>
-struct level_insert<0, Value, Value, Translator, Box>
- : public level_insert_base<0, Value, Value, Translator, Box>
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct level_insert<0, Value, Value, Algo, Translator, Box>
+ : public level_insert_base<0, Value, Value, Algo, Translator, Box>
 {
- typedef level_insert_base<0, Value, Value, Translator, Box> base;
+ typedef level_insert_base<0, Value, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
     typedef typename base::internal_node internal_node;
     typedef typename base::leaf leaf;
@@ -366,13 +365,13 @@
 };
 
 // R*-tree insert visitor
-template <typename Element, typename Value, typename Translator, typename Box>
-class insert : public rtree::visitor<Value, Box, rstar_tag, false>::type
+template <typename Element, typename Value, typename Algo, typename Translator, typename Box>
+class insert : public rtree::visitor<Value, Box, typename Algo::node_tag, false>::type
 {
 protected:
- typedef typename rtree::node<Value, Box, rstar_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, rstar_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
 public:
     inline insert(node* & root,
@@ -392,7 +391,7 @@
     {
         typedef typename elements_type<internal_node>::type elements_type;
 
- rstar::level_insert<0, Element, Value, Translator, Box> lins_v(
+ rstar::level_insert<0, Element, Value, Algo, Translator, Box> lins_v(
             m_root, m_leafs_level, m_element, m_min_elements, m_max_elements, m_tr, m_relative_level);
 
         rtree::apply_visitor(lins_v, n);
@@ -405,7 +404,7 @@
 
     inline void operator()(leaf & n)
     {
- rstar::level_insert<0, Element, Value, Translator, Box> lins_v(
+ rstar::level_insert<0, Element, Value, Algo, Translator, Box> lins_v(
             m_root, m_leafs_level, m_element, m_min_elements, m_max_elements, m_tr, m_relative_level);
 
         rtree::apply_visitor(lins_v, n);
@@ -424,7 +423,7 @@
         for ( typename Elements::const_reverse_iterator it = elements.rbegin();
             it != elements.rend(); ++it)
         {
- rstar::level_insert<1, element_type, Value, Translator, Box> lins_v(
+ rstar::level_insert<1, element_type, Value, Algo, Translator, Box> lins_v(
                 m_root, m_leafs_level, *it, m_min_elements, m_max_elements, m_tr, relative_level);
 
             rtree::apply_visitor(lins_v, *m_root);
@@ -453,11 +452,11 @@
 } // namespace detail
 
 // R*-tree insert visitor
-template <typename Element, typename Value, typename Translator, typename Box>
-class insert<Element, Value, Translator, Box, rstar_tag>
- : public detail::rstar::insert<Element, Value, Translator, Box>
+template <typename Element, typename Value, typename Algo, typename Translator, typename Box>
+class insert<Element, Value, Algo, Translator, Box, with_reinsert_tag>
+ : public detail::rstar::insert<Element, Value, Algo, Translator, Box>
 {
- typedef detail::rstar::insert<Element, Value, Translator, Box> base;
+ typedef detail::rstar::insert<Element, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
 
 public:
@@ -474,11 +473,11 @@
 };
 
 // R*-tree insert visitor
-template <typename Value, typename Translator, typename Box>
-class insert<Value, Value, Translator, Box, rstar_tag>
- : public detail::rstar::insert<Value, Value, Translator, Box>
+template <typename Value, typename Algo, typename Translator, typename Box>
+class insert<Value, Value, Algo, Translator, Box, with_reinsert_tag>
+ : public detail::rstar::insert<Value, Value, Algo, Translator, Box>
 {
- typedef detail::rstar::insert<Value, Value, Translator, Box> base;
+ typedef detail::rstar::insert<Value, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
 
 public:

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -311,12 +311,12 @@
 
 } // namespace rstar
 
-template <typename Value, typename Translator, typename Box>
-struct redistribute_elements<Value, Translator, Box, rstar_tag>
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct redistribute_elements<Value, Algo, Translator, Box, rstar_tag>
 {
- typedef typename rtree::node<Value, Box, rstar_tag>::type node;
- typedef typename rtree::internal_node<Value, Box, rstar_tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
         static const size_t dimension = index::traits::dimension<Box>::value;
 

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rstar.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rstar.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rstar.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -10,12 +10,7 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RSTAR_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RSTAR_HPP
 
-namespace boost { namespace geometry { namespace index {
-
-struct rstar_tag {};
-
-}}} // namespace boost::geometry::index
-
+#include <boost/geometry/extensions/index/rtree/rstar/algo.hpp>
 #include <boost/geometry/extensions/index/rtree/rstar/insert.hpp>
 #include <boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp>
 #include <boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp>

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -16,6 +16,7 @@
 
 #include <boost/geometry/extensions/index/translator/def.hpp>
 
+#include <boost/geometry/extensions/index/rtree/algo.hpp>
 #include <boost/geometry/extensions/index/rtree/filters.hpp>
 
 #include <boost/geometry/extensions/index/rtree/visitors/find.hpp>
@@ -33,7 +34,7 @@
 
 template <
     typename Value,
- typename Tag = linear_tag,
+ typename Algo = linear_tag,
         typename Translator = translator::def<Value>
>
 class rtree
@@ -43,11 +44,13 @@
     typedef Translator translator_type;
         typedef typename translator_type::indexable_type indexable_type;
     typedef typename index::default_box_type<indexable_type>::type box_type;
- typedef Tag tag_type;
-
- typedef typename detail::rtree::node<value_type, box_type, tag_type>::type node;
- typedef typename detail::rtree::internal_node<value_type, box_type, tag_type>::type internal_node;
- typedef typename detail::rtree::leaf<value_type, box_type, tag_type>::type leaf;
+
+ typedef typename detail::rtree::algo_type<Algo>::type algo_type;
+ typedef typename algo_type::node_tag node_tag;
+
+ typedef typename detail::rtree::node<value_type, box_type, node_tag>::type node;
+ typedef typename detail::rtree::internal_node<value_type, box_type, node_tag>::type internal_node;
+ typedef typename detail::rtree::leaf<value_type, box_type, node_tag>::type leaf;
 
     inline explicit rtree(
         size_t max_elems_per_node = 4,
@@ -71,7 +74,7 @@
 
     ~rtree()
     {
- detail::rtree::visitors::destroy<value_type, translator_type, box_type, tag_type> del_v;
+ detail::rtree::visitors::destroy<value_type, algo_type, translator_type, box_type> del_v;
         detail::rtree::apply_visitor(del_v, *m_root);
     }
 
@@ -80,7 +83,7 @@
     template <typename Geometry, typename OutIter>
     inline void find(Geometry const& geom, OutIter out_it) const
     {
- detail::rtree::visitors::find<value_type, translator_type, box_type, tag_type, Geometry, OutIter>
+ detail::rtree::visitors::find<value_type, algo_type, translator_type, box_type, Geometry, OutIter>
             find_v(m_translator, geom, out_it);
 
         detail::rtree::apply_visitor(find_v, *m_root);
@@ -90,7 +93,7 @@
     {
         // TODO: awulkiew - assert for correct value
 
- detail::rtree::visitors::insert<value_type, value_type, translator_type, box_type, tag_type>
+ detail::rtree::visitors::insert<value_type, value_type, algo_type, translator_type, box_type, typename algo_type::insert_tag>
             insert_v(m_root, m_leafs_level, value, m_min_elems_per_node, m_max_elems_per_node, m_translator);
 
         detail::rtree::apply_visitor(insert_v, *m_root);
@@ -103,7 +106,7 @@
         // TODO: awulkiew - assert for correct value
         assert(0 < m_values_count);
 
- detail::rtree::visitors::remove<value_type, translator_type, box_type, tag_type>
+ detail::rtree::visitors::remove<value_type, algo_type, translator_type, box_type>
             remove_v(m_root, m_leafs_level, value, m_min_elems_per_node, m_max_elems_per_node, m_translator);
 
         detail::rtree::apply_visitor(remove_v, *m_root);
@@ -153,18 +156,18 @@
     translator_type m_translator;
 };
 
-template <typename Value, typename Translator, typename Tag>
-void insert(rtree<Value, Translator, Tag> & tree, Value const& v)
+template <typename Value, typename Algo, typename Translator>
+void insert(rtree<Value, Algo, Translator> & tree, Value const& v)
 {
     tree.insert(v);
 }
 
-template <typename Value, typename Translator, typename Tag>
-void remove(rtree<Value, Translator, Tag> & tree, Value const& v)
+template <typename Value, typename Algo, typename Translator>
+void remove(rtree<Value, Algo, Translator> & tree, Value const& v)
 {
     tree.remove(v);
 }
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RSTREE_RSTREE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RTREE_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -17,11 +17,11 @@
 
 namespace detail { namespace rtree { namespace visitors {
 
-template <typename Value, typename Translator, typename Box, typename Tag>
-class are_boxes_ok : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+class are_boxes_ok : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
 public:
     inline are_boxes_ok(Translator const& tr)
@@ -107,15 +107,15 @@
 
 }}} // namespace detail::rtree::visitors
 
-template <typename Value, typename Translator, typename Tag>
-bool are_boxes_ok(rtree<Value, Translator, Tag> const& tree)
+template <typename Value, typename Algo, typename Translator>
+bool are_boxes_ok(rtree<Value, Algo, Translator> const& tree)
 {
- typedef rtree<Value, Translator, Tag> rt;
+ typedef rtree<Value, Algo, Translator> rt;
     detail::rtree::visitors::are_boxes_ok<
         typename rt::value_type,
+ typename rt::algo_type,
         typename rt::translator_type,
- typename rt::box_type,
- typename rt::tag_type> v(tree.get_translator());
+ typename rt::box_type> v(tree.get_translator());
     
     tree.apply_visitor(v);
 

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -16,11 +16,11 @@
 
 namespace detail { namespace rtree { namespace visitors {
 
-template <typename Value, typename Translator, typename Box, typename Tag>
-class are_levels_ok : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+class are_levels_ok : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
 public:
     inline are_levels_ok(Translator const& tr)
@@ -85,15 +85,15 @@
 
 }}} // namespace detail::rtree::visitors
 
-template <typename Value, typename Translator, typename Tag>
-bool are_levels_ok(rtree<Value, Translator, Tag> const& tree)
+template <typename Value, typename Algo, typename Translator>
+bool are_levels_ok(rtree<Value, Algo, Translator> const& tree)
 {
- typedef rtree<Value, Translator, Tag> rt;
+ typedef rtree<Value, Algo, Translator> rt;
     detail::rtree::visitors::are_levels_ok<
         typename rt::value_type,
+ typename rt::algo_type,
         typename rt::translator_type,
- typename rt::box_type,
- typename rt::tag_type> v(tree.get_translator());
+ typename rt::box_type> v(tree.get_translator());
     
     tree.apply_visitor(v);
 

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -16,11 +16,11 @@
 
 namespace detail { namespace rtree { namespace visitors {
 
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct destroy : public rtree::visitor<Value, Box, Tag, false>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct destroy : public rtree::visitor<Value, Box, typename Algo::node_tag, false>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline void operator()(internal_node & n)
     {

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -142,12 +142,12 @@
 
 // rtree spatial query visitor
 
-template <typename Value, typename Translator, typename Box, typename Tag, typename Geometry, typename OutIter>
-struct find : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Translator, typename Box, typename Geometry, typename OutIter>
+struct find : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::node<Value, Box, Tag>::type node;
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline find(Translator const& t, Geometry const& g, OutIter out_it)
         : tr(t), geom(g), out_iter(out_it)

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -94,11 +94,11 @@
 
 } // namespace detail
 
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct gl_draw : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct gl_draw : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline gl_draw(Translator const& t,
                    size_t level_first = 0,
@@ -187,23 +187,23 @@
 
 }}} // namespace detail::rtree::visitors
 
-template <typename Value, typename Translator, typename Tag>
-void gl_draw(rtree<Value, Translator, Tag> const& tree,
+template <typename Value, typename Algo, typename Translator>
+void gl_draw(rtree<Value, Algo, Translator> const& tree,
              size_t level_first = 0,
              size_t level_last = std::numeric_limits<size_t>::max(),
              typename index::traits::coordinate_type<
- typename rtree<Value, Translator, Tag>::box_type
+ typename rtree<Value, Algo, Translator>::box_type
>::type z_coord_level_multiplier = 1
              )
 {
- typedef typename rtree<Value, Translator, Tag>::value_type value_type;
- typedef typename rtree<Value, Translator, Tag>::translator_type translator_type;
- typedef typename rtree<Value, Translator, Tag>::box_type box_type;
- typedef typename rtree<Value, Translator, Tag>::tag_type tag_type;
+ typedef typename rtree<Value, Algo, Translator>::value_type value_type;
+ typedef typename rtree<Value, Algo, Translator>::algo_type algo_type;
+ typedef typename rtree<Value, Algo, Translator>::translator_type translator_type;
+ typedef typename rtree<Value, Algo, Translator>::box_type box_type;
 
     glClear(GL_COLOR_BUFFER_BIT);
 
- detail::rtree::visitors::gl_draw<value_type, translator_type, box_type, tag_type>
+ detail::rtree::visitors::gl_draw<value_type, algo_type, translator_type, box_type>
         gl_draw_v(tree.get_translator(), level_first, level_last, z_coord_level_multiplier);
 
     tree.apply_visitor(gl_draw_v);

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -21,12 +21,15 @@
 namespace detail {
 
 // Default choose_next_node
-template <typename Value, typename Box, typename Tag>
-struct choose_next_node
+template <typename Value, typename Algo, typename Box, typename ChooseNextNodeTag>
+struct choose_next_node;
+
+template <typename Value, typename Algo, typename Box>
+struct choose_next_node<Value, Algo, Box, analyze_area_tag>
 {
- typedef typename rtree::node<Value, Box, Tag>::type node;
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     typedef typename rtree::elements_type<internal_node>::type children_type;
 
@@ -75,17 +78,17 @@
 };
 
 // Not implemented here
-template <typename Value, typename Translator, typename Box, typename Tag>
+template <typename Value, typename Algo, typename Translator, typename Box, typename RedistributeTag>
 struct redistribute_elements;
 
 // Default insert visitor
-template <typename Element, typename Value, typename Translator, typename Box, typename Tag>
-class insert : public rtree::visitor<Value, Box, Tag, false>::type
+template <typename Element, typename Value, typename Algo, typename Translator, typename Box>
+class insert : public rtree::visitor<Value, Box, typename Algo::node_tag, false>::type
 {
 protected:
- typedef typename rtree::node<Value, Box, Tag>::type node;
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline insert(node* & root,
                   size_t & leafs_level,
@@ -117,7 +120,7 @@
     inline void traverse(Visitor & visitor, internal_node & n)
     {
         // choose next node
- size_t choosen_node_index = detail::choose_next_node<Value, Box, Tag>::
+ size_t choosen_node_index = detail::choose_next_node<Value, Algo, Box, typename Algo::choose_next_node_tag>::
             apply(n, rtree::element_indexable(m_element, m_tr), m_leafs_level - m_current_level);
 
         // expand the node to contain value
@@ -175,7 +178,7 @@
 
                 // redistribute elements
                 Box box1, box2;
- redistribute_elements<Value, Translator, Box, Tag>::
+ redistribute_elements<Value, Algo, Translator, Box, typename Algo::redistribute_tag>::
                         apply(n, n2, box1, box2, m_min_elems_per_node, m_max_elems_per_node, m_tr);
 
                 // check numbers of elements
@@ -224,11 +227,15 @@
 
 } // namespace detail
 
+template <typename Element, typename Value, typename Algo, typename Translator, typename Box, typename InsertTag>
+struct insert;
+
 // Default insert visitor
-template <typename Element, typename Value, typename Translator, typename Box, typename Tag>
-struct insert : public detail::insert<Element, Value, Translator, Box, Tag>
+template <typename Element, typename Value, typename Algo, typename Translator, typename Box>
+struct insert<Element, Value, Algo, Translator, Box, default_tag>
+ : public detail::insert<Element, Value, Algo, Translator, Box>
 {
- typedef detail::insert<Element, Value, Translator, Box, Tag> base;
+ typedef detail::insert<Element, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
     typedef typename base::internal_node internal_node;
     typedef typename base::leaf leaf;
@@ -271,10 +278,11 @@
 };
 
 // Default insert visitor specialized for Values elements
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct insert<Value, Value, Translator, Box, Tag> : public detail::insert<Value, Value, Translator, Box, Tag>
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct insert<Value, Value, Algo, Translator, Box, default_tag>
+ : public detail::insert<Value, Value, Algo, Translator, Box>
 {
- typedef detail::insert<Value, Value, Translator, Box, Tag> base;
+ typedef detail::insert<Value, Value, Algo, Translator, Box> base;
     typedef typename base::node node;
     typedef typename base::internal_node internal_node;
     typedef typename base::leaf leaf;

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -16,11 +16,11 @@
 
 namespace detail { namespace rtree { namespace visitors {
 
-template <typename Value, typename Box, typename Tag>
-struct is_leaf : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Box>
+struct is_leaf : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline void operator()(internal_node const&)
     {

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/print.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/print.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/print.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -113,11 +113,11 @@
 
 } // namespace detail
 
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct print : public rtree::visitor<Value, Box, Tag, true>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+struct print : public rtree::visitor<Value, Box, typename Algo::node_tag, true>::type
 {
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
     inline print(std::ostream & o, Translator const& t)
         : os(o), tr(t), level(0)
@@ -180,14 +180,14 @@
 
 }}} // namespace detail::rtree::visitors
 
-template <typename Value, typename Translator, typename Tag>
-std::ostream & operator<<(std::ostream & os, rtree<Value, Translator, Tag> const& tree)
+template <typename Value, typename Algo, typename Translator>
+std::ostream & operator<<(std::ostream & os, rtree<Value, Algo, Translator> const& tree)
 {
- typedef typename rtree<Value, Translator, Tag>::value_type value_type;
- typedef typename rtree<Value, Translator, Tag>::translator_type translator_type;
- typedef typename rtree<Value, Translator, Tag>::box_type box_type;
- typedef typename rtree<Value, Translator, Tag>::tag_type tag_type;
- detail::rtree::visitors::print<value_type, translator_type, box_type, tag_type> print_v(os, tree.get_translator());
+ typedef typename rtree<Value, Algo, Translator>::value_type value_type;
+ typedef typename rtree<Value, Algo, Translator>::algo_type algo_type;
+ typedef typename rtree<Value, Algo, Translator>::translator_type translator_type;
+ typedef typename rtree<Value, Algo, Translator>::box_type box_type;
+ detail::rtree::visitors::print<value_type, algo_type, translator_type, box_type> print_v(os, tree.get_translator());
     tree.apply_visitor(print_v);
     return os;
 }

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -21,12 +21,12 @@
 namespace detail { namespace rtree { namespace visitors {
 
 // Default remove algorithm
-template <typename Value, typename Translator, typename Box, typename Tag>
-class remove : public rtree::visitor<Value, Box, Tag, false>::type
+template <typename Value, typename Algo, typename Translator, typename Box>
+class remove : public rtree::visitor<Value, Box, typename Algo::node_tag, false>::type
 {
- typedef typename rtree::node<Value, Box, Tag>::type node;
- typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
- typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::node<Value, Box, typename Algo::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, typename Algo::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, typename Algo::node_tag>::type leaf;
 
 public:
     inline remove(node* & root,
@@ -115,7 +115,7 @@
                 for ( typename std::vector< std::pair<size_t, node*> >::reverse_iterator it = m_underflowed_nodes.rbegin();
                         it != m_underflowed_nodes.rend() ; ++it )
                 {
- is_leaf<Value, Box, Tag> ilv;
+ is_leaf<Value, Algo, Box> ilv;
                     rtree::apply_visitor(ilv, *it->second);
                     if ( ilv.result )
                         reinsert_elements(rtree::get<leaf>(*it->second), it->first);
@@ -193,7 +193,7 @@
         for ( typename elements_type::iterator it = elements.begin();
             it != elements.end() ; ++it )
         {
- visitors::insert<typename elements_type::value_type, Value, Translator, Box, Tag> insert_v(
+ visitors::insert<typename elements_type::value_type, Value, Algo, Translator, Box, typename Algo::insert_tag> insert_v(
                 m_root_node,
                 m_leafs_level,
                 *it,

Modified: sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/additional_sizes_and_times.cpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -32,6 +32,10 @@
     //typedef bgi::rtree<std::pair<B, size_t>, bgi::linear_tag> RT;
     //typedef bgi::rtree<std::pair<B, size_t>, bgi::quadratic_tag> RT;
     typedef bgi::rtree<std::pair<B, size_t>, bgi::rstar_tag> RT;
+ /*typedef bgi::rtree<
+ std::pair<B, size_t>,
+ bgi::detail::rtree::algo<bgi::with_reinsert_tag, bgi::analyze_area_tag, bgi::rstar_tag, bgi::default_tag>
+ > RT;*/
 
     // load config file
     std::ifstream file_cfg("config.txt");

Modified: sandbox-branches/geometry/index_080_new/tests/translators.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/translators.hpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/translators.hpp 2011-06-12 20:26:38 EDT (Sun, 12 Jun 2011)
@@ -2,6 +2,7 @@
 #define TESTS_TRANSLATORS_HPP
 
 #include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
 #include <boost/geometry/extensions/index/rtree/rtree.hpp>
 
 #include <boost/geometry/extensions/index/translator/def.hpp>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk