|
Boost-Commit : |
From: mariano.consoni_at_[hidden]
Date: 2008-06-16 08:35:21
Author: mconsoni
Date: 2008-06-16 08:35:21 EDT (Mon, 16 Jun 2008)
New Revision: 46418
URL: http://svn.boost.org/trac/boost/changeset/46418
Log:
- Point insertion.
- Remove method.
Text files modified:
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp | 8 ++++++++
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp | 11 +++++++++--
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/spatial_index.hpp | 14 ++++----------
3 files changed, 21 insertions(+), 12 deletions(-)
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/quadtree.hpp 2008-06-16 08:35:21 EDT (Mon, 16 Jun 2008)
@@ -28,6 +28,14 @@
public:
quadtree(const geometry::box<Point> &r)
: root(r, 1), element_count(0), node_size_(1) {}
+
+ /// remove the element with key 'k'
+ /// TODO: implement
+ virtual void remove(const Point &k)
+ {
+ std::cerr << "Not implemented yet." << std::endl;
+ }
+
virtual void insert(const Point &k, const Value &v)
{
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp 2008-06-16 08:35:21 EDT (Mon, 16 Jun 2008)
@@ -42,9 +42,11 @@
root_->add_leaf_node(initial_box, new_leaf);
}
- virtual void insert(const Point &k, const Value &v)
+ /// remove the element with key 'k'
+ /// TODO: implement
+ virtual void remove(const Point &k)
{
- element_count++;
+ std::cerr << "Not implemented yet." << std::endl;
}
virtual void print(void) const
@@ -52,6 +54,11 @@
root_->print();
}
+ virtual void insert(const Point &k, const Value &v)
+ {
+ this->insert(geometry::box<Point>(k,k), v);
+ }
+
void insert(const geometry::box<Point> &e, const Value &v)
{
boost::shared_ptr<rtree_node<Point, Value> > l(choose_leaf(e));
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/spatial_index.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/spatial_index.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/spatial_index.hpp 2008-06-16 08:35:21 EDT (Mon, 16 Jun 2008)
@@ -16,16 +16,7 @@
namespace boost {
namespace spatial_index {
-/// The spatial_index class does nothing.
-/** \ingroup group_nothing
- \param T The type on which spatial_index does nothing.
- \warning This class does nothing.
- \todo Make this class do something.
- \bug This class does do something.
-
- Since spatial_index does nothing, it is not very useful.
-*/
-
+/// spatial index interface
template<typename Point, typename Value>
class spatial_index
{
@@ -37,6 +28,9 @@
/// insert data with envelope 'e' with key 'k'
virtual void insert(const geometry::box<Point> &e, const Value &v) = 0;
+
+ /// remove data with key 'k'
+ virtual void remove(const Point &k) = 0;
/// bulk insert data from values
virtual void bulk_insert(std::vector<Value> &values, std::vector<Point> &points) = 0;
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