QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsterraintileloader.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsterraintileloader.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSTERRAINTILELOADER_H
17#define QGSTERRAINTILELOADER_H
18
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the QGIS API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29
30#define SIP_NO_FILE
31
32#include "qgschunkloader.h"
33
34#include <QImage>
35#include "qgsrectangle.h"
36
38class QgsTerrainEntity;
39class QgsTerrainTileEntity;
40
41namespace Qt3DRender
42{
43 class QTexture2D;
44}
45
46
53class QgsTerrainTileLoader : public QgsChunkLoader
54{
55 Q_OBJECT
56
57 public:
59 QgsTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *mNode );
60
61 protected:
63 void loadTexture();
64
66 Qt3DRender::QTexture2D *createTexture( QgsTerrainTileEntity *entity );
68 void createTextureComponent( QgsTerrainTileEntity *entity, bool isShadingEnabled, const QgsPhongMaterialSettings &shadingMaterial, bool useTexture );
70 QgsTerrainEntity *terrain() { return mTerrain; }
71 // Emit finished by default when texture is loaded.
72 // Subclasses can override this and emit finish later.
73 virtual void onTextureLoaded();
74
75 protected slots:
76 void onImageReady( int jobId, const QImage &image );
77
78 private:
79 QgsTerrainEntity *mTerrain = nullptr;
80 QgsRectangle mExtentMapCrs;
81 QString mTileDebugText;
82 int mTextureJobId = -1;
83 QImage mTextureImage;
84};
85
87
88#endif // QGSTERRAINTILELOADER_H
A rectangle specified with double values.