Boost logo

Boost :

Subject: Re: [boost] [Review Request] Inclusion of the Boost.Polygon Voronoi Library
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2012-04-11 12:43:03


>My point is that if the default point_traits specialization is changed to the one I mentioned in my previous post, this will fix all the issues:
>1) The users will be able to use their legacy point classes by specializing point_traits;
>2) The users whose point type supports x() and y() access methods won't be required to do anything.
>The same will apply for the segment class. If we do some additional clean up to the isotropy.hpp header this won't add any heavy
>dependencies to the current Voronoi code. Please correct me if I am wrong.

We can't really change the default now because it is a documented interface and that would be a breaking change.
If we overload your functions on concept type they would still need to register their point type by specializing the metafunction that looks up the concept of a given type.
The whole point of the Polygon concept type system is to allow overloading of generic functions by concept type. The enables very clear and concise user code:

voronoi_builder<boost::int64_t, my_voronoi_ctype_traits> vb;
vb.insert(point);
vb.insert(segment);
vb.insert(polygon);
vb.insert(rectangle);
vb.insert(polygon_set);
 
The user doesn't need to encode type information in the function names they are calling because the library deduces it for them. Because the library can deduce user intent it makes the library intuitive to use. If polygon_set is a refinement of directed_line_segment_set and voronoi builder has an overload of insert that accepts a directed_line_segment_set_concept then it will accept a polygon_set_concept or any refinement of polygon_set_concept automatically.

The line segment concepts extension of the Polygon library isn't finished:
http://svn.boost.org/svn/boost/trunk/boost/polygon/directed_line_segment_set_data.hpp
http://svn.boost.org/svn/boost/trunk/boost/polygon/directed_line_segment_concept.hpp
but the intention was to provide unifying semantics for voronoi to seamlessly integrate it into Polygon by extending the concept type system to include concepts that voronoi needs for its interfaces. The directed_line_segment_set_concept specifically isn't yet done. That is a challenging TMP task that I'll need to do myself since the 2011 GSOC project failed.

This was my vision for the interfaces of voronoi. We can compromise and just use the point_concept for now with the intention of extending the interface for line segment concepts when they are finished.

Regards,
Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk