fiddled with debugging output.
This commit is contained in:
parent
5d8d7bc687
commit
ffe499047e
1 changed files with 14 additions and 6 deletions
|
@ -182,6 +182,7 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
|
||||||
polys_in.safety_base.contour = NULL;
|
polys_in.safety_base.contour = NULL;
|
||||||
gpc_add_contour( &polys_in.safety_base, &v_list, 0 );
|
gpc_add_contour( &polys_in.safety_base, &v_list, 0 );
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
// process polygons in priority order
|
// process polygons in priority order
|
||||||
for ( int i = 0; i < FG_MAX_AREA_TYPES; ++i ) {
|
for ( int i = 0; i < FG_MAX_AREA_TYPES; ++i ) {
|
||||||
cout << "num polys of type (" << i << ") = "
|
cout << "num polys of type (" << i << ") = "
|
||||||
|
@ -213,13 +214,14 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
|
||||||
// << " accum.num_contours = " << accum.num_contours
|
// << " accum.num_contours = " << accum.num_contours
|
||||||
// << endl;
|
// << endl;
|
||||||
// tmp output accum
|
// tmp output accum
|
||||||
FILE *ofp= fopen("tmp-debug", "w");
|
|
||||||
gpc_write_polygon(ofp, 1, &tmp);
|
|
||||||
fclose(ofp);
|
|
||||||
|
|
||||||
ofp= fopen("accum-debug", "w");
|
// FILE *ofp= fopen("tmp-debug", "w");
|
||||||
gpc_write_polygon(ofp, 1, &accum);
|
// gpc_write_polygon(ofp, 1, &tmp);
|
||||||
fclose(ofp);
|
// fclose(ofp);
|
||||||
|
|
||||||
|
// ofp= fopen("accum-debug", "w");
|
||||||
|
// gpc_write_polygon(ofp, 1, &accum);
|
||||||
|
// fclose(ofp);
|
||||||
|
|
||||||
gpc_polygon_clip(GPC_DIFF, &tmp, &accum, result_diff);
|
gpc_polygon_clip(GPC_DIFF, &tmp, &accum, result_diff);
|
||||||
gpc_polygon_clip(GPC_UNION, &tmp, &accum, &result_union);
|
gpc_polygon_clip(GPC_UNION, &tmp, &accum, &result_union);
|
||||||
|
@ -248,6 +250,12 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
|
||||||
// only add to output list if the clip left us with a polygon
|
// only add to output list if the clip left us with a polygon
|
||||||
if ( result_diff->num_contours > 0 ) {
|
if ( result_diff->num_contours > 0 ) {
|
||||||
polys_clipped.polys[i].push_back(result_diff);
|
polys_clipped.polys[i].push_back(result_diff);
|
||||||
|
|
||||||
|
// char filename[256];
|
||||||
|
// sprintf(filename, "next-result-%02d", count++);
|
||||||
|
// FILE *tmpfp= fopen(filename, "w");
|
||||||
|
// gpc_write_polygon(tmpfp, 1, result_diff);
|
||||||
|
// fclose(tmpfp);
|
||||||
}
|
}
|
||||||
accum = result_union;
|
accum = result_union;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue