diff --git a/src/3rdparty/clip2tri/clip2tri.cpp b/src/3rdparty/clip2tri/clip2tri.cpp index 2f5026671f7367b5f5011bbaf0b4396a0ea53d8b..e715d1c70403c4bb86ad766215302c64f81835e8 100644 --- a/src/3rdparty/clip2tri/clip2tri.cpp +++ b/src/3rdparty/clip2tri/clip2tri.cpp @@ -90,7 +90,7 @@ void clip2tri::addClipPolygon(const Path &path) { clipper.AddPath(path, ptClip, true); } - catch(ClipperLib::clipperException &e) + catch(QtClipperLib::clipperException &e) { printf("addClipPolygon: %s\n", e.what()); } @@ -102,7 +102,7 @@ void clip2tri::addSubjectPath(const Path &path, bool closed) { clipper.AddPath(path, ptSubject, closed); } - catch(ClipperLib::clipperException &e) + catch(QtClipperLib::clipperException &e) { printf("addSubjectPath: %s\n", e.what()); return; @@ -118,17 +118,17 @@ void clip2tri::clearClipper() openSubject = false; } -static ClipperLib::ClipType operation(const clip2tri::Operation &op) +static QtClipperLib::ClipType operation(const clip2tri::Operation &op) { switch (op) { case clip2tri::Intersection: - return ClipperLib::ctIntersection; + return QtClipperLib::ctIntersection; case clip2tri::Union: - return ClipperLib::ctUnion; + return QtClipperLib::ctUnion; case clip2tri::Difference: - return ClipperLib::ctDifference; + return QtClipperLib::ctDifference; case clip2tri::Xor: - return ClipperLib::ctXor; + return QtClipperLib::ctXor; } return ctIntersection; } @@ -166,7 +166,7 @@ Paths clip2tri::execute(const clip2tri::Operation op, const PolyFillType subjFil } } } - catch(ClipperLib::clipperException &e) + catch(QtClipperLib::clipperException &e) { printf("executing %s: %s\n", operationName(op).c_str(), e.what()); } @@ -237,7 +237,7 @@ bool clip2tri::mergePolysToPolyTree(const vector<vector<Point> > &inputPolygons, { clipper.AddPaths(input, ptSubject, true); } - catch(ClipperLib::clipperException &e) + catch(QtClipperLib::clipperException &e) { printf("mergePolysToPolyTree: %s\n", e.what()); } diff --git a/src/3rdparty/clip2tri/clip2tri.h b/src/3rdparty/clip2tri/clip2tri.h index 37b563bbdc4a079a1ccfef5e118f672a4fd27e9f..61c8a0f545a0f2e2503096087cde12597cf803ba 100644 --- a/src/3rdparty/clip2tri/clip2tri.h +++ b/src/3rdparty/clip2tri/clip2tri.h @@ -33,7 +33,7 @@ #include <clipper.h> using namespace std; -using namespace ClipperLib; +using namespace QtClipperLib; namespace c2t { diff --git a/src/3rdparty/clipper/clipper.cpp b/src/3rdparty/clipper/clipper.cpp index d4c82344e473f5f858eedfb0e7d4af07b931cec8..53ac4d826aab79673c537508d98f081bbdc014a6 100644 --- a/src/3rdparty/clipper/clipper.cpp +++ b/src/3rdparty/clipper/clipper.cpp @@ -48,7 +48,7 @@ #include <ostream> #include <functional> -namespace ClipperLib { +namespace QtClipperLib { static double const pi = 3.141592653589793238; static double const two_pi = pi *2; @@ -4619,4 +4619,4 @@ std::ostream& operator <<(std::ostream &s, const Paths &p) } //------------------------------------------------------------------------------ -} //ClipperLib namespace +} //QtClipperLib namespace diff --git a/src/3rdparty/clipper/clipper.h b/src/3rdparty/clipper/clipper.h index 2472ac7708237eba92d64db8cb373ebef0a41231..78013afc798e07a0a26ecd3e7a5e19fed3538cab 100644 --- a/src/3rdparty/clipper/clipper.h +++ b/src/3rdparty/clipper/clipper.h @@ -59,7 +59,7 @@ #include <functional> #include <queue> -namespace ClipperLib { +namespace QtClipperLib { enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor }; enum PolyType { ptSubject, ptClip }; @@ -397,7 +397,7 @@ class clipperException : public std::exception }; //------------------------------------------------------------------------------ -} //ClipperLib namespace +} //QtClipperLib namespace #endif //clipper_hpp diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp index 9aae03fa0c785f73b5fa2225963bdf18cf70161d..274225c036c6d506889235ce3a52e3713cec5ce5 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp @@ -181,7 +181,7 @@ void QGeoMapCircleGeometry::updateScreenPointsInvert(const QList<QDoubleVector2D c2t::clip2tri clipper; clipper.addSubjectPath(QClipperUtils::qListToPath(fill), true); clipper.addClipPolygon(QClipperUtils::qListToPath(hole)); - Paths difference = clipper.execute(c2t::clip2tri::Difference, ClipperLib::pftEvenOdd, ClipperLib::pftEvenOdd); + Paths difference = clipper.execute(c2t::clip2tri::Difference, QtClipperLib::pftEvenOdd, QtClipperLib::pftEvenOdd); // 2) QDoubleVector2D lb = map.geoProjection().geoToWrappedMapProjection(srcOrigin_); @@ -192,7 +192,7 @@ void QGeoMapCircleGeometry::updateScreenPointsInvert(const QList<QDoubleVector2D for (const Path &p: difference) clipper.addSubjectPath(p, true); clipper.addClipPolygon(QClipperUtils::qListToPath(visibleRegion)); - Paths res = clipper.execute(c2t::clip2tri::Intersection, ClipperLib::pftEvenOdd, ClipperLib::pftEvenOdd); + Paths res = clipper.execute(c2t::clip2tri::Intersection, QtClipperLib::pftEvenOdd, QtClipperLib::pftEvenOdd); clippedPaths = QClipperUtils::pathsToQList(res); // 2.1) update srcOrigin_ with the point with minimum X/Y diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index 5cd57dcb5bf65bb7529519d641ad263455f89fc3..0b93a2944a84c02edbe87f6467d96e3a3c8946a2 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -190,7 +190,7 @@ void QGeoMapPolygonGeometry::updateSourcePoints(const QGeoMap &map, c2t::clip2tri clipper; clipper.addSubjectPath(QClipperUtils::qListToPath(wrappedPath), true); clipper.addClipPolygon(QClipperUtils::qListToPath(visibleRegion)); - Paths res = clipper.execute(c2t::clip2tri::Intersection, ClipperLib::pftEvenOdd, ClipperLib::pftEvenOdd); + Paths res = clipper.execute(c2t::clip2tri::Intersection, QtClipperLib::pftEvenOdd, QtClipperLib::pftEvenOdd); clippedPaths = QClipperUtils::pathsToQList(res); // 2.1) update srcOrigin_ and leftBoundWrapped with the point with minimum X