QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsterraintexturegenerator_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsterraintexturegenerator_p.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 QGSTERRAINTEXTUREGENERATOR_P_H
17 #define QGSTERRAINTEXTUREGENERATOR_P_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 
33 class QgsMapSettings;
34 class QgsProject;
35 class QgsRasterLayer;
36 
37 #include <QObject>
38 
39 #include "qgschunknode_p.h"
40 #include "qgsrectangle.h"
41 
42 class Qgs3DMapSettings;
43 
55 class QgsTerrainTextureGenerator : public QObject
56 {
57  Q_OBJECT
58  public:
60  QgsTerrainTextureGenerator( const Qgs3DMapSettings &map );
61 
66  int render( const QgsRectangle &extent, QgsChunkNodeId nodeId, const QString &debugText = QString() );
67 
69  void cancelJob( int jobId );
70 
72  QImage renderSynchronously( const QgsRectangle &extent, const QString &debugText = QString() );
73 
74  signals:
76  void tileReady( int jobId, const QImage &image );
77 
78  private slots:
79  void onRenderingFinished();
80 
81  private:
82  QgsMapSettings baseMapSettings();
83 
84  const Qgs3DMapSettings &mMap;
85 
86  struct JobData
87  {
88  int jobId;
89  QgsChunkNodeId tileId;
90  QgsMapRendererSequentialJob *job = nullptr;
91  QgsRectangle extent;
92  QString debugText;
93  };
94 
95  QHash<QgsMapRendererSequentialJob *, JobData> mJobs;
96  int mLastJobId;
97 };
98 
100 
101 #endif // QGSTERRAINTEXTUREGENERATOR_P_H
qgsrectangle.h
qgschunknode_p.h
QgsRectangle
Definition: qgsrectangle.h:41
QgsProject
Definition: qgsproject.h:92
QgsMapRendererSequentialJob
Definition: qgsmaprenderersequentialjob.h:33
Qgs3DMapSettings
Definition: qgs3dmapsettings.h:51
QgsRasterLayer
Definition: qgsrasterlayer.h:72
QgsMapSettings
Definition: qgsmapsettings.h:86