QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Viewer3DTerrainTexture.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QSize>
5#include <QtPositioning/QGeoCoordinate>
6#include <QtQmlIntegration/QtQmlIntegration>
7#include <QtQuick3D/QQuick3DTextureData>
8
9#include "Viewer3DTileQuery.h"
10
11Q_DECLARE_LOGGING_CATEGORY(Viewer3DTerrainTextureLog)
12
15
16class Viewer3DTerrainTexture : public QQuick3DTextureData
17{
18 Q_OBJECT
19 QML_ELEMENT
20 Q_MOC_INCLUDE("Viewer3DMapProvider.h")
21
22 Q_PROPERTY(Viewer3DMapProvider *mapProvider READ mapProvider WRITE setMapProvider NOTIFY mapProviderChanged)
23 Q_PROPERTY(QGeoCoordinate roiMinCoordinate READ roiMinCoordinate WRITE setRoiMinCoordinate NOTIFY roiMinCoordinateChanged)
24 Q_PROPERTY(QGeoCoordinate roiMaxCoordinate READ roiMaxCoordinate WRITE setRoiMaxCoordinate NOTIFY roiMaxCoordinateChanged)
25 Q_PROPERTY(QSize tileCount READ tileCount NOTIFY tileCountChanged)
26 Q_PROPERTY(bool textureLoaded READ textureLoaded NOTIFY textureLoadedChanged)
27 Q_PROPERTY(bool textureGeometryDone READ textureGeometryDone NOTIFY textureGeometryDoneChanged)
28 Q_PROPERTY(float textureDownloadProgress READ textureDownloadProgress NOTIFY textureDownloadProgressChanged)
29
30public:
31 explicit Viewer3DTerrainTexture();
32
33 Q_INVOKABLE void loadTexture();
34
35 Viewer3DMapProvider *mapProvider() const { return _mapProvider; }
36 void setMapProvider(Viewer3DMapProvider *newMapProvider);
37
38 QGeoCoordinate roiMinCoordinate() const { return _roiMinCoordinate; }
39 void setRoiMinCoordinate(const QGeoCoordinate &newRoiMinCoordinate);
40
41 QGeoCoordinate roiMaxCoordinate() const { return _roiMaxCoordinate; }
42 void setRoiMaxCoordinate(const QGeoCoordinate &newRoiMaxCoordinate);
43
44 QSize tileCount() const { return _tileCount; }
45 void setTileCount(const QSize &newTileCount);
46
47 bool textureLoaded() const { return _textureLoaded; }
48 bool textureGeometryDone() const { return _textureGeometryDone; }
49 float textureDownloadProgress() const { return _textureDownloadProgress; }
50
51 void setTextureGeometryDone(bool newTextureGeometryDone);
52 void setTextureDownloadProgress(float newTextureDownloadProgress);
53 void setTextureGeometry(const Viewer3DTileQuery::TileStatistics_t &tileInfo);
54
55signals:
63
64private:
65 void _updateTexture();
66 void _setTextureLoaded(bool loaded) { _textureLoaded = loaded; emit textureLoadedChanged(); }
67 void _onMapTypeChanged();
68
69 Viewer3DTileQuery *_terrainTileLoader = nullptr;
70 FlightMapSettings *_flightMapSettings = nullptr;
71 Viewer3DMapProvider *_mapProvider = nullptr;
72
73 QGeoCoordinate _roiMinCoordinate;
74 QGeoCoordinate _roiMaxCoordinate;
75 QSize _tileCount;
76 QString _mapType;
77
78 float _textureDownloadProgress = 100.0f;
79 int _mapId = 0;
80 bool _textureLoaded = false;
81 bool _textureGeometryDone = false;
82};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void textureDownloadProgressChanged()