8#ifndef MARBLEABSTRACTPRESENTER_H
9#define MARBLEABSTRACTPRESENTER_H
13#include "GeoDataLatLonBox.h"
14#include "MarblePhysics.h"
15#include <marble_export.h>
20class GeoDataPlacemark;
26class MARBLE_EXPORT MarbleAbstractPresenter :
public QObject
31 void zoomChanged(
int zoom);
32 void distanceChanged(
const QString &distanceString);
39 void regionSelected(
const GeoDataLatLonBox &boundingBox);
42 explicit MarbleAbstractPresenter(MarbleMap *map,
QObject *parent =
nullptr);
43 ~MarbleAbstractPresenter()
override;
45 qreal moveStep()
const;
48 GeoDataLookAt lookAt()
const;
61 qreal distanceFromRadius(qreal radius)
const;
66 qreal radiusFromDistance(qreal distance)
const;
74 void moveByStep(
int stepsRight,
int stepsDown, FlyToMode mode = Automatic);
78 int minimumZoom()
const;
79 int maximumZoom()
const;
81 qreal distanceFromZoom(qreal zoom)
const;
82 qreal zoomFromDistance(qreal distance)
const;
84 void zoomAt(
const QPoint &pos, qreal newDistance);
85 void moveTo(
const QPoint &pos, qreal factor);
87 qreal centerLongitude()
const;
88 qreal centerLatitude()
const;
90 ViewContext viewContext()
const;
92 qreal
zoom(qreal radius)
const;
93 qreal radius(qreal zoom)
const;
98 const MarbleMap *
map()
const;
99 const MarbleModel *model()
const;
102 void setLogzoom(
int value);
104 int zoomStep()
const;
105 qreal viewAngle()
const;
107 bool animationsEnabled()
const;
109 ViewportParams *viewport();
110 const ViewportParams *viewport()
const;
113 void rotateBy(
const qreal deltaLon,
const qreal deltaLat, FlyToMode mode = Instant);
114 void flyTo(
const GeoDataLookAt &newLookAt, FlyToMode mode = Automatic);
115 void goHome(FlyToMode mode = Automatic);
117 void setZoom(
int newZoom, FlyToMode mode = Instant);
118 void zoomView(
int zoom, FlyToMode mode = Instant);
119 void zoomViewBy(
int zoomStep, FlyToMode mode = Instant);
120 void zoomIn(FlyToMode mode = Automatic);
121 void zoomOut(FlyToMode mode = Automatic);
122 void zoomAtBy(
const QPoint &pos,
int zoomStep);
124 void setViewContext(ViewContext viewContext);
126 void centerOn(
const qreal lon,
const qreal lat,
bool animated =
false);
127 void centerOn(
const GeoDataCoordinates &point,
bool animated =
false);
128 void centerOn(
const GeoDataLatLonBox &box,
bool animated =
false);
129 void centerOn(
const GeoDataPlacemark &placemark,
bool animated =
false);
130 void headingOn(qreal heading);
131 void setCenterLatitude(qreal lat, FlyToMode mode);
132 void setCenterLongitude(qreal lon, FlyToMode mode);
134 void setAnimationsEnabled(
bool enabled);
135 void setRadius(
int radius);
136 void setDistance(qreal newDistance);
137 void setSelection(
const QRect ®ion);
140 MarbleMap *
const m_map;
141 MarblePhysics m_physics;
143 bool m_animationsEnabled;
146 const qreal m_viewAngle;
QAction * zoomIn(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoomOut(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
Binds a QML item to a specific geodetic location in screen coordinates.
KOSM_EXPORT double distance(const std::vector< const OSM::Node * > &path, Coordinate coord)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)