Composable scene command/history host with no UI or renderer dependency. Owns its target, command registry and history. Host supplies selection, input, rendering and file I/O; snapshot JSON contains hierarchy/TRS only. @thread Owner thread only. Live targets may notify host observers after publication, without locks. Observers must not destroy or reenter the active session. 更多...
#include <SceneEditorSession.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| SceneEditorSession (std::string targetId) | |
| Own a document target with a nonempty host-local identity. | |
| SceneEditorSession (std::unique_ptr< scene_editing::SceneTargetBase > target) | |
| Transfer a non-null scene target into this session; target ownership is exclusive. | |
| ~SceneEditorSession () | |
| Scene editor session. | |
| SceneEditorSession (const SceneEditorSession &)=delete | |
| SceneEditorSession & | operator= (const SceneEditorSession &)=delete |
| editing::Result< editing::TransactionReceipt > | execute (std::string command, editing::Value payload) |
| Execute a registered scene command through revision checks and one reversible transaction. | |
| editing::Result< void > | restrictCommands (const std::vector< std::string > &commands) |
| Restrict future commands to a host allow-list; empty denies all. Existing history remains undoable. | |
| editing::Result< editing::TransactionReceipt > | undo () |
| Undo the last scene transaction; failures preserve history. | |
| editing::Result< editing::TransactionReceipt > | redo () |
| Reapply the last undone scene transaction. | |
| editing::Value | snapshot () const |
| Copy the versioned hierarchy/TRS snapshot; caller owns the returned tree. | |
| std::string | saveJson () const |
| Encode snapshot deterministically; file I/O and paths belong to the host. | |
| editing::Result< editing::TransactionReceipt > | restoreJson (const std::string &json) |
| Parse and restore schema-1 JSON as an undoable transaction; invalid input changes nothing. | |
| editing::Revision | revision () const |
| Return the current monotonic target revision. | |
| editing::Result< void > | cachePhysicsPlacementHull (const editing::ObjectId &object, std::vector< float > vertices, int maxVertices=64) |
| Cache backend-neutral local-space mesh points for later automatic convex placement. | |
| editing::Result< void > | cachePhysicsPlacementCompound (const editing::ObjectId &object, std::string resourceKey, std::vector< PhysicsPlacementCollider > colliders) |
| Replace one object's generated compound collider cache entry. | |
| editing::Result< void > | removePhysicsPlacementHull (const editing::ObjectId &object) |
| Remove one cached automatic placement hull; missing entries return NoOp. | |
| std::string | savePhysicsPlacementColliderCacheJson () const |
| Encode schema-2 generated collider cache; host owns file I/O and the returned string. | |
| editing::Result< void > | restorePhysicsPlacementColliderCacheJson (const std::string &json) |
| Atomically replace generated collider cache from schema-2 JSON. | |
| editing::Result< void > | beginPhysicsPlacement (PhysicsPlacementRequest request) |
| Begin an isolated Box3D placement preview using current scene transforms. | |
| editing::Result< PhysicsPlacementFrame > | updatePhysicsPlacement (double x, double y, double z, double fixedDelta=1.0/60.0) |
| Move the preview handle and advance one fixed simulation step. | |
| editing::Result< PhysicsPlacementFrame > | updatePhysicsPlacementPose (double x, double y, double z, double rotationX, double rotationY, double rotationZ, double fixedDelta=1.0/60.0) |
| Move and rotate the preview handle, then advance one fixed simulation step. | |
| editing::Result< PhysicsPlacementFrame > | updatePhysicsPlacementTransform (double x, double y, double z, double rotationX, double rotationY, double rotationZ, double scaleX, double scaleY, double scaleZ, double fixedDelta=1.0/60.0) |
| Move, rotate and scale the preview handle, then advance one fixed simulation step. | |
| editing::Result< PhysicsPlacementFrame > | alignPhysicsPlacementToSurface (double fromX, double fromY, double fromZ, double toX, double toY, double toZ, double offset=0.0, double fixedDelta=1.0/60.0) |
| Align the active selection to a non-selected preview surface and advance one step. | |
| editing::Result< editing::TransactionReceipt > | commitPhysicsPlacement () |
| Atomically publish selected preview transforms as one undoable transaction. | |
| editing::Result< void > | cancelPhysicsPlacement () |
| Discard the isolated preview without changing scene state. | |
| bool | physicsPlacementActive () const noexcept |
| Report whether this session owns an active placement preview. | |
详细描述
Composable scene command/history host with no UI or renderer dependency. Owns its target, command registry and history. Host supplies selection, input, rendering and file I/O; snapshot JSON contains hierarchy/TRS only. @thread Owner thread only. Live targets may notify host observers after publication, without locks. Observers must not destroy or reenter the active session.
在文件 SceneEditorSession.h 第 24 行定义.
构造及析构函数说明
◆ SceneEditorSession() [1/3]
|
explicit |
Own a document target with a nonempty host-local identity.
在文件 SceneEditorSession.cpp 第 290 行定义.
◆ SceneEditorSession() [2/3]
|
explicit |
Transfer a non-null scene target into this session; target ownership is exclusive.
在文件 SceneEditorSession.cpp 第 292 行定义.
◆ ~SceneEditorSession()
|
default |
Scene editor session.
◆ SceneEditorSession() [3/3]
|
delete |
成员函数说明
◆ alignPhysicsPlacementToSurface()
| editing::Result< PhysicsPlacementFrame > eve::scene_editor::SceneEditorSession::alignPhysicsPlacementToSurface | ( | double | fromX, |
| double | fromY, | ||
| double | fromZ, | ||
| double | toX, | ||
| double | toY, | ||
| double | toZ, | ||
| double | offset = 0.0, |
||
| double | fixedDelta = 1.0 / 60.0 |
||
| ) |
Align the active selection to a non-selected preview surface and advance one step.
在文件 SceneEditorSession.cpp 第 539 行定义.
引用了 eve::Result< T >::failure() , 以及 offset.
◆ beginPhysicsPlacement()
| editing::Result< void > eve::scene_editor::SceneEditorSession::beginPhysicsPlacement | ( | PhysicsPlacementRequest | request | ) |
Begin an isolated Box3D placement preview using current scene transforms.
在文件 SceneEditorSession.cpp 第 449 行定义.
引用了 eve::scene_editor::Auto, eve::scene_editor::Box, eve::scene_editor::ScenePhysicsPlacementBackend::create(), created, eve::Result< T >::failure(), found, graph, request, shape, value, visiting , 以及 world.
◆ cachePhysicsPlacementCompound()
| editing::Result< void > eve::scene_editor::SceneEditorSession::cachePhysicsPlacementCompound | ( | const editing::ObjectId & | object, |
| std::string | resourceKey, | ||
| std::vector< PhysicsPlacementCollider > | colliders | ||
| ) |
Replace one object's generated compound collider cache entry.
- 参数
-
object Stable scene object identity. resourceKey Host-owned immutable mesh/content revision used for stale detection.
- 参数
-
colliders One or more generated local-space convex or primitive parts; copied by the session.
在文件 SceneEditorSession.cpp 第 346 行定义.
引用了 eve::scene_editor::Auto, eve::scene_editor::ConvexHull, eve::scene_editor::Generated , 以及 value.
被这些函数引用 cachePhysicsPlacementHull() , 以及 eve::scene_editor::exposeSceneEditorSessions().
◆ cachePhysicsPlacementHull()
| editing::Result< void > eve::scene_editor::SceneEditorSession::cachePhysicsPlacementHull | ( | const editing::ObjectId & | object, |
| std::vector< float > | vertices, | ||
| int | maxVertices = 64 |
||
| ) |
Cache backend-neutral local-space mesh points for later automatic convex placement.
- 参数
-
object Stable scene object identity; the session owns a copy of the points. vertices At least four packed finite XYZ points. maxVertices Convex hull simplification budget in [4, 254].
- 返回
- Applied, or Rejected without changing the previous cached entry.
在文件 SceneEditorSession.cpp 第 330 行定义.
引用了 cachePhysicsPlacementCompound(), eve::scene_editor::ConvexHull, eve::scene_editor::PhysicsPlacementCollider::convexMaxVertices, eve::scene_editor::PhysicsPlacementCollider::convexVertices, eve::scene_editor::PhysicsPlacementCollider::shape, value , 以及 vertices.
◆ cancelPhysicsPlacement()
| editing::Result< void > eve::scene_editor::SceneEditorSession::cancelPhysicsPlacement | ( | ) |
Discard the isolated preview without changing scene state.
在文件 SceneEditorSession.cpp 第 610 行定义.
◆ commitPhysicsPlacement()
| editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::commitPhysicsPlacement | ( | ) |
Atomically publish selected preview transforms as one undoable transaction.
在文件 SceneEditorSession.cpp 第 554 行定义.
引用了 execute(), eve::Result< T >::failure(), local , 以及 value.
◆ execute()
| editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::execute | ( | std::string | command, |
| editing::Value | payload | ||
| ) |
Execute a registered scene command through revision checks and one reversible transaction.
在文件 SceneEditorSession.cpp 第 296 行定义.
引用了 eve::Result< T >::failure(), eve::editing::CommandRequest::id, payload , 以及 request.
被这些函数引用 commitPhysicsPlacement(), eve::scene_editor::exposeSceneEditorSessions() , 以及 restoreJson().
◆ operator=()
|
delete |
◆ physicsPlacementActive()
|
noexcept |
Report whether this session owns an active placement preview.
在文件 SceneEditorSession.cpp 第 621 行定义.
◆ redo()
| editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::redo | ( | ) |
Reapply the last undone scene transaction.
在文件 SceneEditorSession.cpp 第 323 行定义.
◆ removePhysicsPlacementHull()
| editing::Result< void > eve::scene_editor::SceneEditorSession::removePhysicsPlacementHull | ( | const editing::ObjectId & | object | ) |
Remove one cached automatic placement hull; missing entries return NoOp.
在文件 SceneEditorSession.cpp 第 375 行定义.
◆ restoreJson()
| editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::restoreJson | ( | const std::string & | json | ) |
Parse and restore schema-1 JSON as an undoable transaction; invalid input changes nothing.
在文件 SceneEditorSession.cpp 第 622 行定义.
引用了 eve::editing::editorValueFromJson(), execute(), eve::Result< T >::failure() , 以及 value.
◆ restorePhysicsPlacementColliderCacheJson()
| editing::Result< void > eve::scene_editor::SceneEditorSession::restorePhysicsPlacementColliderCacheJson | ( | const std::string & | json | ) |
Atomically replace generated collider cache from schema-2 JSON.
在文件 SceneEditorSession.cpp 第 411 行定义.
引用了 eve::editing::editorValueFromJson(), entries, eve::Result< T >::failure(), key, object , 以及 value.
◆ restrictCommands()
| editing::Result< void > eve::scene_editor::SceneEditorSession::restrictCommands | ( | const std::vector< std::string > & | commands | ) |
Restrict future commands to a host allow-list; empty denies all. Existing history remains undoable.
在文件 SceneEditorSession.cpp 第 309 行定义.
引用了 commands , 以及 eve::editor::HostProfile::runtimeBuilder().
◆ revision()
| editing::Revision eve::scene_editor::SceneEditorSession::revision | ( | ) | const |
Return the current monotonic target revision.
在文件 SceneEditorSession.cpp 第 328 行定义.
◆ saveJson()
| std::string eve::scene_editor::SceneEditorSession::saveJson | ( | ) | const |
Encode snapshot deterministically; file I/O and paths belong to the host.
在文件 SceneEditorSession.cpp 第 327 行定义.
引用了 eve::editing::editorValueToJson() , 以及 snapshot().
◆ savePhysicsPlacementColliderCacheJson()
| std::string eve::scene_editor::SceneEditorSession::savePhysicsPlacementColliderCacheJson | ( | ) | const |
Encode schema-2 generated collider cache; host owns file I/O and the returned string.
在文件 SceneEditorSession.cpp 第 387 行定义.
引用了 eve::editing::editorValueToJson() , 以及 entries.
◆ snapshot()
| editing::Value eve::scene_editor::SceneEditorSession::snapshot | ( | ) | const |
Copy the versioned hierarchy/TRS snapshot; caller owns the returned tree.
在文件 SceneEditorSession.cpp 第 326 行定义.
被这些函数引用 eve::scene_editor::exposeSceneEditorSessions() , 以及 saveJson().
◆ undo()
| editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::undo | ( | ) |
Undo the last scene transaction; failures preserve history.
在文件 SceneEditorSession.cpp 第 320 行定义.
◆ updatePhysicsPlacement()
| editing::Result< PhysicsPlacementFrame > eve::scene_editor::SceneEditorSession::updatePhysicsPlacement | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | fixedDelta = 1.0 / 60.0 |
||
| ) |
Move the preview handle and advance one fixed simulation step.
在文件 SceneEditorSession.cpp 第 487 行定义.
引用了 eve::Result< T >::failure(), x, y , 以及 z.
◆ updatePhysicsPlacementPose()
| editing::Result< PhysicsPlacementFrame > eve::scene_editor::SceneEditorSession::updatePhysicsPlacementPose | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | rotationX, | ||
| double | rotationY, | ||
| double | rotationZ, | ||
| double | fixedDelta = 1.0 / 60.0 |
||
| ) |
Move and rotate the preview handle, then advance one fixed simulation step.
在文件 SceneEditorSession.cpp 第 502 行定义.
引用了 eve::Result< T >::failure(), x, y , 以及 z.
◆ updatePhysicsPlacementTransform()
| editing::Result< PhysicsPlacementFrame > eve::scene_editor::SceneEditorSession::updatePhysicsPlacementTransform | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | rotationX, | ||
| double | rotationY, | ||
| double | rotationZ, | ||
| double | scaleX, | ||
| double | scaleY, | ||
| double | scaleZ, | ||
| double | fixedDelta = 1.0 / 60.0 |
||
| ) |
Move, rotate and scale the preview handle, then advance one fixed simulation step.
在文件 SceneEditorSession.cpp 第 519 行定义.
引用了 eve::Result< T >::failure(), x, y , 以及 z.
该类的文档由以下文件生成:
- src/modules/scene/editor/SceneEditorSession.h
- src/modules/scene/editor/SceneEditorSession.cpp