Boost logo

Boost :

Subject: [boost] Adapting Polygon to work with point attributes
From: Paul Miller (paul_at_[hidden])
Date: 2012-02-29 13:22:04


Boost::Polygon looks like exactly what I need to do some boolean
operations on polygons but my polygons have additional attributes per
point that I want to carry through the operation. But I can't figure out
how to get polygon to create sensible values for the attributes other
than X,Y, and I can't find an example that covers this scenario. It
seems from the documentation that this is possible however. Can someone
point me to an example, to say, adapt a polygon with this Point type?

struct Point {
     int x, y;
     float r, g, b, a;
};

Ideally it would average new r, g, b, a values together to make new
points and polygon join points, but it could just copy one of the
existing Points' attributes instead. I'm not picky.

Cheers!


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