QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Display 3D ortho axis in the main 3D view. More...
#include <qgs3daxis.h>
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... | |
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.
Definition at line 56 of file qgs3daxis.h.
|
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.
Qgs3DAxis::Qgs3DAxis | ( | Qt3DExtras::Qt3DWindow * | parentWindow, |
Qt3DCore::QEntity * | parent3DScene, | ||
Qgs3DMapScene * | mapScene, | ||
QgsCameraController * | camera, | ||
Qgs3DMapSettings * | map | ||
) |
Defaul Qgs3DAxis constructor.
parentWindow | qt3d windows |
parent3DScene | root entity to set as parent |
mapScene | 3d map scene to retrieve terrain and 3d engine data |
camera | camera controller used to track camera movements |
map | 3D map settings |
Definition at line 40 of file qgs3daxis.cpp.
|
override |
Definition at line 76 of file qgs3daxis.cpp.
|
inline |
Returns axis viewport horizontal position.
Definition at line 111 of file qgs3daxis.h.
|
inline |
Returns axis viewport size.
Definition at line 106 of file qgs3daxis.h.
|
inline |
Returns axis viewport vertical position.
Definition at line 116 of file qgs3daxis.h.
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.
sourcePos | 3D label coordinates |
sourceCamera | main view camera |
sourceViewport | main viewport |
destCamera | billboarding camera |
destViewport | billboarding viewport |
destSize | main qt3d window size |
Definition at line 329 of file qgs3daxis.cpp.
|
inline |
Returns axis mode.
Definition at line 87 of file qgs3daxis.h.
void Qgs3DAxis::setAxisViewportPosition | ( | int | axisViewportSize, |
Qt::AnchorPoint | axisViewportVertPos, | ||
Qt::AnchorPoint | axisViewportHorizPos | ||
) |
set axis viewport position parameters
axisViewportSize | height/width size in pixel |
axisViewportVertPos | start vertical position |
axisViewportHorizPos | start horizontal position |
Definition at line 918 of file qgs3daxis.cpp.
void Qgs3DAxis::setMode | ( | Qgs3DAxis::Mode | axisMode | ) |
set axis representation mode
axisMode | new node |
Definition at line 1009 of file qgs3daxis.cpp.