Class: QgsCameraController¶
- class qgis._3d.QgsCameraController¶
Bases:
PyQt5.QtCore.QObject
Object that controls camera movement based on user input
Note
Not available in Python bindings
Methods
Returns the camera movement speed
Returns the navigation mode used by the camera controller.
Returns camera pose
Sets the depth buffer image used by the camera controller to calculate world position from a pixel's coordinates and depth
Returns distance of the camera from the point it is looking at.
Called internally from 3D scene when a new frame is generated.
Returns the point in the world coordinates towards which the camera is looking
Move the map by
tx
andty
Returns pitch angle in degrees (0 = looking from the top, 90 = looking from the side).
Reads camera configuration from the given DOM element
Move camera back to the initial position (looking down towards origin of world's coordinates)
Rotate clockwise the view by
deltaYaw
around the view center (camera moves)Rotates the camera on itself.
Set camera heading to
angle
(used for rotating the view)Sets the camera movement speed
Sets the navigation mode used by the camera controller.
Sets camera pose
Sets the complete camera configuration: the point towards it is looking (in 3D world coordinates), the distance of the camera from the point, pitch angle in degrees (0 = looking from the top, 90 = looking from the side) and yaw angle in degrees.
Sets the vertical axis
inversion
behavior.Sets camera to look down towards given point in world coordinate, in given distance from plane with zero elevation
Tilt up the view by
deltaPitch
around the view center (camera moves)Returns the vertical axis inversion behavior.
Walks into the map by
tx
,ty
, andtz
Returns
True
if the camera controller will handle the specified keyevent
, preventing it from being instead handled by parents of the 3D window before the controller ever receives it.Writes camera configuration to the given DOM element
Returns yaw angle in degrees.
Zoom the map by
factor
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- cameraChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- cameraMovementSpeed(self) float ¶
Returns the camera movement speed
New in version 3.18.
- Return type:
float
- cameraMovementSpeedChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
Returns the navigation mode used by the camera controller.
New in version 3.18.
- Return type:
- cameraPose(self) QgsCameraPose ¶
Returns camera pose
New in version 3.4.
- Return type:
- cameraRotationCenterChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- depthBufferCaptured(self, depthImage: QImage)¶
Sets the depth buffer image used by the camera controller to calculate world position from a pixel’s coordinates and depth
New in version 3.24.
- Parameters:
depthImage (QImage) –
- distance(self) float ¶
Returns distance of the camera from the point it is looking at. The value should not be smaller than 10.
New in version 3.4.
- Return type:
float
- frameTriggered(self, dt: float)¶
Called internally from 3D scene when a new frame is generated. Updates camera according to keyboard/mouse input
- Parameters:
dt (float) –
- lookingAtPoint(self) QgsVector3D ¶
Returns the point in the world coordinates towards which the camera is looking
- Return type:
- moveView(self, tx: float, ty: float)¶
Move the map by
tx
andty
- Parameters:
tx (float) –
ty (float) –
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- pitch(self) float ¶
Returns pitch angle in degrees (0 = looking from the top, 90 = looking from the side). The angle should range from 0 to 180.
New in version 3.4.
- Return type:
float
- readXml(self, elem: QDomElement)¶
Reads camera configuration from the given DOM element
- Parameters:
elem (QDomElement) –
- requestDepthBufferCapture¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- resetView(self, distance: float)¶
Move camera back to the initial position (looking down towards origin of world’s coordinates)
- Parameters:
distance (float) –
- rotateAroundViewCenter(self, deltaYaw: float)¶
Rotate clockwise the view by
deltaYaw
around the view center (camera moves)- Parameters:
deltaYaw (float) –
- rotateCamera(self, diffPitch: float, diffYaw: float)¶
Rotates the camera on itself.
- Parameters:
diffPitch (float) – the pitch difference
diffYaw (float) – the yaw difference
New in version 3.30.
- setCameraHeadingAngle(self, angle: float)¶
Set camera heading to
angle
(used for rotating the view)- Parameters:
angle (float) –
- setCameraMovementSpeed(self, movementSpeed: float)¶
Sets the camera movement speed
New in version 3.18.
- Parameters:
movementSpeed (float) –
Sets the navigation mode used by the camera controller.
New in version 3.18.
- Parameters:
navigationMode (Qgis.NavigationMode) –
- setCameraPose(self, camPose: QgsCameraPose)¶
Sets camera pose
New in version 3.4.
- Parameters:
camPose (QgsCameraPose) –
- setCursorPosition¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- setLookingAtPoint(self, point: QgsVector3D, distance: float, pitch: float, yaw: float)¶
Sets the complete camera configuration: the point towards it is looking (in 3D world coordinates), the distance of the camera from the point, pitch angle in degrees (0 = looking from the top, 90 = looking from the side) and yaw angle in degrees.
New in version 3.4.
- Parameters:
point (QgsVector3D) –
distance (float) –
pitch (float) –
yaw (float) –
- setVerticalAxisInversion(self, inversion: Qgis.VerticalAxisInversion)¶
Sets the vertical axis
inversion
behavior.New in version 3.18.
- Parameters:
inversion (Qgis.VerticalAxisInversion) –
- setViewFromTop(self, worldX: float, worldY: float, distance: float, yaw: float = 0)¶
Sets camera to look down towards given point in world coordinate, in given distance from plane with zero elevation
- Parameters:
worldX (float) –
worldY (float) –
distance (float) –
yaw (float = 0) –
- tiltUpAroundViewCenter(self, deltaPitch: float)¶
Tilt up the view by
deltaPitch
around the view center (camera moves)- Parameters:
deltaPitch (float) –
- verticalAxisInversion(self) Qgis.VerticalAxisInversion ¶
Returns the vertical axis inversion behavior.
New in version 3.18.
- Return type:
- walkView(self, tx: float, ty: float, tz: float)¶
Walks into the map by
tx
,ty
, andtz
New in version 3.30.
- Parameters:
tx (float) –
ty (float) –
tz (float) –
- willHandleKeyEvent(self, event: QKeyEvent) bool ¶
Returns
True
if the camera controller will handle the specified keyevent
, preventing it from being instead handled by parents of the 3D window before the controller ever receives it.- Parameters:
event (QKeyEvent) –
- Return type:
bool
- writeXml(self, doc: QDomDocument) QDomElement ¶
Writes camera configuration to the given DOM element
- Parameters:
doc (QDomDocument) –
- Return type:
QDomElement
- yaw(self) float ¶
Returns yaw angle in degrees. Yaw value of zero means the camera is pointing towards north. The angle should range from 0 to 360.
New in version 3.4.
- Return type:
float
- zoom(self, factor: float)¶
Zoom the map by
factor
- Parameters:
factor (float) –