Subject: [geometry] access to poligon point list
From: nicola81 (nicola_cavallini_at_[hidden])
Date: 2012-05-17 14:23:31
I'm kind of new to c++, and definitely new to boost geometry, this is why I
apologize in advance if my point is too ingenuous.
I would like to get the polygon points in a standard vector, or into some
other (simple :( ) structure I can access to.
I've spent several days trying to get something out of Google, but I
couldn't get anything useful. I cannot compile most of the code examples on
stackoverflow or on the geometry library website.
I run the last Intel compiler 12.something, and boost 1.49.
The example I was working on is attached, and is actually from the boost
website. My guess was trying to get a couple of standard vectors (Px, Py)
out object function âlist_coordinatesâ.
Is there a smarter way to do so? I think so but I didn't manage to find it.
Let me say that I'm really looking forward to use Boost.Geometry,
especially because I believe it is going to be crucial in my project,
finite elements fluid-structure interaction.
Thanks a lot,
template <typename Point>
void list_coordinates(Point const& p)
std::cout << "x = " << get<0>(p) << " y = " << get<0>(p) << std::endl;
polygon green, blue;
"POLYGON((0 0,0 1.75,1.75 0,0 0))", green);
"POLYGON((.5 .5, .5 1, 1 1, 1 .5, .5 .5))", blue);
boost::geometry::intersection(green, blue, output);
red = output;
typedef boost::geometry::model::d2::point_xy<double> point;
boost::geometry::for_each_point(red, list_coordinates<point> );
-- View this message in context: http://boost-geometry.203548.n3.nabble.com/access-to-poligon-point-list-tp3999541.html Sent from the Boost Geometry mailing list archive at Nabble.com.
Geometry list run by mateusz at loskot.net