QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgswindow3dengine.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgswindow3dengine.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 QGSWINDOW3DENGINE_H
17 #define QGSWINDOW3DENGINE_H
18 
19 #include "qgsabstract3dengine.h"
22 #include "qgspreviewquad.h"
23 
24 namespace Qt3DRender
25 {
26  class QRenderCapture;
27 }
28 
29 namespace Qt3DExtras
30 {
31  class Qt3DWindow;
32  class QForwardRenderer;
33 }
34 
35 class QWindow;
36 
37 
38 #define SIP_NO_FILE
39 
49 class _3D_EXPORT QgsWindow3DEngine : public QgsAbstract3DEngine
50 {
51  Q_OBJECT
52  public:
53 
57  QgsWindow3DEngine( QObject *parent = nullptr );
58 
60  QWindow *window();
61 
63  Qt3DCore::QEntity *root() const;
64 
66  void setShadowRenderingEnabled( bool enabled );
68  bool shadowRenderingEnabled() { return mShadowRenderingEnabled; }
69 
70  void setClearColor( const QColor &color ) override;
71  void setFrustumCullingEnabled( bool enabled ) override;
72  void setRootEntity( Qt3DCore::QEntity *root ) override;
73 
74  Qt3DRender::QRenderSettings *renderSettings() override;
75  Qt3DRender::QCamera *camera() override;
76  QSize size() const override;
77  QSurface *surface() const override;
78 
79  void setSize( QSize s ) override;
80  private:
82  Qt3DExtras::Qt3DWindow *mWindow3D = nullptr;
84  bool mShadowRenderingEnabled = false;
85  Qt3DCore::QEntity *mRoot = nullptr;
86  Qt3DCore::QEntity *mSceneRoot = nullptr;
87 
88  QgsPreviewQuad *mPreviewQuad = nullptr;
89  QSize mSize = QSize( 1024, 768 );
90 };
91 
92 #endif // QGSWINDOW3DENGINE_H
QgsWindow3DEngine::shadowRenderingEnabled
bool shadowRenderingEnabled()
Returns whether shadow rendering is enabled.
Definition: qgswindow3dengine.h:68
qgspreviewquad.h
QgsAbstract3DEngine::setRootEntity
virtual void setRootEntity(Qt3DCore::QEntity *root)=0
Sets root entity of the 3D scene.
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.
qgsshadowrenderingframegraph.h
Qt3DRender
Definition: qgs3dmapscene.h:28
qgsabstract3dengine.h
QgsAbstract3DEngine
Base class for 3D engine implementation. A 3D engine is responsible for setting up rendering with Qt3...
Definition: qgsabstract3dengine.h:60
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::setSize
virtual void setSize(QSize s)=0
Sets the size of the rendering area (in pixels)
QgsAbstract3DEngine::renderSettings
virtual Qt3DRender::QRenderSettings * renderSettings()=0
Returns access to the engine's render settings (the frame graph can be accessed from here)
qgspostprocessingentity.h
Qt3DExtras
Definition: qgs3dmapscene.h:41
QgsWindow3DEngine
On-screen 3D engine: it creates OpenGL window (QWindow) and displays rendered 3D scene there....
Definition: qgswindow3dengine.h:49
QgsPreviewQuad
Rectangular quad entity used for debugging depth maps.
Definition: qgspreviewquad.h:58
QgsAbstract3DEngine::surface
virtual QSurface * surface() const =0
Returns the surface of the engine.