载入中...
搜索中...
未找到
eve::scene_editor::SceneEditorSession类 参考

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 follows the owned target's versioned schema. @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< void > beginRelationPlacement (PhysicsPlacementRequest request)
 Begin relation-aware preview for one adjustable object, retaining locked static obstacles.
 
editing::Result< std::string > geometryRevision (const editing::ObjectId &object) const
 Inspect the authored immutable geometry recipe, excluding TRS/materials. @thread Owner thread; no callbacks or retained pointers. @cost Recipe serialization per explicit region binding.
 
editing::Result< void > prepareRelationVisibility (std::string host, editing::Value request)
 Prepare owning native projection proof for the active relation preview.
 
editing::Result< editing::Value > checkRelationPlacement () const
 Measure persisted relations incident to the current selected object using contact evidence.
 
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 ()
 Recheck constraints and atomically publish selected transforms as one undoable transaction. @cost Blocking raster/readback per visual target plus one transaction per explicit commit.
 
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 follows the owned target's versioned schema. @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]

eve::scene_editor::SceneEditorSession::SceneEditorSession ( std::string  targetId)
explicit

Own a document target with a nonempty host-local identity.

在文件 SceneEditorSession.cpp 第 303 行定义.

◆ SceneEditorSession() [2/3]

eve::scene_editor::SceneEditorSession::SceneEditorSession ( std::unique_ptr< scene_editing::SceneTargetBase >  target)
explicit

Transfer a non-null scene target into this session; target ownership is exclusive.

在文件 SceneEditorSession.cpp 第 305 行定义.

◆ ~SceneEditorSession()

eve::scene_editor::SceneEditorSession::~SceneEditorSession ( )
default

Scene editor session.

◆ SceneEditorSession() [3/3]

eve::scene_editor::SceneEditorSession::SceneEditorSession ( const SceneEditorSession &  )
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 第 719 行定义.

引用了 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 第 459 行定义.

引用了 eve::scene_editor::Auto, eve::scene_editor::Box, eve::scene_editor::ScenePhysicsPlacementBackend::create(), created, eve::Result< T >::failure(), found, graph, request, shape, value , 以及 visiting.

被这些函数引用 beginRelationPlacement().

◆ beginRelationPlacement()

editing::Result< void > eve::scene_editor::SceneEditorSession::beginRelationPlacement ( PhysicsPlacementRequest  request)

Begin relation-aware preview for one adjustable object, retaining locked static obstacles.

参数
requestOwning collision proxies; relevant persisted participants must be admitted.
返回
Applied or rejection without a preview; existing interactive placement remains unchanged. @thread Owner thread only, no callbacks. @cost Private world construction per begin, amortized across repeated update/check calls.

在文件 SceneEditorSession.cpp 第 497 行定义.

引用了 beginPhysicsPlacement(), eve::scene_editing::ISceneHierarchyEditTarget::editorCapabilityId(), enabled, eve::scene_editor::PhysicsPlacementAdmissionPolicy::excludeLocked, eve::Result< T >::failure(), locked, eve::scene_editing::parseSceneRelations(), relation, request, selected, snapshot() , 以及 value.

◆ 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.

参数
objectStable scene object identity.
resourceKeyHost-owned immutable mesh/content revision used for stale detection.
  • 参数
    collidersOne or more generated local-space convex or primitive parts; copied by the session.

在文件 SceneEditorSession.cpp 第 359 行定义.

引用了 eve::scene_editor::Auto, eve::scene_editor::ConvexHull, eve::scene_editor::Generated , 以及 value.

被这些函数引用 cachePhysicsPlacementHull().

◆ 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.

参数
objectStable scene object identity; the session owns a copy of the points.
verticesAt least four packed finite XYZ points.
maxVerticesConvex hull simplification budget in [4, 254].
返回
Applied, or Rejected without changing the previous cached entry.

在文件 SceneEditorSession.cpp 第 343 行定义.

引用了 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 第 802 行定义.

引用了 eve::editing::noOp().

◆ checkRelationPlacement()

editing::Result< editing::Value > eve::scene_editor::SceneEditorSession::checkRelationPlacement ( ) const

Measure persisted relations incident to the current selected object using contact evidence.

返回
Owning per-relation report; untouched physical pairs are NotEvaluated, all visual relations are checked. @thread Owner thread only; no scene mutation or callbacks. @cost Contact queries plus blocking GPU raster/readback per visual target per explicit check/commit.

在文件 SceneEditorSession.cpp 第 602 行定义.

引用了 eve::Value::at(), c, draw, eve::scene_editing::ISceneHierarchyEditTarget::editorCapabilityId(), eve::scene_editor::evaluateSceneRelations(), eve::scene_editor::evaluateSceneVisualRelations(), evidence, eve::Result< T >::failure(), fields, frame, eve::Value::getIf(), key, matrix, eve::scene_editing::parseSceneRelations(), provider, r, relation, request, root, selected, snapshot(), eve::editing::toEditingValue(), value , 以及 values.

