QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsquickcoordinatetransformer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickcoordinatetransformer.h
3  --------------------------------------
4  Date : 1.6.2017
5  Copyright : (C) 2017 by Matthias Kuhn
6  Email : matthias (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 QGSQUICKCOORDINATETRANSFORMER_H
17 #define QGSQUICKCOORDINATETRANSFORMER_H
18 
19 #include <QObject>
20 
21 #include "qgspoint.h"
22 
23 #include "qgis_quick.h"
26 #include "qgscoordinatetransform.h"
27 #include "qgspoint.h"
28 
40 class QUICK_EXPORT QgsQuickCoordinateTransformer : public QObject
41 {
42  Q_OBJECT
43 
45  Q_PROPERTY( QgsPoint projectedPosition READ projectedPosition NOTIFY projectedPositionChanged )
46 
47 
48  Q_PROPERTY( QgsPoint sourcePosition READ sourcePosition WRITE setSourcePosition NOTIFY sourcePositionChanged )
49 
50 
51  Q_PROPERTY( QgsCoordinateReferenceSystem destinationCrs READ destinationCrs WRITE setDestinationCrs NOTIFY destinationCrsChanged )
52 
53 
54  Q_PROPERTY( QgsCoordinateReferenceSystem sourceCrs READ sourceCrs WRITE setSourceCrs NOTIFY sourceCrsChanged )
55 
56 
57  Q_PROPERTY( QgsCoordinateTransformContext transformContext READ transformContext WRITE setTransformContext NOTIFY transformContextChanged )
58 
59  public:
61  explicit QgsQuickCoordinateTransformer( QObject *parent = nullptr );
62 
64  QgsPoint projectedPosition() const;
65 
67  QgsPoint sourcePosition() const;
68 
70  void setSourcePosition( const QgsPoint &sourcePosition );
71 
73  QgsCoordinateReferenceSystem destinationCrs() const;
74 
76  void setDestinationCrs( const QgsCoordinateReferenceSystem &destinationCrs );
77 
79  QgsCoordinateReferenceSystem sourceCrs() const;
80 
82  void setSourceCrs( const QgsCoordinateReferenceSystem &sourceCrs );
83 
85  void setTransformContext( const QgsCoordinateTransformContext &context );
86 
88  QgsCoordinateTransformContext transformContext() const;
89 
90  signals:
92  void projectedPositionChanged();
93 
95  void sourcePositionChanged();
96 
98  void destinationCrsChanged();
99 
101  void sourceCrsChanged();
102 
104  void transformContextChanged();
105 
106  private:
107  void updatePosition();
108 
109  QgsPoint mProjectedPosition;
110  QgsPoint mSourcePosition;
111  QgsCoordinateTransform mCoordinateTransform;
112 };
113 
114 #endif // QGSQUICKCOORDINATETRANSFORMER_H
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:57
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
qgscoordinatetransformcontext.h
qgspoint.h
qgscoordinatetransform.h
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsQuickCoordinateTransformer
Helper class for transform of coordinates (QgsPoint) to a different coordinate reference system.
Definition: qgsquickcoordinatetransformer.h:40
QgsCoordinateTransform
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:57
qgscoordinatereferencesystem.h