Boost logo

Geometry :

Subject: [ggl] box_range is not a valid range
From: Barend Gehrels (barend)
Date: 2011-05-02 16:12:53


Hi,

> While wokring out my own box2d_range/box2d_iterator to work around
> this, I found ggl's box_iterator is not so lightwigth to be a
> iterator, fot it carrying 4 points everywhere.
> It may be better to store the 4 points in the box_range, and only
> store a pointer to these points and a index in box_iterator. Similar
> solution also applies to segment_range/segment_range_iterator.

Right, it is indeed storing the points because it has to return them.
Alternatively it can do what you suggest (making the iterator dependant
on range) or create them on the fly (having to store a reference to the
box inside, seems OK, it is there already in the form of an address).
Making the iterator dependant on the range is not a big problem because
(I think) there is no big need to use it outside.

Did you work out your suggestion in your solution? If so, could you send
it such that we might replace it?

Thanks, Barend


Geometry list run by mateusz at loskot.net