Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70701 - in sandbox-branches/geometry/index_080_new: boost/geometry/extensions/index boost/geometry/extensions/index/rtree boost/geometry/extensions/index/rtree/rstar boost/geometry/extensions/index/rtree/visitors tests
From: adam.wulkiewicz_at_[hidden]
Date: 2011-03-29 14:03:13


Author: awulkiew
Date: 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
New Revision: 70701
URL: http://svn.boost.org/trac/boost/changeset/70701

Log:
namespaces hierarchy changed
Added:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/node.hpp
      - copied, changed from r70689, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp
      - copied, changed from r70607, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp
      - copied, changed from r70689, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp
      - copied, changed from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp
      - copied, changed from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp
      - copied, changed from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp
      - copied, changed from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp
      - copied, changed from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp
Removed:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp
Text files modified:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp | 8 ++
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/node.hpp | 94 ++++++++++++------------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp | 102 ++-------------------------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp | 32 ++++----
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rstar.hpp | 2
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/split.hpp | 146 ++++++++++++++++++++--------------------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree.hpp | 18 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp | 24 +++---
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp | 22 +++---
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp | 20 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp | 49 ++++++------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 14 +-
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp | 18 ++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/print.hpp | 53 +++++++-------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp | 12 +-
   sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp | 6
   16 files changed, 271 insertions(+), 349 deletions(-)

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/indexable.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -108,6 +108,14 @@
>::value;
 };
 
+template <typename Indexable>
+struct tag
+{
+ typedef typename geometry::traits::tag<
+ Indexable
+ >::type type;
+};
+
 } // namespace traits
 
 namespace dispatch {

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/node.hpp (from r70689, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/node.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -8,28 +8,28 @@
 // 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_DEFAULT_NODE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_DEFAULT_NODE_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_HPP
 
 #include <vector>
 #include <boost/variant.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace detail {
+namespace detail { namespace rtree {
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_node;
+struct node;
 
 // nodes default types
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_internal_node_def
+struct internal_node_def
 {
     typedef std::vector<
         std::pair<
             Box,
- typename rtree_node<Value, Box, Tag>::type *
+ typename node<Value, Box, Tag>::type *
>
> children_type;
 
@@ -37,7 +37,7 @@
 };
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_leaf_def
+struct leaf_def
 {
     typedef std::vector<Value> values_type;
     values_type values;
@@ -46,63 +46,63 @@
 // nodes traits
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_node
+struct node
 {
     typedef boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
+ leaf_def<Value, Box, Tag>,
+ internal_node_def<Value, Box, Tag>
> type;
 };
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_internal_node
+struct internal_node
 {
- typedef rtree_internal_node_def<Value, Box, Tag> type;
+ typedef internal_node_def<Value, Box, Tag> type;
 };
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_leaf
+struct leaf
 {
- typedef rtree_leaf_def<Value, Box, Tag> type;
+ typedef leaf_def<Value, Box, Tag> type;
 };
 
 // nodes elements extractor
 
 template <typename Node>
-struct rtree_elements_type
+struct elements_type
 {
     typedef typename Node::elements_type type;
 };
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_elements_type< rtree_internal_node_def<Value, Box, Tag> >
+struct elements_type< internal_node_def<Value, Box, Tag> >
 {
- typedef typename rtree_internal_node_def<Value, Box, Tag>::children_type type;
+ typedef typename internal_node_def<Value, Box, Tag>::children_type type;
 };
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_elements_type< rtree_leaf_def<Value, Box, Tag> >
+struct elements_type< leaf_def<Value, Box, Tag> >
 {
- typedef typename rtree_leaf_def<Value, Box, Tag>::values_type type;
+ typedef typename leaf_def<Value, Box, Tag>::values_type type;
 };
 
 template <typename Node>
-typename rtree_elements_type<Node>::type &
-rtree_elements_get(Node & n)
+typename elements_type<Node>::type &
+elements_get(Node & n)
 {
     return n.elements;
 }
 
 template <typename Value, typename Box, typename Tag>
-typename rtree_internal_node_def<Value, Box, Tag>::children_type &
-rtree_elements_get(rtree_internal_node_def<Value, Box, Tag> & n)
+typename internal_node_def<Value, Box, Tag>::children_type &
+elements_get(internal_node_def<Value, Box, Tag> & n)
 {
     return n.children;
 }
 
 template <typename Value, typename Box, typename Tag>
-typename rtree_leaf_def<Value, Box, Tag>::values_type &
-rtree_elements_get(rtree_leaf_def<Value, Box, Tag> & n)
+typename leaf_def<Value, Box, Tag>::values_type &
+elements_get(leaf_def<Value, Box, Tag> & n)
 {
     return n.values;
 }
@@ -110,18 +110,18 @@
 // uniform indexable type for child node element's box and value's indexable
 
 template <typename Value, typename Translator>
-struct rtree_element_indexable_type
+struct element_indexable_type
 {
     typedef typename Translator::indexable_type type;
 };
 
 template <typename Value, typename Box, typename Tag, typename Translator>
-struct rtree_element_indexable_type<
+struct element_indexable_type<
     std::pair<
         Box,
         boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
+ leaf_def<Value, Box, Tag>,
+ internal_node_def<Value, Box, Tag>
> *
>,
     Translator
@@ -134,12 +134,12 @@
 
 template <typename Value, typename Box, typename Tag, typename Translator>
 Box const&
-rtree_element_indexable(
+element_indexable(
     std::pair<
         Box,
         boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
+ leaf_def<Value, Box, Tag>,
+ internal_node_def<Value, Box, Tag>
> *
> const& el,
     Translator const&)
@@ -149,7 +149,7 @@
 
 template <typename Value, typename Translator>
 typename Translator::indexable_type const&
-rtree_element_indexable(Value const& el, Translator const& tr)
+element_indexable(Value const& el, Translator const& tr)
 {
     return tr(el);
 };
@@ -157,7 +157,7 @@
 // elements box
 
 template <typename Box, typename FwdIter, typename Translator>
-inline Box rtree_elements_box(FwdIter first, FwdIter last, Translator const& tr)
+inline Box elements_box(FwdIter first, FwdIter last, Translator const& tr)
 {
     Box result;
 
@@ -167,11 +167,11 @@
         return result;
     }
 
- geometry::convert(index::detail::rtree_element_indexable(*first, tr), result);
+ geometry::convert(element_indexable(*first, tr), result);
     ++first;
 
     for ( ; first != last ; ++first )
- geometry::expand(result, index::detail::rtree_element_indexable(*first, tr));
+ geometry::expand(result, element_indexable(*first, tr));
 
     return result;
 }
@@ -179,10 +179,10 @@
 // create leaf node
 
 template <typename Value, typename Box, typename Tag>
-typename rtree_node<Value, Box, Tag>::type *
-rtree_create_node(rtree_leaf_def<Value, Box, Tag> const& l)
+typename node<Value, Box, Tag>::type *
+create_node(leaf_def<Value, Box, Tag> const& l)
 {
- typedef typename rtree_node<Value, Box, Tag>::type node;
+ typedef typename node<Value, Box, Tag>::type node;
     node * n = new node(l);
     return n;
 }
@@ -190,10 +190,10 @@
 // create internal node
 
 template <typename Value, typename Box, typename Tag>
-typename rtree_node<Value, Box, Tag>::type *
-rtree_create_node(rtree_internal_node_def<Value, Box, Tag> const& in)
+typename node<Value, Box, Tag>::type *
+create_node(internal_node_def<Value, Box, Tag> const& in)
 {
- typedef typename rtree_node<Value, Box, Tag>::type node;
+ typedef typename node<Value, Box, Tag>::type node;
     node * n = new node(in);
     return n;
 }
@@ -201,17 +201,17 @@
 // default node
 
 template <typename Value, typename Box, typename Tag>
-void rtree_delete_node(
+void delete_node(
     boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
+ leaf_def<Value, Box, Tag>,
+ internal_node_def<Value, Box, Tag>
> * n)
 {
     delete n;
 }
 
-} // namespace detail
+}} // namespace detail::rtree
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_DEFAULT_NODE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_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-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -16,103 +16,19 @@
 #include <boost/geometry/extensions/index/algorithms/overlap.hpp>
 #include <boost/geometry/extensions/index/algorithms/union_area.hpp>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
-
-struct rtree_rstar_chnn_min_overlap_cost {};
-struct rtree_rstar_chnn_nearly_min_overlap_cost {};
-
-// TODO: awulkiew - it's possible that goodness values may be used to choose next node
-// on this step some of the goodness values would be calculated (not all)
-// and only for some nodes (goodness values should be calculated only if there is an overflow)
-
-template <typename Value, typename Box, typename Tag>
-class rtree_rstar_choose_next_node
-{};
-
-// TODO: awulkiew finish this version
-// use min_element instead of searching by myself
-
-//template <typename Value, typename Box>
-//class rtree_rstar_choose_next_node<Value, Box, rtree_rstar_chnn_nearly_min_overlap_cost>
-//{
-// typedef typename index::detail::rtree_node<Value, Box, rtree_rstar_tag>::type node;
-// typedef typename index::detail::rtree_internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
-// typedef typename index::detail::rtree_leaf<Value, Box, rtree_rstar_tag>::type leaf;
-//
-// typedef typename internal_node::children_type children_type;
-//
-//public:
-// template <typename Indexable>
-// static inline size_t apply(internal_node & n, Indexable const& indexable)
-// {
-// assert(!n.children.empty());
-//
-// bool has_leaves = boost::apply_visitor(
-// visitors::rtree_is_leaf<Value, Box, rtree_rstar_tag>(),
-// *n.children.front().second);
-//
-// if ( !has_leaves )
-// return impl<internal_node_areas>(n, indexable);
-// else
-// return impl<branch_areas>(n, indexable);
-// }
-//
-//private:
-// template <typename Areas, typename Indexable>
-// static inline size_t impl(internal_node & n, Indexable const& indexable)
-// {
-// }
-//
-//};
-
-//template <typename ElIter, typename Translator>
-//typename index::area_result<
-// typename detail::rtree_element_indexable_type<
-// typename std::iterator_traits<ElIter>::value_type,
-// Translator
-// >::type
-//>::type calculate_elements_overlap(ElIter el, ElIter first, ElIter last, Translator const& tr)
-//{
-// typedef typename detail::rtree_element_indexable_type<
-// typename std::iterator_traits<ElIter>::value_type,
-// Translator
-// >::type box_type;
-// typedef typename index::area_result<box_type>::type area_type;
-//
-// area_type result = 0;
-//
-// for ( ; first != last ; ++first )
-// {
-// if ( first != el )
-// {
-// box_type inters;
-// geometry::assign_zero(inters);
-// geometry::intersection(
-// detail::rtree_element_indexable(*first, tr),
-// detail::rtree_element_indexable(*el, tr),
-// inters);
-// result += index::area(inters);
-// }
-// }
-// return result;
-//}
-
-// TODO: awulkiew - wrong algorithm? Should branch check be applied to Leafs?
-// TODO: awulkiew - further optimization: don't calculate area with the overlap, calculate it only if
-// overlap < smallest_overlap (and current area must be stored) OR
-// overlap == smallest_overlap (and area must be compared)
+namespace detail { namespace rtree { namespace rstar {
 
 template <typename Value, typename Box>
-class rtree_rstar_choose_next_node<Value, Box, rtree_rstar_chnn_min_overlap_cost>
+class choose_next_node
 {
- typedef typename index::detail::rtree_node<Value, Box, rtree_rstar_tag>::type node;
- typedef typename index::detail::rtree_internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, rtree_rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, rtree_rstar_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, rtree_rstar_tag>::type leaf;
 
     typedef typename internal_node::children_type children_type;
 
@@ -123,7 +39,7 @@
         assert(!n.children.empty());
         
         bool has_leaves = boost::apply_visitor(
- visitors::rtree_is_leaf<Value, Box, rtree_rstar_tag>(),
+ visitors::is_leaf<Value, Box, rtree_rstar_tag>(),
             *n.children.front().second);
 
         if ( !has_leaves )
@@ -211,7 +127,7 @@
     };
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree:rstar
 
 }}} // namespace boost::geometry::index
 

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp (from r70607, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,8 +7,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_RSTAR_RTREE_INSERT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RTREE_INSERT_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_INSERT_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_INSERT_HPP
 
 #include <algorithm>
 
@@ -19,26 +19,26 @@
 #include <boost/geometry/extensions/index/algorithms/overlap.hpp>
 #include <boost/geometry/extensions/index/algorithms/union_area.hpp>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/insert.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp>
 
 #include <boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp>
 #include <boost/geometry/extensions/index/rtree/rstar/split.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Translator, typename Box>
-class rtree_insert<Value, Translator, Box, rtree_rstar_tag> : public boost::static_visitor<>
+class insert<Value, Translator, Box, rtree_rstar_tag> : public boost::static_visitor<>
 {
- typedef typename index::detail::rtree_node<Value, Box, rtree_rstar_tag>::type node;
- typedef typename index::detail::rtree_internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, rtree_rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, rtree_rstar_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, rtree_rstar_tag>::type leaf;
 
 public:
- inline explicit rtree_insert(node* & root, Value const& v, size_t min_elements, size_t max_elements, Translator const& t)
+ inline explicit insert(node* & root, Value const& v, size_t min_elements, size_t max_elements, Translator const& t)
         : m_value(v), m_tr(t), m_min_elems_per_node(min_elements), m_max_elems_per_node(max_elements)
         , m_root_node(root)
         , m_parent(0), m_current_child_index(0)
@@ -53,7 +53,7 @@
 
         // choose next node, where value insert traversing should go
         m_current_child_index =
- rtree_rstar_choose_next_node<Value, Box, rtree_rstar_chnn_min_overlap_cost>::
+ rstar::choose_next_node<Value, Box>::
             apply(n, m_tr(m_value));
 
         // TODO: awulkiew - if reinsert is implemented this must be changed
@@ -68,7 +68,7 @@
 
         if ( m_max_elems_per_node < n.children.size() )
         {
- rtree_rstar_split<Value, Translator, Box>::
+ rstar::split<Value, Translator, Box>::
                 apply(n, m_parent, m_current_child_index, m_root_node, m_min_elems_per_node, m_max_elems_per_node, m_tr);
         }
     }
@@ -79,7 +79,7 @@
 
         if ( m_max_elems_per_node < n.values.size() )
         {
- rtree_rstar_split<Value, Translator, Box>::
+ rstar::split<Value, Translator, Box>::
                 apply(n, m_parent, m_current_child_index, m_root_node, m_min_elems_per_node, m_max_elems_per_node, m_tr);
         }
     }
@@ -97,8 +97,8 @@
     size_t m_current_child_index;
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RTREE_INSERT_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_INSERT_HPP

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-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -11,6 +11,6 @@
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RSTAR_HPP
 
 #include <boost/geometry/extensions/index/rtree/rstar/tags.hpp>
-#include <boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp>
+#include <boost/geometry/extensions/index/rtree/rstar/insert.hpp>
 
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RSTAR_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/rtree_insert.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,104 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R*-tree insert algorithm implementation
-//
-// 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_RTREE_INSERT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RTREE_INSERT_HPP
-
-#include <algorithm>
-
-#include <boost/tuple/tuple.hpp>
-
-#include <boost/geometry/extensions/index/algorithms/area.hpp>
-#include <boost/geometry/extensions/index/algorithms/margin.hpp>
-#include <boost/geometry/extensions/index/algorithms/overlap.hpp>
-#include <boost/geometry/extensions/index/algorithms/union_area.hpp>
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp>
-
-#include <boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp>
-#include <boost/geometry/extensions/index/rtree/rstar/split.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Translator, typename Box>
-class rtree_insert<Value, Translator, Box, rtree_rstar_tag> : public boost::static_visitor<>
-{
- typedef typename index::detail::rtree_node<Value, Box, rtree_rstar_tag>::type node;
- typedef typename index::detail::rtree_internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, rtree_rstar_tag>::type leaf;
-
-public:
- inline explicit rtree_insert(node* & root, Value const& v, size_t min_elements, size_t max_elements, Translator const& t)
- : m_value(v), m_tr(t), m_min_elems_per_node(min_elements), m_max_elems_per_node(max_elements)
- , m_root_node(root)
- , m_parent(0), m_current_child_index(0)
- {}
-
- inline void operator()(internal_node & n)
- {
- // save previous traverse inputs and set new ones
- internal_node * parent_bckup = m_parent;
- m_parent = &n;
- size_t current_child_index_bckup = m_current_child_index;
-
- // choose next node, where value insert traversing should go
- m_current_child_index =
- rtree_rstar_choose_next_node<Value, Box, rtree_rstar_chnn_min_overlap_cost>::
- apply(n, m_tr(m_value));
-
- // TODO: awulkiew - if reinsert is implemented this must be changed
- geometry::expand(n.children[m_current_child_index].first, m_tr(m_value));
-
- // next traversing step
- boost::apply_visitor(*this, *n.children[m_current_child_index].second);
-
- // restore previous traverse inputs
- m_parent = parent_bckup;
- m_current_child_index = current_child_index_bckup;
-
- if ( m_max_elems_per_node < n.children.size() )
- {
- rtree_rstar_split<Value, Translator, Box>::
- apply(n, m_parent, m_current_child_index, m_root_node, m_min_elems_per_node, m_max_elems_per_node, m_tr);
- }
- }
-
- inline void operator()(leaf & n)
- {
- n.values.push_back(m_value);
-
- if ( m_max_elems_per_node < n.values.size() )
- {
- rtree_rstar_split<Value, Translator, Box>::
- apply(n, m_parent, m_current_child_index, m_root_node, m_min_elems_per_node, m_max_elems_per_node, m_tr);
- }
- }
-
-private:
- Value const& m_value;
- Translator const& m_tr;
- size_t m_min_elems_per_node;
- size_t m_max_elems_per_node;
-
- node* & m_root_node;
-
- // traversing input parameters
- internal_node *m_parent;
- size_t m_current_child_index;
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_RTREE_INSERT_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/split.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/split.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/split.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -19,22 +19,22 @@
 #include <boost/geometry/extensions/index/algorithms/overlap.hpp>
 #include <boost/geometry/extensions/index/algorithms/union_area.hpp>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/insert.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace rstar {
 
 // elements less
 
 template <typename Elements, typename Translator, size_t AxisIndex, size_t Corner>
-class rtree_rstar_elements_less
+class elements_less
 {
     typedef typename Elements::value_type element_type;
 public:
- inline rtree_rstar_elements_less(Translator const& tr)
+ inline elements_less(Translator const& tr)
         : m_tr(tr)
     {}
 
@@ -42,11 +42,11 @@
     {
         return
             index::get<Corner, AxisIndex>(
- index::detail::rtree_element_indexable(e1, m_tr)
+ rtree::element_indexable(e1, m_tr)
             )
             <
             index::get<Corner, AxisIndex>(
- index::detail::rtree_element_indexable(e2, m_tr)
+ rtree::element_indexable(e2, m_tr)
             );
     }
 
@@ -57,13 +57,13 @@
 // rstar split axis data
 
 template <typename Box>
-struct rtree_rstar_split_axis_data
+struct split_axis_data
 {
     typedef typename margin_result<Box>::type margin_type;
     typedef typename overlap_result<Box>::type overlap_type;
     typedef typename area_result<Box>::type area_type;
 
- inline rtree_rstar_split_axis_data()
+ inline split_axis_data()
         : margins_sum(0)
         , smallest_overlap(std::numeric_limits<overlap_type>::max())
         , smallest_area(std::numeric_limits<area_type>::max())
@@ -104,18 +104,18 @@
 // update axis data for given axis and corner
 
 template <typename Value, typename Translator, typename Box, size_t Corner>
-class rtree_rstar_split_update_axis_data_for_corner
+class split_update_axis_data_for_corner
 {
- typedef typename rtree_rstar_split_axis_data<Box>::margin_type margin_type;
- typedef typename rtree_rstar_split_axis_data<Box>::overlap_type overlap_type;
- typedef typename rtree_rstar_split_axis_data<Box>::area_type area_type;
+ typedef typename split_axis_data<Box>::margin_type margin_type;
+ typedef typename split_axis_data<Box>::overlap_type overlap_type;
+ typedef typename split_axis_data<Box>::area_type area_type;
 
     BOOST_STATIC_ASSERT(Corner < 2);
 
 public:
     template <typename Elements>
     static inline void apply(
- rtree_rstar_split_axis_data<Box> & split_axis_data,
+ split_axis_data<Box> & sad,
         Elements const& sorted_elements,
         size_t min_elems,
         size_t max_elems,
@@ -124,14 +124,14 @@
         size_t median_index_last = max_elems - min_elems + 2;
         for ( size_t median_index = min_elems ; median_index < median_index_last ; ++median_index )
         {
- Box left_box = index::detail::rtree_elements_box<Box>(sorted_elements.begin(), sorted_elements.begin() + median_index, tr);
- Box right_box = index::detail::rtree_elements_box<Box>(sorted_elements.begin() + median_index, sorted_elements.end(), tr);
+ Box left_box = rtree::elements_box<Box>(sorted_elements.begin(), sorted_elements.begin() + median_index, tr);
+ Box right_box = rtree::elements_box<Box>(sorted_elements.begin() + median_index, sorted_elements.end(), tr);
 
             margin_type margin = index::margin(left_box) + index::margin(right_box);
             overlap_type overlap = index::overlap(left_box, right_box);
             area_type area = index::area(left_box) + index::area(right_box);
 
- split_axis_data.update(Corner, median_index, left_box, right_box, margin, overlap, area);
+ sad.update(Corner, median_index, left_box, right_box, margin, overlap, area);
         }
     }
 };
@@ -139,13 +139,13 @@
 // split data
 
 template <typename Elements, typename Box>
-struct rtree_rstar_split_data
+struct split_data
 {
     typedef typename margin_result<Box>::type margin_type;
     typedef typename overlap_result<Box>::type overlap_type;
     typedef typename area_result<Box>::type area_type;
 
- inline rtree_rstar_split_data()
+ inline split_data()
         : smallest_margins_sum(std::numeric_limits<margin_type>::max())
     {}
 
@@ -182,36 +182,36 @@
 // update split data for given axis and corner
 
 template <typename Value, typename Translator, typename Box, size_t AxisIndex, size_t Corner>
-class rtree_rstar_split_update_data_for_axis_and_corner
+class split_update_data_for_axis_and_corner
 {
- typedef typename rtree_rstar_split_axis_data<Box>::margin_type margin_type;
- typedef typename rtree_rstar_split_axis_data<Box>::overlap_type overlap_type;
- typedef typename rtree_rstar_split_axis_data<Box>::area_type area_type;
+ typedef typename split_axis_data<Box>::margin_type margin_type;
+ typedef typename split_axis_data<Box>::overlap_type overlap_type;
+ typedef typename split_axis_data<Box>::area_type area_type;
 
 public:
     template <typename Elements>
     static inline void apply(
- rtree_rstar_split_data<Elements, Box> & split_data,
+ split_data<Elements, Box> & split_data,
         Elements & elements,
         size_t min_elems,
         size_t max_elems,
         Translator const& tr)
     {
- rtree_rstar_split_axis_data<Box> split_axis_data;
+ split_axis_data<Box> sad;
 
- rtree_rstar_elements_less<Elements, Translator, AxisIndex, Corner> less_min(tr);
+ elements_less<Elements, Translator, AxisIndex, Corner> less_min(tr);
         std::sort(elements.begin(), elements.end(), less_min);
 
- rtree_rstar_split_update_axis_data_for_corner<Value, Translator, Box, Corner>::
- apply(split_axis_data, elements, min_elems, max_elems, tr);
+ split_update_axis_data_for_corner<Value, Translator, Box, Corner>::
+ apply(sad, elements, min_elems, max_elems, tr);
 
         split_data.update(
             AxisIndex,
- split_axis_data.choosen_corner,
- split_axis_data.choosen_median_index,
- split_axis_data.choosen_left_box,
- split_axis_data.choosen_right_box,
- split_axis_data.margins_sum,
+ sad.choosen_corner,
+ sad.choosen_median_index,
+ sad.choosen_left_box,
+ sad.choosen_right_box,
+ sad.margins_sum,
             elements);
     }
 };
@@ -219,54 +219,54 @@
 // for each dimension and corner update split data
 
 template <typename Value, typename Translator, typename Box, size_t Dimension>
-struct rtree_rstar_split_update_data
+struct split_update_data
 {
     BOOST_STATIC_ASSERT(0 < Dimension);
 
     template <typename Elements>
     static inline void apply(
- rtree_rstar_split_data<Elements, Box> & split_data,
+ split_data<Elements, Box> & sd,
         Elements & elements,
         size_t min_elems,
         size_t max_elems,
         Translator const& tr)
     {
- rtree_rstar_split_update_data<Value, Translator, Box, Dimension - 1>::
- apply(split_data, elements, min_elems, max_elems, tr);
+ split_update_data<Value, Translator, Box, Dimension - 1>::
+ apply(sd, elements, min_elems, max_elems, tr);
 
- rtree_rstar_split_update_data_for_axis_and_corner<Value, Translator, Box, Dimension - 1, min_corner>::
- apply(split_data, elements, min_elems, max_elems, tr);
- rtree_rstar_split_update_data_for_axis_and_corner<Value, Translator, Box, Dimension - 1, max_corner>::
- apply(split_data, elements, min_elems, max_elems, tr);
+ split_update_data_for_axis_and_corner<Value, Translator, Box, Dimension - 1, min_corner>::
+ apply(sd, elements, min_elems, max_elems, tr);
+ split_update_data_for_axis_and_corner<Value, Translator, Box, Dimension - 1, max_corner>::
+ apply(sd, elements, min_elems, max_elems, tr);
     }
 };
 
 template <typename Value, typename Translator, typename Box>
-struct rtree_rstar_split_update_data<Value, Translator, Box, 1>
+struct split_update_data<Value, Translator, Box, 1>
 {
     template <typename Elements>
     static inline void apply(
- rtree_rstar_split_data<Elements, Box> & split_data,
+ split_data<Elements, Box> & sd,
         Elements & elements,
         size_t min_elems,
         size_t max_elems,
         Translator const& tr)
     {
- rtree_rstar_split_update_data_for_axis_and_corner<Value, Translator, Box, 0, min_corner>::
- apply(split_data, elements, min_elems, max_elems, tr);
- rtree_rstar_split_update_data_for_axis_and_corner<Value, Translator, Box, 0, max_corner>::
- apply(split_data, elements, min_elems, max_elems, tr);
+ split_update_data_for_axis_and_corner<Value, Translator, Box, 0, min_corner>::
+ apply(sd, elements, min_elems, max_elems, tr);
+ split_update_data_for_axis_and_corner<Value, Translator, Box, 0, max_corner>::
+ apply(sd, elements, min_elems, max_elems, tr);
     }
 };
 
 // split
 
 template <typename Value, typename Translator, typename Box>
-class rtree_rstar_split
+class split
 {
- typedef typename index::detail::rtree_node<Value, Box, rtree_rstar_tag>::type node;
- typedef typename index::detail::rtree_internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, rtree_rstar_tag>::type leaf;
+ typedef typename rtree::node<Value, Box, rtree_rstar_tag>::type node;
+ typedef typename rtree::internal_node<Value, Box, rtree_rstar_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, rtree_rstar_tag>::type leaf;
 
     static const size_t dimension = index::traits::dimension<Box>::value;
 
@@ -281,62 +281,62 @@
         size_t max_elems,
         Translator const& tr)
     {
- typedef typename index::detail::rtree_elements_type<Node>::type elements_type;
+ typedef typename rtree::elements_type<Node>::type elements_type;
         typedef typename elements_type::value_type element_type;
 
- elements_type & elements = index::detail::rtree_elements_get(n);
+ elements_type & elements = rtree::elements_get(n);
 
         assert(elements.size() == max_elems + 1);
 
         // get split data
- rtree_rstar_split_data<elements_type, Box> split_data;
- rtree_rstar_split_update_data<Value, Translator, Box, dimension>::
- apply(split_data, elements, min_elems, max_elems, tr);
+ split_data<elements_type, Box> sd;
+ split_update_data<Value, Translator, Box, dimension>::
+ apply(sd, elements, min_elems, max_elems, tr);
        
- assert(min_elems <= split_data.choosen_median_index);
- assert(split_data.choosen_median_index <= max_elems + 1 - min_elems);
+ assert(min_elems <= sd.choosen_median_index);
+ assert(sd.choosen_median_index <= max_elems + 1 - min_elems);
 
         // create new node
- node * right_node = rtree_create_node(Node());
- elements_type & new_elems = index::detail::rtree_elements_get(boost::get<Node>(*right_node));
+ node * right_node = rtree::create_node(Node());
+ elements_type & new_elems = rtree::elements_get(boost::get<Node>(*right_node));
 
         // update new node's elements
- new_elems.resize(max_elems + 1 - split_data.choosen_median_index);
+ new_elems.resize(max_elems + 1 - sd.choosen_median_index);
         std::copy(
- split_data.choosen_distribution.begin() + split_data.choosen_median_index,
- split_data.choosen_distribution.end(),
+ sd.choosen_distribution.begin() + sd.choosen_median_index,
+ sd.choosen_distribution.end(),
             new_elems.begin());
 
         // update elements of the current node
- elements.resize(split_data.choosen_median_index);
+ elements.resize(sd.choosen_median_index);
         std::copy(
- split_data.choosen_distribution.begin(),
- split_data.choosen_distribution.begin() + split_data.choosen_median_index,
+ sd.choosen_distribution.begin(),
+ sd.choosen_distribution.begin() + sd.choosen_median_index,
             elements.begin());
         
         if ( parent != 0 )
         {
             // update old node's box
- parent->children[current_child_index].first = split_data.choosen_left_box;
+ parent->children[current_child_index].first = sd.choosen_left_box;
             // add new node to the parent's children
- parent->children.push_back(std::make_pair(split_data.choosen_right_box, right_node));
+ parent->children.push_back(std::make_pair(sd.choosen_right_box, right_node));
         }
         else
         {
             assert(&n == boost::get<Node>(root));
 
             // create new root and add nodes
- node * new_root = rtree_create_node(internal_node());
+ node * new_root = rtree::create_node(internal_node());
 
- boost::get<internal_node>(*new_root).children.push_back(std::make_pair(split_data.choosen_left_box, root));
- boost::get<internal_node>(*new_root).children.push_back(std::make_pair(split_data.choosen_right_box, right_node));
+ boost::get<internal_node>(*new_root).children.push_back(std::make_pair(sd.choosen_left_box, root));
+ boost::get<internal_node>(*new_root).children.push_back(std::make_pair(sd.choosen_right_box, right_node));
 
             root = new_root;
         }
     }
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree:rstar
 
 }}} // namespace boost::geometry::index
 

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-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -15,8 +15,8 @@
 
 #include <boost/geometry/extensions/index/rtree/filters.hpp>
 
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/find.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/destroy.hpp>
 
 #include <boost/geometry/extensions/index/rtree/rstar/rstar.hpp>
 
@@ -37,9 +37,9 @@
     typedef typename detail::geometry_box_type<typename translator_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::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;
 
     inline explicit rtree(
         size_t max_elems_per_node = 2,
@@ -57,26 +57,26 @@
         if ( m_max_elems_per_node < 2 )
             m_max_elems_per_node = 2;
 
- m_root = detail::rtree_create_node(leaf());
+ m_root = detail::rtree::create_node(leaf());
     }
 
     ~rtree()
     {
- visitors::rtree_delete<value_type, translator_type, box_type, tag_type> del_v;
+ detail::rtree::visitors::destroy<value_type, translator_type, box_type, tag_type> del_v;
         boost::apply_visitor(del_v, *m_root);
     }
 
     template <typename Geometry>
     inline std::vector<value_type> find(Geometry const& geom) const
     {
- visitors::rtree_find<value_type, translator_type, box_type, tag_type, Geometry> find_v(geom, m_translator);
+ detail::rtree::visitors::find<value_type, translator_type, box_type, tag_type, Geometry> find_v(geom, m_translator);
         boost::apply_visitor(find_v, *m_root);
         return find_v.result;
     }
 
     void insert(value_type const& value)
     {
- visitors::rtree_insert<value_type, translator_type, box_type, tag_type>
+ detail::rtree::visitors::insert<value_type, translator_type, box_type, tag_type>
             insert_v(m_root, value, m_min_elems_per_node, m_max_elems_per_node, m_translator);
 
         boost::apply_visitor(insert_v, *m_root);

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rtree_node.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,217 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree details
-//
-// Copyright 2008 Federico J. Fernandez.
-// 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_DEFAULT_NODE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_DEFAULT_NODE_HPP
-
-#include <vector>
-#include <boost/variant.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail {
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_node;
-
-// nodes default types
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_internal_node_def
-{
- typedef std::vector<
- std::pair<
- Box,
- typename rtree_node<Value, Box, Tag>::type *
- >
- > children_type;
-
- children_type children;
-};
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_leaf_def
-{
- typedef std::vector<Value> values_type;
- values_type values;
-};
-
-// nodes traits
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_node
-{
- typedef boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
- > type;
-};
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_internal_node
-{
- typedef rtree_internal_node_def<Value, Box, Tag> type;
-};
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_leaf
-{
- typedef rtree_leaf_def<Value, Box, Tag> type;
-};
-
-// nodes elements extractor
-
-template <typename Node>
-struct rtree_elements_type
-{
- typedef typename Node::elements_type type;
-};
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_elements_type< rtree_internal_node_def<Value, Box, Tag> >
-{
- typedef typename rtree_internal_node_def<Value, Box, Tag>::children_type type;
-};
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_elements_type< rtree_leaf_def<Value, Box, Tag> >
-{
- typedef typename rtree_leaf_def<Value, Box, Tag>::values_type type;
-};
-
-template <typename Node>
-typename rtree_elements_type<Node>::type &
-rtree_elements_get(Node & n)
-{
- return n.elements;
-}
-
-template <typename Value, typename Box, typename Tag>
-typename rtree_internal_node_def<Value, Box, Tag>::children_type &
-rtree_elements_get(rtree_internal_node_def<Value, Box, Tag> & n)
-{
- return n.children;
-}
-
-template <typename Value, typename Box, typename Tag>
-typename rtree_leaf_def<Value, Box, Tag>::values_type &
-rtree_elements_get(rtree_leaf_def<Value, Box, Tag> & n)
-{
- return n.values;
-}
-
-// uniform indexable type for child node element's box and value's indexable
-
-template <typename Value, typename Translator>
-struct rtree_element_indexable_type
-{
- typedef typename Translator::indexable_type type;
-};
-
-template <typename Value, typename Box, typename Tag, typename Translator>
-struct rtree_element_indexable_type<
- std::pair<
- Box,
- boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
- > *
- >,
- Translator
->
-{
- typedef Box type;
-};
-
-// uniform indexable getter for child node element's box and value's indexable
-
-template <typename Value, typename Box, typename Tag, typename Translator>
-Box const&
-rtree_element_indexable(
- std::pair<
- Box,
- boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
- > *
- > const& el,
- Translator const&)
-{
- return el.first;
-}
-
-template <typename Value, typename Translator>
-typename Translator::indexable_type const&
-rtree_element_indexable(Value const& el, Translator const& tr)
-{
- return tr(el);
-};
-
-// elements box
-
-template <typename Box, typename FwdIter, typename Translator>
-inline Box rtree_elements_box(FwdIter first, FwdIter last, Translator const& tr)
-{
- Box result;
-
- if (first == last)
- {
- geometry::assign_zero(result);
- return result;
- }
-
- geometry::convert(index::detail::rtree_element_indexable(*first, tr), result);
- ++first;
-
- for ( ; first != last ; ++first )
- geometry::expand(result, index::detail::rtree_element_indexable(*first, tr));
-
- return result;
-}
-
-// create leaf node
-
-template <typename Value, typename Box, typename Tag>
-typename rtree_node<Value, Box, Tag>::type *
-rtree_create_node(rtree_leaf_def<Value, Box, Tag> const& l)
-{
- typedef typename rtree_node<Value, Box, Tag>::type node;
- node * n = new node(l);
- return n;
-}
-
-// create internal node
-
-template <typename Value, typename Box, typename Tag>
-typename rtree_node<Value, Box, Tag>::type *
-rtree_create_node(rtree_internal_node_def<Value, Box, Tag> const& in)
-{
- typedef typename rtree_node<Value, Box, Tag>::type node;
- node * n = new node(in);
- return n;
-}
-
-// default node
-
-template <typename Value, typename Box, typename Tag>
-void rtree_delete_node(
- boost::variant<
- rtree_leaf_def<Value, Box, Tag>,
- rtree_internal_node_def<Value, Box, Tag>
- > * n)
-{
- delete n;
-}
-
-} // namespace detail
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_DEFAULT_NODE_HPP

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp (from r70689, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,24 +7,24 @@
 // 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_RTREE_ARE_BOXES_OK_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_ARE_BOXES_OK_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_ARE_BOXES_OK_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_ARE_BOXES_OK_HPP
 
 #include <boost/geometry/algorithms//equals.hpp>
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Translator, typename Box, typename Tag>
-class rtree_are_boxes_ok : public boost::static_visitor<bool>
+class are_boxes_ok : public boost::static_visitor<bool>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
 public:
- inline rtree_are_boxes_ok(Translator const& tr)
+ inline are_boxes_ok(Translator const& tr)
         : m_tr(tr), m_is_root(true)
     {}
 
@@ -83,13 +83,13 @@
     bool m_is_root;
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 template <typename Value, typename Translator, typename Tag>
-bool rtree_are_boxes_ok(rtree<Value, Translator, Tag> const& tree)
+bool are_boxes_ok(rtree<Value, Translator, Tag> const& tree)
 {
     typedef rtree<Value, Translator, Tag> rt;
- visitors::rtree_are_boxes_ok<
+ detail::rtree::visitors::are_boxes_ok<
         typename rt::value_type,
         typename rt::translator_type,
         typename rt::box_type,
@@ -100,4 +100,4 @@
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_ARE_BOXES_OK_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_ARE_BOXES_OK_HPP

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp (from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/destroy.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -1,26 +1,26 @@
 // Boost.Geometry (aka GGL, Generic Geometry Library)
 //
-// Boost.Index - R-tree delete visitor
+// Boost.Index - R-tree destroy visitor
 //
 // 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_VISITORS_RTREE_DELETE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_DELETE_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_DELETE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_DELETE_HPP
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_delete : public boost::static_visitor<>
+struct destroy : public boost::static_visitor<>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
     inline void operator()(internal_node & n) const
     {
@@ -31,7 +31,7 @@
         {
             boost::apply_visitor(*this, *it->second);
 
- index::detail::rtree_delete_node(it->second);
+ rtree::delete_node(it->second);
         }
     }
 
@@ -40,8 +40,8 @@
     }
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_DELETE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_DELETE_HPP

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp (from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/find.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,26 +7,26 @@
 // 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_RTREE_FIND_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_FIND_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_FIND_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_FIND_HPP
 
 #include <boost/geometry/algorithms/intersects.hpp>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 // rtree spatial query visitor
 
 template <typename Value, typename Translator, typename Box, typename Tag, typename Geometry>
-struct rtree_find : public boost::static_visitor<>
+struct find : public boost::static_visitor<>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
- inline rtree_find(Geometry const& g, Translator const& t)
+ inline find(Geometry const& g, Translator const& t)
         : geom(g), tr(t)
     {}
 
@@ -59,8 +59,8 @@
     std::vector<Value> result;
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_FIND_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_VISITORS_FIND_HPP

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-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -12,20 +12,20 @@
 
 #include <iostream>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 namespace dispatch {
 
 template <typename Point, size_t Dimension>
-struct rtree_gl_draw_point
+struct gl_draw_point
 {};
 
 template <typename Point>
-struct rtree_gl_draw_point<Point, 2>
+struct gl_draw_point<Point, 2>
 {
     static inline void apply(Point const& p, size_t level)
     {
@@ -36,11 +36,11 @@
 };
 
 template <typename Box, size_t Dimension>
-struct rtree_gl_draw_box
+struct gl_draw_box
 {};
 
 template <typename Box>
-struct rtree_gl_draw_box<Box, 2>
+struct gl_draw_box<Box, 2>
 {
     static inline void apply(Box const& b, size_t level)
     {
@@ -54,30 +54,29 @@
 };
 
 template <typename Indexable, typename Tag>
-struct rtree_gl_draw_indexable
+struct gl_draw_indexable
 {
 };
 
 template <typename Indexable>
-struct rtree_gl_draw_indexable<Indexable, box_tag>
+struct gl_draw_indexable<Indexable, box_tag>
 {
- typedef typename geometry::traits::point_type<Indexable>::type point_type;
- static const size_t dimension = geometry::traits::dimension<point_type>::value;
+ static const size_t dimension = index::traits::dimension<Indexable>::value;
 
     static inline void apply(Indexable const& i, size_t level)
     {
- rtree_gl_draw_box<Indexable, dimension>::apply(i, level);
+ gl_draw_box<Indexable, dimension>::apply(i, level);
     }
 };
 
 template <typename Indexable>
-struct rtree_gl_draw_indexable<Indexable, point_tag>
+struct gl_draw_indexable<Indexable, point_tag>
 {
- static const size_t dimension = geometry::traits::dimension<Indexable>::value;
+ static const size_t dimension = index::traits::dimension<Indexable>::value;
 
     static inline void apply(Indexable const& i, size_t level)
     {
- rtree_gl_draw_point<Indexable, dimension>::apply(i, level);
+ gl_draw_point<Indexable, dimension>::apply(i, level);
     }
 };
 
@@ -86,23 +85,23 @@
 namespace detail {
 
 template <typename Indexable>
-inline void rtree_gl_draw_indexable(Indexable const& i, size_t level)
+inline void gl_draw_indexable(Indexable const& i, size_t level)
 {
- dispatch::rtree_gl_draw_indexable<
+ dispatch::gl_draw_indexable<
         Indexable,
- typename geometry::traits::tag<Indexable>::type
+ typename index::traits::tag<Indexable>::type
>::apply(i, level);
 }
 
 } // namespace detail
 
 template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_gl_draw : public boost::static_visitor<>
+struct gl_draw : public boost::static_visitor<>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
- inline rtree_gl_draw(Translator const& t)
+ inline gl_draw(Translator const& t)
         : tr(t), level(0)
     {}
 
@@ -128,7 +127,7 @@
         for (typename children_type::const_iterator it = n.children.begin();
             it != n.children.end(); ++it)
         {
- detail::rtree_gl_draw_indexable(it->first, level);
+ detail::gl_draw_indexable(it->first, level);
         }
         
         size_t level_backup = level;
@@ -152,7 +151,7 @@
         for (typename values_type::const_iterator it = n.values.begin();
             it != n.values.end(); ++it)
         {
- detail::rtree_gl_draw_indexable(tr(*it), level);
+ detail::gl_draw_indexable(tr(*it), level);
         }
     }
 
@@ -161,7 +160,7 @@
     size_t level;
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 template <typename Value, typename Translator, typename Tag>
 void gl_draw(rtree<Value, Translator, Tag> const& tree)
@@ -173,7 +172,7 @@
 
     glClear(GL_COLOR_BUFFER_BIT);
 
- visitors::rtree_gl_draw<value_type, translator_type, box_type, tag_type> gl_draw_v(tree.get_translator());
+ detail::rtree::visitors::gl_draw<value_type, translator_type, box_type, tag_type> gl_draw_v(tree.get_translator());
     tree.apply_visitor(gl_draw_v);
 
     glFlush();

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp (from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,23 +7,23 @@
 // 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_RTREE_INSERT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_INSERT_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_INSERT_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_INSERT_HPP
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_insert
+struct insert
 {
     // not implemented here
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_INSERT_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_INSERT_HPP

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp (from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,20 +7,20 @@
 // 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_RTREE_IS_LEAF_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_IS_LEAF_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_IS_LEAF_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_IS_LEAF_HPP
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Box, typename Tag>
-struct rtree_is_leaf : public boost::static_visitor<bool>
+struct is_leaf : public boost::static_visitor<bool>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
     inline bool operator()(internal_node const&) const
     {
@@ -33,8 +33,8 @@
     }
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_IS_LEAF_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_IS_LEAF_HPP

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-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -13,29 +13,29 @@
 
 #include <iostream>
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 namespace dispatch {
 
 template <typename Point, size_t Dimension>
-struct rtree_print_point
+struct print_point
 {
     BOOST_STATIC_ASSERT(0 < Dimension);
 
     static inline void apply(std::ostream & os, Point const& p)
     {
- rtree_print_point<Point, Dimension - 1>::apply(os, p);
+ print_point<Point, Dimension - 1>::apply(os, p);
 
         os << ", " << geometry::get<Dimension - 1>(p);
     }
 };
 
 template <typename Point>
-struct rtree_print_point<Point, 1>
+struct print_point<Point, 1>
 {
     static inline void apply(std::ostream & os, Point const& p)
     {
@@ -44,20 +44,20 @@
 };
 
 template <typename Box, size_t Corner, size_t Dimension>
-struct rtree_print_corner
+struct print_corner
 {
     BOOST_STATIC_ASSERT(0 < Dimension);
 
     static inline void apply(std::ostream & os, Box const& b)
     {
- rtree_print_corner<Box, Corner, Dimension - 1>::apply(os, b);
+ print_corner<Box, Corner, Dimension - 1>::apply(os, b);
 
         os << ", " << geometry::get<Corner, Dimension - 1>(b);
     }
 };
 
 template <typename Box, size_t Corner>
-struct rtree_print_corner<Box, Corner, 1>
+struct print_corner<Box, Corner, 1>
 {
     static inline void apply(std::ostream & os, Box const& b)
     {
@@ -66,35 +66,34 @@
 };
 
 template <typename Indexable, typename Tag>
-struct rtree_print_indexable
+struct print_indexable
 {
 };
 
 template <typename Indexable>
-struct rtree_print_indexable<Indexable, box_tag>
+struct print_indexable<Indexable, box_tag>
 {
- typedef typename geometry::traits::point_type<Indexable>::type point_type;
- static const size_t dimension = geometry::traits::dimension<point_type>::value;
+ static const size_t dimension = index::traits::dimension<Indexable>::value;
 
     static inline void apply(std::ostream &os, Indexable const& i)
     {
         os << '(';
- rtree_print_corner<Indexable, min_corner, dimension>::apply(os, i);
+ print_corner<Indexable, min_corner, dimension>::apply(os, i);
         os << ")x(";
- rtree_print_corner<Indexable, max_corner, dimension>::apply(os, i);
+ print_corner<Indexable, max_corner, dimension>::apply(os, i);
         os << ')';
     }
 };
 
 template <typename Indexable>
-struct rtree_print_indexable<Indexable, point_tag>
+struct print_indexable<Indexable, point_tag>
 {
- static const size_t dimension = geometry::traits::dimension<Indexable>::value;
+ static const size_t dimension = index::traits::dimension<Indexable>::value;
 
     static inline void apply(std::ostream &os, Indexable const& i)
     {
         os << '(';
- rtree_print_point<Indexable, dimension>::apply(os, i);
+ print_point<Indexable, dimension>::apply(os, i);
         os << ')';
     }
 };
@@ -104,9 +103,9 @@
 namespace detail {
 
 template <typename Indexable>
-inline void rtree_print_indexable(std::ostream & os, Indexable const& i)
+inline void print_indexable(std::ostream & os, Indexable const& i)
 {
- dispatch::rtree_print_indexable<
+ dispatch::print_indexable<
         Indexable,
         typename geometry::traits::tag<Indexable>::type
>::apply(os, i);
@@ -115,12 +114,12 @@
 } // namespace detail
 
 template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_print : public boost::static_visitor<>
+struct print : public boost::static_visitor<>
 {
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
+ typedef typename rtree::internal_node<Value, Box, Tag>::type internal_node;
+ typedef typename rtree::leaf<Value, Box, Tag>::type leaf;
 
- inline rtree_print(std::ostream & o, Translator const& t)
+ inline print(std::ostream & o, Translator const& t)
         : os(o), tr(t), level(0)
     {}
 
@@ -134,7 +133,7 @@
             it != n.children.end(); ++it)
         {
             spaces(level);
- detail::rtree_print_indexable(os, it->first);
+ detail::print_indexable(os, it->first);
             os << " ->" << it->second << '\n';
         }
 
@@ -159,7 +158,7 @@
             it != n.values.end(); ++it)
         {
             spaces(level);
- detail::rtree_print_indexable(os, tr(*it));
+ detail::print_indexable(os, tr(*it));
             os << '\n';
         }
     }
@@ -177,7 +176,7 @@
     size_t level;
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 template <typename Value, typename Translator, typename Tag>
 std::ostream & operator<<(std::ostream & os, rtree<Value, Translator, Tag> const& tree)
@@ -186,7 +185,7 @@
     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;
- visitors::rtree_print<value_type, translator_type, box_type, tag_type> print_v(os, tree.get_translator());
+ detail::rtree::visitors::print<value_type, translator_type, box_type, tag_type> print_v(os, tree.get_translator());
     tree.apply_visitor(print_v);
     return os;
 }

Copied: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp (from r70531, /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp)
==============================================================================
--- /sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/remove.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -7,14 +7,14 @@
 // 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_RTREE_REMOVE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_REMOVE_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_REMOVE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_REMOVE_HPP
 
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
+#include <boost/geometry/extensions/index/rtree/node.hpp>
 
 namespace boost { namespace geometry { namespace index {
 
-namespace visitors {
+namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Translator, typename Box, typename Tag>
 struct rtree_remove
@@ -22,8 +22,8 @@
     // not implemented here
 };
 
-} // namespace visitors
+}}} // namespace detail::rtree::visitors
 
 }}} // namespace boost::geometry::index
 
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_REMOVE_HPP
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_REMOVE_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,103 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree boxes checking visitor
-//
-// 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_VISITORS_RTREE_ARE_BOXES_OK_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_ARE_BOXES_OK_HPP
-
-#include <boost/geometry/algorithms//equals.hpp>
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Translator, typename Box, typename Tag>
-class rtree_are_boxes_ok : public boost::static_visitor<bool>
-{
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
-
-public:
- inline rtree_are_boxes_ok(Translator const& tr)
- : m_tr(tr), m_is_root(true)
- {}
-
- inline bool operator()(internal_node const& n)
- {
- if (n.children.empty())
- return false;
-
- Box box_bckup = m_box;
- bool is_root_bckup = m_is_root;
-
- m_is_root = false;
-
- for ( internal_node::children_type::const_iterator it = n.children.begin();
- it != n.children.end() ; ++it)
- {
- m_box = it->first;
-
- if ( false == boost::apply_visitor(*this, *it->second) )
- return false;
- }
-
- m_box = box_bckup;
- m_is_root = is_root_bckup;
-
- Box result;
- geometry::convert(n.children.front().first, result);
- for(internal_node::children_type::const_iterator it = n.children.begin() + 1;
- it != n.children.end() ; ++it)
- {
- geometry::expand(result, it->first);
- }
-
- return m_is_root || geometry::equals(result, m_box);
- }
-
- inline bool operator()(leaf const& n)
- {
- if (n.values.empty())
- return false;
-
- Box result;
- geometry::convert(m_tr(n.values.front()), result);
- for(leaf::values_type::const_iterator it = n.values.begin() + 1;
- it != n.values.end() ; ++it)
- {
- geometry::expand(result, m_tr(*it));
- }
-
- return m_is_root || geometry::equals(result, m_box);
- }
-
-private:
- Translator const& m_tr;
- Box m_box;
- bool m_is_root;
-};
-
-} // namespace visitors
-
-template <typename Value, typename Translator, typename Tag>
-bool rtree_are_boxes_ok(rtree<Value, Translator, Tag> const& tree)
-{
- typedef rtree<Value, Translator, Tag> rt;
- visitors::rtree_are_boxes_ok<
- typename rt::value_type,
- typename rt::translator_type,
- typename rt::box_type,
- typename rt::tag_type> v(tree.get_translator());
-
- return tree.apply_visitor(v);
-}
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_ARE_BOXES_OK_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_delete.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,47 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree delete visitor
-//
-// 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_VISITORS_RTREE_DELETE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_DELETE_HPP
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_delete : public boost::static_visitor<>
-{
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
-
- inline void operator()(internal_node & n) const
- {
- typedef typename internal_node::children_type children_type;
-
- for (typename children_type::iterator it = n.children.begin();
- it != n.children.end(); ++it)
- {
- boost::apply_visitor(*this, *it->second);
-
- index::detail::rtree_delete_node(it->second);
- }
- }
-
- inline void operator()(leaf & n) const
- {
- }
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_DELETE_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_find.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,66 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree find
-//
-// 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_VISITORS_RTREE_FIND_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_FIND_HPP
-
-#include <boost/geometry/algorithms/intersects.hpp>
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-// rtree spatial query visitor
-
-template <typename Value, typename Translator, typename Box, typename Tag, typename Geometry>
-struct rtree_find : public boost::static_visitor<>
-{
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
-
- inline rtree_find(Geometry const& g, Translator const& t)
- : geom(g), tr(t)
- {}
-
- inline void operator()(internal_node const& n)
- {
- typedef typename internal_node::children_type children_type;
-
- for (typename children_type::const_iterator it = n.children.begin();
- it != n.children.end(); ++it)
- {
- if ( geometry::intersects(it->first, geom) )
- boost::apply_visitor(*this, *it->second);
- }
- }
-
- inline void operator()(leaf const& n)
- {
- typedef typename leaf::values_type values_type;
-
- for (typename values_type::const_iterator it = n.values.begin();
- it != n.values.end(); ++it)
- {
- if ( geometry::intersects(tr(*it), geom) )
- result.push_back(*it);
- }
- }
-
- Geometry const& geom;
- Translator const& tr;
- std::vector<Value> result;
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_FIND_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_insert.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,29 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree details
-//
-// 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_VISITORS_RTREE_INSERT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_INSERT_HPP
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_insert
-{
- // not implemented here
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_INSERT_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_is_leaf.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,40 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree is leaf visitor
-//
-// 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_VISITORS_RTREE_IS_LEAF_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_IS_LEAF_HPP
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Box, typename Tag>
-struct rtree_is_leaf : public boost::static_visitor<bool>
-{
- typedef typename index::detail::rtree_internal_node<Value, Box, Tag>::type internal_node;
- typedef typename index::detail::rtree_leaf<Value, Box, Tag>::type leaf;
-
- inline bool operator()(internal_node const&) const
- {
- return false;
- }
-
- inline bool operator()(leaf const&) const
- {
- return true;
- }
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_IS_LEAF_HPP

Deleted: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/rtree_remove.hpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
+++ (empty file)
@@ -1,29 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - R-tree remove
-//
-// 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_VISITORS_RTREE_REMOVE_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_REMOVE_HPP
-
-#include <boost/geometry/extensions/index/rtree/rtree_node.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace visitors {
-
-template <typename Value, typename Translator, typename Box, typename Tag>
-struct rtree_remove
-{
- // not implemented here
-};
-
-} // namespace visitors
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_VISITORS_RTREE_REMOVE_HPP

Modified: sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp (original)
+++ sandbox-branches/geometry/index_080_new/tests/additional_glut_vis.cpp 2011-03-29 14:03:10 EDT (Tue, 29 Mar 2011)
@@ -5,7 +5,7 @@
 
 #include <boost/geometry/extensions/index/rtree/visitors/gl_draw.hpp>
 #include <boost/geometry/extensions/index/rtree/visitors/print.hpp>
-#include <boost/geometry/extensions/index/rtree/visitors/rtree_are_boxes_ok.hpp>
+#include <boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp>
 
 typedef boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> P;
 typedef boost::geometry::model::box<P> B;
@@ -53,9 +53,9 @@
         std::cout << "\n\n\n" << t << "\n\n";
         
         std::cout << "inserted: ";
- boost::geometry::index::visitors::detail::rtree_print_indexable(std::cout, b);
+ boost::geometry::index::detail::rtree::visitors::detail::print_indexable(std::cout, b);
         std::cout << '\n';
- std::cout << ( boost::geometry::index::rtree_are_boxes_ok(t) ? "boxes OK" : "WRONG BOXES!" );
+ std::cout << ( boost::geometry::index::are_boxes_ok(t) ? "boxes OK" : "WRONG BOXES!" );
 
         glutPostRedisplay();
     }


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