QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsabstract3dengine.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsabstract3dengine.h
3  --------------------------------------
4  Date : July 2018
5  Copyright : (C) 2018 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 QGSABSTRACT3DENGINE_H
17 #define QGSABSTRACT3DENGINE_H
18 
19 #include "qgis_3d.h"
20 
21 #include <QObject>
22 
23 #define SIP_NO_FILE
24 
25 class QColor;
26 class QRect;
27 class QSurface;
28 
29 namespace Qt3DCore
30 {
31  class QEntity;
32 }
33 
34 namespace Qt3DRender
35 {
36  class QRenderSettings;
37  class QCamera;
38  class QFrameGraphNode;
39 }
40 
57 class _3D_EXPORT QgsAbstract3DEngine : public QObject
58 {
59  Q_OBJECT
60  public:
61 
65  QgsAbstract3DEngine( QObject *parent = nullptr );
66 
68  virtual void setClearColor( const QColor &color ) = 0;
70  virtual void setFrustumCullingEnabled( bool enabled ) = 0;
72  virtual void setRootEntity( Qt3DCore::QEntity *root ) = 0;
73 
75  virtual Qt3DRender::QRenderSettings *renderSettings() = 0;
77  virtual Qt3DRender::QCamera *camera() = 0;
79  virtual QSize size() const = 0;
80 
86  virtual void requestCaptureImage() = 0;
87 
93  virtual QSurface *surface() const = 0;
94 
95  signals:
97  void imageCaptured( const QImage &image );
98 };
99 
100 
101 #endif // QGSABSTRACT3DENGINE_H
QgsAbstract3DEngine::setRootEntity
virtual void setRootEntity(Qt3DCore::QEntity *root)=0
Sets root entity of the 3D scene.
QgsAbstract3DEngine::imageCaptured
void imageCaptured(const QImage &image)
Emitted after a call to requestCaptureImage() to return the captured image.
QgsAbstract3DEngine::setClearColor
virtual void setClearColor(const QColor &color)=0
Sets background color of the scene.
QgsAbstract3DEngine::size
virtual QSize size() const =0
Returns size of the engine's rendering area in pixels.
Qt3DCore
Definition: qgsabstract3drenderer.h:31
Qt3DRender
Definition: qgs3dmapscene.h:27
QgsAbstract3DEngine
3 Base class for 3D engine implementation.
Definition: qgsabstract3dengine.h:58
QgsAbstract3DEngine::camera
virtual Qt3DRender::QCamera * camera()=0
Returns pointer to the engine's camera entity.
QgsAbstract3DEngine::setFrustumCullingEnabled
virtual void setFrustumCullingEnabled(bool enabled)=0
Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities ...
QgsAbstract3DEngine::requestCaptureImage
virtual void requestCaptureImage()=0
Starts a request for an image rendered by the engine.
QgsAbstract3DEngine::renderSettings
virtual Qt3DRender::QRenderSettings * renderSettings()=0
Returns access to the engine's render settings (the frame graph can be accessed from here)
QgsAbstract3DEngine::surface
virtual QSurface * surface() const =0
Returns the surface of the engine.