QGIS API Documentation 3.41.0-Master (cea29feecf2)
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 "qgsquickmapsettings.h"
20
21#include <QObject>
22#include <QPointF>
23#include <qgspoint.h>
24
34class QUICK_EXPORT QgsQuickMapToScreen : public QObject
35{
36 Q_OBJECT
37
39 Q_PROPERTY( QgsQuickMapSettings *mapSettings READ mapSettings WRITE setMapSettings NOTIFY mapSettingsChanged )
40
41
42 Q_PROPERTY( QgsPoint mapPoint READ mapPoint WRITE setMapPoint NOTIFY mapPointChanged )
44 Q_PROPERTY( QPointF screenPoint READ screenPoint NOTIFY screenPointChanged )
45
47 Q_PROPERTY( double mapDistance READ mapDistance WRITE setMapDistance NOTIFY mapDistanceChanged )
49 Q_PROPERTY( double screenDistance READ screenDistance NOTIFY screenDistanceChanged )
50
51 public:
53 explicit QgsQuickMapToScreen( QObject *parent = nullptr );
54
56 void setMapSettings( QgsQuickMapSettings *mapSettings );
58 QgsQuickMapSettings *mapSettings() const;
59
61 void setMapPoint( const QgsPoint &point );
63 QgsPoint mapPoint() const;
64
66 void setMapDistance( const double distance );
68 double mapDistance() const;
69
71 QPointF screenPoint() const;
72
74 double screenDistance() const;
75
76 signals:
77
79 void mapSettingsChanged();
81 void mapPointChanged();
83 void mapDistanceChanged();
85 void screenPointChanged();
87 void screenDistanceChanged();
88
89 private slots:
90 void transformPoint();
91 void transformDistance();
92
93 private:
94 QgsQuickMapSettings *mMapSettings = nullptr;
95 QgsPoint mMapPoint = QgsPoint();
96 double mMapDistance = 0.0;
97 QPointF mScreenPoint = QPointF();
98 double mScreenDistance = 0.0;
99};
100
101#endif // QGSQUICKMAPTOSCREEN_H
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
The QgsQuickMapToScreen class transform map points to screen coordinates as well as distances from ma...