Skip to content

Commit f3f3ee8

Browse files
committed
feat: split EditorAlgorithms.hpp into 7 cohesive headers (SYS-W3-05)
Decompose the 2,514-line EditorAlgorithms.hpp into EditorCommandAlgorithms (857 lines), EditorSelectionAlgorithms (326), EditorTransformAlgorithms (363), EditorPersistenceAlgorithms (479), EditorEventAlgorithms (308), EditorPreferencesAlgorithms (238) and EditorUtilityAlgorithms (108), grouped by verified call-site cross-reference rather than the original proposal's guess (findParentListAlg/removeFromListAlg moved into Commands, not Selection, since grep showed every caller is a Commands/Transform mutator). Every function/struct body is byte-identical, confirmed by a line-range diff against the original before deleting it; the +165 total lines are entirely the 7x duplicated pragma/comment/include preamble. Migrated all 30 files the original grep flagged: 5 were comment-only false positives needing no change, Macro.cpp's include was dead and removed outright, and of the 25 real consumers 14 need exactly 1 new header, 8 need 2, 1 needs 3, and the largest (Commands.cpp) needs 4 - no consumer was left including everything, and no facade header was left behind. MeshCraft and all 13 affected test targets built clean with zero missing- include errors. ctest -LE render: 181 tests, 163 passed; the only failures are the two pre-existing, unrelated exceptions (mc3_json_document_budget Debug-build timeout, 3 Blender-numpy import tests) plus 14 mcb_*/ mc3togltf_* tests that were simply never built in this reused cmake-build-debug (spot-built 3 to confirm - pre-existing gap, not a regression; none consume any Editor*Algorithms.hpp header).
1 parent 3a2cb0d commit f3f3ee8

36 files changed

Lines changed: 2801 additions & 2550 deletions

NEXT.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ on `develop` and `plan.md`'s own `[DONE]`/`[IN_PROGRESS]` markers for the
126126
true current state before assuming
127127
anything below this point is stale.
128128

129+
`SYS-W11-09` and `SYS-W11-10` landed (see `plan.md`, both `[DONE]`). Then
130+
**`SYS-W3-05`** (real refactor, not cosmetic): split the 2,514-line
131+
`EditorAlgorithms.hpp` into 7 cohesive, CNA-free headers
132+
(`EditorCommandAlgorithms.hpp`/`EditorSelectionAlgorithms.hpp`/
133+
`EditorTransformAlgorithms.hpp`/`EditorPersistenceAlgorithms.hpp`/
134+
`EditorEventAlgorithms.hpp`/`EditorPreferencesAlgorithms.hpp`/
135+
`EditorUtilityAlgorithms.hpp`), moved `findParentListAlg`/`removeFromListAlg`
136+
into Commands (not Selection as first proposed) once grep proved every call
137+
site is a Commands/Transform mutator, and migrated all 30 flagged consumer
138+
files individually — 14 now need exactly 1 new header, 8 need 2, 1 needs 3,
139+
1 (`Commands.cpp`) needs 4; one (`Macro.cpp`) had a dead include removed
140+
outright; 5 were comment-only false positives needing no change. No facade
141+
left behind; the original header is deleted. `MeshCraft` plus all 13
142+
affected test targets built clean with zero missing-include errors;
143+
`ctest -LE render` is 181 tests / 163 passed, with only the two
144+
already-known pre-existing exceptions (`mc3_json_document_budget` timeout,
145+
3 Blender-`numpy` import tests) plus 14 unrelated `mcb_*`/`mc3togltf_*`
146+
tests that were simply never built in this reused `cmake-build-debug`
147+
(spot-built 3 to confirm — pre-existing gap, not a regression). See
148+
`plan.md`'s `SYS-W3-05` entry for full line-count/fan-out evidence.
149+
129150
## Known release blockers and decisions
130151

131152
| Area | Live state |

include/MeshCraft/Editor/EventPreviewRunner.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#pragma once
22

33
#include "MeshCraft/Editor/LuaScriptRunner.hpp"
4-
#include "MeshCraft/EditorAlgorithms.hpp"
4+
#include "MeshCraft/EditorCommandAlgorithms.hpp"
5+
#include "MeshCraft/EditorSelectionAlgorithms.hpp"
56
#include "MeshCraft/EventBindingAlgorithms.hpp"
67
#include "MeshCraft/Mc3/Mc3Validation.hpp"
78

include/MeshCraft/Editor/ObjectTypeName.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
// This is the single source of truth. It replaces two divergent copies that
77
// both silently mishandled five primitive types:
88
// * objectTypeName() in src/MeshCraft/MeshCraftPrivate.hpp
9-
// * objectTypeNameAlg() in include/MeshCraft/EditorAlgorithms.hpp
9+
// * objectTypeNameAlg() in include/MeshCraft/EditorCommandAlgorithms.hpp
10+
// (formerly EditorAlgorithms.hpp before its SYS-W3-05
11+
// split into per-concern headers)
1012
// Both used `default: return "Object"` and omitted Torus, Capsule, Disk, Grid
1113
// and IcoSphere, so those types displayed as "Object" in the outliner and,
1214
// critically, the macro recorder wrote `add Object` for them. On replay
1315
// objectTypeFromName("Object") fell through to Box, so recording "add Torus"
1416
// and replaying it produced a Box — a silent, lossy round-trip.
1517
//
16-
// Depends only on Mc3Object.hpp (the enum), so it is safe to include from the
17-
// CNA/ImGui-free EditorAlgorithms.hpp and unit-testable standalone.
18+
// Depends only on Mc3Object.hpp (the enum), so it is safe to include from any
19+
// CNA/ImGui-free Editor*Algorithms.hpp header and unit-testable standalone.
1820

1921
#include <MeshCraft/Mc3/Mc3Object.hpp>
2022

0 commit comments

Comments
 (0)