From aa84d13f0a63f469a6454d0043a34cda4162988e Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Wed, 11 Aug 2021 11:24:27 +0200 Subject: Update clipper to version 6.4.2 Also update the qdoc module in attribution file, so that it is listed on the licenses page. Task-number: QTBUG-94418 Change-Id: I101c577854141d00a4d43da25009769cc94c2ac7 Reviewed-by: Alex Blasche (cherry picked from commit cbe3f64048fa0ad31e0ff4b95bc4324e4e849242) Reviewed-by: Qt Cherry-pick Bot --- src/3rdparty/clipper/clipper.cpp | 31 +++++++++++++++++++------------ src/3rdparty/clipper/clipper.h | 10 +++++----- src/3rdparty/clipper/qt_attribution.json | 8 ++++---- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/3rdparty/clipper/clipper.cpp b/src/3rdparty/clipper/clipper.cpp index 53ac4d82..d9735649 100644 --- a/src/3rdparty/clipper/clipper.cpp +++ b/src/3rdparty/clipper/clipper.cpp @@ -1,10 +1,10 @@ /******************************************************************************* * * * Author : Angus Johnson * -* Version : 6.4.0 * -* Date : 2 July 2015 * +* Version : 6.4.2 * +* Date : 27 February 2017 * * Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2015 * +* Copyright : Angus Johnson 2010-2017 * * * * License: * * Use, modification & distribution is subject to Boost Software License Ver 1. * @@ -179,7 +179,7 @@ int PolyTree::Total() const // PolyNode methods ... //------------------------------------------------------------------------------ -PolyNode::PolyNode(): Childs(), Parent(0), Index(0), m_IsOpen(false) +PolyNode::PolyNode(): Parent(0), Index(0), m_IsOpen(false) { } //------------------------------------------------------------------------------ @@ -1866,7 +1866,7 @@ OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt) prevE = e->PrevInAEL; } - if (prevE && prevE->OutIdx >= 0) + if (prevE && prevE->OutIdx >= 0 && prevE->Top.Y < Pt.Y && e->Top.Y < Pt.Y) { cInt xPrev = TopX(*prevE, Pt.Y); cInt xE = TopX(*e, Pt.Y); @@ -2713,7 +2713,11 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) if (horzEdge->OutIdx >= 0 && !IsOpen) //note: may be done multiple times { - op1 = AddOutPt(horzEdge, e->Curr); +#ifdef use_xyz + if (dir == dLeftToRight) SetZ(e->Curr, *horzEdge, *e); + else SetZ(e->Curr, *e, *horzEdge); +#endif + op1 = AddOutPt(horzEdge, e->Curr); TEdge* eNextHorz = m_SortedEdges; while (eNextHorz) { @@ -3039,7 +3043,10 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY) { e->Curr.X = TopX( *e, topY ); e->Curr.Y = topY; - } +#ifdef use_xyz + e->Curr.Z = topY == e->Top.Y ? e->Top.Z : (topY == e->Bot.Y ? e->Bot.Z : 0); +#endif + } //When StrictlySimple and 'e' is being touched by another edge, then //make sure both edges have a vertex here ... @@ -3663,7 +3670,7 @@ void Clipper::FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec) { OutRec* outRec = m_PolyOuts[i]; OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft); - if (outRec->Pts && outRec->FirstLeft == OldOutRec) + if (outRec->Pts && firstLeft == OldOutRec) outRec->FirstLeft = NewOutRec; } } @@ -4322,10 +4329,10 @@ double DistanceFromLineSqrd( const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2) { //The equation of a line in general form (Ax + By + C = 0) - //given 2 points (x¹,y¹) & (x²,y²) is ... - //(y¹ - y²)x + (x² - x¹)y + (y² - y¹)x¹ - (x² - x¹)y¹ = 0 - //A = (y¹ - y²); B = (x² - x¹); C = (y² - y¹)x¹ - (x² - x¹)y¹ - //perpendicular distance of point (x³,y³) = (Ax³ + By³ + C)/Sqrt(A² + B²) + //given 2 points (x¹,y¹) & (x²,y²) is ... + //(y¹ - y²)x + (x² - x¹)y + (y² - y¹)x¹ - (x² - x¹)y¹ = 0 + //A = (y¹ - y²); B = (x² - x¹); C = (y² - y¹)x¹ - (x² - x¹)y¹ + //perpendicular distance of point (x³,y³) = (Ax³ + By³ + C)/Sqrt(A² + B²) //see http://en.wikipedia.org/wiki/Perpendicular_distance double A = double(ln1.Y - ln2.Y); double B = double(ln2.X - ln1.X); diff --git a/src/3rdparty/clipper/clipper.h b/src/3rdparty/clipper/clipper.h index d9103ce4..de4a540d 100644 --- a/src/3rdparty/clipper/clipper.h +++ b/src/3rdparty/clipper/clipper.h @@ -1,10 +1,10 @@ /******************************************************************************* * * * Author : Angus Johnson * -* Version : 6.4.0 * -* Date : 2 July 2015 * +* Version : 6.4.2 * +* Date : 27 February 2017 * * Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2015 * +* Copyright : Angus Johnson 2010-2017 * * * * License: * * Use, modification & distribution is subject to Boost Software License Ver 1. * @@ -34,7 +34,7 @@ #ifndef clipper_hpp #define clipper_hpp -#define CLIPPER_VERSION "6.2.6" +#define CLIPPER_VERSION "6.4.2" //use_int32: When enabled 32bit ints are used instead of 64bit ints. This //improve performance but coordinate values are limited to the range +/- 46340 @@ -159,7 +159,7 @@ private: class PolyTree: public PolyNode { public: - ~PolyTree(){Clear();}; + ~PolyTree(){ Clear(); }; PolyNode* GetFirst() const; void Clear(); int Total() const; diff --git a/src/3rdparty/clipper/qt_attribution.json b/src/3rdparty/clipper/qt_attribution.json index 4f6a2321..cc00a496 100644 --- a/src/3rdparty/clipper/qt_attribution.json +++ b/src/3rdparty/clipper/qt_attribution.json @@ -1,13 +1,13 @@ { "Id": "clipper", "Name": "Clipper Polygon Clipping Library", - "QDocModule": "qtlocation", - "QtUsage": "Used in the QML plugin of Qt Location.", + "QDocModule": "qtpositioning", + "QtUsage": "Used in the QML plugin of Qt Location and in Qt Positioning.", "Description": "The Clipper library performs line & polygon clipping - intersection, union, difference & exclusive-or, and line & polygon offsetting.", "Homepage": "http://www.angusj.com/delphi/clipper.php", - "Version": "6.4.0", + "Version": "6.4.2", "LicenseId": "BSL-1.0", "License": "Boost Software License 1.0", "LicenseFile": "LICENSE", - "Copyright": "Copyright Angus Johnson 2010-2015" + "Copyright": "Copyright Angus Johnson 2010-2017" } -- cgit v1.2.3