$search
00001 #include <stdio.h> 00002 #include "gpc.h" 00003 00004 int main(void) 00005 { 00006 gpc_polygon subject, clip, result; 00007 FILE *sfp, *cfp, *ofp; 00008 00009 sfp= fopen("poly1", "r"); 00010 cfp= fopen("poly2", "r"); 00011 gpc_read_polygon(sfp, 0, &subject); 00012 gpc_read_polygon(cfp, 0, &clip); 00013 00014 //gpc_polygon_clip(GPC_INT, &subject, &clip, &result); 00015 //gpc_polygon_clip(GPC_DIFF, &subject, &clip, &result); 00016 //gpc_polygon_clip(GPC_XOR, &subject, &clip, &result); 00017 gpc_polygon_clip(GPC_UNION, &subject, &clip, &result); 00018 00019 ofp= fopen("result", "w"); 00020 gpc_write_polygon(ofp, 0, &result); 00021 printf("result written to \"result\" file\n"); 00022 gpc_free_polygon(&subject); 00023 gpc_free_polygon(&clip); 00024 gpc_free_polygon(&result); 00025 00026 fclose(sfp); 00027 fclose(cfp); 00028 fclose(ofp); 00029 return 0; 00030 }