diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-26 15:33:50 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-30 11:45:45 +0000 |
commit | 19fa507fc6c75e472d88f97353ded9340c084de8 (patch) | |
tree | 20be9d5c58280473859c6ff681f5de8585a6a416 /src/location/declarativemaps/qdeclarativepolygonmapitem.cpp | |
parent | 7fc3265612963e8d4c58c2b3fd4d2d432b64483b (diff) | |
download | qtlocation-19fa507fc6c75e472d88f97353ded9340c084de8.tar.gz |
Clean up dead code and TODO comments
This patch cleans up dead or disabled code and TODO comments added
with change c57d42b47004623db9b934d0688180ec6dc1a73e
Change-Id: I2817f20c8eb56386f8dbee2c661e3034f48caa30
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolygonmapitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolygonmapitem.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index b9632636..8f5442d6 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -276,9 +276,6 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map) if (ppi.elementCount() < 3) return; - // TODO: move this to clip2tri, and remove the code below. - // For clip2tri use the intersection between the the viewport AND the map as clipping region. - // Intersection between the viewport and a concave polygon can create multiple polygons // joined by a line at the viewport border, and poly2tri does not triangulate this very well // so use the full src path if the resulting polygon is concave. @@ -313,35 +310,6 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map) screenOutline_ = ppi; -#if 0 // TODO: This code appears to crash seldomly in presence of tilt. Requires further investigation - std::vector<std::vector<c2t::Point>> clipperPoints; - clipperPoints.push_back(std::vector<c2t::Point>()); - std::vector<c2t::Point> &curPts = clipperPoints.front(); - curPts.reserve(ppi.elementCount()); - for (int i = 0; i < ppi.elementCount(); ++i) { - const QPainterPath::Element e = ppi.elementAt(i); - if (e.isMoveTo() || i == ppi.elementCount() - 1 - || (qAbs(e.x - curPts.front().x) < 0.1 - && qAbs(e.y - curPts.front().y) < 0.1)) { - if (curPts.size() > 2) { - c2t::clip2tri *cdt = new c2t::clip2tri(); - std::vector<c2t::Point> outputTriangles; - cdt->triangulate(clipperPoints, outputTriangles, std::vector<c2t::Point>()); - for (size_t i = 0; i < outputTriangles.size(); ++i) { - screenVertices_ << QPointF(outputTriangles[i].x, outputTriangles[i].y); - } - delete cdt; - } - curPts.clear(); - curPts.reserve(ppi.elementCount() - i); - curPts.push_back( c2t::Point(e.x, e.y)); - } else if (e.isLineTo()) { - curPts.push_back( c2t::Point(e.x, e.y)); - } else { - qWarning("Unhandled element type in polygon painterpath"); - } - } -#else // Old qTriangulate()-based code. QTriangleSet ts = qTriangulate(ppi); qreal *vx = ts.vertices.data(); @@ -359,7 +327,6 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map) } for (int i = 0; i < (ts.vertices.size()/2*2); i += 2) screenVertices_ << QPointF(vx[i], vx[i + 1]); -#endif screenBounds_ = ppi.boundingRect(); } |