QGIS API Documentation 3.43.0-Master (ea98b95b755)
Public Slots | Public Member Functions | List of all members
Qgs3DAxis Class Reference

Display 3D ortho axis in the main 3D view. More...

#include <qgs3daxis.h>

Inheritance diagram for Qgs3DAxis:
Inheritance graph
[legend]

Public Slots

void onAxisSettingsChanged ()
 Force update of the axis and the viewport when a setting has changed.
 

Public Member Functions

 Qgs3DAxis (Qgs3DMapCanvas *canvas, Qt3DCore::QEntity *parent3DScene, Qgs3DMapScene *mapScene, QgsCameraController *camera, Qgs3DMapSettings *map)
 Default Qgs3DAxis constructor.
 
 ~Qgs3DAxis () override
 
QVector3D from3DTo2DLabelPosition (const QVector3D &sourcePos, Qt3DRender::QCamera *sourceCamera, Qt3DRender::QCamera *destCamera)
 Project a 3D position from sourceCamera to a 2D position for destCamera.
 
bool handleEvent (QEvent *event)
 Returns if the 3D axis controller will handle the specified event.
 
void onViewportScaleFactorChanged (double scaleFactor)
 Used as callback from renderview when viewport scale factor changes.
 

Detailed Description

Display 3D ortho axis in the main 3D view.

Axis are displayed in a dedicated viewport which can be placed all around the main viewport. Axis labels are displayed in a dedicated viewport with a specific camera to act as a billboarding layer. Axis labels can be changed with the mode combo box from the navigation widget.

Note
Not available in Python bindings
Since
QGIS 3.26

Definition at line 51 of file qgs3daxis.h.

Constructor & Destructor Documentation

◆ Qgs3DAxis()

Qgs3DAxis::Qgs3DAxis ( Qgs3DMapCanvas canvas,
Qt3DCore::QEntity *  parent3DScene,
Qgs3DMapScene mapScene,
QgsCameraController camera,
Qgs3DMapSettings map 
)

Default Qgs3DAxis constructor.

Parameters
canvasparent Qgs3DMapCanvas
parent3DSceneroot entity to set as parent
mapScene3d map scene to retrieve terrain and 3d engine data
cameracamera controller used to track camera movements
map3D map settings

Definition at line 43 of file qgs3daxis.cpp.

◆ ~Qgs3DAxis()

Qgs3DAxis::~Qgs3DAxis ( )
override

Definition at line 74 of file qgs3daxis.cpp.

Member Function Documentation

◆ from3DTo2DLabelPosition()

QVector3D Qgs3DAxis::from3DTo2DLabelPosition ( const QVector3D &  sourcePos,
Qt3DRender::QCamera *  sourceCamera,
Qt3DRender::QCamera *  destCamera 
)

Project a 3D position from sourceCamera to a 2D position for destCamera.

destCamera acts as a billboarding layer. The labels displayed by this process will always face the camera.

Parameters
sourcePos3D label coordinates
sourceCameramain view camera
destCamerabillboarding camera

Definition at line 327 of file qgs3daxis.cpp.

◆ handleEvent()

bool Qgs3DAxis::handleEvent ( QEvent *  event)

Returns if the 3D axis controller will handle the specified event.

  • true when event is key within Ctrl+[2345689] to handle view orientation
  • false when event is mouse click within the 3Daxis space to handle menu and orientation by clicking on cube faces

Definition at line 122 of file qgs3daxis.cpp.

◆ onAxisSettingsChanged

void Qgs3DAxis::onAxisSettingsChanged ( )
slot

Force update of the axis and the viewport when a setting has changed.

Definition at line 927 of file qgs3daxis.cpp.

◆ onViewportScaleFactorChanged()

void Qgs3DAxis::onViewportScaleFactorChanged ( double  scaleFactor)

Used as callback from renderview when viewport scale factor changes.

Since
QGIS 3.44

Definition at line 946 of file qgs3daxis.cpp.


The documentation for this class was generated from the following files: