I want to expand/shrink a polygon with holes using boost::polygon. So to clarify that a bit, I have a single data structure
boost::polygon::polygon_with_holes_data<int> inPoly
where inPoly contains data that describe a rectangular outline and a triangle which forms the hole within this rectangle (in picture below this is the left, black drawing).
Now I want to
a) expand the whole stuff so that the rectangle becomes bigger and the hole becomes smaller (resulting in the red polygon in image below) or
b) shrink it so that the rectangle becomes smaller and the hole bigger (resulting in the green image below).
The corners don't necessarily need to be straight, the also can be rounded or somehow "rough".
My question: how can this be done using boost::polygon?
Thanks!

I answered this Expand polygons with boost::geometry?
And yes you can teach Boost Geometry to act on Boost Polygon types:
I came up with a test polygon like you described:
Now, apparently we can't just
bufferon the adapted polygon, nor can webg::assignorbg::convertdirectly. So, I came up with an ugly workaround of converting to WKT and back. And then you can do the buffer, and conver back similarly.It's not very elegant, but it does work:
Full Demo
Include SVG output:
Live On Coliru
The
output.svgwritten: