QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 #include <QElapsedTimer>
23 
24 #define SIP_NO_FILE
25 
26 class QColor;
27 class QRect;
28 class QSurface;
29 
30 namespace Qt3DCore
31 {
32  class QEntity;
33 }
34 
35 namespace Qt3DRender
36 {
37  class QRenderSettings;
38  class QCamera;
39  class QFrameGraphNode;
40 }
41 
43 
60 class _3D_EXPORT QgsAbstract3DEngine : public QObject
61 {
62  Q_OBJECT
63  public:
64 
68  QgsAbstract3DEngine( QObject *parent = nullptr );
69 
71  virtual void setClearColor( const QColor &color ) = 0;
73  virtual void setFrustumCullingEnabled( bool enabled ) = 0;
75  virtual void setRootEntity( Qt3DCore::QEntity *root ) = 0;
76 
78  virtual Qt3DRender::QRenderSettings *renderSettings() = 0;
80  virtual Qt3DRender::QCamera *camera() = 0;
82  virtual QSize size() const = 0;
84  virtual void setSize( QSize s ) = 0;
85 
91  void requestDepthBufferCapture();
92 
98  void requestCaptureImage();
99 
105  virtual QSurface *surface() const = 0;
106 
112  QgsShadowRenderingFrameGraph *frameGraph() { return mFrameGraph; }
113 
121  void setRenderCaptureEnabled( bool enabled );
122 
127  bool renderCaptureEnabled() const;
128  signals:
130  void imageCaptured( const QImage &image );
131 
137  void depthBufferCaptured( const QImage &image );
138  protected:
139  QgsShadowRenderingFrameGraph *mFrameGraph = nullptr;
140 };
141 
142 
143 #endif // QGSABSTRACT3DENGINE_H
QgsAbstract3DEngine::frameGraph
QgsShadowRenderingFrameGraph * frameGraph()
Returns the shadow rendering frame graph object used to render the scene.
Definition: qgsabstract3dengine.h:112
QgsShadowRenderingFrameGraph
Container class that holds different objects related to shadow rendering.
Definition: qgsshadowrenderingframegraph.h:59
Qt3DCore
Definition: qgsabstract3drenderer.h:30
Qt3DRender
Definition: qgs3dmapscene.h:28
QgsAbstract3DEngine
Base class for 3D engine implementation. A 3D engine is responsible for setting up rendering with Qt3...
Definition: qgsabstract3dengine.h:60