Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add 3D engine base class + window & offscreen implementations
- Loading branch information
Showing
11 changed files
with
541 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*************************************************************************** | ||
qgsabstract3dengine.cpp | ||
-------------------------------------- | ||
Date : July 2018 | ||
Copyright : (C) 2018 by Martin Dobias | ||
Email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsabstract3dengine.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef QGSABSTRACT3DENGINE_H | ||
#define QGSABSTRACT3DENGINE_H | ||
|
||
#include "qgis_3d.h" | ||
|
||
#include <QObject> | ||
|
||
class QColor; | ||
class QRect; | ||
|
||
namespace Qt3DCore | ||
{ | ||
class QEntity; | ||
} | ||
|
||
namespace Qt3DRender | ||
{ | ||
class QRenderSettings; | ||
class QCamera; | ||
} | ||
|
||
/** | ||
* Base class for 3D engine implementation. A 3D engine is responsible for setting up | ||
* rendering with Qt3D. This means mainly: | ||
* - creating Qt3D aspect engine and registering rendering aspect | ||
* - setting up a camera, render settings and frame graph | ||
* | ||
* We have two implementations: | ||
* - QgsWindow3DEngine - used for rendering on display (has a QWindow that can be embedded into QWidget) | ||
* - QgsOffscreen3DEngine - renders scene to images | ||
* | ||
* \since QGIS 3.4 | ||
*/ | ||
class _3D_EXPORT QgsAbstract3DEngine : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
|
||
virtual void setClearColor( const QColor &color ) = 0; | ||
virtual void setFrustumCullingEnabled( bool enabled ) = 0; | ||
virtual void setRootEntity( Qt3DCore::QEntity *root ) = 0; | ||
|
||
virtual Qt3DRender::QRenderSettings *renderSettings() = 0; | ||
virtual Qt3DRender::QCamera *camera() = 0; | ||
virtual QSize size() const = 0; | ||
|
||
signals: | ||
void imageCaptured( const QImage &image ); | ||
}; | ||
|
||
|
||
#endif // QGSABSTRACT3DENGINE_H |
Oops, something went wrong.