QGIS API Documentation 4.1.0-Master (9af12b5a203)
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
31#include "qgschunkloader.h"
32#include "qgsrectangle.h"
33
34#include <QImage>
35
36#define SIP_NO_FILE
37
39class QgsTerrainEntity;
40class QgsTerrainTileEntity;
43
44namespace Qt3DRender
45{
46 class QTexture2D;
47}
48
49
56class QgsTerrainTileLoader : public QgsChunkLoader
57{
58 Q_OBJECT
59
60 public:
62 QgsTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *mNode );
63
64 protected:
66 void loadTexture();
67
69 Qt3DRender::QTexture2D *createTexture( QgsTerrainTileEntity *entity, const QgsMaterialContext &context );
71 void createTextureComponent( QgsTerrainTileEntity *entity, bool isShadingEnabled, const QgsPhongMaterialSettings &shadingMaterial, bool useTexture, const Qgs3DRenderContext &context );
73 QgsTerrainEntity *terrain() { return mTerrain; }
74 // Emit finished by default when texture is loaded.
75 // Subclasses can override this and emit finish later.
76 virtual void onTextureLoaded();
77
78 protected slots:
79 void onImageReady( int jobId, const QImage &image );
80
81 private:
82 QgsTerrainEntity *mTerrain = nullptr;
83 QgsRectangle mExtentMapCrs;
84 QString mTileDebugText;
85 int mTextureJobId = -1;
86 QImage mTextureImage;
87};
88
90
91#endif // QGSTERRAINTILELOADER_H
Rendering context for preparation of 3D entities.
Context settings for a material.
Basic shading material used for rendering based on the Phong shading model with three color component...