16 #ifndef QGSDEMTERRAINTILELOADER_P_H
17 #define QGSDEMTERRAINTILELOADER_P_H
32 #include <QtConcurrent/QtConcurrentRun>
33 #include <QFutureWatcher>
34 #include <QElapsedTimer>
52 class QgsDemTerrainTileLoader :
public QgsTerrainTileLoader
57 QgsDemTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *node,
QgsTerrainGenerator *terrainGenerator );
59 Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent )
override;
62 void onHeightMapReady(
int jobId,
const QByteArray &heightMap );
67 QByteArray mHeightMap;
80 class QgsDemHeightMapGenerator :
public QObject
90 ~QgsDemHeightMapGenerator()
override;
93 int render(
int x,
int y,
int z );
96 void waitForFinished();
99 int resolution()
const {
return mResolution; }
102 float heightAt(
double x,
double y );
106 void heightMapReady(
int jobId,
const QByteArray &heightMap );
109 void onFutureFinished();
124 std::unique_ptr<QgsTerrainDownloader> mDownloader;
129 QgsChunkNodeId tileId;
131 QFuture<QByteArray> future;
135 QHash<QFutureWatcher<QByteArray>*, JobData> mJobs;
137 void lazyLoadDtmCoarseData(
int res,
const QgsRectangle &rect );
138 mutable QMutex mLazyLoadDtmCoarseDataMutex;
140 QByteArray mDtmCoarseData;
145 #endif // QGSDEMTERRAINTILELOADER_P_H