QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Signals | Public Member Functions | Protected Attributes | List of all members
QgsAbstract3DEngine Class Referenceabstract

3 More...

#include <qgsabstract3dengine.h>

Inheritance diagram for QgsAbstract3DEngine:
Inheritance graph
[legend]

Signals

void depthBufferCaptured (const QImage &image)
 Emitted after a call to requestDepthBufferCapture() to return the captured depth buffer. More...
 
void imageCaptured (const QImage &image)
 Emitted after a call to requestCaptureImage() to return the captured image. More...
 
void sizeChanged ()
 Emitted after a call to setSize() More...
 

Public Member Functions

 QgsAbstract3DEngine (QObject *parent=nullptr)
 Constructor for QgsAbstract3DEngine with the specified parent object. More...
 
virtual Qt3DRender::QCamera * camera ()=0
 Returns pointer to the engine's camera entity. More...
 
QgsFrameGraphframeGraph ()
 Returns the shadow rendering frame graph object used to render the scene. More...
 
bool renderCaptureEnabled () const
 Returns whether it will be possible to render to an image. More...
 
virtual Qt3DRender::QRenderSettings * renderSettings ()=0
 Returns access to the engine's render settings (the frame graph can be accessed from here) More...
 
void requestCaptureImage ()
 Starts a request for an image rendered by the engine. More...
 
void requestDepthBufferCapture ()
 Starts a request for an image containing the depth buffer data of the engine. More...
 
virtual void setClearColor (const QColor &color)=0
 Sets background color of the scene. More...
 
virtual void setFrustumCullingEnabled (bool enabled)=0
 Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities outside of camera's view) More...
 
void setRenderCaptureEnabled (bool enabled)
 Sets whether it will be possible to render to an image. More...
 
virtual void setRootEntity (Qt3DCore::QEntity *root)=0
 Sets root entity of the 3D scene. More...
 
virtual void setSize (QSize s)=0
 Sets the size of the rendering area (in pixels) More...
 
virtual QSize size () const =0
 Returns size of the engine's rendering area in pixels. More...
 
virtual QSurface * surface () const =0
 Returns the surface of the engine. More...
 

Protected Attributes

QgsFrameGraphmFrameGraph = nullptr
 

Detailed Description

3

Base class for 3D engine implementation. A 3D engine is responsible for setting up rendering with Qt3D. This means mainly:

We have two implementations:

Note
Not available in Python bindings
Since
QGIS 3.4

Definition at line 60 of file qgsabstract3dengine.h.

Constructor & Destructor Documentation

◆ QgsAbstract3DEngine()

QgsAbstract3DEngine::QgsAbstract3DEngine ( QObject *  parent = nullptr)

Constructor for QgsAbstract3DEngine with the specified parent object.

Definition at line 23 of file qgsabstract3dengine.cpp.

Member Function Documentation

◆ camera()

virtual Qt3DRender::QCamera * QgsAbstract3DEngine::camera ( )
pure virtual

Returns pointer to the engine's camera entity.

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ depthBufferCaptured

void QgsAbstract3DEngine::depthBufferCaptured ( const QImage &  image)
signal

Emitted after a call to requestDepthBufferCapture() to return the captured depth buffer.

Note
The depth buffer values are encoded into RGB channels and should be decoded with Qgs3DUtils::decodeDepth()
Since
QGIS 3.24

◆ frameGraph()

QgsFrameGraph * QgsAbstract3DEngine::frameGraph ( )
inline

Returns the shadow rendering frame graph object used to render the scene.

Since
QGIS 3.18

Definition at line 112 of file qgsabstract3dengine.h.

◆ imageCaptured

void QgsAbstract3DEngine::imageCaptured ( const QImage &  image)
signal

Emitted after a call to requestCaptureImage() to return the captured image.

◆ renderCaptureEnabled()

bool QgsAbstract3DEngine::renderCaptureEnabled ( ) const

Returns whether it will be possible to render to an image.

Since
QGIS 3.18

Definition at line 58 of file qgsabstract3dengine.cpp.

◆ renderSettings()

virtual Qt3DRender::QRenderSettings * QgsAbstract3DEngine::renderSettings ( )
pure virtual

Returns access to the engine's render settings (the frame graph can be accessed from here)

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ requestCaptureImage()

void QgsAbstract3DEngine::requestCaptureImage ( )

Starts a request for an image rendered by the engine.

The function does not block - when the rendered image is captured, it is returned in imageCaptured() signal. Only one image request can be active at a time.

Definition at line 29 of file qgsabstract3dengine.cpp.

◆ requestDepthBufferCapture()

void QgsAbstract3DEngine::requestDepthBufferCapture ( )

Starts a request for an image containing the depth buffer data of the engine.

The function does not block - when the depth buffer image is captured, it is returned in depthBufferCaptured() signal. Only one image request can be active at a time.

Definition at line 41 of file qgsabstract3dengine.cpp.

◆ setClearColor()

virtual void QgsAbstract3DEngine::setClearColor ( const QColor &  color)
pure virtual

Sets background color of the scene.

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ setFrustumCullingEnabled()

virtual void QgsAbstract3DEngine::setFrustumCullingEnabled ( bool  enabled)
pure virtual

Sets whether frustum culling is enabled (this should make rendering faster by not rendering entities outside of camera's view)

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ setRenderCaptureEnabled()

void QgsAbstract3DEngine::setRenderCaptureEnabled ( bool  enabled)

Sets whether it will be possible to render to an image.

Note
for QgsWindow3DEngine render capture will be disabled by default and for QgsOffscreen3DEngine it is enabled by default
Since
QGIS 3.18

Definition at line 53 of file qgsabstract3dengine.cpp.

◆ setRootEntity()

virtual void QgsAbstract3DEngine::setRootEntity ( Qt3DCore::QEntity *  root)
pure virtual

Sets root entity of the 3D scene.

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ setSize()

virtual void QgsAbstract3DEngine::setSize ( QSize  s)
pure virtual

Sets the size of the rendering area (in pixels)

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ size()

virtual QSize QgsAbstract3DEngine::size ( ) const
pure virtual

Returns size of the engine's rendering area in pixels.

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

◆ sizeChanged

void QgsAbstract3DEngine::sizeChanged ( )
signal

Emitted after a call to setSize()

Since
QGIS 3.30

◆ surface()

virtual QSurface * QgsAbstract3DEngine::surface ( ) const
pure virtual

Returns the surface of the engine.

Since
QGIS 3.14

Implemented in QgsOffscreen3DEngine, and QgsWindow3DEngine.

Member Data Documentation

◆ mFrameGraph

QgsFrameGraph* QgsAbstract3DEngine::mFrameGraph = nullptr
protected

Definition at line 145 of file qgsabstract3dengine.h.


The documentation for this class was generated from the following files: