Boost logo

Geometry :

Subject: [ggl] spacial index construction interface
From: Barend Gehrels (barend.gehrels)
Date: 2011-01-31 04:18:16

hi Adam,

> What if someone wants to use our rtree as a primary container to store
> some kind of point objects. Existing implementation requires three
> copies of this point, internally it stores these three points and
> doubles processing e.g. in boxes expanding. It looks like this:
> rtree<box<Point>, Point> rt(ma, mi);
> rt.insert(box<Point>(Point(), Point()), Point());
> What if someone implements some volumetric object class which has a
> box inside. It's very common. Boxes are doubled.
> I'd like to propose slightly different implementation. The main idea
> is to provide a translator object which translates from Values to Box
> or Point. Our index now stores a translator and our Values. Internally
> Values are stored and algorithms for Boxes and Points are choosen in
> compile time. It would look like this:
> template <typename Value, typename Translator = vtr::default<Value> >
> (...)

> What do you think?

In short, I think the translator is a very good idea!

Thanks, Barend

Geometry list run by mateusz at