QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgsabstract3dengine.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsabstract3dengine.cpp
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 #include "qgsabstract3dengine.h"
17 
19 
20 #include <Qt3DRender/QRenderCapture>
21 
23  : QObject( parent )
24 {
25 
26 }
27 
29 {
30  Qt3DRender::QRenderCaptureReply *captureReply;
31  captureReply = mFrameGraph->renderCapture()->requestCapture();
32  connect( captureReply, &Qt3DRender::QRenderCaptureReply::completed, this, [ = ]
33  {
34  emit imageCaptured( captureReply->image() );
35  captureReply->deleteLater();
36  } );
37 }
38 
40 {
42 }
43 
45 {
47 }
void requestCaptureImage()
Starts a request for an image rendered by the engine.
void imageCaptured(const QImage &image)
Emitted after a call to requestCaptureImage() to return the captured image.
bool renderCaptureEnabled() const
Returns whether it will be possible to render to an image.
void setRenderCaptureEnabled(bool enabled)
Sets whether it will be possible to render to an image.
QgsAbstract3DEngine(QObject *parent=nullptr)
Constructor for QgsAbstract3DEngine with the specified parent object.
QgsShadowRenderingFrameGraph * mFrameGraph
bool renderCaptureEnabled() const
Returns whether it will be possible to render to an image.
Qt3DRender::QRenderCapture * renderCapture()
Returns the render capture object used to take an image of the scene.
void setRenderCaptureEnabled(bool enabled)
Sets whether it will be possible to render to an image.