diff options
author | Aaron McCarthy <aaron.mccarthy@jollamobile.com> | 2015-01-06 09:18:09 +1000 |
---|---|---|
committer | Aaron McCarthy <mccarthy.aaron@gmail.com> | 2015-01-07 02:37:20 +0100 |
commit | 804f60d1dbcbeff1741584629942a7f59175e7c5 (patch) | |
tree | 15c662069af2bc0927934e3318f43b8f4abf87c9 /src/3rdparty/poly2tri | |
parent | 5924aa508acd42da45106c9294c9721418eb868d (diff) | |
download | qtlocation-804f60d1dbcbeff1741584629942a7f59175e7c5.tar.gz |
Update poly2tri to latest upstream.
Sync'd with upstream change 26242d0aa7b8.
Change-Id: I16e8fd333006b88c464d8e083af181cd2ce726e3
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Michal Klocek <michal.klocek@digia.com>
Diffstat (limited to 'src/3rdparty/poly2tri')
-rw-r--r-- | src/3rdparty/poly2tri/common/shapes.h | 2 | ||||
-rw-r--r-- | src/3rdparty/poly2tri/sweep/sweep_context.cpp | 28 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/3rdparty/poly2tri/common/shapes.h b/src/3rdparty/poly2tri/common/shapes.h index f147955a..c99f293c 100644 --- a/src/3rdparty/poly2tri/common/shapes.h +++ b/src/3rdparty/poly2tri/common/shapes.h @@ -254,7 +254,7 @@ inline bool operator ==(const Point& a, const Point& b) inline bool operator !=(const Point& a, const Point& b) { - return a.x != b.x && a.y != b.y; + return !(a.x == b.x) && !(a.y == b.y); } /// Peform the dot product on two vectors. diff --git a/src/3rdparty/poly2tri/sweep/sweep_context.cpp b/src/3rdparty/poly2tri/sweep/sweep_context.cpp index 85c5b5dc..e9791caf 100644 --- a/src/3rdparty/poly2tri/sweep/sweep_context.cpp +++ b/src/3rdparty/poly2tri/sweep/sweep_context.cpp @@ -34,7 +34,13 @@ namespace p2t { -SweepContext::SweepContext(std::vector<Point*> polyline) +SweepContext::SweepContext(std::vector<Point*> polyline) : + front_(0), + head_(0), + tail_(0), + af_head_(0), + af_middle_(0), + af_tail_(0) { basin = Basin(); edge_event = EdgeEvent(); @@ -164,12 +170,20 @@ void SweepContext::RemoveFromMap(Triangle* triangle) void SweepContext::MeshClean(Triangle& triangle) { - if (&triangle != NULL && !triangle.IsInterior()) { - triangle.IsInterior(true); - triangles_.push_back(&triangle); - for (int i = 0; i < 3; i++) { - if (!triangle.constrained_edge[i]) - MeshClean(*triangle.GetNeighbor(i)); + std::vector<Triangle *> triangles; + triangles.push_back(&triangle); + + while(!triangles.empty()){ + Triangle *t = triangles.back(); + triangles.pop_back(); + + if (t != NULL && !t->IsInterior()) { + t->IsInterior(true); + triangles_.push_back(t); + for (int i = 0; i < 3; i++) { + if (!t->constrained_edge[i]) + triangles.push_back(t->GetNeighbor(i)); + } } } } |