React-style scene component: implement build(), call setState / markDirty, then rebuild(). Mounts onto a named SceneHost via mountAs / attach. Isomorphic to eve::ui::Component. 更多...
#include <SceneComponent.h>
Public 成员函数 | |
| virtual | ~SceneComponent ()=default |
| virtual NodeDesc | build ()=0 |
| virtual void | onMount (SceneHost *host) |
| Called once when the component is attached to a host. | |
| void | attach (SceneHost *host) |
| void | mountAs (const std::string &hostName) |
| SceneHost * | host () const |
| void | rebuild (bool forceFull=false) |
| Rebuild tree onto host (reconcile by key when possible). | |
| void | markDirty () |
| bool | isDirty () const |
| bool | updateIfDirty () |
| If dirty, rebuild and clear flag. Returns true if rebuilt. | |
Protected 成员函数 | |
| void | setState () |
| Subclasses call after mutating local state that affects build(). | |
详细描述
React-style scene component: implement build(), call setState / markDirty, then rebuild(). Mounts onto a named SceneHost via mountAs / attach. Isomorphic to eve::ui::Component.
在文件 SceneComponent.h 第 15 行定义.
构造及析构函数说明
◆ ~SceneComponent()
|
virtualdefault |
成员函数说明
◆ attach()
| void eve::scene::SceneComponent::attach | ( | SceneHost * | host | ) |
◆ build()
◆ host()
|
inline |
在文件 SceneComponent.h 第 26 行定义.
被这些函数引用 attach().
◆ isDirty()
|
inline |
在文件 SceneComponent.h 第 32 行定义.
◆ markDirty()
|
inline |
在文件 SceneComponent.h 第 31 行定义.
◆ mountAs()
| void eve::scene::SceneComponent::mountAs | ( | const std::string & | hostName | ) |
在文件 SceneComponent.cpp 第 16 行定义.
引用了 attach(), eve::scene::SceneHost::createHost(), h , 以及 rebuild().
◆ onMount()
|
inlinevirtual |
Called once when the component is attached to a host.
在文件 SceneComponent.h 第 22 行定义.
被这些函数引用 attach().
◆ rebuild()
| void eve::scene::SceneComponent::rebuild | ( | bool | forceFull = false | ) |
Rebuild tree onto host (reconcile by key when possible).
在文件 SceneComponent.cpp 第 23 行定义.
引用了 build(), eve::scene::SceneHost::setTree(), eve::scene::SceneHost::setTreeReconcile() , 以及 eve::scene::TransformSystem::updateHost().
被这些函数引用 mountAs() , 以及 updateIfDirty().
◆ setState()
|
inlineprotected |
Subclasses call after mutating local state that affects build().
在文件 SceneComponent.h 第 39 行定义.
◆ updateIfDirty()
| bool eve::scene::SceneComponent::updateIfDirty | ( | ) |
If dirty, rebuild and clear flag. Returns true if rebuilt.
在文件 SceneComponent.cpp 第 32 行定义.
引用了 rebuild().
该类的文档由以下文件生成:
- src/modules/scene/SceneComponent.h
- src/modules/scene/SceneComponent.cpp