- class QAspectEngine¶
Responsible for handling all the
QAbstractAspect
subclasses that have been registered with the scene. More…Synopsis¶
Methods¶
def
__init__()
def
aspect()
def
aspects()
def
executeCommand()
def
lookupNode()
def
lookupNodes()
def
processFrame()
def
registerAspect()
def
rootEntity()
def
runMode()
def
setRootEntity()
def
setRunMode()
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 Qt3D run loop is controlled by the Qt3DRender::QAspectEngine.
QAbstractAspect
subclasses can be registered by calling Qt3DCore::QAspectEngine::registerAspect() which will take care of registering the aspect and in turn that will call Qt3DCore::QAbstractAspect::onRegistered();The simulation loop is launched as soon as a root
QEntity
is set on theQAspectEngine
. This is followed by a call to onEngineStartup() on each aspect so that they can start their simulation work.The simulation loop is stopped when the root entity is set to Qt3DCore::QEntityPtr(). This calls onEngineShutdown() on each aspect so that they can stop performing their simulation work.
Setting a new valid root entity would restart the simulation loop again.
- class RunMode¶
Constructs a new
QAspectEngine
withparent
.- aspect(name)¶
- Parameters:
name – str
- Return type:
QAbstractAspect
Returns the asepect matching the
name
Note
Required that the aspect was registered by name
- aspects()¶
- Return type:
.list of Qt3DCore.QAbstractAspect
Returns the aspects owned by the aspect engine.
- executeCommand(command)¶
- Parameters:
command – str
- Return type:
object
Executes the given
command
on aspect engine. Valid commands are:“list aspects”
Returns the reply for the command.
- lookupNode(id)¶
- Parameters:
id –
QNodeId
- Return type:
QNode
- lookupNodes(ids)¶
- Parameters:
ids – .list of Qt3DCore.QNodeId
- Return type:
.list of Qt3DCore.QNode
- processFrame()¶
If using the manual run mode, this function executes the jobs for each aspect. It is blocking and won’t return until all jobs have been completed.
If you are using the QRenderAspect,
- registerAspect(aspect)¶
- Parameters:
aspect –
QAbstractAspect
Registers a new
aspect
to the AspectManager. TheQAspectEngine
takes ownership of the aspect and will delete it when the aspect is unregistered.- registerAspect(name)
- Parameters:
name – str
Registers a new aspect to the AspectManager based on its
name
Uses the currently set aspect factory to create the actual aspect instance.- rootEntity()¶
- Return type:
QSharedPointer
Returns the root entity of the aspect engine.
See also
setRootEntity()
- runMode()¶
- Return type:
RunMode
- setRootEntity(root)¶
- Parameters:
root –
QSharedPointer
Sets the
root
entity for the aspect engine.See also
rootEntity()
- setRunMode(mode)¶
- Parameters:
mode –
RunMode
- unregisterAspect(aspect)¶
- Parameters:
aspect –
QAbstractAspect
Unregisters and deletes the given
aspect
.- unregisterAspect(name)
- Parameters:
name – str
Unregisters and deletes the aspect with the given
name
.