Boost logo

Boost :

Subject: [boost] Boost.Polygon : How to deal with per point attributes
From: philippe.lamontagne.2_at_[hidden]
Date: 2010-02-25 14:57:16


Hi Boost community,

I am currently experimenting with the BOOST polygon library and I have a few questions.
 
Question 1:
For my specific application the points inside the polygons need to contain attributes
in addition to their x and y coordinates. This extra information is required in a
per-point basis. I need to compute intersections and differences of polygons. The
operations can be performed regardless on the attributes, but it's important that
the attributes be present in the polygons resulting from the operations. Does BOOST
provide a mechanism for keeping such per point attributes?
I followed the example to make my own point and polygon classes work with BOOST, but
for what I can see, the polygons operations are performed using GTL's own data types
and transferred back to my types, loosing any attributes in the process. I am
missing something here?
 
Question 2:
I noticed that if I have multiple points located on the same straight line only the
initial and final points will be kept in the resulting polygon and that the intermediate
points will be discarded. Whereas this behavior is probably preferable in the general
case, it causes me a problem if I want to maintain point attributes because the
attributes are not guaranteed to be the same all over the straight line. Is there
a way to change this behavior?
 
I'm aware that polygon operations may create new points. I can deal with a few empty attributes as long as original points keep their initial attributes.
 
  We hope there are some solutions or workarounds because I strongly appreciate the library. Thanks for the excellent work.


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