QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 "qgsrectangle.h"
38 
39 class Qgs3DMapSettings;
40 
52 class QgsTerrainTextureGenerator : public QObject
53 {
54  Q_OBJECT
55  public:
57  QgsTerrainTextureGenerator( const Qgs3DMapSettings &map );
58 
63  int render( const QgsRectangle &extent, const QString &debugText = QString() );
64 
66  void cancelJob( int jobId );
67 
69  QImage renderSynchronously( const QgsRectangle &extent, const QString &debugText = QString() );
70 
71  signals:
73  void tileReady( int jobId, const QImage &image );
74 
75  private slots:
76  void onRenderingFinished();
77 
78  private:
79  QgsMapSettings baseMapSettings();
80 
81  const Qgs3DMapSettings &mMap;
82 
83  struct JobData
84  {
85  int jobId;
86  QgsMapRendererSequentialJob *job = nullptr;
87  QgsRectangle extent;
88  QString debugText;
89  };
90 
91  QHash<QgsMapRendererSequentialJob *, JobData> mJobs;
92  int mLastJobId;
93 };
94 
96 
97 #endif // QGSTERRAINTEXTUREGENERATOR_P_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
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:89
Job implementation that renders everything sequentially in one thread.