Q3DCamera#

Representation of a camera in 3D space. More

Synopsis#

Functions#

Signals#

Detailed Description#

Q3DCamera represents a basic orbit around centerpoint 3D camera that is used when rendering the data visualization. The class offers simple methods for rotating the camera around the origin and setting zoom level.

class PySide6.QtDataVisualization.Q3DCamera([parent=None])#
Parameters

parentPySide6.QtCore.QObject

Constructs a new 3D camera with position set to origin, up direction facing towards the Y-axis and looking at origin by default. An optional parent parameter can be given and is then passed to QObject constructor.

PySide6.QtDataVisualization.Q3DCamera.CameraPreset#

Predefined positions for camera.

Constant

Description

Q3DCamera.CameraPresetNone

Used to indicate a preset has not been set, or the scene has been rotated freely.

Q3DCamera.CameraPresetFrontLow

Q3DCamera.CameraPresetFront

Q3DCamera.CameraPresetFrontHigh

Q3DCamera.CameraPresetLeftLow

Q3DCamera.CameraPresetLeft

Q3DCamera.CameraPresetLeftHigh

Q3DCamera.CameraPresetRightLow

Q3DCamera.CameraPresetRight

Q3DCamera.CameraPresetRightHigh

Q3DCamera.CameraPresetBehindLow

Q3DCamera.CameraPresetBehind

Q3DCamera.CameraPresetBehindHigh

Q3DCamera.CameraPresetIsometricLeft

Q3DCamera.CameraPresetIsometricLeftHigh

Q3DCamera.CameraPresetIsometricRight

Q3DCamera.CameraPresetIsometricRightHigh

Q3DCamera.CameraPresetDirectlyAbove

Q3DCamera.CameraPresetDirectlyAboveCW45

Q3DCamera.CameraPresetDirectlyAboveCCW45

Q3DCamera.CameraPresetFrontBelow

In Q3DBars from onward these only work for graphs including negative values. They act as Preset…Low for positive-only values.

Q3DCamera.CameraPresetLeftBelow

Q3DCamera.CameraPresetRightBelow

Q3DCamera.CameraPresetBehindBelow

Q3DCamera.CameraPresetDirectlyBelow

Acts as for positive-only bars.

PySide6.QtDataVisualization.Q3DCamera.cameraPreset()#
Return type

CameraPreset

This property holds The currently active camera preset..

If no CameraPreset value is set, CameraPresetNone is used by default.

PySide6.QtDataVisualization.Q3DCamera.cameraPresetChanged(preset)#
Parameters

presetCameraPreset

PySide6.QtDataVisualization.Q3DCamera.maxZoomLevel()#
Return type

float

This property holds The maximum allowed camera zoom level..

If the maximum level is set to a new value that is lower than the existing minimum level, the minimum level is adjusted to the new maximum as well. If the current zoomLevel is outside the new bounds, it is adjusted as well. Defaults to 500.0f.

PySide6.QtDataVisualization.Q3DCamera.maxZoomLevelChanged(zoomLevel)#
Parameters

zoomLevel – float

PySide6.QtDataVisualization.Q3DCamera.minZoomLevel()#
Return type

float

This property holds The minimum allowed camera zoom level..

If the minimum level is set to a new value that is higher than the existing maximum level, the maximum level is adjusted to the new minimum as well. If the current zoomLevel is outside the new bounds, it is adjusted as well. The cannot be set below 1.0f. Defaults to 10.0f.

PySide6.QtDataVisualization.Q3DCamera.minZoomLevelChanged(zoomLevel)#
Parameters

zoomLevel – float

PySide6.QtDataVisualization.Q3DCamera.setCameraPosition(horizontal, vertical[, zoom=100.0f])#
Parameters
  • horizontal – float

  • vertical – float

  • zoom – float

Utility function that sets the camera rotations and distance.``horizontal`` and vertical define the camera rotations to be used. Optional zoom parameter can be given to set the zoom percentage of the camera within the bounds defined by minZoomLevel and maxZoomLevel properties.

PySide6.QtDataVisualization.Q3DCamera.setCameraPreset(preset)#
Parameters

presetCameraPreset

This property holds The currently active camera preset..

If no CameraPreset value is set, CameraPresetNone is used by default.

PySide6.QtDataVisualization.Q3DCamera.setMaxZoomLevel(zoomLevel)#
Parameters

zoomLevel – float

This property holds The maximum allowed camera zoom level..

If the maximum level is set to a new value that is lower than the existing minimum level, the minimum level is adjusted to the new maximum as well. If the current zoomLevel is outside the new bounds, it is adjusted as well. Defaults to 500.0f.

PySide6.QtDataVisualization.Q3DCamera.setMinZoomLevel(zoomLevel)#
Parameters

zoomLevel – float

This property holds The minimum allowed camera zoom level..

If the minimum level is set to a new value that is higher than the existing maximum level, the maximum level is adjusted to the new minimum as well. If the current zoomLevel is outside the new bounds, it is adjusted as well. The cannot be set below 1.0f. Defaults to 10.0f.

PySide6.QtDataVisualization.Q3DCamera.setTarget(target)#
Parameters

targetPySide6.QtGui.QVector3D

This property holds The camera target as a vector or vertex in the 3D space..

Defaults to QVector3D(0.0, 0.0, 0.0).

Valid coordinate values are between -1.0...1.0, where the edge values indicate the edges of the corresponding axis range. Any values outside this range are clamped to the edge.

Note

For bar graphs, the Y-coordinate is ignored and camera always targets a point on the horizontal background.

PySide6.QtDataVisualization.Q3DCamera.setWrapXRotation(isEnabled)#
Parameters

isEnabled – bool

This property holds The behavior of the minimum and maximum limits in the X-rotation..

If set to true, the X-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If set to false, the X-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to true by default.

PySide6.QtDataVisualization.Q3DCamera.setWrapYRotation(isEnabled)#
Parameters

isEnabled – bool

This property holds The behavior of the minimum and maximum limits in the Y-rotation..

If true, the Y-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If false, the Y-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to true by default.

PySide6.QtDataVisualization.Q3DCamera.setXRotation(rotation)#
Parameters

rotation – float

This property holds The X-rotation angle of the camera around the target point in degrees..

PySide6.QtDataVisualization.Q3DCamera.setYRotation(rotation)#
Parameters

rotation – float

This property holds The Y-rotation angle of the camera around the target point in degrees..

PySide6.QtDataVisualization.Q3DCamera.setZoomLevel(zoomLevel)#
Parameters

zoomLevel – float

This property holds The camera zoom level in percentage..

The default value of 100.0f means there is no zoom in or out set in the camera. The value is limited by the minZoomLevel and maxZoomLevel properties.

PySide6.QtDataVisualization.Q3DCamera.target()#
Return type

PySide6.QtGui.QVector3D

This property holds The camera target as a vector or vertex in the 3D space..

Defaults to QVector3D(0.0, 0.0, 0.0).

Valid coordinate values are between -1.0...1.0, where the edge values indicate the edges of the corresponding axis range. Any values outside this range are clamped to the edge.

Note

For bar graphs, the Y-coordinate is ignored and camera always targets a point on the horizontal background.

PySide6.QtDataVisualization.Q3DCamera.targetChanged(target)#
Parameters

targetPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.Q3DCamera.wrapXRotation()#
Return type

bool

This property holds The behavior of the minimum and maximum limits in the X-rotation..

If set to true, the X-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If set to false, the X-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to true by default.

PySide6.QtDataVisualization.Q3DCamera.wrapXRotationChanged(isEnabled)#
Parameters

isEnabled – bool

PySide6.QtDataVisualization.Q3DCamera.wrapYRotation()#
Return type

bool

This property holds The behavior of the minimum and maximum limits in the Y-rotation..

If true, the Y-rotation of the camera is wrapped from minimum to maximum and from maximum to minimum. If false, the Y-rotation of the camera is limited to the sector determined by the minimum and maximum values. Set to true by default.

PySide6.QtDataVisualization.Q3DCamera.wrapYRotationChanged(isEnabled)#
Parameters

isEnabled – bool

PySide6.QtDataVisualization.Q3DCamera.xRotation()#
Return type

float

This property holds The X-rotation angle of the camera around the target point in degrees..

PySide6.QtDataVisualization.Q3DCamera.xRotationChanged(rotation)#
Parameters

rotation – float

PySide6.QtDataVisualization.Q3DCamera.yRotation()#
Return type

float

This property holds The Y-rotation angle of the camera around the target point in degrees..

PySide6.QtDataVisualization.Q3DCamera.yRotationChanged(rotation)#
Parameters

rotation – float

PySide6.QtDataVisualization.Q3DCamera.zoomLevel()#
Return type

float

This property holds The camera zoom level in percentage..

The default value of 100.0f means there is no zoom in or out set in the camera. The value is limited by the minZoomLevel and maxZoomLevel properties.

PySide6.QtDataVisualization.Q3DCamera.zoomLevelChanged(zoomLevel)#
Parameters

zoomLevel – float