QAspectEngine Class
(Qt3DCore::QAspectEngine)Responsible for handling all the QAbstractAspect subclasses that have been registered with the scene. 更多...
头文件: | #include <Qt3DCore/QAspectEngine> |
qmake: | QT += 3dcore |
基类: | QObject |
公有函数
QAspectEngine(QObject *parent = nullptr) | |
~QAspectEngine() | |
QVector<QAbstractAspect *> | aspects() const |
QVariant | executeCommand(const QString &command) |
void | registerAspect(QAbstractAspect *aspect) |
void | registerAspect(const QString &name) |
QEntityPtr | rootEntity() const |
void | setRootEntity(QEntityPtr root) |
void | unregisterAspect(QAbstractAspect *aspect) |
void | unregisterAspect(const QString &name) |
- 32 个公有函数继承自 QObject
相关非成员
typedef | QEntityPtr |
其他继承的成员
- 1 个属性继承自 QObject
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
Responsible for handling all the QAbstractAspect subclasses that have been registered with the scene.
The Qt3D run loop is controlled by the Qt3DRender::QAspectEngine.
Qt3DCore::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 Qt3DCore::QEntity is set on the Qt3DCore::QAspectEngine. 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.
成员函数
QAspectEngine::QAspectEngine(QObject *parent = nullptr)
Constructs a new QAspectEngine with parent.
QAspectEngine::~QAspectEngine()
Destroys the engine.
QVector<QAbstractAspect *> QAspectEngine::aspects() const
Returns the aspects owned by the aspect engine.
QVariant QAspectEngine::executeCommand(const QString &command)
Executes the given command on aspect engine. Valid commands are:
- "list aspects"
Returns the reply for the command.
void QAspectEngine::registerAspect(QAbstractAspect *aspect)
Registers a new aspect to the AspectManager. The QAspectEngine takes ownership of the aspect and will delete it when the aspect is unregistered.
void QAspectEngine::registerAspect(const QString &name)
Registers a new aspect to the AspectManager based on its name Uses the currently set aspect factory to create the actual aspect instance.
QEntityPtr QAspectEngine::rootEntity() const
Returns the root entity of the aspect engine.
参见 setRootEntity().
void QAspectEngine::setRootEntity(QEntityPtr root)
Sets the root entity for the aspect engine.
参见 rootEntity().
void QAspectEngine::unregisterAspect(QAbstractAspect *aspect)
Unregisters and deletes the given aspect.
void QAspectEngine::unregisterAspect(const QString &name)
Unregisters and deletes the aspect with the given name.