载入中...
搜索中...
未找到
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:
30 ScenePanel() = default;
33 ScenePanel(const ScenePanel&) = delete;
34 ScenePanel& operator=(const ScenePanel&) = delete;
35
37 void open();
39 void close();
41 bool isOpen() const;
43 [[nodiscard]] UIHostHandle host() const noexcept { return host_; }
44
46 void refresh();
48 bool selectNode(const std::string& id);
50 const std::string& selectedNode() const { return selectedId_; }
55 void setPickHandler(std::function<void(const std::string&)> handler);
56
58 WidgetDesc build();
59
60private:
61 WidgetDesc nodeTree(const eve::SceneNodeInfo& node,
62 const std::vector<eve::SceneNodeInfo>& all);
63 void rebuildHost();
64
65 UIHostHandle host_{};
66 std::string selectedId_;
67 std::function<void(const std::string&)> pickHandler_;
68};
69
70} // namespace eve::ui
#define EVENGINE_API_WORLD
Definition Export.h:109
HSQOBJECT handler
const RoadNode * node
Scene hierarchy panel (DevTools, MVVM).
Definition ScenePanel.h:27
UIHostHandle host() const noexcept
Returns the mounted scene host handle, or an empty handle until open().
Definition ScenePanel.h:43
ScenePanel & operator=(const ScenePanel &)=delete
ScenePanel()=default
Scene panel.
const std::string & selectedNode() const
Id of the selected node ("" when none).
Definition ScenePanel.h:50
ScenePanel(const ScenePanel &)=delete
ecs::EntityHandle UIHostHandle
Definition UIHost.h:16
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
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:15