QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgstiledsceneindex.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledsceneindex.h
3 --------------------
4 begin : June 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ******************************************************************
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSTILEDSCENEINDEX_H
20#define QGSTILEDSCENEINDEX_H
21
22#include "qgis.h"
23#include "qgis_core.h"
24
25#include <QCache>
26#include <QMutex>
27
29class QgsFeedback;
31
32#ifndef SIP_RUN
33
44{
45 public:
48
51
55 virtual QgsTiledSceneTile rootTile() const = 0;
56
63 virtual long long parentTileId( long long id ) const = 0;
64
70 virtual QVector< long long > childTileIds( long long id ) const = 0;
71
75 virtual QgsTiledSceneTile getTile( long long id ) = 0;
76
82 virtual QVector< long long > getTiles( const QgsTiledSceneRequest &request ) = 0;
83
91 QByteArray retrieveContent( const QString &uri, QgsFeedback *feedback = nullptr );
92
98 virtual Qgis::TileChildrenAvailability childAvailability( long long id ) const = 0;
99
109 virtual bool fetchHierarchy( long long id, QgsFeedback *feedback = nullptr ) = 0;
110
111 protected:
120 virtual QByteArray fetchContent( const QString &uri, QgsFeedback *feedback = nullptr ) = 0;
121
122 private:
123 // we have to use a mutex to protect a QCache, not a read/write lock
124 // see https://bugreports.qt.io/browse/QTBUG-19794
125 mutable QMutex mCacheMutex;
126 QCache< QString, QByteArray > mContentCache;
127};
128#endif
129
142class CORE_EXPORT QgsTiledSceneIndex
143{
144 public:
153
155
160
164 bool isValid() const;
165
170
174 QgsTiledSceneTile getTile( long long id );
175
182 long long parentTileId( long long id ) const;
183
189 QVector< long long > childTileIds( long long id ) const;
190
196 QVector< long long > getTiles( const QgsTiledSceneRequest &request );
197
204
214 bool fetchHierarchy( long long id, QgsFeedback *feedback = nullptr );
215
223 QByteArray retrieveContent( const QString &uri, QgsFeedback *feedback = nullptr );
224
225 private:
226 std::shared_ptr<QgsAbstractTiledSceneIndex> mIndex;
227};
228
229
230#endif // QGSTILEDSCENEINDEX_H
TileChildrenAvailability
Possible availability states for a tile's children.
Definition qgis.h:6024
An abstract base class for tiled scene data provider indices.
QgsAbstractTiledSceneIndex & operator=(const QgsAbstractTiledSceneIndex &other)=delete
virtual QVector< long long > childTileIds(long long id) const =0
Returns a list of the tile IDs of any children for the tile with matching id.
virtual long long parentTileId(long long id) const =0
Returns the tile ID of the parent tile of the tile with matching id, or -1 if the tile has no parent.
virtual ~QgsAbstractTiledSceneIndex()
virtual QgsTiledSceneTile rootTile() const =0
Returns the root tile for the index.
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.
virtual bool fetchHierarchy(long long id, QgsFeedback *feedback=nullptr)=0
Populates the tile with the given id by fetching any sub datasets attached to the tile.
virtual QgsTiledSceneTile getTile(long long id)=0
Returns the tile with matching id, or an invalid tile if the matching tile is not available.
QgsAbstractTiledSceneIndex(const QgsAbstractTiledSceneIndex &other)=delete
virtual Qgis::TileChildrenAvailability childAvailability(long long id) const =0
Returns the availability for a tile's children.
virtual QVector< long long > getTiles(const QgsTiledSceneRequest &request)=0
Returns the tile IDs which match the given request.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
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.
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_TRANSFER
Definition qgis_sip.h:35