16 #ifndef QGSDEMTERRAINTILELOADER_P_H
17 #define QGSDEMTERRAINTILELOADER_P_H
32 #include <QtConcurrent/QtConcurrentRun>
33 #include <QFutureWatcher>
34 #include <QElapsedTimer>
50 class QgsDemTerrainTileLoader :
public QgsTerrainTileLoader
55 QgsDemTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *node );
57 Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent )
override;
60 void onHeightMapReady(
int jobId,
const QByteArray &heightMap );
65 QByteArray mHeightMap;
78 class QgsDemHeightMapGenerator :
public QObject
88 ~QgsDemHeightMapGenerator()
override;
91 int render(
int x,
int y,
int z );
94 QByteArray renderSynchronously(
int x,
int y,
int z );
97 int resolution()
const {
return mResolution; }
100 float heightAt(
double x,
double y );
104 void heightMapReady(
int jobId,
const QByteArray &heightMap );
107 void onFutureFinished();
122 std::unique_ptr<QgsTerrainDownloader> mDownloader;
127 QgsChunkNodeId tileId;
129 QFuture<QByteArray> future;
133 QHash<QFutureWatcher<QByteArray>*, JobData> mJobs;
136 QByteArray mDtmCoarseData;
141 #endif // QGSDEMTERRAINTILELOADER_P_H