[271] Umbaufilter: Status Bestand/Abbruch/Neu mit Etappen, Filter wie Archicad in Grundriss, Schnitt, Ansicht, Axo, 3D, Kennzahlen, DXF und IFC

Modell (Rust, gen:types): `renovation: {status, phase?}` an Wand, Öffnung (ohne eigenen Status
folgt sie der Wand), Decke, Dach, Treppe, Stütze, Körper und Raum (Raum nur Sichtbarkeit und
Flächen, keine Farbe); `Project.renovation` (Etappen, Farben, eigene Filter, KNOWN_KEYS);
`renovationFilter`/`renovationPhase` an DrawingLevel, ViewTemplate und ViewSnapshot — der Filter
gehört zur Ebene wie die Modelldarstellung [173], damit je Reiter, Ausschnitt und Vorlage.

Kern `renovation.rs` als ein Ort für „sichtbar/wie gezeichnet im Filter“: Vorgaben Bestand,
Abbruch, Neubau, Umbauplan, Endzustand; SIA-400-Farben (Bestand grau, Abbruch gelb gestrichelt,
Neu rot), anpassbar; Etappe „bis n“; neue Öffnung in Bestandswand = Abbruch-Stück, zugemauerte
Öffnung = Ausfachung (die Wand schliesst, wo die Öffnung ausgeblendet ist, wie bei der Regel
„Ausblenden“). Angebunden: Grundriss (Ctx.hidden, Farben je Element-Bereich, nur Schnittflächen
gefüllt, Symbole in Linienfarbe), Schnitt (without_elements + CutRules::with_renovation), Ansicht,
Vektor-Axo, 3D (model3dParts mit Filter, 3D-Fenster nimmt den Filter der aktiven Ebene),
Kennzahlen/Flächen (Text = Zustand), DXF (Layer <Klasse>_Abbruch/_Neu), IFC (Status im
Pset_*Common, Etappe in Dossier_Umbau). Tusche behält die Umbau-Farben (extras::KeepColors).
Neue Bauteile der Zeichenbefehle tragen den Zeichen-Status (commands::stamp_renovation).

Bedienung: Objekt-Info/Objekteinstellungen „Umbau“ und „Etappe“ (Mehrfachauswahl, ein
Undo-Schritt), Statusleiste „Umbau: …“ mit Zeichen-Status und Umbaufilter der Ansicht (im
Überlauf „⋯“ mit der Pausfolie), Befehl `umbau` (B/A/N; getippte Options-Kürzel mit Enter),
Ressourcen-Tab „Umbau“ (Etappen, Farben), Flächenbilanz „Zustand“, Vorlage „Beispiel Umbau“
(CLI :umbau), CLI --renovation/--phase für plan, section, elevation, axo, model3d, kennzahlen.

Tests: Kern renovation_tests.rs (20: Vorgaben, Etappen, Öffnungen in Bestandswand, Grundriss,
Schnitt, Ansicht, Kennzahlen, DXF, IFC, 3D, Tusche, Zeichen-Status, Unsinn), Robustheit (Plan,
Schnitt, Ansicht, Kennzahlen, 3D mit Filter), vitest model/renovation.test.ts und
commands/cmds/renovation.test.ts, e2e renovation271.spec.ts (2× grün). Goldens unverändert.
Bilder doc/review-271 (CLI-SVG --hatch in Chromium, App). Nur im Linux-Container geprüft, nicht
in der Tauri-App/auf dem Mac (Prüfschritt RELEASE-1.0 13.37). Offen: TODO [271].
This commit is contained in:
Claude committed 2026-11-17 11:44:28 +00:00
1 parent c1f9e91d28
commit fb0c932b53
73 files changed
+2888 -56

No files matched your search

