File indexing completed on 2025-01-05 03:59:35
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org> 0004 // 0005 0006 #ifndef MARBLE_DOWNLOADREGION_H 0007 #define MARBLE_DOWNLOADREGION_H 0008 0009 #include <QObject> 0010 #include <QVector> 0011 0012 #include <MarbleGlobal.h> 0013 0014 #include "digikam_export.h" 0015 0016 namespace Marble 0017 { 0018 class DownloadRegionPrivate; 0019 class GeoDataLatLonAltBox; 0020 class GeoDataLineString; 0021 class TileCoordsPyramid; 0022 class MarbleModel; 0023 class TileLayer; 0024 class TextureLayer; 0025 0026 class DIGIKAM_EXPORT DownloadRegion : public QObject 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 explicit DownloadRegion( QObject* parent=nullptr ); 0032 0033 void setMarbleModel( MarbleModel *model ); 0034 0035 ~DownloadRegion() override; 0036 0037 void setTileLevelRange( int const minimumTileLevel, int const maximumTileLevel ); 0038 0039 QVector<TileCoordsPyramid> region( const TileLayer *tileLayer, const GeoDataLatLonAltBox ®ion ) const; 0040 0041 void setVisibleTileLevel( int const tileLevel ); 0042 0043 /** 0044 * @brief calculates the region to be downloaded around a path 0045 */ 0046 QVector<TileCoordsPyramid> fromPath( const TileLayer *tileLayer, qreal offset, const GeoDataLineString &path ) const; 0047 0048 QVector<int> validTileLevels( const TileType tileType ) const; 0049 0050 private: 0051 DownloadRegionPrivate* const d; 0052 }; 0053 0054 } 0055 0056 #endif