QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
Public Types | 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 Types

enum  Mode { Mode::Off = 1, Mode::Crs = 2, Mode::Cube = 3 }
 The Mode enum. More...
 

Public Member Functions

 Qgs3DAxis (Qt3DExtras::Qt3DWindow *parentWindow, Qt3DCore::QEntity *parent3DScene, Qgs3DMapScene *mapScene, QgsCameraController *camera, Qgs3DMapSettings *map)
 Defaul Qgs3DAxis constructor. More...
 
 ~Qgs3DAxis () override
 
Qt::AnchorPoint axisViewportHorizontalPosition () const
 Returns axis viewport horizontal position. More...
 
int axisViewportSize () const
 Returns axis viewport size. More...
 
Qt::AnchorPoint axisViewportVerticalPosition () const
 Returns axis viewport vertical position. More...
 
QVector3D from3dTo2dLabelPosition (const QVector3D &sourcePos, Qt3DRender::QCamera *sourceCamera, Qt3DRender::QViewport *sourceViewport, Qt3DRender::QCamera *destCamera, Qt3DRender::QViewport *destViewport, const QSize &destSize)
 project a 3D position from sourceCamera (in sourceViewport) to a 2D position for destCamera (in destViewport). More...
 
Qgs3DAxis::Mode mode ()
 Returns axis mode. More...
 
void setAxisViewportPosition (int axisViewportSize, Qt::AnchorPoint axisViewportVertPos, Qt::AnchorPoint axisViewportHorizPos)
 set axis viewport position parameters More...
 
void setMode (Qgs3DAxis::Mode axisMode)
 set axis representation mode More...
 

Detailed Description

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

3 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 56 of file qgs3daxis.h.

Member Enumeration Documentation

◆ Mode

enum Qgs3DAxis::Mode
strong

The Mode enum.

Enumerator
Off 

Hide 3d axis.

Crs 

Respect CRS directions.

Cube 

Abstract cube mode.

Definition at line 76 of file qgs3daxis.h.

Constructor & Destructor Documentation

◆ Qgs3DAxis()

Qgs3DAxis::Qgs3DAxis ( Qt3DExtras::Qt3DWindow *  parentWindow,
Qt3DCore::QEntity *  parent3DScene,
Qgs3DMapScene mapScene,
QgsCameraController camera,
Qgs3DMapSettings map 
)

Defaul Qgs3DAxis constructor.

Parameters
parentWindowqt3d windows
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 40 of file qgs3daxis.cpp.

◆ ~Qgs3DAxis()

Qgs3DAxis::~Qgs3DAxis ( )
override

Definition at line 76 of file qgs3daxis.cpp.

Member Function Documentation

◆ axisViewportHorizontalPosition()

Qt::AnchorPoint Qgs3DAxis::axisViewportHorizontalPosition ( ) const
inline

Returns axis viewport horizontal position.

Definition at line 111 of file qgs3daxis.h.

◆ axisViewportSize()

int Qgs3DAxis::axisViewportSize ( ) const
inline

Returns axis viewport size.

Definition at line 106 of file qgs3daxis.h.

◆ axisViewportVerticalPosition()

Qt::AnchorPoint Qgs3DAxis::axisViewportVerticalPosition ( ) const
inline

Returns axis viewport vertical position.

Definition at line 116 of file qgs3daxis.h.

◆ from3dTo2dLabelPosition()

QVector3D Qgs3DAxis::from3dTo2dLabelPosition ( const QVector3D &  sourcePos,
Qt3DRender::QCamera *  sourceCamera,
Qt3DRender::QViewport *  sourceViewport,
Qt3DRender::QCamera *  destCamera,
Qt3DRender::QViewport *  destViewport,
const QSize &  destSize 
)

project a 3D position from sourceCamera (in sourceViewport) to a 2D position for destCamera (in destViewport).

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

Parameters
sourcePos3D label coordinates
sourceCameramain view camera
sourceViewportmain viewport
destCamerabillboarding camera
destViewportbillboarding viewport
destSizemain qt3d window size
Returns

Definition at line 329 of file qgs3daxis.cpp.

◆ mode()

Qgs3DAxis::Mode Qgs3DAxis::mode ( )
inline

Returns axis mode.

Definition at line 87 of file qgs3daxis.h.

◆ setAxisViewportPosition()

void Qgs3DAxis::setAxisViewportPosition ( int  axisViewportSize,
Qt::AnchorPoint  axisViewportVertPos,
Qt::AnchorPoint  axisViewportHorizPos 
)

set axis viewport position parameters

Parameters
axisViewportSizeheight/width size in pixel
axisViewportVertPosstart vertical position
axisViewportHorizPosstart horizontal position

Definition at line 918 of file qgs3daxis.cpp.

◆ setMode()

void Qgs3DAxis::setMode ( Qgs3DAxis::Mode  axisMode)

set axis representation mode

Parameters
axisModenew node

Definition at line 1009 of file qgs3daxis.cpp.


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