QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
3d
qgsoffscreen3dengine.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsoffscreen3dengine.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 QGSOFFSCREEN3DENGINE_H
17
#define QGSOFFSCREEN3DENGINE_H
18
19
#include "
qgsabstract3dengine.h
"
20
21
#include <QSize>
22
23
#define SIP_NO_FILE
24
25
class
QOffscreenSurface;
26
27
namespace
Qt3DCore
28
{
29
class
QAspectEngine;
30
class
QNode;
31
}
// namespace Qt3DCore
32
33
namespace
Qt3DRender
34
{
35
class
QCameraSelector;
36
class
QClearBuffers;
37
class
QRenderAspect;
38
class
QRenderTarget;
39
class
QRenderTargetSelector;
40
class
QRenderTargetOutput;
41
class
QRenderSurfaceSelector;
42
class
QTexture2D;
43
class
QViewport;
44
}
// namespace Qt3DRender
45
46
namespace
Qt3DLogic
47
{
48
class
QLogicAspect;
49
}
50
51
63
class
_3D_EXPORT
QgsOffscreen3DEngine
:
public
QgsAbstract3DEngine
64
{
65
Q_OBJECT
66
public
:
67
QgsOffscreen3DEngine
();
68
~QgsOffscreen3DEngine
()
override
;
69
70
void
setSize
( QSize s )
override
;
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
:
82
QSize mSize = QSize( 640, 480 );
83
Qt3DRender::QCamera *mCamera =
nullptr
;
84
std::unique_ptr<QOffscreenSurface> mOffscreenSurface;
85
86
// basic Qt3D stuff
87
std::unique_ptr<Qt3DCore::QAspectEngine> mAspectEngine;
// The aspect engine, which holds the scene and related aspects.
88
Qt3DRender::QRenderAspect *mRenderAspect =
nullptr
;
// The render aspect, which deals with rendering the scene.
89
Qt3DLogic::QLogicAspect *mLogicAspect =
nullptr
;
// The logic aspect, which runs jobs to do with synchronising frames.
90
Qt3DRender::QRenderSettings *mRenderSettings =
nullptr
;
// The render settings, which control the general rendering behavior.
91
Qt3DCore::QNode *mSceneRoot =
nullptr
;
// The scene root, which becomes a child of the engine's root entity.
92
Qt3DCore::QEntity *mRoot =
nullptr
;
93
};
94
95
#endif
// QGSOFFSCREEN3DENGINE_H
QgsAbstract3DEngine::surface
virtual QSurface * surface() const =0
Returns the surface of the engine.
QgsAbstract3DEngine::camera
virtual Qt3DRender::QCamera * camera()=0
Returns pointer to the engine's camera entity.
QgsAbstract3DEngine::QgsAbstract3DEngine
QgsAbstract3DEngine(QObject *parent=nullptr)
Constructor for QgsAbstract3DEngine with the specified parent object.
Definition
qgsabstract3dengine.cpp:26
QgsAbstract3DEngine::setClearColor
virtual void setClearColor(const QColor &color)=0
Sets background color of the scene.
QgsAbstract3DEngine::setSize
virtual void setSize(QSize s)=0
Sets the size of the rendering area (in pixels).
QgsAbstract3DEngine::setFrustumCullingEnabled
virtual void setFrustumCullingEnabled(bool enabled)=0
Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities ...
QgsAbstract3DEngine::setRootEntity
virtual void setRootEntity(Qt3DCore::QEntity *root)=0
Sets root entity of the 3D scene.
QgsAbstract3DEngine::size
virtual QSize size() const =0
Returns size of the engine's 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).
QgsOffscreen3DEngine::QgsOffscreen3DEngine
QgsOffscreen3DEngine()
Definition
qgsoffscreen3dengine.cpp:42
QgsOffscreen3DEngine::~QgsOffscreen3DEngine
~QgsOffscreen3DEngine() override
Qt3DCore
Definition
qgsabstract3drenderer.h:33
Qt3DLogic
Definition
qgs3dmapcanvas.h:56
Qt3DRender
Definition
qgs3d.h:45
qgsabstract3dengine.h
Generated on
for QGIS API Documentation by
1.17.0