28 mContentCache.setMaxCost( 10000 );
35 QMutexLocker locker( &mCacheMutex );
36 if ( QByteArray *cachedData = mContentCache.object( uri ) )
47 mContentCache.insert( uri,
new QByteArray( res ) );
64 : mIndex( other.mIndex )
74 mIndex = other.mIndex;
80 return static_cast< bool >( mIndex.get() );
88 return mIndex->rootTile();
96 return mIndex->getTile(
id );
104 return mIndex->parentTileId(
id );
112 return mIndex->childTileIds(
id );
120 return mIndex->getTiles( request );
128 return mIndex->childAvailability(
id );
136 return mIndex->fetchHierarchy(
id, feedback );
144 return mIndex->retrieveContent( uri, feedback );
TileChildrenAvailability
Possible availability states for a tile's children.
@ NoChildren
Tile is known to have no children.
An abstract base class for tiled scene data provider indices.
QgsAbstractTiledSceneIndex()
virtual ~QgsAbstractTiledSceneIndex()
QByteArray retrieveContent(const QString &uri, QgsFeedback *feedback=nullptr)
Retrieves index content for the specified uri.
virtual QByteArray fetchContent(const QString &uri, QgsFeedback *feedback=nullptr)=0
Fetches index content for the specified uri.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
bool isCanceled() const
Tells whether the operation has been canceled already.
An index for tiled scene data providers.
Qgis::TileChildrenAvailability childAvailability(long long id) const
Returns the availability for a tile's children.
QgsTiledSceneTile rootTile() const
Returns the root tile for the index.
QByteArray retrieveContent(const QString &uri, QgsFeedback *feedback=nullptr)
Retrieves index content for the specified uri.
bool fetchHierarchy(long long id, QgsFeedback *feedback=nullptr)
Populates the tile with the given id by fetching any sub datasets attached to the tile.
QVector< long long > childTileIds(long long id) const
Returns a list of the tile IDs of any children for the tile with matching id.
QgsTiledSceneIndex(QgsAbstractTiledSceneIndex *index=nullptr)
Constructor for QgsTiledSceneIndex.
QgsTiledSceneTile getTile(long long id)
Returns the tile with matching id, or an invalid tile if the matching tile is not available.
QgsTiledSceneIndex & operator=(const QgsTiledSceneIndex &other)
QVector< long long > getTiles(const QgsTiledSceneRequest &request)
Returns the list of tile IDs which match the given request.
long long parentTileId(long long id) const
Returns the tile ID of the parent tile of the tile with matching id, or -1 if the tile has no parent.
bool isValid() const
Returns true if the index is valid.
Tiled scene data request.
Represents an individual tile from a tiled scene data source.