summaryrefslogtreecommitdiff
path: root/src/positioning/qgeopath.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix QGeoPolygon translate not updating clipper cachePaolo Angelelli2020-02-031-9/+15
| | | | | | | | | | | | | | | Problem resulting in failure when calling the contains() method. This patch caches the leftbound that is used in many other methods. This patch also fixes the copy constructor, now correctly converting rectangles and circles into polygons. Tests are added in a subsequent patch. [ChangeLog][QtPositioning][QGeoPolygon] Fixed contains method. Change-Id: I324e5a6e9bf981f830a8bb88e5f2abedb5ece5dd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-011-0/+4
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5700c90ee86873599b5e7c9ccb6cef7ca48153e7
| * Document QGeoPath::length behaviorPaolo Angelelli2019-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | By default, the method computes a closed-loop length. Being this public API, the only thing that can be done is to properly document the behavior. [ChangeLog][QtPositioning] Documented QGeoPath::length behavior properly. Change-Id: Ie48a51ab0d11ec68851c2ea26b8c6f6894be8b61 Fixes: QTBUG-71358 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QGeoPath/QGeoPolygon: defer bbox computationPaolo Angelelli2018-12-211-280/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces 2 versions of QGeoPath/polygon private: a lazy version (default) and an eager version. The reason is that certain classes such as MapItems make heavy use of the bounding box of the geoshapes, as well as the contains method, and in those cases it's beneficial to have it eagerly computed and cached. Other use cases do not see this feature so much in use, and the added costs, both in terms of computation and in terms of memory requirements for cached data can be avoided. As the patch currently stands, using copy constructors for QGeoPath and QGeoPolygon with a QGeoPathEager and a QGeoPolygonEager (and vice-versa) changes the type of d_ptr. This means that doing, for example, QGeoPath(someQGeoPathEager) effectively returns a QGeoPath that behaves like a QGeoPathEager (although not being one). Change-Id: I8cfed1e0a747139d0fb6d5fb5236bf5f5fbf24c1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix comparison for QGeoPolygon: check holesPaolo Angelelli2018-12-111-1/+1
|/ | | | | Change-Id: Ie817aebbb5fe52638cf26c4e583bb1ad08b71adf Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QGeoPath: revert clear API to clearPathv5.12.0-rc2v5.12.0-rc1v5.12.05.12.0Samuel Gaist2018-11-101-1/+1
| | | | | | | | The original name was correct as clear would need to reset more properties which is was not the goal of this method. Change-Id: Iac43a61e4b8bf57220c88d627b33578612c4ddad Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12.0v5.12.0-beta4Liang Qi2018-10-301-0/+3
|\ | | | | | | Change-Id: I0f4a3b7bc7c5c7f8da5af631000a6d5156884efe
| * Fix crash when calling QGeoPath::length on empty QGeoPath instanceAlex Blasche2018-10-241-0/+3
| | | | | | | | | | | | | | Fixes: QTBUG-71355 Change-Id: I47b058891a47cd6d020c4e192d40233c57814313 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | QGeoPath: fix clear APIv5.12.0-alpha1Samuel Gaist2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | Change the clear method name from clearPath to just clear to follow more closely the other Qt APIs. Change-Id: I98d4ea43e69e3d365c2c470e9b8b14479f288fe6 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add hole support in QGeoPolygonJulian Sherollari2018-08-201-0/+66
| | | | | | | | | | | | | | | | [ChangeLog][QtPositioning] Added holes in QGeoPolygons Change-Id: I490bcf8c4a6d9f35fa364072d8ea70b914bfc640 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | QGeoPath: implement clear functionSamuel Gaist2018-06-271-0/+18
|/ | | | | | | | | | | | | QGeoPath is missing a function to clear its content. This patch implements it. [ChangeLog][Positioning] QGeoPath can now be cleared directly using clearPath. Task-number: QTBUG-62875 Change-Id: I215edf180d11002c6f7e57bb10b008e935f32340 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Improve QGeoPath::path documentation and add autotestsv5.11.0-beta4Paolo Angelelli2018-04-121-3/+7
| | | | | | Change-Id: I8359c79f114abd0006012098cc154695013e0512 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Fix all documentation warningsTopi Reinio2018-03-271-2/+8
| | | | | | | | | | | | | | | | | | | | Fix multiple warnings caused by invalid documentation configuration, missing QML module specifiers, wrong QML type names, incorrect arguments for the \fn command, and missing documentation. Remove incorrect statement from the example usage of the Waypoint QML type. Use 'QtLocation' as the name for the module throughout the docs. Clang (used as the parser for QDoc in Qt 5.11) was unable to resolve the path for qlocation.h, causing QDoc to omit the QLocation namespace documentation. Fix this by including the file explicitly from qlocationglobal.h for documentation builds. Change-Id: I2bd790db1ff5ad96f0cdb415a682b97593b3a6dc Reviewed-by: Martin Smith <martin.smith@qt.io>
* Make QGeoPath::path a qvariantlist propertyPaolo Angelelli2017-12-051-2/+32
| | | | | Change-Id: I1f21d25832c7eb87d4a68a89e556f5c859498c2d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add QGeoPolygon to QtPositioningPaolo Angelelli2017-08-041-12/+61
| | | | | | | | | | | This patch introduces a new QGeoShape, QGeoPolygon, together with helper functions in the location singleton (QtPositioning.*) to create and convert geopolygons from QML. [ChangeLog][QtPositioning][QGeoPolygon] Added QGeoPolygon shape. Change-Id: I111c576d7428f2a953f0459d16c25eea7ab2bd7c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add QGeoPath::sizePaolo Angelelli2017-06-071-0/+16
| | | | | | | | | | | | A way to retrieve the size of the path is missing, as the path property turns out not to be accessible to QML. This patch adds a Q_INVOKABLE method to expose it. [ChangeLog][QtPositioning][QGeoPath] Add ::size() to QGeoPath to retrieve the number of coordinates in the path. Change-Id: Ifa7a640113cba71f23e36626a84c8b2fe473a07e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix for incorrect QGeoPathPrivate::containsPaolo Angelelli2017-06-061-1/+1
| | | | | Change-Id: I4067d6df69aad0af9495a29532a34f0a7e992596 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Complete parameter documentationNico Vertriest2017-04-101-1/+2
| | | | | | | | | | | qdeclarativegeomap.cpp: 1327: warning: Can't link to 'Component.onCompleted' qgeopath.cpp:117: warning: Undocumented parameter 'width' in QGeoPath::QGeoPath() qgeopath.cpp:117: warning: Undocumented parameter 'path' in QGeoPath::QGeoPath() qgeoshape.cpp:90: warning: Undocumented enum item 'PathType' in QGeoShape::ShapeType qgeoshape.cpp:231: warning: No such parameter 'QGeoRectangle' in QGeoShape::boundingGeoRectangle() Change-Id: Ie57dff2aabe82d61b8122362a396ac706939c3b3 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Use geoshapes as geo-model in qdeclarativegeomapitemsPaolo Angelelli2017-01-261-1/+1
| | | | | | | | | | | | | | | | | This patch uses QGeoShapes as data model inside the QDeclarativeMapItemBase subclasses. Advantages: - avoids duplication of implementation for geo-related methods (now only inside QGeoShapes). - provides map items a bounding box, usable for area based item searching ,or simple viewport fitting - allows to follow the graphics-view pattern, and have the same items visualized in different Maps (not yet supported). Change-Id: I6eec738fef5d753d90bdeeb4b109be89155b25f8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename QGeoProjection to QWebMercatorPaolo Angelelli2017-01-161-6/+6
| | | | | | | | | | QGeoProjection is currently a class containing only static methods for WebMercator conversion/interpolation. This patch renames it to QWebMercator, effectively freeing the QGeoProjection name for a real projection class Change-Id: I15b71d04f7d1d21a1d26f46687ed33aa277f6deb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add support for QGeoPathPaolo Angelelli2016-12-011-0/+679
This patch adds an addition qgeoshapes, QGeoPath. This represents a geographical path where each consecutive geopoints are connected along the shortest line of constant bearing (rhumb line). The path has a width, in meters, that is used in the contains() method to decide whether a coordinate is or not on the path, based on shortest distance to the rhumb line segments. Change-Id: Ia02780e3c8ac6c6d63a6083f53ea0677f8a21a1d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>