|
QGIS API Documentation 3.99.0-Master (f78f5286a64)
|
Convenience wrapper to simplify the creation of a 3D window ready to be used with QGIS. More...
#include <qgs3dmapcanvas.h>

Signals | |
| void | cameraNavigationSpeedChanged (double speed) |
| Emitted when the camera navigation speed is changed. | |
| void | fpsCountChanged (float fpsCount) |
| Emitted when the FPS count changes (at most every frame) | |
| void | fpsCounterEnabledChanged (bool enabled) |
| Emitted when the FPS counter is enabled or disabeld. | |
| void | mapSettingsChanged () |
| Emitted when the the map setting is changed. | |
| void | savedAsImage (const QString &fileName) |
| Emitted when the 3D map canvas was successfully saved as image. | |
| void | viewed2DExtentFrom3DChanged (QVector< QgsPointXY > extent) |
| Emitted when the viewed 2D extent seen by the 3D camera has changed. | |
Public Member Functions | |
| Qgs3DMapCanvas () | |
| ~Qgs3DMapCanvas () | |
| Qt3DRender::QFrameGraphNode * | activeFrameGraph () const |
| Returns the node of the active frame graph. | |
| Qt3DRender::QCamera * | camera () const |
| Returns the default camera of the 3D Window. | |
| QgsCameraController * | cameraController () |
Returns access to the view's camera controller. Returns nullptr if the scene has not been initialized yet with setMapSettings() | |
| void | clearHighlights () |
| Clears all QgsRubberBand3D highlights. | |
| QgsWindow3DEngine * | engine () const |
| Returns the 3D engine. | |
| void | highlightFeature (const QgsFeature &feature, QgsMapLayer *layer) |
| Highlights a feature from layer using a QgsRubberBand3D. | |
| Qgs3DMapSettings * | mapSettings () |
| Returns access to the 3D scene configuration. | |
| Qgs3DMapTool * | mapTool () const |
| Returns the active map tool that will receive events from the 3D canvas. | |
| Qt3DRender::QRenderSettings * | renderSettings () const |
| Returns the render settings of the 3D Window. | |
| void | resetView () |
| Resets camera position to the default: looking down at the origin of world coordinates. | |
| void | saveAsImage (const QString &fileName, const QString &fileFormat) |
| Saves the current scene as an image. | |
| Qgs3DMapScene * | scene () |
| Returns access to the 3D scene (root 3D entity) | |
| void | setActiveFrameGraph (Qt3DRender::QFrameGraphNode *activeFrameGraph) |
| Activates the specified activeFrameGraph. | |
| void | setMapSettings (Qgs3DMapSettings *mapSettings) |
| Configure map scene being displayed. Takes ownership. | |
| void | setMapTool (Qgs3DMapTool *tool) |
| Sets the active map tool that will receive events from the 3D canvas. | |
| void | setRootEntity (Qt3DCore::QEntity *root) |
| Sets the specified root entity of the scene. | |
| void | setTemporalController (QgsTemporalController *temporalController) |
| Sets the temporal controller. | |
| void | setViewFrom2DExtent (const QgsRectangle &extent) |
| Resets camera view to show the extent (top view) | |
| void | setViewFromTop (const QgsPointXY ¢er, float distance, float rotation=0) |
| Sets camera position to look down at the given point (in map coordinates) in given distance from plane with zero elevation. | |
| QVector< QgsPointXY > | viewFrustum2DExtent () |
| Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid. | |
Protected Member Functions | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| void | resizeEvent (QResizeEvent *) override |
| Resets the aspect ratio of the 3D window. | |
| void | showEvent (QShowEvent *e) override |
| Manages the display events specified in e. | |
Convenience wrapper to simplify the creation of a 3D window ready to be used with QGIS.
Definition at line 82 of file qgs3dmapcanvas.h.
| Qgs3DMapCanvas::Qgs3DMapCanvas | ( | ) |
Definition at line 41 of file qgs3dmapcanvas.cpp.
| Qgs3DMapCanvas::~Qgs3DMapCanvas | ( | ) |
Definition at line 80 of file qgs3dmapcanvas.cpp.
| Qt3DRender::QFrameGraphNode * Qgs3DMapCanvas::activeFrameGraph | ( | ) | const |
Returns the node of the active frame graph.
Definition at line 112 of file qgs3dmapcanvas.cpp.
| Qt3DRender::QCamera * Qgs3DMapCanvas::camera | ( | ) | const |
Returns the default camera of the 3D Window.
Definition at line 117 of file qgs3dmapcanvas.cpp.
| QgsCameraController * Qgs3DMapCanvas::cameraController | ( | ) |
Returns access to the view's camera controller. Returns nullptr if the scene has not been initialized yet with setMapSettings()
Definition at line 185 of file qgs3dmapcanvas.cpp.
|
signal |
Emitted when the camera navigation speed is changed.
| void Qgs3DMapCanvas::clearHighlights | ( | ) |
Clears all QgsRubberBand3D highlights.
Definition at line 403 of file qgs3dmapcanvas.cpp.
|
inline |
Returns the 3D engine.
Definition at line 152 of file qgs3dmapcanvas.h.
|
overrideprotected |
Definition at line 269 of file qgs3dmapcanvas.cpp.
|
signal |
Emitted when the FPS count changes (at most every frame)
|
signal |
Emitted when the FPS counter is enabled or disabeld.
| void Qgs3DMapCanvas::highlightFeature | ( | const QgsFeature & | feature, |
| QgsMapLayer * | layer | ||
| ) |
Highlights a feature from layer using a QgsRubberBand3D.
Definition at line 361 of file qgs3dmapcanvas.cpp.
|
inline |
Returns access to the 3D scene configuration.
Definition at line 90 of file qgs3dmapcanvas.h.
|
signal |
Emitted when the the map setting is changed.
|
inline |
Returns the active map tool that will receive events from the 3D canvas.
If the tool is nullptr, events will be used for camera manipulation.
Definition at line 147 of file qgs3dmapcanvas.h.
| Qt3DRender::QRenderSettings * Qgs3DMapCanvas::renderSettings | ( | ) | const |
Returns the render settings of the 3D Window.
Definition at line 122 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::resetView | ( | ) |
Resets camera position to the default: looking down at the origin of world coordinates.
Definition at line 190 of file qgs3dmapcanvas.cpp.
|
overrideprotected |
Resets the aspect ratio of the 3D window.
Definition at line 140 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::saveAsImage | ( | const QString & | fileName, |
| const QString & | fileFormat | ||
| ) |
Saves the current scene as an image.
Definition at line 208 of file qgs3dmapcanvas.cpp.
|
signal |
Emitted when the 3D map canvas was successfully saved as image.
|
inline |
Returns access to the 3D scene (root 3D entity)
Definition at line 93 of file qgs3dmapcanvas.h.
| void Qgs3DMapCanvas::setActiveFrameGraph | ( | Qt3DRender::QFrameGraphNode * | activeFrameGraph | ) |
Activates the specified activeFrameGraph.
Definition at line 107 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setMapSettings | ( | Qgs3DMapSettings * | mapSettings | ) |
Configure map scene being displayed. Takes ownership.
Definition at line 147 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setMapTool | ( | Qgs3DMapTool * | tool | ) |
Sets the active map tool that will receive events from the 3D canvas.
Does not transfer ownership. If the tool is nullptr, events will be used for camera manipulation.
Definition at line 242 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setRootEntity | ( | Qt3DCore::QEntity * | root | ) |
Sets the specified root entity of the scene.
Definition at line 95 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setTemporalController | ( | QgsTemporalController * | temporalController | ) |
Sets the temporal controller.
Definition at line 325 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setViewFrom2DExtent | ( | const QgsRectangle & | extent | ) |
Resets camera view to show the extent (top view)
Definition at line 348 of file qgs3dmapcanvas.cpp.
| void Qgs3DMapCanvas::setViewFromTop | ( | const QgsPointXY & | center, |
| float | distance, | ||
| float | rotation = 0 |
||
| ) |
Sets camera position to look down at the given point (in map coordinates) in given distance from plane with zero elevation.
Definition at line 198 of file qgs3dmapcanvas.cpp.
|
overrideprotected |
Manages the display events specified in e.
Definition at line 127 of file qgs3dmapcanvas.cpp.
|
signal |
Emitted when the viewed 2D extent seen by the 3D camera has changed.
| QVector< QgsPointXY > Qgs3DMapCanvas::viewFrustum2DExtent | ( | ) |
Calculates the 2D extent viewed by the 3D camera as the vertices of the viewed trapezoid.
Definition at line 356 of file qgs3dmapcanvas.cpp.