- class 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
Methods¶
def
__init__()
def
isVisible()
def
meshFile()
def
position()
def
rotation()
def
scaling()
def
setMeshFile()
def
setPosition()
def
setRotation()
def
setScaling()
def
setTextureFile()
def
setVisible()
def
textureFile()
Signals¶
def
needUpdate()
def
scalingChanged()
def
visibleChanged()
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
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property meshFileᅟ: str¶
This property holds The item mesh file name..
The item in the file must be in mesh format. The other types can be converted by Balsam asset import tool. The mesh files are recommended to include vertices, normals, and UVs.
- Access functions:
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
isfalse
, unless the item is aQCustom3DVolume
that would be partially visible andscalingAbsolute
is alsofalse
. In that case, the visible portion of the volume will be rendered.See also
positionAbsolute
- Access functions:
- property 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:
- property rotationᅟ: QQuaternion¶
This property holds The item rotation as a QQuaternion..
Defaults to
QQuaternion(0.0, 0.0, 0.0, 0.0)
.- Access functions:
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:
- property 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
istrue
, 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, forQCustom3DVolume
items, the range clipping is calculated on the unrotated item.Note
Only absolute scaling is supported for
QCustom3DLabel
items or for custom items used inpolar
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:
- property shadowCastingᅟ: bool¶
This property holds Whether shadow casting for the item is enabled..
Defaults to
true
. Iffalse
, the item does not cast shadows regardless of Q3DGraphsWidgetItem::ShadowQuality.- Access functions:
- property 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:
- property visibleᅟ: bool¶
This property holds The visibility of the item..
Defaults to
true
.- Access functions:
Constructs a custom 3D item with the specified
parent
.- __init__(meshFile, position, scaling, rotation, texture[, parent=None])
- Parameters:
meshFile – str
position –
QVector3D
scaling –
QVector3D
rotation –
QQuaternion
texture –
QImage
parent –
QObject
Constructs a custom 3D item with the specified
meshFile
,position
,scaling
,rotation
,texture
image, and optionalparent
.- isPositionAbsolute()¶
- Return type:
bool
Getter of property
positionAbsoluteᅟ
.- isScalingAbsolute()¶
- Return type:
bool
Getter of property
scalingAbsoluteᅟ
.- isShadowCasting()¶
- Return type:
bool
Getter of property
shadowCastingᅟ
.- isVisible()¶
- Return type:
bool
Getter of property
visibleᅟ
.- meshFile()¶
- Return type:
str
See also
Getter of property
meshFileᅟ
.- meshFileChanged(meshFile)¶
- Parameters:
meshFile – str
Notification signal of property
meshFileᅟ
.- needUpdate()¶
- position()¶
- Return type:
See also
Getter of property
positionᅟ
.- positionAbsoluteChanged(positionAbsolute)¶
- Parameters:
positionAbsolute – bool
Notification signal of property
positionAbsoluteᅟ
.Notification signal of property
positionᅟ
.- rotation()¶
- Return type:
See also
Getter of property
rotationᅟ
.- rotationChanged(rotation)¶
- Parameters:
rotation –
QQuaternion
Notification signal of property
rotationᅟ
.- scaling()¶
- Return type:
See also
Getter of property
scalingᅟ
.- scalingAbsoluteChanged(scalingAbsolute)¶
- Parameters:
scalingAbsolute – bool
Notification signal of property
scalingAbsoluteᅟ
.Notification signal of property
scalingᅟ
.- setMeshFile(meshFile)¶
- Parameters:
meshFile – str
See also
Setter of property
meshFileᅟ
.Setter of property
positionᅟ
.- setPositionAbsolute(positionAbsolute)¶
- Parameters:
positionAbsolute – bool
See also
Setter of property
positionAbsoluteᅟ
.- setRotation(rotation)¶
- Parameters:
rotation –
QQuaternion
See also
Setter of property
rotationᅟ
.A convenience function to construct the rotation quaternion from
axis
andangle
.See also
Setter of property
scalingᅟ
.- setScalingAbsolute(scalingAbsolute)¶
- Parameters:
scalingAbsolute – bool
See also
Setter of property
scalingAbsoluteᅟ
.- setShadowCasting(enabled)¶
- Parameters:
enabled – bool
See also
Setter of property
shadowCastingᅟ
.- setTextureFile(textureFile)¶
- Parameters:
textureFile – str
See also
Setter of property
textureFileᅟ
.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.
- setVisible(visible)¶
- Parameters:
visible – bool
See also
Setter of property
visibleᅟ
.- shadowCastingChanged(shadowCasting)¶
- Parameters:
shadowCasting – bool
Notification signal of property
shadowCastingᅟ
.- textureFile()¶
- Return type:
str
See also
Getter of property
textureFileᅟ
.- textureFileChanged(textureFile)¶
- Parameters:
textureFile – str
Notification signal of property
textureFileᅟ
.- visibleChanged(visible)¶
- Parameters:
visible – bool
Notification signal of property
visibleᅟ
.