载入中...
搜索中...
未找到
SceneQuery.h
浏览该文件的文档.
1#pragma once
2
3// Capability interface: scene inspection for devtools / MCP.
4//
5// Scene is an optional module. DevTools must not include scene headers, so the
6// scene module registers an implementation of this interface and devtools
7// queries it (nullptr when the module was trimmed out).
8
9#include "common/Export.h"
10#include "common/Result.h"
11
12#include <string>
13#include <vector>
14
15namespace eve {
16
19 std::string id;
20 std::string name;
21 std::string path;
22 bool visible = true;
23 float x = 0.f, y = 0.f, z = 0.f;
24 float yaw = 0.f, pitch = 0.f, roll = 0.f;
25 float sx = 1.f, sy = 1.f, sz = 1.f;
26 std::string parent;
27 std::vector<std::string> children;
28};
29
32public:
33 static constexpr const char* capabilityName = "ISceneQuery";
34
36 virtual ~ISceneQuery() = default;
37
39 virtual std::string activeHost() const = 0;
41 virtual int hostCount() const = 0;
43 virtual std::string hostNameAt(int index) const = 0;
44
46 virtual int nodeCount() const = 0;
48 virtual std::string rootId() const = 0;
50 virtual std::vector<SceneNodeInfo> nodes(int limit) const = 0;
52 virtual std::vector<SceneNodeInfo> nodesOf(const std::string& host, int limit) const = 0;
57 [[nodiscard]] virtual Result<SceneNodeInfo> getNode(const std::string& id) const = 0;
62 [[nodiscard]] virtual Result<SceneNodeInfo> getNodeIn(const std::string& host, const std::string& id) const = 0;
63
68 [[nodiscard]] virtual Result<void> setNodeTransform(const std::string& id, float x, float y, float z) = 0;
73 [[nodiscard]] virtual Result<void> setNodeVisible(const std::string& id, bool visible) = 0;
75 virtual void syncTransforms() = 0;
76};
77
78} // namespace eve
double z
double y
double x
float yaw
Definition BushMesh.cpp:37
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Move-only, checked operation results for the common layer.
bool visible
int limit
Definition TreeMesh.cpp:166
UIHostHandle host
uint32_t index
Scene graph query/mutation surface (provided by the scene module).
Definition SceneQuery.h:31
virtual ~ISceneQuery()=default
I scene query.
virtual Result< void > setNodeVisible(const std::string &id, bool visible)=0
Show/hide a node in the active host.
virtual void syncTransforms()=0
Propagate local transforms -> world for every host.
virtual std::string hostNameAt(int index) const =0
Name of the host at index.
virtual Result< SceneNodeInfo > getNode(const std::string &id) const =0
Look up one node in the active host.
virtual Result< SceneNodeInfo > getNodeIn(const std::string &host, const std::string &id) const =0
Look up one node in a named host.
virtual std::string activeHost() const =0
Name of the currently selected host, or "" when none.
virtual int hostCount() const =0
Number of mounted hosts.
virtual std::vector< SceneNodeInfo > nodes(int limit) const =0
Depth-first node list of the active host, capped at limit.
virtual std::string rootId() const =0
Root node id of the active host, or "".
virtual Result< void > setNodeTransform(const std::string &id, float x, float y, float z)=0
Mutate the active host's node transform (marks subtree dirty).
virtual std::vector< SceneNodeInfo > nodesOf(const std::string &host, int limit) const =0
Node list of a named host, capped at limit.
virtual int nodeCount() const =0
Node count of the active host (0 when none).
Move-only operation result carrying either a value or Status.
Definition Result.h:176
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:18
std::vector< std::string > children
Definition SceneQuery.h:27
std::string path
Definition SceneQuery.h:21
std::string parent
Definition SceneQuery.h:26
std::string id
Definition SceneQuery.h:19
std::string name
Definition SceneQuery.h:20