载入中...
搜索中...
未找到
ScenePanel.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "ui/Widget.h"
5
6#include <functional>
7#include <string>
8#include <vector>
9
10namespace eve {
11struct SceneNodeInfo;
12} // namespace eve
13
14namespace eve::ui {
15
16class UIHost;
17
28public:
29 ScenePanel() = default;
31 ScenePanel(const ScenePanel&) = delete;
32 ScenePanel& operator=(const ScenePanel&) = delete;
33
35 void open();
37 void close();
39 bool isOpen() const;
41 UIHost* host() const { return host_; }
42
44 void refresh();
46 bool selectNode(const std::string& id);
48 const std::string& selectedNode() const { return selectedId_; }
53 void setPickHandler(std::function<void(const std::string&)> handler);
54
56 WidgetDesc build();
57
58private:
59 WidgetDesc nodeTree(const eve::SceneNodeInfo& node,
60 const std::vector<eve::SceneNodeInfo>& all);
61 void rebuildHost();
62
63 UIHost* host_ = nullptr;
64 std::string selectedId_;
65 std::function<void(const std::string&)> pickHandler_;
66};
67
68} // namespace eve::ui
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
Scene hierarchy panel (DevTools, MVVM).
Definition ScenePanel.h:27
ScenePanel & operator=(const ScenePanel &)=delete
UIHost * host() const
The mounted host (nullptr until open()); for embedding/tests.
Definition ScenePanel.h:41
const std::string & selectedNode() const
Id of the selected node ("" when none).
Definition ScenePanel.h:48
ScenePanel(const ScenePanel &)=delete
ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e....
Definition UIHost.h:130
Definition Build.cpp:11
Serializable snapshot of one scene node (value type, no scene types).
Definition SceneQuery.h:17
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:13