Boost logo

Geometry :

Subject: [ggl] Point/Box in Box Test (Border Cases - 3D)
From: Simonson, Lucanus J (lucanus.j.simonson)
Date: 2011-06-29 12:47:24


Adam Wulkiewicz wrote:
> What is more, if someone perform the querry for points inside some
> Geometry, points that are on the edge of this Geometry should be
> returned or not? This should be configurable by some template
> parameter I guess.
>
> Maby something like this:
>
> within(g1, g2); // default one
> within<with_border>(g1, g2);
> within<without_border>(g1, g2);
>
> intersects(g1, g2); // default one
> intersects<with_border>(g1, g2);
> intersects<without_border>(g1, g2);
>
> index | spatially_filtered(g); // default one
> index | spatially_filtered<with_border>(g);
> index | spatially_filtered<without_border>(g);

I would suggest an optional runtime argument with default to the current behavior:

intersects(g1, g2);
intersects(g1, g2, true);

Since it should inline constant propigation should eliminate the cost of the runtime argument and make it the same cost as a template parameter. The runtime argument allows runtime use cases whereas the template parameter forces the awkward if(true) return contains<true>(g1, g2); else return contains<false>(g1,g2); syntax onto user code.

Regards,
Luke


Geometry list run by mateusz at loskot.net