summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeoprojection_p.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-31 03:03:41 +0200
committerAlex Blasche <alexander.blasche@qt.io>2020-04-02 08:20:37 +0200
commitb06a07cf9fd474e11fbe467047e5fe0322b677f0 (patch)
treeba8b1dd84c3d263b27a1865fff84a659b5273091 /src/location/maps/qgeoprojection_p.h
parent4cfed13377ababcfaa7dacb055bcd3dd0f2cf7d4 (diff)
parent29816a3aaa3f368422a3b19983add62673bb6960 (diff)
downloadqtlocation-b06a07cf9fd474e11fbe467047e5fe0322b677f0.tar.gz
Merge 5.15 to dev and fix resulting compile issues
Conflicts: src/imports/location/location.cpp The change fixes the bare minimum of what needs to be done to compile and run. This includes the following issues: 1. Fix build failures as a result of QMetaType changes in qtbase moc now stores the QMetaType of properties as a result of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires full type information about the property type inside the moc generated source file. Many of the property types were forward-declared, and this resulted in build errors like: "invalid application of 'sizeof' to an incomplete type 'QDeclarativeGeoMap'" 2. Adopts QtQML API changes. A private QJSValue ctor was removed. The "replacement" is QJSValuePrivate::fromReturnedValue(..). 3. The mapboxgl 3rdparty backend does not compile at this point in time and seems unmaintained. For the time being, the mapboxgl backend is disabled in the interest of keeping qtlocation closer to dev HEAD of other Qt modules. Change-Id: I756e1c2effb29eaaf96a61a28c1c17338774b77c
Diffstat (limited to 'src/location/maps/qgeoprojection_p.h')
-rw-r--r--src/location/maps/qgeoprojection_p.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/location/maps/qgeoprojection_p.h b/src/location/maps/qgeoprojection_p.h
index 2e1af8c5..9a75246a 100644
--- a/src/location/maps/qgeoprojection_p.h
+++ b/src/location/maps/qgeoprojection_p.h
@@ -52,6 +52,8 @@
#include <QtLocation/private/qgeocameradata_p.h>
#include <QtPositioning/private/qdoublematrix4x4_p.h>
#include <QtPositioning/QGeoShape>
+#include <QMatrix4x4>
+#include <QTransform>
QT_BEGIN_NAMESPACE
@@ -107,6 +109,17 @@ public:
virtual QGeoShape visibleRegion() const;
virtual bool setBearing(qreal bearing, const QGeoCoordinate &coordinate);
+ virtual QMatrix4x4 projectionTransformation() const = 0; // This brings a mercator coord into the correct viewport coordinate.
+ virtual QMatrix4x4 projectionTransformation_centered() const = 0; // Same as projectionTransformation, but the center of the camera is around 0,0.
+ // Requires subsequent shifting of the geometry to fit such camera.
+ virtual const QMatrix4x4 &qsgTransform() const = 0;
+ virtual QDoubleVector3D centerMercator() const = 0;
+
+ void setItemToWindowTransform(const QTransform &itemToWindowTransform);
+ virtual QTransform itemToWindowTransform() const;
+
+ QTransform m_itemToWindowTransform;
+ mutable bool m_qsgTransformDirty = true;
};
class Q_LOCATION_PRIVATE_EXPORT QGeoProjectionWebMercator : public QGeoProjection
@@ -117,6 +130,11 @@ public:
// From QGeoProjection
double minimumZoom() const override;
+ QMatrix4x4 projectionTransformation() const override;
+ QMatrix4x4 projectionTransformation_centered() const override;
+ const QMatrix4x4 &qsgTransform() const override;
+ QDoubleVector3D centerMercator() const override;
+
double maximumCenterLatitudeAtZoom(const QGeoCameraData &cameraData) const override;
double minimumCenterLatitudeAtZoom(const QGeoCameraData &cameraData) const override;
@@ -144,6 +162,7 @@ public:
QDoubleVector2D geoToMapProjection(const QGeoCoordinate &coordinate) const;
QGeoCoordinate mapProjectionToGeo(const QDoubleVector2D &projection) const;
+ int projectionWrapFactor(const QDoubleVector2D &projection) const;
QDoubleVector2D wrapMapProjection(const QDoubleVector2D &projection) const;
QDoubleVector2D unwrapMapProjection(const QDoubleVector2D &wrappedProjection) const;
@@ -213,7 +232,10 @@ protected:
double m_1_viewportWidth;
double m_1_viewportHeight;
+ QDoubleMatrix4x4 m_cameraMatrix;
+ QDoubleMatrix4x4 m_cameraMatrix0;
QDoubleMatrix4x4 m_transformation;
+ QDoubleMatrix4x4 m_transformation0;
QDoubleMatrix4x4 m_quickItemTransformation;
QDoubleVector3D m_eye;
QDoubleVector3D m_up;
@@ -234,6 +256,7 @@ protected:
// For the clipping region
QDoubleVector3D m_centerMercator;
QDoubleVector3D m_eyeMercator;
+ QDoubleVector3D m_eyeMercator0;
QDoubleVector3D m_viewMercator;
QDoubleVector3D m_upMercator;
QDoubleVector3D m_sideMercator;
@@ -245,6 +268,8 @@ protected:
QList<QDoubleVector2D> m_visibleRegionExpanded;
QList<QDoubleVector2D> m_projectableRegion;
bool m_visibleRegionDirty;
+
+ mutable QMatrix4x4 m_qsgTransform;
QRectF m_visibleArea;
Q_DISABLE_COPY(QGeoProjectionWebMercator)