
Help!
I wrote this function to load the data point to a boost polygon.
typedef vector<polygon_data<int> > LayoutSet;
static void addPolygonData(LayoutSet &sets,int* points,int size){
polygon_data<int> poly_data;
vector<point_data<int> > poly_points(size);
for(int i=0;i<size;i++)
{
int x=i*2;
int y=x+1;
poly_points[i]=point_data<int>(points[x],points[y]);
}
poly_data.set(poly_points.begin(),poly_points.end());
sets.push_back(poly_data);
}
Then I load two sets of points
int p1[8]={1200 2400 1200 3600 4000 3600 4000 2400};
int p2[8]={1800 600 1800 4700 3500 4700 3500 600};
LayoutSet group_2;
LayoutSet group_1;
addPolygonData(group_1,p1,8);
addPolygonData(group_1,p2,8);
boost::polygon::assign(group_2,group_1[0] & group_1[1]); // Here I do the
logic operation & (AND)
vector<point_data<int> > pts;
pts.insert(pts.begin(),group_2[0].begin(),group[0].end());
for(size_t i=0;i