QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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
33class QgsMapSettings;
34class QgsProject;
35class QgsRasterLayer;
36
37#include <QObject>
38#include <QSize>
39
40#include "qgschunknode.h"
41#include "qgsrectangle.h"
42
44
55class 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 void waitForFinished();
73
75 QSize textureSize() const { return mTextureSize; }
77 void setTextureSize( QSize textureSize ) { mTextureSize = textureSize; }
78
79 signals:
81 void tileReady( int jobId, const QImage &image );
82
83 private slots:
84 void onRenderingFinished();
85
86 private:
87 QgsMapSettings baseMapSettings();
88
89 const Qgs3DMapSettings &mMap;
90
91 struct JobData
92 {
93 int jobId;
94 QgsChunkNodeId tileId;
95 QgsMapRendererSequentialJob *job = nullptr;
96 QgsRectangle extent;
97 QString debugText;
98 };
99
100 QHash<QgsMapRendererSequentialJob *, JobData> mJobs;
101 int mLastJobId;
102 QSize mTextureSize;
103};
104
106
107#endif // QGSTERRAINTEXTUREGENERATOR_P_H
Job implementation that renders everything sequentially in one thread.
The QgsMapSettings class contains configuration for rendering of the map.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
Represents a raster layer.
A rectangle specified with double values.