KOSMIndoorMap
view.cpp
15static constexpr const double SceneWorldSize = 256.0; // size of the scene when containing the full world
17static constexpr const auto MaxZoomFactor = 21; // 2^MaxZoomFactor subdivisions of the scene space
32 SceneWorldSize / (2.0 * M_PI) * (M_PI - std::log(std::tan((M_PI / 4.0) + ((OSM::degToRad(lat) / 2.0)))))
182 return QRectF(mapSceneToScreen(sceneRect.topLeft()), mapSceneToScreen(sceneRect.bottomRight()));
231 const auto s = std::min(viewport.width() / m_bbox.width(), viewport.height() / m_bbox.height());
329 m_screenWidthInMeters = OSM::distance(mapSceneToGeo(QPointF(m_viewport.left(), m_viewport.center().y())), mapSceneToGeo(QPointF(m_viewport.right(), m_viewport.center().y())));
335 m_sceneToScreenTransform.scale(screenWidth() / (m_viewport.width()), screenHeight() / (m_viewport.height()));
350 const auto alignedTime = QDateTime(beginTime.date(), {beginTime.time().hour(), beginTime.time().minute()});
365 const auto alignedTime = QDateTime(endTime.date(), {endTime.time().hour(), endTime.time().minute()});
Q_INVOKABLE void centerOnGeoCoordinate(QPointF geoCoord)
Center the view on the given geo-coordinate.
Definition view.cpp:317
static QPointF mapGeoToScene(OSM::Coordinate coord)
Map a geographic coordinate to a scene coordinate, ie.
Definition view.cpp:27
Q_INVOKABLE void zoomOut(QPointF screenCenter)
Decrease zoom level by one/scale down by 2x around the screen position center.
Definition view.cpp:218
QRectF viewportForZoom(double zoom, QPointF screenCenter) const
Computes the viewport for the given zoom level and screenCenter.
Definition view.cpp:123
QTransform deviceTransform() const
Device tranformation for manual high DPI scaling.
Definition view.cpp:307
Q_INVOKABLE double mapMetersToScreen(double meters) const
Returns how many pixels on screen represent the distance of meters with the current view transformati...
Definition view.cpp:263
static Q_INVOKABLE QPointF mapSceneToGeoPoint(QPointF p)
QML only API due to lack of OSM::Coordinate support there.
Definition view.cpp:373
Q_INVOKABLE void panTopLeft(double x, double y)
Move the viewport to the pan coordinates x and y.
Definition view.cpp:299
double mapMetersToScene(double meters) const
Returns how many units in scene coordinate represent the distance of meters in the current view trans...
Definition view.cpp:257
int screenWidth() const
Screen-space sizes, ie the size of the on-screen area used for displaying.
Definition view.cpp:63
double mapScreenDistanceToSceneDistance(double distance) const
Converts a distance in screen coordinates to a distance in scene coordinates.
Definition view.cpp:191
Q_INVOKABLE double mapScreenToMeters(int pixels) const
Returns how many meters are represented by pixels with the current view transformation.
Definition view.cpp:269
Q_INVOKABLE void zoomIn(QPointF screenCenter)
Increase zoom level by one/scale up by 2x around the screen position center.
Definition view.cpp:213
QPointF mapSceneToScreen(QPointF scenePos) const
Converts a point in scene coordinates to screen coordinates.
Definition view.cpp:175
Q_INVOKABLE void setZoomLevel(double zoom, QPointF screenCenter)
Set the zoom level to zoom, and adjusting it around center position center.
Definition view.cpp:105
QTransform sceneToScreenTransform() const
The transformation to apply to scene coordinate to get to the view on screen.
Definition view.cpp:208
Q_INVOKABLE QPointF mapScreenToScene(QPointF screenPos) const
Converts a point in screen coordinates to scene coordinates.
Definition view.cpp:185
static OSM::Coordinate mapSceneToGeo(QPointF p)
Map a scene coordinate to a geographic one, ie.
Definition view.cpp:43
Coordinate, stored as 1e7 * degree to avoid floating point precision issues, and offset to unsigned v...
Definition datatypes.h:37
OSM-based multi-floor indoor maps for buildings.
Definition locationqueryoverlayproxymodel.h:20
KOSM_EXPORT double distance(double lat1, double lon1, double lat2, double lon2)
Distance between two coordinates.
Definition geomath.cpp:16
QDateTime currentDateTime()
QDate date() const const
Q_EMITQ_EMIT
int x() const const
int y() const const
qreal x() const const
qreal y() const const
QPointF bottomLeft() const const
QPointF bottomRight() const const
qreal height() const const
void setHeight(qreal height)
void setWidth(qreal width)
QPointF topLeft() const const
QPointF topRight() const const
qreal width() const const
int height() const const
void setWidth(int width)
int width() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:42 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:42 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.