#include "Scene/SceneViewportFeature.h" #include "Scene/EditorSceneRuntime.h" #include "State/EditorCommandFocusService.h" namespace XCEngine::UI::Editor::App { void SceneViewportFeature::Initialize( const EditorIconService* iconService, EditorSceneViewportRuntime& sceneViewportRuntime) { m_sceneViewportRuntime = &sceneViewportRuntime; m_controller.Initialize(iconService); } void SceneViewportFeature::Shutdown() { m_controller.Shutdown(); m_sceneViewportRuntime = nullptr; } void SceneViewportFeature::ResetInteractionState() { m_controller.ResetInteractionState(); } void SceneViewportFeature::SetCommandFocusService( EditorCommandFocusService* commandFocusService) { m_controller.SetCommandFocusService(commandFocusService); } void SceneViewportFeature::SyncRenderRequest(EditorSceneRuntime& sceneRuntime) { if (m_sceneViewportRuntime != nullptr) { m_sceneViewportRuntime->SetRenderRequest( sceneRuntime.BuildSceneViewportRenderRequest()); } } void SceneViewportFeature::Update( EditorSceneRuntime& sceneRuntime, const UIEditorWorkspaceComposeState& composeState, const UIEditorWorkspaceComposeFrame& composeFrame) { if (m_sceneViewportRuntime == nullptr) { return; } m_controller.Update( sceneRuntime, m_sceneViewportRuntime->GetObjectPicker(), composeState, composeFrame); SyncRenderRequest(sceneRuntime); } void SceneViewportFeature::Append(::XCEngine::UI::UIDrawList& drawList) const { m_controller.Append(drawList); } } // namespace XCEngine::UI::Editor::App