ElevationModel::ElevationModel( HttpDownloadManager *downloadManager, PluginManager* pluginManager, QObject *parent ) : QObject( parent ), d( new ElevationModelPrivate( this, downloadManager, pluginManager ) ) { connect( &d->m_tileLoader, SIGNAL(tileCompleted(TileId,QImage)), this, SLOT(tileCompleted(TileId,QImage)) ); }
void TileLoader::updateTile( QByteArray const & data, QString const & idStr ) { QStringList const components = idStr.split( ':', QString::SkipEmptyParts ); Q_ASSERT( components.size() == 4 ); QString const sourceDir = components[ 0 ]; int const zoomLevel = components[ 1 ].toInt(); int const tileX = components[ 2 ].toInt(); int const tileY = components[ 3 ].toInt(); TileId const id = TileId( sourceDir, zoomLevel, tileX, tileY ); QImage const tileImage = QImage::fromData( data ); if ( tileImage.isNull() ) return; emit tileCompleted( id, tileImage ); }
void TileLoader::updateTile(const QString &fileName, const QString &idStr) { QStringList const components = idStr.split( ':', QString::SkipEmptyParts ); Q_ASSERT( components.size() == 5 ); QString const origin = components[0]; QString const sourceDir = components[ 1 ]; int const zoomLevel = components[ 2 ].toInt(); int const tileX = components[ 3 ].toInt(); int const tileY = components[ 4 ].toInt(); TileId const id = TileId( sourceDir, zoomLevel, tileX, tileY ); if (origin == GeoSceneTypes::GeoSceneVectorTileType) { GeoDataDocument* document = openVectorFile(MarbleDirs::path(fileName)); if (document) { emit tileCompleted(id, document); } } }