QCustom3DItem#
The QCustom3DItem
class adds a custom item to a graph. More…
Inherited by: QCustom3DVolume, QCustom3DLabel
Synopsis#
Properties#
meshFile
- Item mesh file nameposition
- Item position as a QVector3DpositionAbsolute
- Whether item position is to be handled in data coordinates or in absolute coordinatesrotation
- Item rotation as a QQuaternionscaling
- Item scaling as a QVector3DscalingAbsolute
- Whether item scaling is to be handled in data values or in absolute valuesshadowCasting
- Whether shadow casting for the item is enabledtextureFile
- Texture file name for the itemvisible
- Visibility of the item
Functions#
def
isPositionAbsolute
()def
isScalingAbsolute
()def
isShadowCasting
()def
isVisible
()def
meshFile
()def
position
()def
rotation
()def
scaling
()def
setMeshFile
(meshFile)def
setPosition
(position)def
setPositionAbsolute
(positionAbsolute)def
setRotation
(rotation)def
setRotationAxisAndAngle
(axis, angle)def
setScaling
(scaling)def
setScalingAbsolute
(scalingAbsolute)def
setShadowCasting
(enabled)def
setTextureFile
(textureFile)def
setTextureImage
(textureImage)def
setVisible
(visible)def
textureFile
()
Signals#
def
meshFileChanged
(meshFile)def
positionAbsoluteChanged
(positionAbsolute)def
positionChanged
(position)def
rotationChanged
(rotation)def
scalingAbsoluteChanged
(scalingAbsolute)def
scalingChanged
(scaling)def
shadowCastingChanged
(shadowCasting)def
textureFileChanged
(textureFile)def
visibleChanged
(visible)
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#
A custom item has a custom mesh, position, scaling, rotation, and an optional texture.
See also
- class PySide6.QtDataVisualization.QCustom3DItem([parent=None])#
PySide6.QtDataVisualization.QCustom3DItem(meshFile, position, scaling, rotation, texture[, parent=None])
- Parameters:
position –
PySide6.QtGui.QVector3D
scaling –
PySide6.QtGui.QVector3D
rotation –
PySide6.QtGui.QQuaternion
meshFile – str
texture –
PySide6.QtGui.QImage
parent –
PySide6.QtCore.QObject
Constructs a custom 3D item with the specified parent
.
Constructs a custom 3D item with the specified meshFile
, position
, scaling
, rotation
, texture
image, and optional parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtDataVisualization.QCustom3DItem.meshFile: str#
This property holds The item mesh file name..
The item in the file must be in Wavefront OBJ format and include vertices, normals, and UVs. It also needs to be in triangles. If the file is missing either normals or UVs, loading will fail with an error message to the console output and the item will not be rendered.
- Access functions:
meshFile
()setMeshFile
(meshFile)Signal
meshFileChanged
(meshFile)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.position: PySide6.QtGui.QVector3D#
This property holds The item position as a QVector3D
..
Defaults to QVector3D(0.0, 0.0, 0.0)
.
Item position is specified either in data coordinates or in absolute coordinates, depending on the positionAbsolute
property. When using absolute coordinates, values between -1.0...1.0
are within axis ranges.
Note
Items positioned outside any axis range are not rendered if positionAbsolute
is false
, unless the item is a QCustom3DVolume
that would be partially visible and scalingAbsolute
is also false
. In that case, the visible portion of the volume will be rendered.
See also
positionAbsolute
- Access functions:
position
()setPosition
(position)Signal
positionChanged
(position)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.positionAbsolute: bool#
This property holds Whether item position is to be handled in data coordinates or in absolute coordinates..
Defaults to false
. Items with absolute coordinates will always be rendered, whereas items with data coordinates are only rendered if they are within axis ranges.
See also
- Access functions:
setPositionAbsolute
(positionAbsolute)Signal
positionAbsoluteChanged
(positionAbsolute)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.rotation: PySide6.QtGui.QQuaternion#
This property holds The item rotation as a QQuaternion
..
Defaults to QQuaternion(0.0, 0.0, 0.0, 0.0)
.
- Access functions:
rotation
()setRotation
(rotation)Signal
rotationChanged
(rotation)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.scaling: PySide6.QtGui.QVector3D#
This property holds The item scaling as a QVector3D
..
Defaults to QVector3D(0.1, 0.1, 0.1)
.
Item scaling is either in data values or in absolute values, depending on the scalingAbsolute
property. The default vector interpreted as absolute values sets the item to 10% of the height of the graph, provided the item mesh is normalized and the graph aspect ratios have not been changed from the defaults.
See also
scalingAbsolute
- Access functions:
scaling
()setScaling
(scaling)Signal
scalingChanged
(scaling)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.scalingAbsolute: bool#
This property holds Whether item scaling is to be handled in data values or in absolute values..
Defaults to true
.
Items with absolute scaling will be rendered at the same size, regardless of axis ranges. Items with data scaling will change their apparent size according to the axis ranges. If positionAbsolute
is true
, this property is ignored and scaling is interpreted as an absolute value. If the item has rotation, the data scaling is calculated on the unrotated item. Similarly, for QCustom3DVolume
items, the range clipping is calculated on the unrotated item.
Note
Only absolute scaling is supported for QCustom3DLabel
items or for custom items used in polar
graphs.
Note
The custom item’s mesh must be normalized to the range [-1 ,1]
, or the data scaling will not be accurate.
See also
scaling
positionAbsolute
- Access functions:
setScalingAbsolute
(scalingAbsolute)Signal
scalingAbsoluteChanged
(scalingAbsolute)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.shadowCasting: bool#
This property holds Whether shadow casting for the item is enabled..
Defaults to true
. If false
, the item does not cast shadows regardless of ShadowQuality
.
- Access functions:
setShadowCasting
(enabled)Signal
shadowCastingChanged
(shadowCasting)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.textureFile: str#
This property holds The texture file name for the item..
If both this property and the texture image are unset, a solid gray texture will be used.
Note
To conserve memory, the QImage
loaded from the file is cleared after a texture is created.
- Access functions:
textureFile
()setTextureFile
(textureFile)Signal
textureFileChanged
(textureFile)
- property PᅟySide6.QtDataVisualization.QCustom3DItem.visible: bool#
This property holds The visibility of the item..
Defaults to true
.
- Access functions:
isVisible
()setVisible
(visible)Signal
visibleChanged
(visible)
- PySide6.QtDataVisualization.QCustom3DItem.isPositionAbsolute()#
- Return type:
bool
Getter of property positionAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.isScalingAbsolute()#
- Return type:
bool
Getter of property scalingAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.isShadowCasting()#
- Return type:
bool
Getter of property shadowCasting
.
- PySide6.QtDataVisualization.QCustom3DItem.isVisible()#
- Return type:
bool
Getter of property visible
.
- PySide6.QtDataVisualization.QCustom3DItem.meshFile()#
- Return type:
str
See also
Getter of property meshFile
.
- PySide6.QtDataVisualization.QCustom3DItem.meshFileChanged(meshFile)#
- Parameters:
meshFile – str
Notification signal of property meshFile
.
- PySide6.QtDataVisualization.QCustom3DItem.position()#
- Return type:
See also
Getter of property position
.
- PySide6.QtDataVisualization.QCustom3DItem.positionAbsoluteChanged(positionAbsolute)#
- Parameters:
positionAbsolute – bool
Notification signal of property positionAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.positionChanged(position)#
- Parameters:
position –
PySide6.QtGui.QVector3D
Notification signal of property position
.
- PySide6.QtDataVisualization.QCustom3DItem.rotation()#
- Return type:
See also
Getter of property rotation
.
- PySide6.QtDataVisualization.QCustom3DItem.rotationChanged(rotation)#
- Parameters:
rotation –
PySide6.QtGui.QQuaternion
Notification signal of property rotation
.
- PySide6.QtDataVisualization.QCustom3DItem.scaling()#
- Return type:
See also
Getter of property scaling
.
- PySide6.QtDataVisualization.QCustom3DItem.scalingAbsoluteChanged(scalingAbsolute)#
- Parameters:
scalingAbsolute – bool
Notification signal of property scalingAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.scalingChanged(scaling)#
- Parameters:
scaling –
PySide6.QtGui.QVector3D
Notification signal of property scaling
.
- PySide6.QtDataVisualization.QCustom3DItem.setMeshFile(meshFile)#
- Parameters:
meshFile – str
See also
Setter of property meshFile
.
- PySide6.QtDataVisualization.QCustom3DItem.setPosition(position)#
- Parameters:
position –
PySide6.QtGui.QVector3D
See also
Setter of property position
.
- PySide6.QtDataVisualization.QCustom3DItem.setPositionAbsolute(positionAbsolute)#
- Parameters:
positionAbsolute – bool
See also
Setter of property positionAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.setRotation(rotation)#
- Parameters:
rotation –
PySide6.QtGui.QQuaternion
See also
Setter of property rotation
.
- PySide6.QtDataVisualization.QCustom3DItem.setRotationAxisAndAngle(axis, angle)#
- Parameters:
axis –
PySide6.QtGui.QVector3D
angle – float
A convenience function to construct the rotation quaternion from axis
and angle
.
See also
- PySide6.QtDataVisualization.QCustom3DItem.setScaling(scaling)#
- Parameters:
scaling –
PySide6.QtGui.QVector3D
See also
Setter of property scaling
.
- PySide6.QtDataVisualization.QCustom3DItem.setScalingAbsolute(scalingAbsolute)#
- Parameters:
scalingAbsolute – bool
See also
Setter of property scalingAbsolute
.
- PySide6.QtDataVisualization.QCustom3DItem.setShadowCasting(enabled)#
- Parameters:
enabled – bool
See also
Setter of property shadowCasting
.
- PySide6.QtDataVisualization.QCustom3DItem.setTextureFile(textureFile)#
- Parameters:
textureFile – str
See also
Setter of property textureFile
.
- PySide6.QtDataVisualization.QCustom3DItem.setTextureImage(textureImage)#
- Parameters:
textureImage –
PySide6.QtGui.QImage
Sets the value of textureImage
as a QImage
for the item. The texture defaults to solid gray.
Note
To conserve memory, the given QImage
is cleared after a texture is created.
- PySide6.QtDataVisualization.QCustom3DItem.setVisible(visible)#
- Parameters:
visible – bool
See also
Setter of property visible
.
- PySide6.QtDataVisualization.QCustom3DItem.shadowCastingChanged(shadowCasting)#
- Parameters:
shadowCasting – bool
Notification signal of property shadowCasting
.
- PySide6.QtDataVisualization.QCustom3DItem.textureFile()#
- Return type:
str
See also
Getter of property textureFile
.
- PySide6.QtDataVisualization.QCustom3DItem.textureFileChanged(textureFile)#
- Parameters:
textureFile – str
Notification signal of property textureFile
.
- PySide6.QtDataVisualization.QCustom3DItem.visibleChanged(visible)#
- Parameters:
visible – bool
Notification signal of property visible
.