被这些函数引用 commitPhysicsPlacement().

◆ commitPhysicsPlacement()

editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::commitPhysicsPlacement ( )

Recheck constraints and atomically publish selected transforms as one undoable transaction. @cost Blocking raster/readback per visual target plus one transaction per explicit commit.

在文件 SceneEditorSession.cpp 第 734 行定义.

引用了 checkRelationPlacement(), committed, execute(), eve::Result< T >::failure(), local, selected , 以及 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 第 309 行定义.

引用了 eve::Result< T >::failure(), eve::editing::CommandRequest::id, payload , 以及 request.

被这些函数引用 commitPhysicsPlacement() , 以及 restoreJson().

◆ geometryRevision()

editing::Result< std::string > eve::scene_editor::SceneEditorSession::geometryRevision ( const editing::ObjectId &  object) const

Inspect the authored immutable geometry recipe, excluding TRS/materials. @thread Owner thread; no callbacks or retained pointers. @cost Recipe serialization per explicit region binding.

返回
Owning revision token or unsupported/missing source diagnostic.

在文件 SceneEditorSession.cpp 第 531 行定义.

引用了 eve::scene_editing::sceneGeometryRevision().

◆ operator=()

SceneEditorSession & eve::scene_editor::SceneEditorSession::operator= ( const SceneEditorSession &  )
delete

引用了 snapshot.

◆ physicsPlacementActive()

bool eve::scene_editor::SceneEditorSession::physicsPlacementActive ( ) const
noexcept

Report whether this session owns an active placement preview.

在文件 SceneEditorSession.cpp 第 813 行定义.

◆ prepareRelationVisibility()

editing::Result< void > eve::scene_editor::SceneEditorSession::prepareRelationVisibility ( std::string  host,
editing::Value  request 
)

Prepare owning native projection proof for the active relation preview.

参数
hostNamed authoring projection, borrowed only for this call.
requestBounded visibility request; camera/models must match this document.
返回
Applied or diagnostic without changing scene or existing proof. @thread Owner thread; no callbacks. No native resource pointer retained. @cost Linear validation per begin; expensive raster occurs only on explicit check/commit.

在文件 SceneEditorSession.cpp 第 534 行定义.

引用了 camera, draw, eve::scene_editing::ISceneHierarchyEditTarget::editorCapabilityId(), eve::Result< T >::failure(), fields, frame, host, input, key, matrix, message, node, eve::scene_editing::parseSceneRelations(), provider, request, revision(), root, eve::scene_editing::sceneVisibilityTargets(), selected, snapshot(), status, targets, eve::editing::toPresentationValue(), value , 以及 values.

◆ redo()

editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::redo ( )

Reapply the last undone scene transaction.

在文件 SceneEditorSession.cpp 第 336 行定义.

◆ 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 第 388 行定义.

引用了 eve::editing::noOp().

◆ 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 第 814 行定义.

引用了 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 第 421 行定义.

引用了 eve::editing::editorValueFromJson(), entries, eve::Result< T >::failure(), key, object, value , 以及 version.

◆ 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 第 322 行定义.

引用了 commands , 以及 eve::editor::HostProfile::runtimeBuilder().

◆ revision()

editing::Revision eve::scene_editor::SceneEditorSession::revision ( ) const

Return the current monotonic target revision.

在文件 SceneEditorSession.cpp 第 341 行定义.

被这些函数引用 prepareRelationVisibility().

◆ saveJson()

std::string eve::scene_editor::SceneEditorSession::saveJson ( ) const

Encode snapshot deterministically; file I/O and paths belong to the host.

在文件 SceneEditorSession.cpp 第 340 行定义.

引用了 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 第 397 行定义.

引用了 eve::editing::editorValueToJson(), entries , 以及 objects.

◆ snapshot()

editing::Value eve::scene_editor::SceneEditorSession::snapshot ( ) const

Copy the versioned hierarchy/TRS snapshot; caller owns the returned tree.

在文件 SceneEditorSession.cpp 第 339 行定义.

被这些函数引用 beginRelationPlacement(), checkRelationPlacement(), prepareRelationVisibility() , 以及 saveJson().

◆ undo()

editing::Result< editing::TransactionReceipt > eve::scene_editor::SceneEditorSession::undo ( )

Undo the last scene transaction; failures preserve history.

在文件 SceneEditorSession.cpp 第 333 行定义.

◆ 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 第 667 行定义.

引用了 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 第 682 行定义.

引用了 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 第 699 行定义.

引用了 eve::Result< T >::failure(), x, y , 以及 z.


该类的文档由以下文件生成: