Q3DScene¶
Q3DScene
class provides description of the 3D scene being visualized. More…
Synopsis¶
Functions¶
def
activeCamera
()def
activeLight
()def
devicePixelRatio
()def
graphPositionQuery
()def
isPointInPrimarySubView
(point)def
isPointInSecondarySubView
(point)def
isSecondarySubviewOnTop
()def
isSlicingActive
()def
primarySubViewport
()def
secondarySubViewport
()def
selectionQueryPosition
()def
setActiveCamera
(camera)def
setActiveLight
(light)def
setDevicePixelRatio
(pixelRatio)def
setGraphPositionQuery
(point)def
setPrimarySubViewport
(primarySubViewport)def
setSecondarySubViewport
(secondarySubViewport)def
setSecondarySubviewOnTop
(isSecondaryOnTop)def
setSelectionQueryPosition
(point)def
setSlicingActive
(isSlicing)def
viewport
()
Signals¶
def
activeCameraChanged
(camera)def
activeLightChanged
(light)def
devicePixelRatioChanged
(pixelRatio)def
graphPositionQueryChanged
(position)def
primarySubViewportChanged
(subViewport)def
secondarySubViewportChanged
(subViewport)def
secondarySubviewOnTopChanged
(isSecondaryOnTop)def
selectionQueryPositionChanged
(position)def
slicingActiveChanged
(isSlicingActive)def
viewportChanged
(viewport)
Static functions¶
def
invalidSelectionPoint
()
Detailed Description¶
The 3D scene contains a single active camera and a single active light source. Visualized data is assumed to be at a fixed location.
The 3D scene also keeps track of the viewport in which visualization rendering is done, the primary subviewport inside the viewport where the main 3D data visualization view resides and the secondary subviewport where the 2D sliced view of the data resides. The subviewports are by default resized by the Q3DScene
. To override the resize behavior you need to listen to both viewportChanged()
and slicingActiveChanged()
signals and recalculate the subviewports accordingly.
Also the scene has flag for tracking if the secondary 2D slicing view is currently active or not.
Note
Not all visualizations support the secondary 2D slicing view.
- class PySide6.QtDataVisualization.Q3DScene([parent=None])¶
- Parameters
parent –
PySide6.QtCore.QObject
Constructs a basic scene with one light and one camera in it. An optional parent
parameter can be given and is then passed to QObject
constructor.
- PySide6.QtDataVisualization.Q3DScene.activeCamera()¶
- Return type
This property holds The currently active camera in the 3D scene..
When a new Q3DCamera
object is set, it is automatically added as child of the scene.
- PySide6.QtDataVisualization.Q3DScene.activeCameraChanged(camera)¶
- Parameters
- PySide6.QtDataVisualization.Q3DScene.activeLight()¶
- Return type
This property holds The currently active light in the 3D scene..
When a new Q3DLight
objects is set, it is automatically added as child of the scene.
- PySide6.QtDataVisualization.Q3DScene.activeLightChanged(light)¶
- Parameters
- PySide6.QtDataVisualization.Q3DScene.devicePixelRatio()¶
- Return type
float
This property holds The device pixel ratio that is used when mapping input coordinates to pixel coordinates..
- PySide6.QtDataVisualization.Q3DScene.devicePixelRatioChanged(pixelRatio)¶
- Parameters
pixelRatio – float
- PySide6.QtDataVisualization.Q3DScene.graphPositionQuery()¶
- Return type
This property holds The coordinates for the user input that should be processed by the scene as a graph position query..
If this property is set to a value other than invalidSelectionPoint()
, the graph tries to match a graph position to the specified coordinates within the primary viewport. After the rendering pass, this property is returned to its default state of invalidSelectionPoint()
. The queried graph position can be read from the queriedGraphPosition
property after the next render pass.
There is no single correct 3D coordinate to match a particular screen position, so to be consistent, the queries are always done against the inner sides of an invisible box surrounding the graph.
Note
Bar graphs allow graph position queries only at the graph floor level.
See also
- PySide6.QtDataVisualization.Q3DScene.graphPositionQueryChanged(position)¶
- Parameters
position –
PySide6.QtCore.QPoint
- static PySide6.QtDataVisualization.Q3DScene.invalidSelectionPoint()¶
- Return type
Returns a QPoint
signifying an invalid selection position.
- PySide6.QtDataVisualization.Q3DScene.isPointInPrimarySubView(point)¶
- Parameters
point –
PySide6.QtCore.QPoint
- Return type
bool
Returns whether the given point
resides inside the primary subview or not. Returns true
if the point is inside the primary subview.
Note
If subviews are superimposed, and the given point
resides inside both, result is true
only when the primary subview is on top.
- PySide6.QtDataVisualization.Q3DScene.isPointInSecondarySubView(point)¶
- Parameters
point –
PySide6.QtCore.QPoint
- Return type
bool
Returns whether the given point
resides inside the secondary subview or not. Returns true
if the point is inside the secondary subview.
Note
If subviews are superimposed, and the given point
resides inside both, result is true
only when the secondary subview is on top.
- PySide6.QtDataVisualization.Q3DScene.isSecondarySubviewOnTop()¶
- Return type
bool
This property holds Whether the 2D slicing view or the 3D view is drawn on top..
- PySide6.QtDataVisualization.Q3DScene.isSlicingActive()¶
- Return type
bool
This property holds Whether the 2D slicing view is currently active..
If true
, selectionMode
must have either SelectionRow
or SelectionColumn
set to a valid selection.
Note
Not all visualizations support the 2D slicing view.
- PySide6.QtDataVisualization.Q3DScene.primarySubViewport()¶
- Return type
This property holds The current subviewport rectangle inside the viewport where the primary view of the data visualization is targeted..
If isSlicingActive()
is false
, the primary sub viewport is equal to viewport()
. If isSlicingActive()
is true
and the primary sub viewport has not been explicitly set, it will be one fifth of viewport()
.
Note
Setting larger than or outside of the viewport resizes the viewport accordingly.
- PySide6.QtDataVisualization.Q3DScene.primarySubViewportChanged(subViewport)¶
- Parameters
subViewport –
PySide6.QtCore.QRect
- PySide6.QtDataVisualization.Q3DScene.secondarySubViewport()¶
- Return type
This property holds The secondary viewport rectangle inside the viewport..
The secondary viewport is used for drawing the 2D slice view in some visualizations. If it has not been explicitly set, it will be equal to QRect
. If isSlicingActive()
is true
, it will be equal to viewport
.
Note
If the secondary sub viewport is larger than or outside of the viewport, the viewport is resized accordingly.
- PySide6.QtDataVisualization.Q3DScene.secondarySubViewportChanged(subViewport)¶
- Parameters
subViewport –
PySide6.QtCore.QRect
- PySide6.QtDataVisualization.Q3DScene.secondarySubviewOnTopChanged(isSecondaryOnTop)¶
- Parameters
isSecondaryOnTop – bool
- PySide6.QtDataVisualization.Q3DScene.selectionQueryPosition()¶
- Return type
This property holds The coordinates for the user input that should be processed by the scene as a selection..
If this property is set to a value other than invalidSelectionPoint()
, the graph tries to select a data item, axis label, or a custom item at the specified coordinates within the primary viewport. After the rendering pass, the property is returned to its default state of invalidSelectionPoint()
.
See also
- PySide6.QtDataVisualization.Q3DScene.selectionQueryPositionChanged(position)¶
- Parameters
position –
PySide6.QtCore.QPoint
- PySide6.QtDataVisualization.Q3DScene.setActiveCamera(camera)¶
- Parameters
This property holds The currently active camera in the 3D scene..
When a new Q3DCamera
object is set, it is automatically added as child of the scene.
- PySide6.QtDataVisualization.Q3DScene.setActiveLight(light)¶
- Parameters
This property holds The currently active light in the 3D scene..
When a new Q3DLight
objects is set, it is automatically added as child of the scene.
- PySide6.QtDataVisualization.Q3DScene.setDevicePixelRatio(pixelRatio)¶
- Parameters
pixelRatio – float
This property holds The device pixel ratio that is used when mapping input coordinates to pixel coordinates..
- PySide6.QtDataVisualization.Q3DScene.setGraphPositionQuery(point)¶
- Parameters
point –
PySide6.QtCore.QPoint
This property holds The coordinates for the user input that should be processed by the scene as a graph position query..
If this property is set to a value other than invalidSelectionPoint()
, the graph tries to match a graph position to the specified coordinates within the primary viewport. After the rendering pass, this property is returned to its default state of invalidSelectionPoint()
. The queried graph position can be read from the queriedGraphPosition
property after the next render pass.
There is no single correct 3D coordinate to match a particular screen position, so to be consistent, the queries are always done against the inner sides of an invisible box surrounding the graph.
Note
Bar graphs allow graph position queries only at the graph floor level.
See also
- PySide6.QtDataVisualization.Q3DScene.setPrimarySubViewport(primarySubViewport)¶
- Parameters
primarySubViewport –
PySide6.QtCore.QRect
This property holds The current subviewport rectangle inside the viewport where the primary view of the data visualization is targeted..
If isSlicingActive()
is false
, the primary sub viewport is equal to viewport()
. If isSlicingActive()
is true
and the primary sub viewport has not been explicitly set, it will be one fifth of viewport()
.
Note
Setting larger than or outside of the viewport resizes the viewport accordingly.
- PySide6.QtDataVisualization.Q3DScene.setSecondarySubViewport(secondarySubViewport)¶
- Parameters
secondarySubViewport –
PySide6.QtCore.QRect
This property holds The secondary viewport rectangle inside the viewport..
The secondary viewport is used for drawing the 2D slice view in some visualizations. If it has not been explicitly set, it will be equal to QRect
. If isSlicingActive()
is true
, it will be equal to viewport
.
Note
If the secondary sub viewport is larger than or outside of the viewport, the viewport is resized accordingly.
- PySide6.QtDataVisualization.Q3DScene.setSecondarySubviewOnTop(isSecondaryOnTop)¶
- Parameters
isSecondaryOnTop – bool
This property holds Whether the 2D slicing view or the 3D view is drawn on top..
- PySide6.QtDataVisualization.Q3DScene.setSelectionQueryPosition(point)¶
- Parameters
point –
PySide6.QtCore.QPoint
This property holds The coordinates for the user input that should be processed by the scene as a selection..
If this property is set to a value other than invalidSelectionPoint()
, the graph tries to select a data item, axis label, or a custom item at the specified coordinates within the primary viewport. After the rendering pass, the property is returned to its default state of invalidSelectionPoint()
.
See also
- PySide6.QtDataVisualization.Q3DScene.setSlicingActive(isSlicing)¶
- Parameters
isSlicing – bool
This property holds Whether the 2D slicing view is currently active..
If true
, selectionMode
must have either SelectionRow
or SelectionColumn
set to a valid selection.
Note
Not all visualizations support the 2D slicing view.
- PySide6.QtDataVisualization.Q3DScene.slicingActiveChanged(isSlicingActive)¶
- Parameters
isSlicingActive – bool
- PySide6.QtDataVisualization.Q3DScene.viewport()¶
- Return type
This property holds A read only property that contains the current viewport rectangle where all the 3D rendering is targeted..
- PySide6.QtDataVisualization.Q3DScene.viewportChanged(viewport)¶
- Parameters
viewport –
PySide6.QtCore.QRect
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.