[100] Deckenspiegel: Anlegen im Navigator (+ Deckenspiegel, Bezugsgeschoss im Ebenen-Editor), 2D-Ansicht wie Zeichnung, CLI plan --ceiling, i18n de/en

This commit is contained in:
Claude committed 2026-11-05 07:55:55 +00:00
1 parent 6fc1c676c4
commit f5a3c6abee
14 files changed
+85 -7

No files matched your search

+4 -1
View File
@@ -937,6 +937,7 @@ export default function App() {
addDrawing,
addSection,
addElevation,
addCeiling,
addCategory,
patchCategory,
addSubCategory,
@@ -1644,7 +1645,7 @@ export default function App() {
// das Handle ist null, Aktionen sind No-Ops).
const planActive = activeLevel.kind === "floor" && viewType === "grundriss";
// 3D gibt es aus Geschoss, Schnitt und Ansicht ([115]); eine freie Zeichnung hat keine Höhe.
const has3dView = activeLevel.kind !== "drawing";
const has3dView = activeLevel.kind !== "drawing" && activeLevel.kind !== "ceiling";
// Start-Protokoll: war der letzte Lauf unsauber beendet, kurz darauf hinweisen (Autosave sichert
// die Daten); beim Schliessen die Sitzung als sauber markieren.
useEffect(() => {
@@ -1746,6 +1747,7 @@ export default function App() {
onAddFloor: addFloor,
onAddSection: addSection,
onAddElevation: addElevation,
onAddCeiling: addCeiling,
onAddDrawing: addDrawing,
onSetDisplayMode: (mode) => setModeFor(BUILTIN_PANEL_IDS.drawingLevels, mode),
},
@@ -1964,6 +1966,7 @@ export default function App() {
addDrawing,
addSection,
addElevation,
addCeiling,
addCategory,
snapshotLayerVisibility,
applyLayerVisibility,
+11 -3
View File
@@ -5,7 +5,7 @@
// dossier-cli <projekt.obp> info
// dossier-cli <projekt.obp> validate
// dossier-cli <projekt.obp> migrate [--out neu.obp]
// dossier-cli <projekt.obp> plan [--level EG] [--scale 100] [--sketch] [--hatch] [--format svg|json] [--out eg.svg]
// dossier-cli <projekt.obp> plan [--level EG] [--ceiling] [--scale 100] [--sketch] [--hatch] [--format svg|json] [--out eg.svg]
// json = render2d-Szene (planToRenderScene)
// dossier-cli <projekt.obp> section <Name> [--sketch] [--hatch] [--out schnitt.svg] (--format json: render2d-Szene)
// dossier-cli <projekt.obp> elevation <Name> [--sketch] [--hatch] [--out ansicht.svg] (--sketch: Skizzenstil [67])
@@ -595,10 +595,18 @@ async function execute(project: Project, file: string, command: string, rest: st
return 0;
case "plan": {
// Geschosse und freie 2D-Zeichnungsebenen (z. B. das Blatt „Raumprogramm").
const lvl = findLevel(project, ["floor", "drawing"], args.flags.get("level"));
let planProject = project;
let lvl = findLevel(project, ["floor", "drawing", "ceiling"], args.flags.get("level"));
if (!lvl) fail(`Geschoss nicht gefunden: ${args.flags.get("level") ?? "(erstes)"}`);
// `--ceiling` ([100]): Deckenspiegel des Geschosses (vorhandene Ebene, sonst vorübergehend angelegt).
if (args.flags.has("ceiling") && lvl.kind === "floor") {
const floorId = lvl.id;
const own = project.drawingLevels.find((l) => l.kind === "ceiling" && l.ceilingOfId === floorId);
lvl = own ?? { id: `ceiling-${floorId}`, name: `Deckenspiegel ${lvl.name}`, kind: "ceiling", visible: true, locked: false, ceilingOfId: floorId };
if (!own) planProject = { ...project, drawingLevels: [...project.drawingLevels, lvl] };
}
// Massstab geht in die Plan-Erzeugung ein (Bemassung in Papier-mm, Strichstärken nach Massstab).
const plan = generatePlan(withSketch(project, lvl.id, args), lvl.id, allCodes, undefined, "mittel", false, false, true, scale);
const plan = generatePlan(withSketch(planProject, lvl.id, args), lvl.id, allCodes, undefined, "mittel", false, false, true, scale);
if (args.flags.get("format") === "json") {
out(args, JSON.stringify(planToRenderScene(plan, scale)), `${lvl.name}.scene.json`);
return 0;
+6
View File
@@ -922,6 +922,7 @@ export const de = {
"levels.addFloor": "+ Geschoss",
"levels.addSection": "+ Schnitt",
"levels.addElevation": "+ Ansicht",
"levels.addCeiling": "+ Deckenspiegel",
"levels.addDrawing": "+ Zeichnung",
"layers.addCategory": "+ Ebene",
@@ -929,6 +930,7 @@ export const de = {
"levelCat.floor": "Geschosse",
"levelCat.section": "Schnitte",
"levelCat.elevation": "Ansichten",
"levelCat.ceiling": "Deckenspiegel",
"levelCat.drawing": "2D-Zeichnungen",
"levelCat.collapse": "Kategorie ein-/ausklappen",
"nav.visibility": "Sichtbarkeit",
@@ -943,6 +945,7 @@ export const de = {
"badge.floor": "Geschoss",
"badge.section": "Schnitt",
"badge.elevation": "Ansicht",
"badge.ceiling": "Deckenspiegel",
"badge.drawing": "Zeichnung",
// ── Darstellungsmodus-Umschalter ─────────────────────────────────────────
@@ -1029,6 +1032,7 @@ export const de = {
"editor.viewTop": "Oberkante Sicht",
"editor.viewBottom": "Unterkante Sicht",
"editor.viewDepth": "Darunter sichtbar bis",
"editor.ceilingOf": "Deckenspiegel von",
"editor.sectionDepth": "Sichttiefe",
"editor.sectionDepth.hint": "Bauteile weiter hinter der Schnitt-/Ansichtsebene entfallen in der Projektion (leer = unbegrenzt).",
"editor.unit.mm": "mm",
@@ -1066,6 +1070,7 @@ export const de = {
"default.floorName": "Geschoss {n}",
"default.sectionName": "Schnitt {n}",
"default.elevationName": "Ansicht {n}",
"default.ceilingName": "Deckenspiegel {floor}",
"default.drawingName": "Zeichnung {n}",
"default.categoryName": "Neue Ebene",
"default.subCategoryName": "Neue Sub-Ebene",
@@ -2180,6 +2185,7 @@ export const de = {
"import.badge.floor": "Geschoss",
"import.badge.section": "Schnitt",
"import.badge.elevation": "Ansicht",
"import.badge.ceiling": "Deckenspiegel",
"import.badge.drawing": "Zeichnung",
// ── PDF-Export ───────────────────────────────────────────────────────────
+6
View File
@@ -917,6 +917,7 @@ export const en: Record<TranslationKey, string> = {
"levels.addFloor": "+ Floor",
"levels.addSection": "+ Section",
"levels.addElevation": "+ Elevation",
"levels.addCeiling": "+ Reflected ceiling plan",
"levels.addDrawing": "+ Drawing",
"layers.addCategory": "+ Layer",
@@ -924,6 +925,7 @@ export const en: Record<TranslationKey, string> = {
"levelCat.floor": "Floors",
"levelCat.section": "Sections",
"levelCat.elevation": "Elevations",
"levelCat.ceiling": "Reflected ceiling plans",
"levelCat.drawing": "2D drawings",
"levelCat.collapse": "Collapse/expand category",
"nav.visibility": "Visibility",
@@ -938,6 +940,7 @@ export const en: Record<TranslationKey, string> = {
"badge.floor": "Floor",
"badge.section": "Section",
"badge.elevation": "Elevation",
"badge.ceiling": "RCP",
"badge.drawing": "Drawing",
// Display mode select.
@@ -1023,6 +1026,7 @@ export const en: Record<TranslationKey, string> = {
"editor.viewTop": "View top",
"editor.viewBottom": "View bottom",
"editor.viewDepth": "Visible below down to",
"editor.ceilingOf": "Ceiling plan of",
"editor.sectionDepth": "View depth",
"editor.sectionDepth.hint": "Elements farther behind the section/view plane are not projected (empty = unlimited).",
"editor.unit.mm": "mm",
@@ -1060,6 +1064,7 @@ export const en: Record<TranslationKey, string> = {
"default.floorName": "Floor {n}",
"default.sectionName": "Section {n}",
"default.elevationName": "Elevation {n}",
"default.ceilingName": "Reflected ceiling plan {floor}",
"default.drawingName": "Drawing {n}",
"default.categoryName": "New layer",
"default.subCategoryName": "New sub-layer",
@@ -2168,6 +2173,7 @@ export const en: Record<TranslationKey, string> = {
"import.badge.floor": "Floor",
"import.badge.section": "Section",
"import.badge.elevation": "Elevation",
"import.badge.ceiling": "RCP",
"import.badge.drawing": "Drawing",
// PDF export.
+19 -1
View File
@@ -271,6 +271,24 @@ export function LevelInlineEditor({
))}
</>
)}
{/* Deckenspiegel ([100]): Geschoss, dessen Untersicht gezeigt wird. */}
{level.kind === "ceiling" && (
<EditorField label={t("editor.ceilingOf")}>
<select
data-testid="level-ceiling-of"
value={level.ceilingOfId ?? ""}
onChange={(e) => patchLevel(level.id, { ceilingOfId: e.target.value || undefined })}
>
{project.drawingLevels
.filter((z) => z.kind === "floor" && !z.layoutId)
.map((z) => (
<option key={z.id} value={z.id}>
{z.name}
</option>
))}
</select>
</EditorField>
)}
{/* Sichttiefe ([36]) für Schnitt/Ansicht: leer = unbegrenzt (Darstellung wie bisher). */}
{(level.kind === "section" || level.kind === "elevation") && (
<EditorField label={t("editor.sectionDepth")}>
@@ -293,7 +311,7 @@ export function LevelInlineEditor({
)}
{!isFloor && (
<div className="editor-note">
{level.kind === "drawing"
{level.kind === "drawing" || level.kind === "ceiling"
? t("editor.noHeightDrawing")
: t("editor.noHeightSection")}
</div>
+2
View File
@@ -29,6 +29,7 @@ export function DrawingLevelsWindowApp() {
const [collapsed, setCollapsed] = useState<Record<DrawingLevelKind, boolean>>({
floor: false,
section: false,
ceiling: false,
elevation: false,
drawing: false,
});
@@ -91,6 +92,7 @@ export function DrawingLevelsWindowApp() {
floor: handlers.onAddFloor,
section: handlers.onAddSection,
elevation: handlers.onAddElevation,
ceiling: handlers.onAddCeiling,
drawing: handlers.onAddDrawing,
};
+1
View File
@@ -36,6 +36,7 @@ export interface DrawingLevelsCommandHandlers {
onAddFloor: () => void;
onAddSection: () => void;
onAddElevation: () => void;
onAddCeiling: () => void;
onAddDrawing: () => void;
onSetDisplayMode: (mode: DisplayMode) => void;
}
+6 -1
View File
@@ -30,6 +30,7 @@ const KIND_BADGE_KEY: Record<DrawingLevelKind, string> = {
floor: "badge.floor",
section: "badge.section",
elevation: "badge.elevation",
ceiling: "badge.ceiling",
drawing: "badge.drawing",
};
@@ -39,6 +40,7 @@ export const CATEGORY_ORDER: DrawingLevelKind[] = [
"floor",
"section",
"elevation",
"ceiling",
"drawing",
];
@@ -47,6 +49,7 @@ export const CATEGORY_TITLE_KEY: Record<DrawingLevelKind, string> = {
floor: "levelCat.floor",
section: "levelCat.section",
elevation: "levelCat.elevation",
ceiling: "levelCat.ceiling",
drawing: "levelCat.drawing",
};
@@ -55,6 +58,7 @@ export const CATEGORY_ADD_KEY: Record<DrawingLevelKind, string> = {
floor: "levels.addFloor",
section: "levels.addSection",
elevation: "levels.addElevation",
ceiling: "levels.addCeiling",
drawing: "levels.addDrawing",
};
@@ -65,7 +69,7 @@ export function DrawingLevelsPanel() {
// Auf-/Zu-Zustand je Kategorie, lokal — Default: alle aufgeklappt.
const [collapsed, setCollapsed] = useState<Record<DrawingLevelKind, boolean>>(
{ floor: false, section: false, elevation: false, drawing: false },
{ floor: false, section: false, elevation: false, ceiling: false, drawing: false },
);
const toggleCategory = (kind: DrawingLevelKind) =>
setCollapsed((c) => ({ ...c, [kind]: !c[kind] }));
@@ -74,6 +78,7 @@ export function DrawingLevelsPanel() {
floor: host.onAddFloor,
section: host.onAddSection,
elevation: host.onAddElevation,
ceiling: host.onAddCeiling,
drawing: host.onAddDrawing,
};
+1
View File
@@ -103,6 +103,7 @@ export interface PanelHostValue {
onAddDrawing: () => void;
onAddSection: () => void;
onAddElevation: () => void;
onAddCeiling: () => void;
/**
* Rechtsklick auf eine Zeichnungsebenen-Zeile: öffnet das Kontextmenü an der
* Cursorposition. App hält das offene Menü und baut die Einträge
+20
View File
@@ -123,6 +123,8 @@ export interface ProjectSlice {
addSection: () => void;
/** Legt eine neue Ansichts-Zeichnungsebene (kind:"elevation") als Platzhalter an. */
addElevation: () => void;
/** Legt einen Deckenspiegel ([100], kind:"ceiling") des aktiven Geschosses an (sonst des ersten). */
addCeiling: () => void;
patchLevel: (id: string, patch: Partial<DrawingLevel>) => void;
duplicateLevel: (id: string) => void;
deleteLevel: (id: string) => void;
@@ -684,6 +686,24 @@ export function createProjectSlice(
return addItems("drawingLevels", [elevation]);
}),
addCeiling: () => {
const activeLevelId = get().activeLevelId;
applyChange((p) => {
const floors = p.drawingLevels.filter((z) => z.kind === "floor" && !z.layoutId);
const floor = floors.find((z) => z.id === activeLevelId) ?? floors[0];
if (!floor) return [];
const ceiling: DrawingLevel = {
id: `ceiling-${Date.now()}`,
name: t("default.ceilingName", { floor: floor.name }),
kind: "ceiling",
visible: true,
locked: false,
ceilingOfId: floor.id,
};
return addItems("drawingLevels", [ceiling]);
});
},
patchLevel: (id, patch) =>
applyChange((p) =>
fieldOps(
+3
View File
@@ -139,6 +139,7 @@ export function usePanelHostBase(opts: {
| "addDrawing"
| "addSection"
| "addElevation"
| "addCeiling"
| "addCategory"
| "snapshotLayerVisibility"
| "applyLayerVisibility"
@@ -253,6 +254,7 @@ export function usePanelHostBase(opts: {
addDrawing,
addSection,
addElevation,
addCeiling,
addCategory,
snapshotLayerVisibility,
applyLayerVisibility,
@@ -350,6 +352,7 @@ export function usePanelHostBase(opts: {
onAddDrawing: addDrawing,
onAddSection: addSection,
onAddElevation: addElevation,
onAddCeiling: addCeiling,
onLevelContextMenu: (id, x, y) =>
setMenu({ kind: "level", id, x, y }),
activeCategoryCode,
+2
View File
@@ -80,6 +80,7 @@ export function useProjectActions(
const addDrawing = useStore((s) => s.addDrawing);
const addSection = useStore((s) => s.addSection);
const addElevation = useStore((s) => s.addElevation);
const addCeiling = useStore((s) => s.addCeiling);
const addCategory = useStore((s) => s.addCategory);
const patchCategory = useStore((s) => s.patchCategory);
const addSubCategory = useStore((s) => s.addSubCategory);
@@ -395,6 +396,7 @@ export function useProjectActions(
addDrawing,
addSection,
addElevation,
addCeiling,
addCategory,
patchCategory,
addSubCategory,
+2
View File
@@ -87,6 +87,8 @@ function kindBadgeKey(kind: DrawingLevelKind): TranslationKey {
return "import.badge.section";
case "elevation":
return "import.badge.elevation";
case "ceiling":
return "import.badge.ceiling";
case "drawing":
return "import.badge.drawing";
}
+2 -1
View File
@@ -409,7 +409,8 @@ export const Content = memo(function Content({
// `drawings2d` nach `level.id`), nur OHNE Geschoss-Eigenschaftsleiste und ohne
// 3D-Umschaltung — eine Zeichnung hat keine Höhe/3D. So sind importierte
// DXF-Polylinien hier sofort sichtbar und mit den 2D-Werkzeugen bearbeitbar.
if (level.kind === "drawing") {
// Deckenspiegel ([100]): wie eine Zeichnung (2D, Inhalt aus dem Kern), ohne 3D-Umschaltung.
if (level.kind === "drawing" || level.kind === "ceiling") {
// Blatt-Ebene eines offenen Layouts: Papier 1:1 (Massstab 1), Hintergrund + Viewports vom Blatt.
const plan = (sheetPlan?: SheetPlanProps) => (
<LevelPlanView