+4 -1
View File
@@ -576,7 +576,10 @@ export function createProjectSlice(
// Befehl ([K4] S3, `commands.rs`): der Kern rechnet ihn auf dem Dokument und wendet ihn im selben
// Aufruf an (`cmdMutation`); Prüfung, Verlauf und Meldungen wie `commitOps`.
const applyCmd = (req: object, coalesceKey?: string) => {
const applyCmd = (req0: object, coalesceKey?: string) => {
// [271] Aktueller Zeichen-Status: der Kern gibt ihn neuen Bauteilen der Zeichenbefehle (`commands::stamp_renovation`).
const dr = (get() as unknown as { drawRenovation?: { status: string; phase?: string } }).drawRenovation;
const req = dr && (dr.status !== "existing" || dr.phase) ? { ...req0, renovation: dr } : req0;
if (forwarded(() => storeDocument(get().project).cmdOps(req), coalesceKey)) return;
let notice: string | undefined;
set((s) => {
+31
View File
@@ -60,6 +60,10 @@ declare global {
sectionWalls: () => Promise<{ n: number; area: number }>;
/** [193] Gelände-/Umgebungs-Elemente (Art, Id, bei der Baugrube die erste Umrissecke, bei Höhenlinien der erste Punkt). */
context: () => { id: string; type: string; first?: { x: number; y: number } }[];
/** [271] Füllfarben der Element-Flächen im Grundriss der aktiven Ebene (Farbe → Anzahl, alle Klassen, 1:100). */
planFillColors: () => Record<string, number>;
/** [271] Umbau: Filter und Etappe der aktiven Ebene, Zeichen-Status, Status je Wand. */
renovation: () => { filter: string | null; phase: string | null; draw: string; walls: Record<string, string> };
/** [193] Gefüllte Flächen (Füllfarbe gesetzt) im Grundriss der aktiven Ebene (alle Kategorien, 1:100); bei 0 ist nichts Gefülltes mehr zu sehen. */
planFills: () => number;
/** [193] Höhe (z) des ersten Gelände-Netz-Punkts. */
@@ -153,6 +157,33 @@ export function installTestHooks(): void {
walk(s.project.layers);
return generatePlan(s.project, s.activeLevelId, codes, undefined, s.detail, false, false, true, 50).primitives.filter((q) => q.kind === "line" && q.cls === cls).length;
},
planFillColors: () => {
const s = getState();
const codes = new Set<string>();
const walk = (cs: { code: string; children?: unknown[] }[]): void => {
for (const c of cs) {
codes.add(c.code);
walk((c.children ?? []) as { code: string; children?: unknown[] }[]);
}
};
walk(s.project.layers);
const out: Record<string, number> = {};
for (const q of generatePlan(s.project, s.activeLevelId, codes, undefined, s.detail, false, false, true, 100).primitives) {
if (q.kind !== "polygon" || !q.fill || !Object.entries(q).some(([k, v]) => k.endsWith("Id") && !!v)) continue;
out[q.fill] = (out[q.fill] ?? 0) + 1;
}
return out;
},
renovation: () => {
const s = getState();
const l = s.project.drawingLevels.find((x) => x.id === s.activeLevelId);
return {
filter: l?.renovationFilter ?? null,
phase: l?.renovationPhase ?? null,
draw: s.drawRenovation.status,
walls: Object.fromEntries(s.project.walls.map((w) => [w.id, w.renovation?.status ?? "existing"])),
};
},
context: () =>
(getState().project.context ?? []).map((c) => ({ id: c.id, type: c.type, first: c.type === "excavation" ? c.outline[0] : c.type === "contourSet" ? c.contours[0]?.pts[0] : undefined })),
planFills: () => {
+2
View File
@@ -89,6 +89,7 @@ export function useNativeMenu(opts: {
onNewProjectFromSample,
onNewProjectFromComplexSample,
onNewProjectFromWettbewerbSample,
onNewProjectFromUmbauSample,
onNewProjectFromTemplate,
onOpenProject,
onSaveProject,
@@ -119,6 +120,7 @@ export function useNativeMenu(opts: {
onNewProjectFromSample,
onNewProjectFromComplexSample,
onNewProjectFromWettbewerbSample,
onNewProjectFromUmbauSample,
onNewProjectFromTemplate,
onOpenProject,
onSaveProject,
+9
View File
@@ -50,6 +50,7 @@ import { emptyProject, sampleProject } from "../model/sampleProject";
import { withNewProjectNames } from "../model/newProjectNames";
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
import { buildWettbewerbSampleProject } from "../model/sampleProjectWettbewerb";
import { buildUmbauSampleProject } from "../model/sampleProjectUmbau";
import { withStandards } from "../model/standards";
import type { Project } from "../model/types";
import type { PlanViewHandle } from "../views/plan/PlanView";
@@ -570,6 +571,13 @@ export function useProjectFileActions(
getState().loadProject(next);
lastSavedProjectRef.current = next;
});
// [271] „Neu aus Vorlage: Beispiel Umbau" — Demo-Haus mit Abbruch, zugemauertem und neuem Fenster, Anbau in zwei Etappen.
const onNewProjectFromUmbauSample = () => guardDiscard(() => {
releaseCurrentProjectLock();
const next = buildUmbauSampleProject();
getState().loadProject(next);
lastSavedProjectRef.current = next;
});
// „Neu aus Vorlage: Datei wählen…" — native `.obpt`-Dialog unter Tauri, sonst
// das versteckte `<input type=file>` (projectTemplateFileInputRef).
const onNewProjectFromTemplate = () => {
@@ -914,6 +922,7 @@ export function useProjectFileActions(
onNewProjectFromSample,
onNewProjectFromComplexSample,
onNewProjectFromWettbewerbSample,
onNewProjectFromUmbauSample,
onNewProjectFromTemplate,
onProjectTemplateFileChosen,
releaseCurrentProjectLock,
+10
View File
@@ -18,6 +18,7 @@ import type { useProjectActions } from "./useProjectActions";
import type { useTopBarState } from "./useTopBarState";
import { useViewTemplateHandlers } from "./useViewTemplateHandlers";
import { modelViewHandlers } from "./useModelViewHandlers";
import { setField, setPhasesOps } from "../core";
type TopBar = ReturnType<typeof useTopBarState>;
type Dialogs = ReturnType<typeof useDialogState>;
@@ -135,6 +136,15 @@ export function useResourceHandlers(opts: {
...viewTemplateHandlers,
// [173] Modelldarstellung (neue Stufe über dem Detailgrad der Anzeige).
...modelViewHandlers(applyChange, () => detail),
// [271] Umbau: Etappen und Farben (Ressourcen-Tab „Umbau“).
onSetRenovationPhases: (phases) => applyChange((p) => setPhasesOps(p, phases)),
onSetRenovationStyles: (styles) =>
applyChange((p) => {
const next = { ...(p.renovation ?? {}) };
if (styles) next.styles = styles;
else delete next.styles;
return [setField("renovation", Object.keys(next).length ? next : undefined)];
}),
onPatchComponent: patchComponent,
onPatchWallType: patchWallType,
onAddWallType: addWallType,
+9 -1
View File
@@ -9,7 +9,7 @@
import { sampleProject } from "../model/sampleProject";
import type { DetailLevel, RenderMode, View3d, ViewType } from "../model/viewTypes";
import type { TraceReference } from "../model/types";
import type { TraceReference, RenovationStatus } from "../model/types";
import type { DisplayMode } from "../panels/types";
import { DEFAULT_MARQUEE_COLOR, DEFAULT_SNAP_COLOR } from "../theme/accents";
import type { StoreApi } from "./store";
@@ -21,6 +21,12 @@ const DEFAULT_DISPLAY_MODE: DisplayMode = "all";
export interface ViewSlice {
// Aktive Zeichnungsebene (Geschoss/Schnitt/Zeichnung).
activeLevelId: string;
/**
* [271] Aktueller Zeichen-Status (Umbau): neue Bauteile der Zeichenbefehle tragen ihn (Vorgabe Bestand, Wunsch
* Maintainer); mit Etappe. Zustand der Sitzung, kein Undo-Schritt.
*/
drawRenovation: { status: RenovationStatus; phase?: string };
setDrawRenovation: (status: RenovationStatus, phase?: string) => void;
// Ansichtstyp (Grundriss / Perspektive).
viewType: ViewType;
// Zuletzt gewählter Ansichtstyp je Zeichnungsebene — jeder Tab merkt sich
@@ -92,6 +98,8 @@ export function createViewSlice(api: StoreApi<ViewSlice>): ViewSlice {
const { set, get } = api;
return {
activeLevelId: sampleProject.drawingLevels[0].id,
drawRenovation: { status: "existing" },
setDrawRenovation: (status, phase) => set({ drawRenovation: phase ? { status, phase } : { status } }),
viewType: "grundriss",
viewTypeByLevel: {},
detail: "mittel",