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+
116#ifndef QGSOFFSCREEN3DENGINE_H
217#define QGSOFFSCREEN3DENGINE_H
318
@@ -34,13 +49,23 @@ namespace Qt3DLogic
3449}
3550
3651
52+ /* *
53+ * \ingroup 3d
54+ * Off-screen 3D engine implementation. It is useful for recording rendered 3D scenes of arbitrary size.
55+ *
56+ * \note While the on-screen 3D engine also allows capturing of images, its limitation is that
57+ * the captured images are of the size of the on-screen window.
58+ *
59+ * \since QGIS 3.4
60+ */
3761class _3D_EXPORT QgsOffscreen3DEngine : public QgsAbstract3DEngine
3862{
3963 Q_OBJECT
4064 public:
4165 QgsOffscreen3DEngine ();
4266 ~QgsOffscreen3DEngine ();
4367
68+ // ! Sets the size of the rendering area (in pixels)
4469 void setSize ( const QSize &s );
4570
4671 void setClearColor ( const QColor &color ) override ;
@@ -59,7 +84,7 @@ class _3D_EXPORT QgsOffscreen3DEngine : public QgsAbstract3DEngine
5984
6085 private:
6186
62- QSize mSize ;
87+ QSize mSize = QSize( 640 , 480 ) ;
6388 Qt3DRender::QCamera *mCamera = nullptr ;
6489 QOffscreenSurface *mOffscreenSurface = nullptr ;
6590 Qt3DRender::QRenderCaptureReply *mReply = nullptr ;
@@ -68,7 +93,7 @@ class _3D_EXPORT QgsOffscreen3DEngine : public QgsAbstract3DEngine
6893 Qt3DCore::QAspectEngine *mAspectEngine = nullptr ; // The aspect engine, which holds the scene and related aspects.
6994 Qt3DRender::QRenderAspect *mRenderAspect = nullptr ; // The render aspect, which deals with rendering the scene.
7095 Qt3DLogic::QLogicAspect *mLogicAspect = nullptr ; // The logic aspect, which runs jobs to do with synchronising frames.
71- Qt3DRender::QRenderSettings *mRenderSettings = nullptr ; // The render settings, which control the general rendering behaviour .
96+ Qt3DRender::QRenderSettings *mRenderSettings = nullptr ; // The render settings, which control the general rendering behavior .
7297 Qt3DCore::QNode *mSceneRoot = nullptr ; // The scene root, which becomes a child of the engine's root entity.
7398 Qt3DCore::QEntity *mRoot = nullptr ;
7499
0 commit comments