QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsquickmaptoscreen.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsquickmaptoscreen.h
3 ----------------------------------------------------
4 Date : 22.08.2018
5 Copyright : (C) 2018 by Denis Rouzaud
6 Email : denis (at) opengis.ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSQUICKMAPTOSCREEN_H
17#define QGSQUICKMAPTOSCREEN_H
18
19#include "qgspoint.h"
20#include "qgsquickmapsettings.h"
21
22#include <QObject>
23#include <QPointF>
24
35class QUICK_EXPORT QgsQuickMapToScreen : public QObject
36{
37 Q_OBJECT
38
41
42
43 Q_PROPERTY( QgsPoint mapPoint READ mapPoint WRITE setMapPoint NOTIFY mapPointChanged )
45 Q_PROPERTY( QPointF screenPoint READ screenPoint NOTIFY screenPointChanged )
46
48 Q_PROPERTY( double mapDistance READ mapDistance WRITE setMapDistance NOTIFY mapDistanceChanged )
50 Q_PROPERTY( double screenDistance READ screenDistance NOTIFY screenDistanceChanged )
51
52 public:
54 explicit QgsQuickMapToScreen( QObject *parent = nullptr );
55
60
62 void setMapPoint( const QgsPoint &point );
64 QgsPoint mapPoint() const;
65
67 void setMapDistance( const double distance );
69 double mapDistance() const;
70
72 QPointF screenPoint() const;
73
75 double screenDistance() const;
76
77 signals:
78
89
90 private slots:
91 void transformPoint();
92 void transformDistance();
93
94 private:
95 QgsQuickMapSettings *mMapSettings = nullptr;
96 QgsPoint mMapPoint = QgsPoint();
97 double mMapDistance = 0.0;
98 QPointF mScreenPoint = QPointF();
99 double mScreenDistance = 0.0;
100};
101
102#endif // QGSQUICKMAPTOSCREEN_H
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
Encapsulates QgsMapSettings class to offer settings of configuration of map rendering via QML propert...
void mapPointChanged()
Point in map coordinates.
QPointF screenPoint
Point in screen coordinates (read-only).
QgsQuickMapSettings * mapSettings
Map settings used to define the map canvas CRS and detect any extent change.
void mapDistanceChanged()
Distance in map unit.
QgsQuickMapToScreen(QObject *parent=nullptr)
Creates a map to screen object.
void mapSettingsChanged()
Map settings used to define the map canvas CRS and detect any extent change.
void screenPointChanged()
Point in screen coordinates (read-only).
void screenDistanceChanged()
Distance in screen coordinates (read-only).
void setMapSettings(QgsQuickMapSettings *mapSettings)
Map settings used to define the map canvas CRS and detect any extent change.
double screenDistance
Distance in screen coordinates (read-only).
QgsPoint mapPoint
Point in map coordinates.
void setMapDistance(const double distance)
Distance in map unit.
void setMapPoint(const QgsPoint &point)
Point in map coordinates.
double mapDistance
Distance in map unit.