17 connect(_flightMapSettings->mapType(), &
Fact::rawValueChanged,
this, &Viewer3DTerrainTexture::_onMapTypeChanged);
20void Viewer3DTerrainTexture::loadTexture()
22 _setTextureLoaded(
false);
23 setTextureGeometryDone(
false);
24 setTextureDownloadProgress(0.0f);
26 if (!_mapProvider || !_mapProvider->
mapLoaded()) {
27 qCDebug(Viewer3DTerrainTextureLog) <<
"loadTexture: no map provider or map not loaded";
31 if (!_terrainTileLoader) {
43void Viewer3DTerrainTexture::_updateTexture()
45 qCDebug(Viewer3DTerrainTextureLog) <<
"Texture loaded:" << _terrainTileLoader->
mapSize();
46 setSize(_terrainTileLoader->
mapSize());
47 setFormat(QQuick3DTextureData::RGBA32F);
48 setHasTransparency(
false);
50 setTextureData(_terrainTileLoader->
mapData());
51 _setTextureLoaded(
true);
52 setTextureGeometryDone(
true);
56 _terrainTileLoader->deleteLater();
57 _terrainTileLoader =
nullptr;
58 setTextureDownloadProgress(100.0f);
61void Viewer3DTerrainTexture::_onMapTypeChanged()
63 _mapType = _flightMapSettings->
mapProvider()->rawValue().toString()
65 + _flightMapSettings->
mapType()->rawValue().toString();
69 if (mapId == _mapId) {
73 qCDebug(Viewer3DTerrainTextureLog) <<
"Map type changed:" << _mapType <<
"mapId:" << mapId;
78void Viewer3DTerrainTexture::setRoiMinCoordinate(
const QGeoCoordinate &newRoiMinCoordinate)
80 if (_roiMinCoordinate == newRoiMinCoordinate) {
83 _roiMinCoordinate = newRoiMinCoordinate;
87void Viewer3DTerrainTexture::setRoiMaxCoordinate(
const QGeoCoordinate &newRoiMaxCoordinate)
89 if (_roiMaxCoordinate == newRoiMaxCoordinate) {
92 _roiMaxCoordinate = newRoiMaxCoordinate;
98 if (_mapProvider == newMapProvider) {
106 _mapProvider = newMapProvider;
117void Viewer3DTerrainTexture::setTileCount(
const QSize &newTileCount)
119 if (_tileCount == newTileCount) {
122 _tileCount = newTileCount;
126void Viewer3DTerrainTexture::setTextureGeometryDone(
bool newTextureGeometryDone)
128 if (_textureGeometryDone == newTextureGeometryDone) {
131 _textureGeometryDone = newTextureGeometryDone;
135void Viewer3DTerrainTexture::setTextureDownloadProgress(
float newTextureDownloadProgress)
137 if (qFuzzyCompare(_textureDownloadProgress, newTextureDownloadProgress)) {
140 _textureDownloadProgress = newTextureDownloadProgress;
#define QGC_LOGGING_CATEGORY(name, categoryStr)
void rawValueChanged(const QVariant &value)
Fact *mapType READ mapType CONSTANT Fact * mapType()
Fact *mapProvider READ mapProvider CONSTANT Fact * mapProvider()
Provides access to all app settings.
static int getQtMapIdFromProviderType(QStringView type)
virtual std::pair< QGeoCoordinate, QGeoCoordinate > mapBoundingBox() const =0
virtual bool mapLoaded() const =0
void textureGeometryDoneChanged()
void mapProviderChanged()
void roiMaxCoordinateChanged()
void roiMinCoordinateChanged()
void textureDownloadProgressChanged()
void textureGeometryReady(TileStatistics_t tileInfo)
void mapTileDownloaded(float progress)
void adaptiveMapTilesLoader(const QString &mapType, int mapId, const QGeoCoordinate &coordinateMin, const QGeoCoordinate &coordinateMax)
QByteArray mapData() const
void loadingMapCompleted()
QGeoCoordinate coordinateMax
QGeoCoordinate coordinateMin