QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
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 <QSize>
20
21#include "qgsabstract3dengine.h"
22
23
24namespace Qt3DExtras
25{
26 class QForwardRenderer;
27}
28
29
30class Qgs3DMapCanvas;
31class QWindow;
32
33
34#define SIP_NO_FILE
35
45class _3D_EXPORT QgsWindow3DEngine : public QgsAbstract3DEngine
46{
47 Q_OBJECT
48 public:
49
54
56 QWindow *window();
57
59 Qt3DCore::QEntity *root() const;
60
62 void setShadowRenderingEnabled( bool enabled );
64 bool shadowRenderingEnabled() { return mShadowRenderingEnabled; }
65
66 void setClearColor( const QColor &color ) override;
67 void setFrustumCullingEnabled( bool enabled ) override;
68 void setRootEntity( Qt3DCore::QEntity *root ) override;
69
70 Qt3DRender::QRenderSettings *renderSettings() override;
71 Qt3DRender::QCamera *camera() override;
72 QSize size() const override;
73 QSurface *surface() const override;
74
75 void setSize( QSize s ) override;
76 private:
78 Qgs3DMapCanvas *mMapCanvas3D = nullptr;
80 bool mShadowRenderingEnabled = false;
81 Qt3DCore::QEntity *mRoot = nullptr;
82 Qt3DCore::QEntity *mSceneRoot = nullptr;
83
84 QSize mSize = QSize( 1024, 768 );
85};
86
87#endif // QGSWINDOW3DENGINE_H
virtual QSurface * surface() const =0
Returns the surface of the engine.
virtual Qt3DRender::QCamera * camera()=0
Returns pointer to the engine's camera entity.
virtual void setClearColor(const QColor &color)=0
Sets background color of the scene.
virtual void setSize(QSize s)=0
Sets the size of the rendering area (in pixels)
virtual void setFrustumCullingEnabled(bool enabled)=0
Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities ...
virtual void setRootEntity(Qt3DCore::QEntity *root)=0
Sets root entity of the 3D scene.
virtual QSize size() const =0
Returns size of the engine's rendering area in pixels.
virtual Qt3DRender::QRenderSettings * renderSettings()=0
Returns access to the engine's render settings (the frame graph can be accessed from here)
bool shadowRenderingEnabled()
Returns whether shadow rendering is enabled.