|
deletes the group but not the polygon included
group handle cannot be NULL
Make sure you dont use the handle after it was ungrouped.
Example:
The example shows how to go over all the polygons that belong to several group
Note that if we would go over all the polygons of the first group
and then over all the polygons of the second group we might go over some polygon
twice since it could be for example that groupA belongs to groupB
and therefore by going over all the polygons of groupB will also go
over all the polygons of groupA. The code below show how to do it right so we
go over each polygon only once. We do it by grouping several objects together and then ungroup them back
DWORD top_group=STATE_group_creare("Top group");
STATE_group_set_father_group(grpA, top_group);
STATE_group_set_father_group(grpB, top_group);
STATE_group_set_father_group(grpC, top_group);
for( DWORD poly=STATE_group_get_first_polygon(top_group); poly!=NULL; poly=STATE_group_get_next_polygon(poly) ) {
Your code here ....
}
STATE_group_ungroup(top_group); We can now delete the top group if we want to.
my_group=NULL; For safty since we cant use it anymore.
|