mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
This is a new navigation mode for QgsCameraController which is meant to work just like the terrain-based navigation mode, but for 3D scenes with globe. Initially, the new navigation mode can handle: - zooming in/out with mouse wheel - orbit around globe when dragging with left mouse button pressed - left/right/up/down keys to orbit around globe - shift + left/right keys to change heading angle - shift + up/down keys to change pitch angle - page up/page down keys to increase/decrease elevation For camera pose, we use QgsCameraPose as for "flat" scenes, but the QCamera is positioned/rotated slightly differently - the main change is that in case of globe, we use ECEF coordinates of the camera pose's center point, convert them to lat/lon coordinates in order to set up initial rotation of the camera so that it is perpendicular to the tangent plane at the given ECEF coordinate.
93 lines
2.8 KiB
Plaintext
93 lines
2.8 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/3d/qgscamerapose.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsCameraPose
|
|
{
|
|
%Docstring(signature="appended")
|
|
Class that encapsulates camera pose in a 3D scene.
|
|
|
|
The pose is defined with the following parameters:
|
|
|
|
- center point - towards which point the camera is looking
|
|
- distance from the center point - how far is the camera from the point towards which it is looking
|
|
- pitch angle - vertical rotation of the camera (0 degrees = camera looking down, 90 degrees = camera looking from the side)
|
|
- yaw angle - horizontal rotation of the camera
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgscamerapose.h"
|
|
%End
|
|
public:
|
|
QgsVector3D centerPoint() const;
|
|
%Docstring
|
|
Returns center point (towards which point the camera is looking)
|
|
%End
|
|
void setCenterPoint( const QgsVector3D &point );
|
|
%Docstring
|
|
Sets center point (towards which point the camera is looking)
|
|
%End
|
|
|
|
float distanceFromCenterPoint() const;
|
|
%Docstring
|
|
Returns distance of the camera from the center point
|
|
%End
|
|
void setDistanceFromCenterPoint( float distance );
|
|
%Docstring
|
|
Sets distance of the camera from the center point
|
|
%End
|
|
|
|
float pitchAngle() const;
|
|
%Docstring
|
|
Returns pitch angle in degrees
|
|
%End
|
|
void setPitchAngle( float pitch );
|
|
%Docstring
|
|
Sets pitch angle in degrees
|
|
%End
|
|
|
|
float headingAngle() const;
|
|
%Docstring
|
|
Returns heading (yaw) angle in degrees
|
|
%End
|
|
void setHeadingAngle( float heading );
|
|
%Docstring
|
|
Sets heading (yaw) angle in degrees
|
|
%End
|
|
|
|
|
|
|
|
QDomElement writeXml( QDomDocument &doc ) const;
|
|
%Docstring
|
|
Writes configuration to a new DOM element and returns it
|
|
%End
|
|
void readXml( const QDomElement &elem );
|
|
%Docstring
|
|
Reads configuration from a DOM element previously written using :py:func:`~QgsCameraPose.writeXml`
|
|
%End
|
|
|
|
bool operator==( const QgsCameraPose &other ) const;
|
|
bool operator!=( const QgsCameraPose &other ) const;
|
|
|
|
};
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/3d/qgscamerapose.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|