QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 
31 class QgsMapSettings;
32 class QgsProject;
33 class QgsRasterLayer;
34 
35 #include <QObject>
36 
37 #include "qgschunknode_p.h"
38 #include "qgsrectangle.h"
39 
40 class Qgs3DMapSettings;
41 
53 class QgsTerrainTextureGenerator : public QObject
54 {
55  Q_OBJECT
56  public:
58  QgsTerrainTextureGenerator( const Qgs3DMapSettings &map );
59 
64  int render( const QgsRectangle &extent, QgsChunkNodeId nodeId, const QString &debugText = QString() );
65 
67  void cancelJob( int jobId );
68 
70  QImage renderSynchronously( const QgsRectangle &extent, const QString &debugText = QString() );
71 
72  signals:
74  void tileReady( int jobId, const QImage &image );
75 
76  private slots:
77  void onRenderingFinished();
78 
79  private:
80  QgsMapSettings baseMapSettings();
81 
82  const Qgs3DMapSettings &mMap;
83 
84  struct JobData
85  {
86  int jobId;
87  QgsChunkNodeId tileId;
88  QgsMapRendererSequentialJob *job = nullptr;
89  QgsRectangle extent;
90  QString debugText;
91  };
92 
93  QHash<QgsMapRendererSequentialJob *, JobData> mJobs;
94  int mLastJobId;
95 };
96 
98 
99 #endif // QGSTERRAINTEXTUREGENERATOR_P_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Represents a raster layer.
3 Definition of the world
The QgsMapSettings class contains configuration for rendering of the map.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:91
Job implementation that renders everything sequentially in one thread.