From 512693f001dc7ae5cfdaed9a8afeb86a8fc40851 Mon Sep 17 00:00:00 2001 From: Peter Sadrozinski Date: Sat, 31 Mar 2012 10:31:37 -0400 Subject: [PATCH] hopefully fix windows build --- src/Airports/GenAirports850/linearfeature.cxx | 2 - src/Airports/GenAirports850/linearfeature.hxx | 2 +- src/Lib/Polygon/polygon.cxx | 84 ++++++++++--------- src/Lib/Polygon/polygon.hxx | 2 - 4 files changed, 44 insertions(+), 46 deletions(-) diff --git a/src/Airports/GenAirports850/linearfeature.cxx b/src/Airports/GenAirports850/linearfeature.cxx index cd250dd4..310613ba 100644 --- a/src/Airports/GenAirports850/linearfeature.cxx +++ b/src/Airports/GenAirports850/linearfeature.cxx @@ -296,8 +296,6 @@ void LinearFeature::ConvertContour( BezContour* src, bool closed ) else { // calculate linear distance to determine how many segments we want - Point3D destLoc = nextNode->GetLoc(); - if (num_segs > 1) { for (int p=0; perase(); for (unsigned int i=0; iouter.size(); j++) { - ip = IntPoint( pg->outer[j].X, pg->outer[j].Y ); + ip = ClipperLib::IntPoint( pg->outer[j].X, pg->outer[j].Y ); out->add_node(res_contour, MakeTGPoint(ip)); } out->set_hole_flag(res_contour, 0); @@ -572,7 +574,7 @@ void make_tg_poly_from_clipper_ex( const ExPolygons& in, TGPolygon *out ) { for (unsigned int k = 0; k < pg->holes[j].size(); k++) { - ip = IntPoint( pg->holes[j].at(k).X, pg->holes[j].at(k).Y ); + ip = ClipperLib::IntPoint( pg->holes[j].at(k).X, pg->holes[j].at(k).Y ); out->add_node(res_contour, MakeTGPoint(ip)); } out->set_hole_flag(res_contour, 1); @@ -581,18 +583,18 @@ void make_tg_poly_from_clipper_ex( const ExPolygons& in, TGPolygon *out ) } } -void make_tg_poly_from_clipper( const Polygons& in, TGPolygon *out ) +void make_tg_poly_from_clipper( const ClipperLib::Polygons& in, TGPolygon *out ) { out->erase(); // for each polygon, we need to check the orientation, to set the hole flag... for (unsigned int i=0; iadd_node( i, MakeTGPoint(ip) ); } @@ -607,14 +609,14 @@ void make_tg_poly_from_clipper( const Polygons& in, TGPolygon *out ) } } -Polygons clipper_simplify( ExPolygons &in ) +ClipperLib::Polygons clipper_simplify( ClipperLib::ExPolygons &in ) { - Polygons out; - Polygon contour; + ClipperLib::Polygons out; + ClipperLib::Polygon contour; for (unsigned int i=0; iouter; @@ -644,36 +646,36 @@ TGPolygon polygon_clip_clipper( clip_op poly_op, const TGPolygon& subject, const { TGPolygon result; - Polygons clipper_subject; + ClipperLib::Polygons clipper_subject; make_clipper_poly( subject, &clipper_subject ); - Polygons clipper_clip; + ClipperLib::Polygons clipper_clip; make_clipper_poly( clip, &clipper_clip ); - ExPolygons clipper_result; + ClipperLib::ExPolygons clipper_result; - ClipType op; + ClipperLib::ClipType op; if ( poly_op == POLY_DIFF ) { - op = ctDifference; + op = ClipperLib::ctDifference; } else if ( poly_op == POLY_INT ) { - op = ctIntersection; + op = ClipperLib::ctIntersection; } else if ( poly_op == POLY_XOR ) { - op = ctXor; + op = ClipperLib::ctXor; } else if ( poly_op == POLY_UNION ) { - op = ctUnion; + op = ClipperLib::ctUnion; } else { throw sg_exception("Unknown polygon op, exiting."); } - Clipper c; + ClipperLib::Clipper c; c.Clear(); - c.AddPolygons(clipper_subject, ptSubject); - c.AddPolygons(clipper_clip, ptClip); + c.AddPolygons(clipper_subject, ClipperLib::ptSubject); + c.AddPolygons(clipper_clip, ClipperLib::ptClip); - c.Execute(op, clipper_result, pftEvenOdd, pftEvenOdd); + c.Execute(op, clipper_result, ClipperLib::pftEvenOdd, ClipperLib::pftEvenOdd); // verify each result is simple - Polygons simple_result = clipper_simplify( clipper_result ); + ClipperLib::Polygons simple_result = clipper_simplify( clipper_result ); make_tg_poly_from_clipper( simple_result, &result ); @@ -860,7 +862,7 @@ TGPolygon tgPolygonStripHoles( const TGPolygon &poly ) { return result; } -void PrintClipperPoly( Polygons polys ) +void PrintClipperPoly( ClipperLib::Polygons polys ) { int nContours = polys.size(); @@ -880,7 +882,7 @@ TGPolygon tgPolygonExpand(const TGPolygon &poly, double delta) { TGPolygon result; - Polygons clipper_src, clipper_dst; + ClipperLib::Polygons clipper_src, clipper_dst; make_clipper_poly( poly, &clipper_src ); @@ -901,7 +903,7 @@ TGPolygon tgPolygonExpand(const TGPolygon &poly, double delta) TGPolygon tgPolygonSimplify(const TGPolygon &poly) { TGPolygon result; - Polygons clipper_poly; + ClipperLib::Polygons clipper_poly; make_clipper_poly( poly, &clipper_poly ); diff --git a/src/Lib/Polygon/polygon.hxx b/src/Lib/Polygon/polygon.hxx index dc7a8e54..a16355f8 100644 --- a/src/Lib/Polygon/polygon.hxx +++ b/src/Lib/Polygon/polygon.hxx @@ -57,8 +57,6 @@ extern "C" { } #include "clipper.hpp" -using namespace ClipperLib; - #define FG_MAX_VERTICES 1500000 typedef TGPolygon ClipPolyType;