16#ifndef QGS3DMAPCANVAS_H
17#define QGS3DMAPCANVAS_H
25#include <QtGui/QWindow>
31 class QAbstractAspect;
38 class QFrameGraphNode;
40 class QRenderSettings;
45 class QForwardRenderer;
127 bool crossSectionEnabled()
const;
150 void setRootEntity( Qt3DCore::QEntity *root );
155 void setActiveFrameGraph( Qt3DRender::QFrameGraphNode *activeFrameGraph );
160 Qt3DRender::QFrameGraphNode *activeFrameGraph()
const;
165 Qt3DRender::QCamera *camera()
const;
170 Qt3DRender::QRenderSettings *renderSettings()
const;
179 void setViewFromTop(
const QgsPointXY ¢er,
float distance,
float rotation = 0 );
182 void saveAsImage(
const QString &fileName,
const QString &fileFormat );
202 QVector<QgsPointXY> viewFrustum2DExtent();
213 void clearHighlights();
242 void captureDepthBuffer();
245 void updateHighlightSizes();
251 void showEvent( QShowEvent *e )
override;
258 bool eventFilter( QObject *watched, QEvent *event )
override;
261 Qt3DCore::QAspectEngine *m_aspectEngine;
264 Qt3DRender::QRenderAspect *m_renderAspect;
265 Qt3DInput::QInputAspect *m_inputAspect;
266 Qt3DLogic::QLogicAspect *m_logicAspect;
269 Qt3DRender::QRenderSettings *m_renderSettings;
270 Qt3DRender::QCamera *m_defaultCamera;
273 Qt3DInput::QInputSettings *m_inputSettings;
276 Qt3DCore::QEntity *m_root;
277 Qt3DCore::QEntity *m_userRoot =
nullptr;
279 bool m_initialized =
false;
291 QString mCaptureFileName;
292 QString mCaptureFileFormat;
297 QMap<QgsMapLayer *, QgsRubberBand3D *> mHighlights;
NavigationMode
The navigation mode used by 3D cameras.
QgsWindow3DEngine * engine() const
Returns the 3D engine.
Qgs3DMapSettings * mapSettings()
Returns access to the 3D scene configuration.
void mapSettingsChanged()
Emitted when the the map setting is changed.
void crossSectionEnabledChanged(bool enabled)
Emitted when the cross section mode is enabled or disabled.
void viewed2DExtentFrom3DChanged(QVector< QgsPointXY > extent)
Emitted when the viewed 2D extent seen by the 3D camera has changed.
Qgs3DMapTool * mapTool() const
Returns the active map tool that will receive events from the 3D canvas.
void fpsCountChanged(float fpsCount)
Emitted when the FPS count changes (at most every frame).
void showEvent(QShowEvent *e) override
Manages the display events specified in e.
QgsCrossSection crossSection() const
Returns the current cross section definition for the 3D map canvas.
void cameraNavigationSpeedChanged(double speed)
Emitted when the camera navigation speed is changed.
Qgs3DMapScene * scene()
Returns access to the 3D scene (root 3D entity).
void resizeEvent(QResizeEvent *) override
Resets the aspect ratio of the 3D window.
void savedAsImage(const QString &fileName)
Emitted when the 3D map canvas was successfully saved as image.
void fpsCounterEnabledChanged(bool enabled)
Emitted when the FPS counter is enabled or disabeld.
bool eventFilter(QObject *watched, QEvent *event) override
Entity that encapsulates our 3D scene - contains all other entities (such as terrain) as children.
Object that controls camera movement based on user input.
Encapsulates the definition of a cross section in 3D map coordinates.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for all map layer types.
Responsible for defining parameters of the ray casting operations in 3D map canvases.
Contains the results of ray casting operations in a 3D map canvas.
A rectangle specified with double values.
A controller base class for temporal objects, contains a signal for notifying updates of the objects ...
On-screen 3D engine: it creates an OpenGL window (QWindow) and displays rendered 3D scenes there.
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.