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/QList>
4#include <QtCore/QObject>
5#include <QtNetwork/QNetworkReply>
6
7class QGeoCoordinate;
8class QNetworkAccessManager;
9
24
27class TerrainQueryInterface : public QObject
28{
29 Q_OBJECT
30
31public:
32 explicit TerrainQueryInterface(QObject *parent = nullptr);
33 virtual ~TerrainQueryInterface();
34
38 virtual void requestCoordinateHeights(const QList<QGeoCoordinate> &coordinates);
39
43 virtual void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord);
44
50 virtual void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly);
51
52 void signalCoordinateHeights(bool success, const QList<double> &heights);
53 void signalPathHeights(bool success, double distanceBetween, double finalDistanceBetween, const QList<double> &heights);
54 void signalCarpetHeights(bool success, double minHeight, double maxHeight, const QList<QList<double>> &carpet);
55
56signals:
57 void coordinateHeightsReceived(bool success, const QList<double> &heights);
58 void pathHeightsReceived(bool success, double distanceBetween, double finalDistanceBetween, const QList<double> &heights);
59 void carpetHeightsReceived(bool success, double minHeight, double maxHeight, const QList<QList<double>> &carpet);
60
61protected:
62 virtual void _requestFailed();
63
65};
66
67/*===========================================================================*/
68
70{
71 Q_OBJECT
72
73public:
74 explicit TerrainOfflineQuery(QObject *parent = nullptr);
76
77 void requestCoordinateHeights(const QList<QGeoCoordinate> &coordinates) override;
78 void requestPathHeights(const QGeoCoordinate &fromCoord, const QGeoCoordinate &toCoord) override;
79 void requestCarpetHeights(const QGeoCoordinate &swCoord, const QGeoCoordinate &neCoord, bool statsOnly) override;
80};
81
82/*===========================================================================*/
83
85{
86 Q_OBJECT
87
88public:
89 explicit TerrainOnlineQuery(QObject *parent = nullptr);
90 virtual ~TerrainOnlineQuery();
91
92protected slots:
93 virtual void _requestFinished();
94 virtual void _requestError(QNetworkReply::NetworkError code);
95 virtual void _sslErrors(const QList<QSslError> &errors);
96
97protected:
98 QNetworkAccessManager *_networkManager = nullptr;
99};
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)