Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68981 - in sandbox-branches/geometry/index_080: boost/geometry/extensions/index/rtree tests
From: adam.wulkiewicz_at_[hidden]
Date: 2011-02-17 20:38:48


Author: awulkiew
Date: 2011-02-17 20:38:32 EST (Thu, 17 Feb 2011)
New Revision: 68981
URL: http://svn.boost.org/trac/boost/changeset/68981

Log:
index translator example added
Text files modified:
   sandbox-branches/geometry/index_080/boost/geometry/extensions/index/rtree/rtree.hpp | 2 +-
   sandbox-branches/geometry/index_080/tests/rtree_native.cpp | 36 ++++++++++++++++++++++++++++++++++++
   2 files changed, 37 insertions(+), 1 deletions(-)

Modified: sandbox-branches/geometry/index_080/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_080/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index_080/boost/geometry/extensions/index/rtree/rtree.hpp 2011-02-17 20:38:32 EST (Thu, 17 Feb 2011)
@@ -49,7 +49,7 @@
     /**
      * \brief Creates a rtree with 'maximum' elements per node and 'minimum'.
      */
- rtree(unsigned int const& maximum, unsigned int const& minimum, Translator tr = translator::def<Value>())
+ rtree(unsigned int const& maximum, unsigned int const& minimum, Translator tr = Translator())
         : m_count(0)
         , m_min_elems_per_node(minimum)
         , m_max_elems_per_node(maximum)

Modified: sandbox-branches/geometry/index_080/tests/rtree_native.cpp
==============================================================================
--- sandbox-branches/geometry/index_080/tests/rtree_native.cpp (original)
+++ sandbox-branches/geometry/index_080/tests/rtree_native.cpp 2011-02-17 20:38:32 EST (Thu, 17 Feb 2011)
@@ -1,6 +1,7 @@
 #include <boost/geometry/geometry.hpp>
 
 #include <boost/geometry/extensions/index/rtree/rtree.hpp>
+#include <boost/geometry/extensions/index/translator/index.hpp>
 
 #include <iostream>
 
@@ -150,6 +151,41 @@
         t.print();
     }
 
+ std::cout << "-------------------------------------------------\n";
+ std::cout << "-------------------------------------------------\n";
+
+ // size_t
+ {
+ typedef boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> P;
+ typedef boost::geometry::model::box<P> B;
+
+ typedef size_t V;
+ typedef boost::geometry::index::translator::index<std::vector<B> > T;
+
+ std::vector<B> v;
+ v.push_back(B(P(0, 0), P(1, 1)));
+ v.push_back(B(P(2, 2), P(3, 3)));
+ v.push_back(B(P(4, 4), P(5, 5)));
+ v.push_back(B(P(6, 6), P(7, 7)));
+
+ boost::geometry::index::rtree<V, T> t(3, 0, T(v));
+
+ t.insert(0);
+ t.insert(1);
+ t.insert(2);
+ t.insert(3);
+ t.print();
+
+ // error
+ t.remove_in(B(P(0, 0), P(2, 1)));
+ // ok
+ t.remove_in(B(P(0, 0), P(1, 1)));
+ t.print();
+
+ t.remove(3);
+ t.print();
+ }
+
     // ERROR!
     // remove_in expects previously inserted box - it should remove all objects inside some bigger box
 


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