16#ifndef QGS3DMAPCANVAS_H
17#define QGS3DMAPCANVAS_H
26#include <QtGui/QWindow>
32 class QAbstractAspect;
39 class QFrameGraphNode;
41 class QRenderSettings;
46 class QForwardRenderer;
63class Qgs3DMapSceneEntity;
67class QgsFeature3DHandler;
131 bool crossSectionEnabled()
const;
154 void setRootEntity( Qt3DCore::QEntity *root );
159 void setActiveFrameGraph( Qt3DRender::QFrameGraphNode *activeFrameGraph );
164 Qt3DRender::QFrameGraphNode *activeFrameGraph()
const;
169 Qt3DRender::QCamera *camera()
const;
174 Qt3DRender::QRenderSettings *renderSettings()
const;
183 void setViewFromTop(
const QgsPointXY ¢er,
float distance,
float rotation = 0 );
186 void saveAsImage(
const QString &fileName,
const QString &fileFormat );
206 QVector<QgsPointXY> viewFrustum2DExtent();
253 void captureDepthBuffer();
261 void showEvent( QShowEvent *e )
override;
268 bool eventFilter( QObject *watched, QEvent *event )
override;
271 Qt3DCore::QAspectEngine *m_aspectEngine;
274 Qt3DRender::QRenderAspect *m_renderAspect;
275 Qt3DInput::QInputAspect *m_inputAspect;
276 Qt3DLogic::QLogicAspect *m_logicAspect;
279 Qt3DRender::QRenderSettings *m_renderSettings;
280 Qt3DRender::QCamera *m_defaultCamera;
283 Qt3DInput::QInputSettings *m_inputSettings;
286 Qt3DCore::QEntity *m_root;
287 Qt3DCore::QEntity *m_userRoot =
nullptr;
289 bool m_initialized =
false;
301 QString mCaptureFileName;
302 QString mCaptureFileFormat;
306 std::unique_ptr<Qgs3DHighlightFeatureHandler> mHighlightsHandler =
nullptr;
NavigationMode
The navigation mode used by 3D cameras.
Handles the creation of 3D entities used for highlighting identified features.
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 highlightFeature(const QgsFeature &feature, QgsMapLayer *layer)
Add a highlight 3d entity for feature of layer.
void savedAsImage(const QString &fileName)
Emitted when the 3D map canvas was successfully saved as image.
void clearHighlights()
Removes all highlight entities.
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.