KOSMIndoorMap::View

Search for usage in LXR

KOSMIndoorMap::View Class Reference

#include <view.h>

Inheritance diagram for KOSMIndoorMap::View:

Properties

QDateTime beginTime
 
QDateTime endTime
 
int floorLevel
 
double panHeight
 
double panWidth
 
double panX
 
double panY
 
double zoomLevel
 
- Properties inherited from QObject
 objectName
 

Signals

void floorLevelChanged ()
 
void timeChanged ()
 
void transformationChanged ()
 

Public Member Functions

 View (QObject *parent=nullptr)
 
QDateTime beginTime () const
 
Q_INVOKABLE void centerOnGeoCoordinate (QPointF geoCoord)
 
QTransform deviceTransform () const
 
QDateTime endTime () const
 
int level () const
 
QPointF mapGeoToScene (OSM::Coordinate coord) const
 
QRectF mapGeoToScene (OSM::BoundingBox box) const
 
double mapMetersToScene (double meters) const
 
Q_INVOKABLE double mapMetersToScreen (double meters) const
 
OSM::Coordinate mapSceneToGeo (QPointF p) const
 
OSM::BoundingBox mapSceneToGeo (const QRectF &box) const
 
QPointF mapSceneToScreen (QPointF scenePos) const
 
QRectF mapSceneToScreen (const QRectF &sceneRect) const
 
double mapScreenDistanceToSceneDistance (double distance) const
 
Q_INVOKABLE double mapScreenToMeters (int pixels) const
 
QPointF mapScreenToScene (QPointF screenPos) const
 
double panHeight () const
 
void panScreenSpace (QPoint offset)
 
Q_INVOKABLE void panTopLeft (double x, double y)
 
double panWidth () const
 
double panX () const
 
double panY () const
 
QRectF sceneBoundingBox () const
 
QTransform sceneToScreenTransform () const
 
int screenHeight () const
 
int screenWidth () const
 
void setBeginTime (const QDateTime &beginTime)
 
void setDeviceTransform (const QTransform &t)
 
void setEndTime (const QDateTime &endTime)
 
void setLevel (int level)
 
void setSceneBoundingBox (OSM::BoundingBox bbox)
 
void setSceneBoundingBox (const QRectF &bbox)
 
void setScreenSize (QSize size)
 
void setViewport (const QRectF &viewport)
 
Q_INVOKABLE void setZoomLevel (double zoom, QPointF screenCenter)
 
QRectF viewport () const
 
Q_INVOKABLE void zoomIn (QPointF screenCenter)
 
double zoomLevel () const
 
Q_INVOKABLE void zoomOut (QPointF screenCenter)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

View transformations and transformation manipulation.

There are three different coordinate systems involved here:

  • The geographic world coordinates of the OSM input data. This uses OSM::Coordinate.
  • The scene coordinates which have a the Web Mercator projection applied (see https://en.wikipedia.org/wiki/Mercator_projection). This uses QPointF ranging from 0x0 to 256x256
  • The screen coordinates (ie. visible pixels on screen). This uses QPoint. Further, there's also three slight variations of those in use here:
  • "HUD" coordinates: elements that follow the scene coordinates for their positioning, but the screen coordinates regarding scaling and rotation. This is used for map labels.
  • Geographic distances. This is needed to display things in a fixed width in meters in the scene, or to compute the map scale. Note that this only works due to the relatively high zoom levels, so that earth curvature or map projection effects are negligible.
  • "pan space": same transform as screen space, but with the origin at the origin of the scene bounding box This is useful for implementing scene-wide panning and showing scroll bars.

Definition at line 39 of file view.h.

Member Function Documentation

QDateTime KOSMIndoorMap::View::beginTime ( ) const

Time range that is displayed.

This matters for example when opening hours are considered for styling.

void View::centerOnGeoCoordinate ( QPointF  geoCoord)

Center the view on the given geo-coordinate.

Definition at line 309 of file view.cpp.

QTransform View::deviceTransform ( ) const

Device tranformation for manual high DPI scaling.

Definition at line 299 of file view.cpp.

int View::level ( ) const

The (floor) level to display.

See also
MapLevel.

Definition at line 84 of file view.cpp.

QPointF View::mapGeoToScene ( OSM::Coordinate  coord) const

Map a geographic coordinate to a scene coordinate, ie.

apply the mercator projection.

Definition at line 27 of file view.cpp.

double View::mapMetersToScene ( double  meters) const

Returns how many units in scene coordinate represent the distance of meters in the current view transformation.

Definition at line 245 of file view.cpp.

double View::mapMetersToScreen ( double  meters) const

Returns how many pixels on screen represent the distance of meters with the current view transformation.

Definition at line 254 of file view.cpp.

OSM::Coordinate View::mapSceneToGeo ( QPointF  p) const

Map a scene coordinate to a geographic one, ie.

apply the inverse mercator projection.

Definition at line 43 of file view.cpp.

QPointF View::mapSceneToScreen ( QPointF  scenePos) const

Converts a point in scene coordinates to screen coordinates.

Definition at line 168 of file view.cpp.

QRectF View::mapSceneToScreen ( const QRectF sceneRect) const

Converts a rectanble in scene coordinates to screen coordinates.

Definition at line 173 of file view.cpp.

double View::mapScreenDistanceToSceneDistance ( double  distance) const

Converts a distance in screen coordinates to a distance in scene coordinates.

Definition at line 184 of file view.cpp.

double View::mapScreenToMeters ( int  pixels) const

Returns how many meters are represented by pixels with the current view transformation.

Definition at line 261 of file view.cpp.

QPointF View::mapScreenToScene ( QPointF  screenPos) const

Converts a point in screen coordinates to scene coordinates.

Definition at line 178 of file view.cpp.

void View::panTopLeft ( double  x,
double  y 
)

Move the viewport to the pan coordinates x and y.

Definition at line 292 of file view.cpp.

double KOSMIndoorMap::View::panWidth ( ) const

Size of the pan-able area in screen coordinates.

double KOSMIndoorMap::View::panX ( ) const

Position of the viewport in pan coordinates.

QRectF View::sceneBoundingBox ( ) const

The bounding box of the scene.

The viewport cannot exceed this area.

Definition at line 135 of file view.cpp.

QTransform View::sceneToScreenTransform ( ) const

The transformation to apply to scene coordinate to get to the view on screen.

Definition at line 200 of file view.cpp.

int View::screenWidth ( ) const

Screen-space sizes, ie the size of the on-screen area used for displaying.

Definition at line 63 of file view.cpp.

void View::setZoomLevel ( double  zoom,
QPointF  screenCenter 
)

Set the zoom level to zoom, and adjusting it around center position center.

Definition at line 105 of file view.cpp.

QRectF View::viewport ( ) const

The sub-rect of the scene bounding box currently displayed.

Specified in scene coordinates.

Definition at line 124 of file view.cpp.

void View::zoomIn ( QPointF  screenCenter)

Increase zoom level by one/scale up by 2x around the screen position center.

Definition at line 208 of file view.cpp.

double KOSMIndoorMap::View::zoomLevel ( ) const

OSM-compatible zoom level, ie.

the 2^level-th subdivision of the scene space.

void View::zoomOut ( QPointF  screenCenter)

Decrease zoom level by one/scale down by 2x around the screen position center.

Definition at line 213 of file view.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jul 29 2021 23:03:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.