12#include <QtCore/QObject>
13#include <QtCore/QPointF>
14#include <QtCore/QSizeF>
15#include <QtCore/qnumeric.h>
16#include <QtGui/QQuaternion>
17#include <QtGui/QVector3D>
18#include <QtPositioning/QGeoCoordinate>
19#include <QtQmlIntegration/QtQmlIntegration>
73 QGeoCoordinate
center() const;
81 qreal
heading()
const {
return _heading; }
85 qreal
tilt()
const {
return _tilt; }
122 Q_INVOKABLE
void reset();
142 Q_INVOKABLE
void beginPan(
const QPointF& screenPos);
144 Q_INVOKABLE
void panTo(
const QPointF& screenPos);
147 Q_INVOKABLE
void beginOrbit(
const QPointF& screenPos);
150 Q_INVOKABLE
void orbitTo(
const QPointF& screenPos);
154 Q_INVOKABLE
void rotateBy(qreal degrees,
const QPointF& screenPos);
158 Q_INVOKABLE
void tiltBy(qreal degrees,
const QPointF& screenPos);
162 Q_INVOKABLE
void zoom(qreal amount,
const QPointF& screenPos);
166 Q_INVOKABLE
void zoomBy(qreal factor,
const QPointF& screenPos);
186 const QPointF& screenPos,
double worldZ = 0.0,
215 std::optional<QPointF>
screenToGround(
const QPointF& screenPos)
const;
221 std::optional<QPointF>
groundPointCapped(
const QPointF& screenPos,
double maxRange)
const;
226 std::optional<QPointF>
worldToScreen(
const QPointF& worldGround,
double worldZ = 0.0)
const;
242 void _setCenterWorld(
const QPointF& world);
244 void _anchorToScreen(
const QPointF& anchorWorld,
const QPointF& screenPos);
245 static qreal _normalizedHeading(qreal
heading);
247 QPointF _centerWorld;
248 bool _positioned =
false;
249 QPointF _sceneOrigin;
251 qreal _heading = 0.0;
254 qreal _centerElevation = 0.0;
255 QSizeF _viewportSize;
259 std::optional<QPointF> _panAnchorWorld;
260 std::optional<QPointF> _orbitAnchorWorld;
261 QPointF _orbitAnchorScreen;
262 QPointF _orbitStartScreen;
263 qreal _orbitStartHeading = 0.0;
264 qreal _orbitStartTilt = 0.0;
qreal default3DTilt() const
Q_INVOKABLE void panTo(const QPointF &screenPos)
Continue a pan gesture: the ground point picked at beginPan stays under the cursor.
QSizeF viewportSize() const
void centerElevationChanged()
void setCenterElevation(qreal elevation)
void setFieldOfView(qreal fov)
std::optional< QPointF > worldToScreen(const QPointF &worldGround, double worldZ=0.0) const
Q_INVOKABLE void goTo2D()
qreal fieldOfView() const
Q_INVOKABLE void beginPan(const QPointF &screenPos)
Start a pan gesture at the given screen position (pixels)
static constexpr qreal kMinTilt
QPointF cameraGroundPosition() const
Q_INVOKABLE qreal sceneUnitsPerPixel() const
Q_INVOKABLE void zoom(qreal amount, const QPointF &screenPos)
std::optional< QPointF > screenToGround(const QPointF &screenPos) const
void setCenter(const QGeoCoordinate ¢er)
static constexpr qreal kDefault3DTilt
qreal centerElevation() const
static constexpr qreal kMinDistance
void setSceneOrigin(const QPointF &origin)
void fieldOfViewChanged()
Q_INVOKABLE void zoomBy(qreal factor, const QPointF &screenPos)
Q_INVOKABLE void orbitTo(const QPointF &screenPos)
void setDistance(qreal distance)
Q_INVOKABLE void lookAt(const QGeoCoordinate ¢er, qreal heading, qreal tilt, qreal distance)
Set the full pose in one call. tilt/distance are clamped.
bool isPositioned() const
QVector3D cameraPosition() const
Q_INVOKABLE void goTo3D()
Q_INVOKABLE void beginOrbit(const QPointF &screenPos)
Start an orbit gesture at the given screen position (pixels)
void setHeading(qreal heading)
QVector3D scenePosition() const
void setViewportSize(const QSizeF &size)
void viewportSizeChanged()
static constexpr qreal kDefaultDistance
Q_INVOKABLE void reset()
Restore the default pose at the current center (heading 0, tilt 0, default distance)
QPointF sceneOrigin() const
static constexpr qreal kMaxTilt
Q_INVOKABLE void tiltBy(qreal degrees, const QPointF &screenPos)
static constexpr qreal kDefaultFieldOfView
std::optional< QPointF > groundPointCapped(const QPointF &screenPos, double maxRange) const
Q_INVOKABLE void rotateBy(qreal degrees, const QPointF &screenPos)
Q_INVOKABLE qreal distanceForZoomLevel(qreal zoomLevel) const
Q_INVOKABLE QGeoCoordinate centerForCoordinateAtScreenPoint(const QGeoCoordinate &coordinate, const QPointF &screenPos, double worldZ=0.0, double centerElevation=qQNaN()) const
QGeoCoordinate center() const
static constexpr qreal kMaxDistance
QQuaternion sceneRotation() const