3

How can I iterate over the points of a polygon_set_data?

It is possible to get the polygons in a polygon_set_data by using void get(output_container& output) const, and then use the result to iterate over the points like in the below example, but this modifies the set and I would like to keep it untouched.

// [...] define polygons polySet & clip

polygon_set_data<int> result;
result.insert(polySet ^ clip); // some operations between polygons

std::vector<polygon_with_holes_data<int>> out;
result.get(out);

It is also possible to iterate over the edges of a polygon_set_data with its begin() method, but edges are not sorted.

genpfault
  • 51,148
  • 11
  • 85
  • 139
arthur.sw
  • 11,052
  • 9
  • 47
  • 104

0 Answers0