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-05-22 13:06:53


Andrii Sydorchuk wrote:

>There are two examples on data association usage:
>1) Basic tutorial (non-practical examples that shows how to use this
>functionality):
>2) Voronoi visualizer:
>Uses depth first search to remove Voronoi edges outside of the polygon bounds.
>The data field is used to mark edges as visited (I added some comments):
>While this example doesn't directly associate any data with Voronoi edges, it shows additional usage of this field that appeared to be practical.

The objection to void* is a style objection. I think if you made the field an int (preferably std::size_t ) then you could name it color instead of data and it would be clear it was intended for graph algorithms. As a std::size_t it would be usable as an index into a vector of arbitrary type to allow complex data to be associated with the graph elements in O[1] time for more complex use cases. That way you preserve the ability to implement graph algorithms directly on the data structure and can update your example without needing to declare your own classes.

Regards,
Luke


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