PySide6.QtGraphs.Q3DScene¶
- class Q3DScene¶
Q3DScene
class provides description of the 3D scene being visualized. More…Synopsis¶
Properties¶
devicePixelRatioᅟ
- Device pixel ratio that is used when mapping input coordinates to pixel coordinatesgraphPositionQueryᅟ
- Coordinates for the user input that should be processed by the scene as a graph position queryprimarySubViewportᅟ
- Current subviewport rectangle inside the viewport where the primary view of the graphs is targetedsecondarySubViewportᅟ
- Secondary viewport rectangle inside the viewportsecondarySubviewOnTopᅟ
- Whether the 2D slicing view or the 3D view is drawn on topselectionQueryPositionᅟ
- Coordinates for the user input that should be processed by the scene as a selectionslicingActiveᅟ
- Whether the 2D slicing view is currently activeviewportᅟ
- A read only property that contains the current viewport rectangle where all the 3D rendering is targeted
Methods¶
def
__init__()
def
viewport()
Signals¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
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 graph rendering is done, the primary subviewport inside the viewport where the main 3D graphs 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 bothviewportChanged()
andslicingActiveChanged()
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 graphs support the secondary 2D slicing view.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property devicePixelRatioᅟ: float¶
This property holds The device pixel ratio that is used when mapping input coordinates to pixel coordinates..
- Access functions:
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 ofinvalidSelectionPoint()
. The queried graph position can be read from thequeriedGraphPosition
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
- Access functions:
- Access functions:
This property holds The current subviewport rectangle inside the viewport where the primary view of the graphs is targeted..
If the primary sub viewport has not been explicitly set, it will be one fifth of
viewport()
.Note
Setting primarySubViewport larger than or outside of the viewport resizes the viewport accordingly.
- Access functions:
This property holds The secondary viewport rectangle inside the viewport..
The secondary viewport is used for drawing the 2D slice view in some graphs. If it has not been explicitly set, it will be equal to the size of the viewport.
Note
If the secondary sub viewport is larger than or outside of the viewport, the viewport is resized accordingly.
- Access functions:
- property secondarySubviewOnTopᅟ: bool¶
This property holds Whether the 2D slicing view or the 3D view is drawn on top..
- Access functions:
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 ofinvalidSelectionPoint()
.See also
- Access functions:
- property slicingActiveᅟ: bool¶
This property holds Whether the 2D slicing view is currently active..
If
true
,selectionMode
must have eitherRow
orColumn
set to a valid selection.Note
Not all graphs support the 2D slicing view.
- Access functions:
This property holds A read only property that contains the current viewport rectangle where all the 3D rendering is targeted..
- Access functions:
Signal
viewportChanged()
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.- devicePixelRatio()¶
- Return type:
float
See also
Getter of property
devicePixelRatioᅟ
.- devicePixelRatioChanged(pixelRatio)¶
- Parameters:
pixelRatio – float
Notification signal of property
devicePixelRatioᅟ
.- graphPositionQuery()¶
- Return type:
See also
Getter of property
graphPositionQueryᅟ
.Notification signal of property
graphPositionQueryᅟ
.Returns a QPoint signifying an invalid selection position.
Getter of property
invalidSelectionPointᅟ
.Returns whether the given
point
resides inside the primary subview or not. Returnstrue
if the point is inside the primary subview.Note
If subviews are superimposed, and the given
point
resides inside both, result istrue
only when the primary subview is on top.Returns whether the given
point
resides inside the secondary subview or not. Returnstrue
if the point is inside the secondary subview.Note
If subviews are superimposed, and the given
point
resides inside both, result istrue
only when the secondary subview is on top.- isSecondarySubviewOnTop()¶
- Return type:
bool
Getter of property
secondarySubviewOnTopᅟ
.- isSlicingActive()¶
- Return type:
bool
Getter of property
slicingActiveᅟ
.- needRender()¶
- primarySubViewport()¶
- Return type:
See also
Getter of property
primarySubViewportᅟ
.Notification signal of property
primarySubViewportᅟ
.- secondarySubViewport()¶
- Return type:
See also
Getter of property
secondarySubViewportᅟ
.Notification signal of property
secondarySubViewportᅟ
.- secondarySubviewOnTopChanged(isSecondaryOnTop)¶
- Parameters:
isSecondaryOnTop – bool
Notification signal of property
secondarySubviewOnTopᅟ
.- selectionQueryPosition()¶
- Return type:
See also
Getter of property
selectionQueryPositionᅟ
.Notification signal of property
selectionQueryPositionᅟ
.- setDevicePixelRatio(pixelRatio)¶
- Parameters:
pixelRatio – float
See also
Setter of property
devicePixelRatioᅟ
.Setter of property
graphPositionQueryᅟ
.Setter of property
primarySubViewportᅟ
.Setter of property
secondarySubViewportᅟ
.- setSecondarySubviewOnTop(isSecondaryOnTop)¶
- Parameters:
isSecondaryOnTop – bool
See also
Setter of property
secondarySubviewOnTopᅟ
.Setter of property
selectionQueryPositionᅟ
.- setSlicingActive(isSlicing)¶
- Parameters:
isSlicing – bool
See also
Setter of property
slicingActiveᅟ
.- slicingActiveChanged(isSlicingActive)¶
- Parameters:
isSlicingActive – bool
Notification signal of property
slicingActiveᅟ
.Getter of property
viewportᅟ
.Notification signal of property
viewportᅟ
.