Boost logo

Geometry :

Subject: [ggl] (spatial_)index::is_overlapping
From: Barend Gehrels (Barend.Gehrels)
Date: 2009-06-18 06:13:21


Hi Chris,

> I've simplified the function to this:
>
> template <typename Box>
> inline bool is_overlapping(Box const& b1, Box const& b2)
> {
> if (ggl::get<min_corner, 0>(b1) > ggl::get<max_corner, 0>(b2))
> return false
>
> if (ggl::get<max_corner, 0>(b1) < ggl::get<min_corner, 0>(b2))
> return false;
>
> if (ggl::get<min_corner, 1>(b1) > ggl::get<max_corner, 1>(b2))
> return false;
>
> if (ggl::get<max_corner, 1>(b1) < ggl::get<min_corner, 1>(b2))
> return false;
>
> return true;
> }
>
>
> This should dramatically reduce the numbers of "get". Do you see an
> obvious flaw?
>
OK and much better than what I just checked in, and somewhat faster. OK
to commit (if you add the semicolon :-)
Thanks again, Barend

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20090618/758d3dd4/attachment-0001.html


Geometry list run by mateusz at loskot.net