summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli.qt@gmail.com>2019-12-30 13:27:29 +0100
committerPaolo Angelelli <paolo.angelelli.qt@gmail.com>2020-02-12 11:24:45 +0000
commitbe7cbed7411d024d178377bd327d5916c80e02a0 (patch)
treed5840e89206157770188c4472bcc752f793a6a5d /src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h
parenta4469cad4041f21e640efa9ca5d0b192dd702955 (diff)
downloadqtlocation-be7cbed7411d024d178377bd327d5916c80e02a0.tar.gz
Add geometry simplification to MapPolyline/MapPolylineObjectQSG
This change introduces a metric-based implementation of the Ramer-Douglas-Peucker line simplification algorithm to generate a LOD pyramid for the polyline geometries. This comes with a related property (in MapItemBase), lodThreshold, that can be used to change the threshold after which no simplification will be used. By default the value of this property is 0, meaning that the behavior will be unchanged and no LOD will be used. This change also introduces LOD on map polyine objects QSG, for which no property is introduced, and there's a default threshold set to zoom level 12 (which appear to produce acceptable results). Finally, this patch makes use of a threadpool with 1 thread to enqueue geometry simplification tasks, which would otherwise freeze the UI when computing for the first time. Support for geometry simplification is currently added only to polylines. It might be of interest extending it to polygons as well, once a proper strategy for handling the simplification of inner holes has been identified. Finally, extending it to circles could be of interest, while potentially bringing only minor benefits, as circle geometries are currently fixed to 128 vertices. Also adds a MapObject-based delegate to the geojson viewer example. Task-number: QTBUG-46652 Task-number: QTBUG-38459 Task-number: QTBUG-49303 Change-Id: I64b5db4577962db17e5388812909285c9356ef0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h b/src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h
index 520abdf3..65d2f618 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem_p_p.h
@@ -364,7 +364,8 @@ public:
combinedMatrix,
cameraCenter,
Qt::SquareCap,
- true);
+ true,
+ 30); // No LOD for rectangles
m_borderGeometry.setPreserveGeometry(false);
m_borderGeometry.markClean();
} else {