diff --git a/docs/plan/editor-core-refactor-plan.md b/docs/plan/editor-core-refactor-plan.md index 339a6390..4640a1da 100644 --- a/docs/plan/editor-core-refactor-plan.md +++ b/docs/plan/editor-core-refactor-plan.md @@ -109,7 +109,7 @@ Completed boundary cuts: - The private `editor/app` compatibility include root is gone from `XCEditorCore` and `XCEditor`. App implementation files now include through explicit module roots such as `app/Composition`, `app/Features`, - `app/Windowing`, `app/Scene`, `app/Services`, `app/Support`, + `app/Windowing`, `app/Services`, `app/Support`, `app/Host/Interfaces`, `app/Host/Win32`, and `app/Host/D3D12`; only executable-host code consumes `app/Bootstrap`. - Concrete `app/Rendering/**` files now build through the @@ -346,7 +346,7 @@ Initial contents: - `app/Composition/**` - `app/Features/**` - `app/Project/**` or `app/Services/Project/**` -- `app/Scene/**` or `app/Services/Scene/**` +- `app/Services/Scene/**` - `app/Core/UtilityWindows/**` - `app/Core/Windowing/**` - `app/Windowing/**` core files that do not require Win32 or D3D12 @@ -469,13 +469,20 @@ Completed: ```text Rendering/Viewport/SceneViewportRenderRequest.h -> Core/Scene/SceneViewportRenderRequest.h + +Scene/EditorSceneRuntime.h +Scene/EditorSceneBridge.h +Scene/SceneToolState.h +Scene/SceneViewportCameraController.h + -> Services/Scene/ ``` Current shape: ```text Core/Scene/SceneViewportRenderRequest.h -Scene/EditorSceneRuntime.h +Services/Scene/EditorSceneRuntime.h +Services/Scene/EditorSceneBridge.h Rendering/Viewport/SceneViewportRenderService.h ``` @@ -483,6 +490,9 @@ Rendering/Viewport/SceneViewportRenderService.h not a rendering implementation detail. Keep future scene-to-viewport request values under `Core/Scene` so scene services can build requests without taking an `app/Rendering/**` include dependency. +Scene runtime, scene bridge, scene tool state, and scene viewport camera +control are service-layer implementation and live under `Services/Scene`; +the app root no longer owns a concrete `Scene` service directory. - Scene viewport shader paths are runtime configuration now. Build them from the runtime repo root in the viewport runtime service, inject them into `SceneViewportRenderService`, and keep grid/selection render passes from diff --git a/editor/AGENTS.md b/editor/AGENTS.md index cc58927a..fcf0aaa7 100644 --- a/editor/AGENTS.md +++ b/editor/AGENTS.md @@ -35,8 +35,8 @@ change. contracts under `app/Core` and `app/Host/Interfaces`. - `XCEditorCore` also does not consume the whole `editor/app` root privately. Its implementation include paths enumerate concrete app module roots such as - `app/Composition`, `app/Features`, `app/Windowing`, `app/Scene`, - `app/Services`, and `app/Support`. + `app/Composition`, `app/Features`, `app/Windowing`, `app/Services`, + and `app/Support`. - Concrete `app/Rendering/**` implementation builds as the `XCEditorCoreRendering` object library. `XCEditorCore` consumes those object files, but it does not publish or privately widen its include surface back to @@ -105,12 +105,15 @@ change. panel factory. Shared utility-window contracts and descriptors live under `app/Core/UtilityWindows` so windowing can resolve utility window shape without constructing concrete feature panels. -- `app/Services/Project/` and `app/Scene/` hold application services that - panels should use instead of owning global state themselves. Shared app +- `app/Services/Project/` and `app/Services/Scene/` hold application services + that panels should use instead of owning global state themselves. Shared app state contracts live under `app/Core/State`. `ProjectBrowserModel` and `EditorProjectRuntime` live under `app/Services/Project`; project panels adapt those service models into widget-specific tree/list presentation data. + `EditorSceneRuntime`, `EditorSceneBridge`, scene tool state, and the scene + viewport camera controller live under `app/Services/Scene`; scene feature + panels consume those services instead of owning scene state. ## Layering @@ -457,6 +460,8 @@ inside pure shell/widget code. - `editor/app/Composition/EditorContext.cpp` - `editor/app/Services/Project/EditorProjectRuntime.cpp` - `editor/app/Services/Project/ProjectBrowserModel.cpp` +- `editor/app/Services/Scene/EditorSceneRuntime.cpp` +- `editor/app/Services/Scene/EditorSceneBridge.cpp` - `editor/app/Composition/EditorShellRuntime.cpp` - `editor/app/Composition/EditorShellAssetBuilder.cpp` - `editor/app/Windowing/EditorWindowManager.cpp` @@ -552,6 +557,12 @@ ownership rule. and `EditorProjectRuntime` now live under `app/Services/Project`, and the Project panel owns the widget-tree projection instead of making the service model depend on `UIEditorTreeViewItem`. +- Scene service ownership moved out of the app root: + `EditorSceneRuntime`, `EditorSceneBridge`, scene tool state, and the scene + viewport camera controller now live under `app/Services/Scene`. The app root + no longer has a concrete `app/Scene` service directory; shared scene + contracts remain under `app/Core/Scene`, and scene viewport UI stays under + `app/Features/Scene`. - The old `Win32EditorWindowRenderRuntimeSurface` adapter was removed. Win32 now captures native render startup data into the neutral `Rendering::Host::EditorWindowRenderRuntimeSurface` value contract, so D3D12 diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 8c933dba..eb3c4cd1 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -279,10 +279,10 @@ if(XCENGINE_BUILD_XCUI_EDITOR_CORE) ) set(XCUI_EDITOR_APP_SUPPORT_SOURCES - app/Scene/EditorSceneRuntime.cpp + app/Services/Scene/EditorSceneRuntime.cpp app/Services/Project/EditorProjectRuntime.cpp app/Services/Project/ProjectBrowserModel.cpp - app/Scene/EditorSceneBridge.cpp + app/Services/Scene/EditorSceneBridge.cpp ) set(XCUI_EDITOR_APP_CORE_SOURCES @@ -336,7 +336,6 @@ if(XCENGINE_BUILD_XCUI_EDITOR_CORE) PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/app/Composition ${CMAKE_CURRENT_SOURCE_DIR}/app/Features - ${CMAKE_CURRENT_SOURCE_DIR}/app/Scene ${CMAKE_CURRENT_SOURCE_DIR}/app/Services ${CMAKE_CURRENT_SOURCE_DIR}/app/Support ${CMAKE_CURRENT_SOURCE_DIR}/app/Windowing @@ -392,7 +391,6 @@ if(XCENGINE_BUILD_XCUI_EDITOR_APP) ${CMAKE_CURRENT_SOURCE_DIR}/app/Host/Win32 ${CMAKE_CURRENT_SOURCE_DIR}/app/Host/D3D12 ${CMAKE_CURRENT_SOURCE_DIR}/app/Rendering - ${CMAKE_CURRENT_SOURCE_DIR}/app/Scene ${CMAKE_CURRENT_SOURCE_DIR}/app/Services ${CMAKE_CURRENT_SOURCE_DIR}/app/Support ${CMAKE_CURRENT_SOURCE_DIR}/app/Windowing diff --git a/editor/app/Composition/EditorContext.cpp b/editor/app/Composition/EditorContext.cpp index fba41cba..17badee7 100644 --- a/editor/app/Composition/EditorContext.cpp +++ b/editor/app/Composition/EditorContext.cpp @@ -1,6 +1,6 @@ #include "EditorContext.h" #include "EditorShellAssetBuilder.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "Panels/EditorPanelIds.h" #include "WorkspaceEventSync.h" #include diff --git a/editor/app/Composition/EditorContext.h b/editor/app/Composition/EditorContext.h index e2874421..822ef82b 100644 --- a/editor/app/Composition/EditorContext.h +++ b/editor/app/Composition/EditorContext.h @@ -2,7 +2,7 @@ #include "Panels/EditorPanelServices.h" #include "Windowing/EditorFrameServices.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "Project/EditorProjectRuntime.h" #include "UtilityWindows/EditorUtilityWindowRuntime.h" diff --git a/editor/app/Features/Hierarchy/HierarchyModel.cpp b/editor/app/Features/Hierarchy/HierarchyModel.cpp index 10157165..c7c5ff70 100644 --- a/editor/app/Features/Hierarchy/HierarchyModel.cpp +++ b/editor/app/Features/Hierarchy/HierarchyModel.cpp @@ -1,6 +1,6 @@ #include "HierarchyModel.h" -#include "EditorSceneBridge.h" +#include "Scene/EditorSceneBridge.h" #include #include diff --git a/editor/app/Features/Hierarchy/HierarchyPanel.cpp b/editor/app/Features/Hierarchy/HierarchyPanel.cpp index 92d4843b..2bb80b36 100644 --- a/editor/app/Features/Hierarchy/HierarchyPanel.cpp +++ b/editor/app/Features/Hierarchy/HierarchyPanel.cpp @@ -2,7 +2,7 @@ #include "Assets/EditorIconService.h" #include #include -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "State/EditorCommandFocusService.h" #include #include diff --git a/editor/app/Features/Inspector/Components/IInspectorComponentEditor.h b/editor/app/Features/Inspector/Components/IInspectorComponentEditor.h index 78ad92c9..96fddbaa 100644 --- a/editor/app/Features/Inspector/Components/IInspectorComponentEditor.h +++ b/editor/app/Features/Inspector/Components/IInspectorComponentEditor.h @@ -1,6 +1,6 @@ #pragma once -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include diff --git a/editor/app/Features/Inspector/InspectorPanel.cpp b/editor/app/Features/Inspector/InspectorPanel.cpp index 0bb69115..f1dea886 100644 --- a/editor/app/Features/Inspector/InspectorPanel.cpp +++ b/editor/app/Features/Inspector/InspectorPanel.cpp @@ -10,7 +10,7 @@ #include "Inspector/Components/IInspectorComponentEditor.h" #include "Inspector/Components/InspectorComponentEditorRegistry.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "Project/EditorProjectRuntime.h" #include "State/EditorCommandFocusService.h" diff --git a/editor/app/Features/Inspector/InspectorPresentationModel.cpp b/editor/app/Features/Inspector/InspectorPresentationModel.cpp index 6f10ac2c..53dd588c 100644 --- a/editor/app/Features/Inspector/InspectorPresentationModel.cpp +++ b/editor/app/Features/Inspector/InspectorPresentationModel.cpp @@ -3,7 +3,7 @@ #include "Inspector/Components/IInspectorComponentEditor.h" #include "Inspector/Components/InspectorComponentEditorUtils.h" #include "Inspector/Components/InspectorComponentEditorRegistry.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include diff --git a/editor/app/Features/Inspector/InspectorSubject.cpp b/editor/app/Features/Inspector/InspectorSubject.cpp index 3ff91f26..718ce132 100644 --- a/editor/app/Features/Inspector/InspectorSubject.cpp +++ b/editor/app/Features/Inspector/InspectorSubject.cpp @@ -1,6 +1,6 @@ #include "Inspector/InspectorSubject.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" namespace XCEngine::UI::Editor::App { diff --git a/editor/app/Features/Scene/SceneEditCommandRoute.cpp b/editor/app/Features/Scene/SceneEditCommandRoute.cpp index f40434de..8b8826c1 100644 --- a/editor/app/Features/Scene/SceneEditCommandRoute.cpp +++ b/editor/app/Features/Scene/SceneEditCommandRoute.cpp @@ -1,6 +1,6 @@ #include "Scene/SceneEditCommandRoute.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include diff --git a/editor/app/Features/Scene/SceneViewportController.cpp b/editor/app/Features/Scene/SceneViewportController.cpp index 8012c1fc..09d2ee53 100644 --- a/editor/app/Features/Scene/SceneViewportController.cpp +++ b/editor/app/Features/Scene/SceneViewportController.cpp @@ -1,7 +1,7 @@ #include "Scene/SceneViewportController.h" #include "Viewport/EditorViewportPicking.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "State/EditorCommandFocusService.h" #include "Panels/EditorPanelIds.h" diff --git a/editor/app/Features/Scene/SceneViewportFeature.cpp b/editor/app/Features/Scene/SceneViewportFeature.cpp index 152e4edb..1ff80cc6 100644 --- a/editor/app/Features/Scene/SceneViewportFeature.cpp +++ b/editor/app/Features/Scene/SceneViewportFeature.cpp @@ -1,6 +1,6 @@ #include "Scene/SceneViewportFeature.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "State/EditorCommandFocusService.h" namespace XCEngine::UI::Editor::App { diff --git a/editor/app/Features/Scene/SceneViewportSceneOverlay.cpp b/editor/app/Features/Scene/SceneViewportSceneOverlay.cpp index 59fb8d3d..6c2f9119 100644 --- a/editor/app/Features/Scene/SceneViewportSceneOverlay.cpp +++ b/editor/app/Features/Scene/SceneViewportSceneOverlay.cpp @@ -2,7 +2,7 @@ #include "Scene/SceneViewportTransformGizmoSupport.h" #include "Assets/EditorIconService.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include #include diff --git a/editor/app/Features/Scene/SceneViewportToolOverlay.h b/editor/app/Features/Scene/SceneViewportToolOverlay.h index 28367422..9c1e555b 100644 --- a/editor/app/Features/Scene/SceneViewportToolOverlay.h +++ b/editor/app/Features/Scene/SceneViewportToolOverlay.h @@ -1,6 +1,6 @@ #pragma once -#include "SceneToolState.h" +#include "Scene/SceneToolState.h" #include "Assets/EditorIconService.h" #include diff --git a/editor/app/Features/Scene/SceneViewportTransformGizmo.cpp b/editor/app/Features/Scene/SceneViewportTransformGizmo.cpp index bee2b013..bd811d44 100644 --- a/editor/app/Features/Scene/SceneViewportTransformGizmo.cpp +++ b/editor/app/Features/Scene/SceneViewportTransformGizmo.cpp @@ -1,8 +1,8 @@ #include "Scene/SceneViewportTransformGizmo.h" #include "Scene/SceneViewportTransformGizmoSupport.h" -#include "EditorSceneRuntime.h" -#include "SceneToolState.h" +#include "Scene/EditorSceneRuntime.h" +#include "Scene/SceneToolState.h" #include #include diff --git a/editor/app/Scene/EditorSceneBridge.cpp b/editor/app/Services/Scene/EditorSceneBridge.cpp similarity index 99% rename from editor/app/Scene/EditorSceneBridge.cpp rename to editor/app/Services/Scene/EditorSceneBridge.cpp index 7da77ff9..409c5852 100644 --- a/editor/app/Scene/EditorSceneBridge.cpp +++ b/editor/app/Services/Scene/EditorSceneBridge.cpp @@ -1,4 +1,4 @@ -#include "EditorSceneBridge.h" +#include "Scene/EditorSceneBridge.h" #include #include diff --git a/editor/app/Scene/EditorSceneBridge.h b/editor/app/Services/Scene/EditorSceneBridge.h similarity index 100% rename from editor/app/Scene/EditorSceneBridge.h rename to editor/app/Services/Scene/EditorSceneBridge.h diff --git a/editor/app/Scene/EditorSceneRuntime.cpp b/editor/app/Services/Scene/EditorSceneRuntime.cpp similarity index 99% rename from editor/app/Scene/EditorSceneRuntime.cpp rename to editor/app/Services/Scene/EditorSceneRuntime.cpp index 5182f7ee..3ebc3ca3 100644 --- a/editor/app/Scene/EditorSceneRuntime.cpp +++ b/editor/app/Services/Scene/EditorSceneRuntime.cpp @@ -1,4 +1,4 @@ -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include #include diff --git a/editor/app/Scene/EditorSceneRuntime.h b/editor/app/Services/Scene/EditorSceneRuntime.h similarity index 98% rename from editor/app/Scene/EditorSceneRuntime.h rename to editor/app/Services/Scene/EditorSceneRuntime.h index 64ebcf98..cad32c86 100644 --- a/editor/app/Scene/EditorSceneRuntime.h +++ b/editor/app/Services/Scene/EditorSceneRuntime.h @@ -1,8 +1,8 @@ #pragma once -#include "EditorSceneBridge.h" -#include "SceneViewportCameraController.h" -#include "SceneToolState.h" +#include "Scene/EditorSceneBridge.h" +#include "Scene/SceneViewportCameraController.h" +#include "Scene/SceneToolState.h" #include "State/EditorSelectionService.h" #include "Scene/SceneViewportRenderRequest.h" diff --git a/editor/app/Scene/SceneToolState.h b/editor/app/Services/Scene/SceneToolState.h similarity index 100% rename from editor/app/Scene/SceneToolState.h rename to editor/app/Services/Scene/SceneToolState.h diff --git a/editor/app/Scene/SceneViewportCameraController.h b/editor/app/Services/Scene/SceneViewportCameraController.h similarity index 100% rename from editor/app/Scene/SceneViewportCameraController.h rename to editor/app/Services/Scene/SceneViewportCameraController.h diff --git a/tests/UI/Editor/unit/CMakeLists.txt b/tests/UI/Editor/unit/CMakeLists.txt index c9091f2d..44fa9f5e 100644 --- a/tests/UI/Editor/unit/CMakeLists.txt +++ b/tests/UI/Editor/unit/CMakeLists.txt @@ -132,7 +132,6 @@ if(TARGET XCEditorCore) ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Core ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Features ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Host/Interfaces - ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Scene ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Services ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Support ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/include @@ -175,7 +174,6 @@ if(TARGET XCEditorCore) ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Features ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Host/Interfaces ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Rendering - ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Scene ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Services ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/app/Support ${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/include diff --git a/tests/UI/Editor/unit/test_hierarchy_scene_binding.cpp b/tests/UI/Editor/unit/test_hierarchy_scene_binding.cpp index d1387b7d..19085ffa 100644 --- a/tests/UI/Editor/unit/test_hierarchy_scene_binding.cpp +++ b/tests/UI/Editor/unit/test_hierarchy_scene_binding.cpp @@ -1,5 +1,5 @@ #include "Hierarchy/HierarchyModel.h" -#include "EditorSceneBridge.h" +#include "Scene/EditorSceneBridge.h" #include #include diff --git a/tests/UI/Editor/unit/test_inspector_presentation.cpp b/tests/UI/Editor/unit/test_inspector_presentation.cpp index a497b80d..17fe82ea 100644 --- a/tests/UI/Editor/unit/test_inspector_presentation.cpp +++ b/tests/UI/Editor/unit/test_inspector_presentation.cpp @@ -2,7 +2,7 @@ #include "Inspector/Components/InspectorComponentEditorRegistry.h" #include "Inspector/InspectorPresentationModel.h" #include "Inspector/InspectorSubject.h" -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include #include diff --git a/tests/UI/Editor/unit/test_scene_viewport_runtime.cpp b/tests/UI/Editor/unit/test_scene_viewport_runtime.cpp index f3c679b7..4ead961a 100644 --- a/tests/UI/Editor/unit/test_scene_viewport_runtime.cpp +++ b/tests/UI/Editor/unit/test_scene_viewport_runtime.cpp @@ -1,4 +1,4 @@ -#include "EditorSceneRuntime.h" +#include "Scene/EditorSceneRuntime.h" #include "Scene/SceneViewportController.h" #include "Inspector/InspectorSubject.h" #include "Viewport/SceneViewportRenderService.h"