QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TerrainQueryInterface.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QList>
5#include <QtCore/QObject>
6#include <QtNetwork/QNetworkReply>
7
8class QGeoCoordinate;
9class QNetworkAccessManager;
10
11Q_DECLARE_LOGGING_CATEGORY(TerrainQueryInterfaceLog)
12
27
29class TerrainQueryInterface : public QObject
30{
31 Q_OBJECT
32
33public:
34 explicit TerrainQueryInterface(QObject *parent = nullptr);
35 virtual ~TerrainQueryInterface();
36
40 virtual void requestCoordinateHeights(const QList<QGeoCoordinate> &coordinates);
41
45 virtual void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord);
46
52 virtual void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly);
53
54 void signalCoordinateHeights(bool success, const QList<double> &heights);
55 void signalPathHeights(bool success, double distanceBetween, double finalDistanceBetween, const QList<double> &heights);
56 void signalCarpetHeights(bool success, double minHeight, double maxHeight, const QList<QList<double>> &carpet);
57
58signals:
59 void coordinateHeightsReceived(bool success, const QList<double> &heights);
60 void pathHeightsReceived(bool success, double distanceBetween, double finalDistanceBetween, const QList<double> &heights);
61 void carpetHeightsReceived(bool success, double minHeight, double maxHeight, const QList<QList<double>> &carpet);
62
63protected:
64 virtual void _requestFailed();
65
67};
68
69/*===========================================================================*/
70
72{
73 Q_OBJECT
74
75public:
76 explicit TerrainOfflineQuery(QObject *parent = nullptr);
78
79 void requestCoordinateHeights(const QList<QGeoCoordinate> &coordinates) override;
80 void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord) override;
81 void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly) override;
82};
83
84/*===========================================================================*/
85
87{
88 Q_OBJECT
89
90public:
91 explicit TerrainOnlineQuery(QObject *parent = nullptr);
92 virtual ~TerrainOnlineQuery();
93
94protected slots:
95 virtual void _requestFinished();
96 virtual void _requestError(QNetworkReply::NetworkError code);
97 virtual void _sslErrors(const QList<QSslError> &errors);
98
99protected:
100 QNetworkAccessManager *_networkManager = nullptr;
101};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly) override
void requestCoordinateHeights(const QList< QGeoCoordinate > &coordinates) override
void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord) override
QNetworkAccessManager * _networkManager
virtual void _requestError(QNetworkReply::NetworkError code)
virtual void _sslErrors(const QList< QSslError > &errors)
Base class for offline/online terrain queries.
TerrainQuery::QueryMode _queryMode
void pathHeightsReceived(bool success, double distanceBetween, double finalDistanceBetween, const QList< double > &heights)
void signalPathHeights(bool success, double distanceBetween, double finalDistanceBetween, const QList< double > &heights)
void signalCoordinateHeights(bool success, const QList< double > &heights)
void signalCarpetHeights(bool success, double minHeight, double maxHeight, const QList< QList< double > > &carpet)
void carpetHeightsReceived(bool success, double minHeight, double maxHeight, const QList< QList< double > > &carpet)
virtual void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord)
virtual void requestCoordinateHeights(const QList< QGeoCoordinate > &coordinates)
void coordinateHeightsReceived(bool success, const QList< double > &heights)
virtual void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly)