QGIS API Documentation  3.17.0-Master (a035f434f4)
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  QgsShadowRenderingFrameGraph *shadowRenderingFrameGraph() { return mShadowRenderingFrameGraph; }
64 
65  void requestCaptureImage() override;
66 
68  void setShadowRenderingEnabled( bool enabled );
70  bool shadowRenderingEnabled() { return mShadowRenderingEnabled; }
71 
72  void setClearColor( const QColor &color ) override;
73  void setFrustumCullingEnabled( bool enabled ) override;
74  void setRootEntity( Qt3DCore::QEntity *root ) override;
75 
76  Qt3DRender::QRenderSettings *renderSettings() override;
77  Qt3DRender::QCamera *camera() override;
78  QSize size() const override;
79  QSurface *surface() const override;
80 
81  private:
83  Qt3DExtras::Qt3DWindow *mWindow3D = nullptr;
85  bool mShadowRenderingEnabled = false;
86  QgsShadowRenderingFrameGraph *mShadowRenderingFrameGraph = nullptr;
87  Qt3DExtras::QForwardRenderer *mDefaultForwardRenderer = nullptr;
88  Qt3DCore::QEntity *mRoot = nullptr;
89  Qt3DCore::QEntity *mSceneRoot = nullptr;
90 
91  QgsPreviewQuad *mPreviewQuad = nullptr;
92 };
93 
94 #endif // QGSWINDOW3DENGINE_H
3 On-screen 3D engine: it creates OpenGL window (QWindow) and displays rendered 3D scene there...
bool shadowRenderingEnabled()
Returns whether shadow rendering is enabled.
3 Rectangular quad entity used for debugging depth maps
3 Base class for 3D engine implementation.
3 Container class that holds different objects related to shadow rendering
QgsShadowRenderingFrameGraph * shadowRenderingFrameGraph()
Returns the frame graph object.