[279] Geländer als eigenes Bauteil: Modell, Grundriss, Schnitt, Ansicht, 3D, 3D-Dokument, IFC IfcRailing, DXF-Ebene, Umbau und Varianten, Befehl gelaender, Objekt-Info, Griffe, Beispiel Wettbewerb
This commit is contained in:
103 files changed
+2289
-73
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// Geländer ([279]): Kennzahlen aus dem Rust-Kern (`railing.rs::info`) für die Objekt-Info — Länge der Achse, absolute
|
||||
// Fuss- und Oberkante, Zahl der Stäbe und Pfosten, Ansichtsfläche. Die Teilung rechnet der Kern (eine Quelle für
|
||||
// 3D, Schnitt, Ansicht, IFC).
|
||||
|
||||
import type { Project } from "../model/types";
|
||||
import { documentFor } from "../core/document";
|
||||
|
||||
export interface RailingInfo {
|
||||
/** Länge der Achse (m). */
|
||||
length: number;
|
||||
/** Absolute Fuss- und Oberkante (m). */
|
||||
baseZ: number;
|
||||
topZ: number;
|
||||
height: number;
|
||||
/** Stäbe und Pfosten (nur Art „Stäbe"). */
|
||||
bars: number;
|
||||
posts: number;
|
||||
/** Ansichtsfläche Länge × Höhe (m²). */
|
||||
area: number;
|
||||
closed: boolean;
|
||||
}
|
||||
|
||||
/** Kennzahlen eines Geländers; `null` bei unbekannter Id oder unsinnigen Massen. */
|
||||
export function railingInfo(project: Project, id: string): RailingInfo | null {
|
||||
if (!(project.railings ?? []).some((r) => r.id === id)) return null;
|
||||
return documentFor(project).query<RailingInfo | null>("railingInfo", [], id);
|
||||
}
|
||||
@@ -28,7 +28,7 @@ Ribbon-Befehle sie erreichen: `src/state/useToolInput.ts`.
|
||||
|
||||
| Gruppe | Module |
|
||||
|---|---|
|
||||
| Bauteile | `wall.ts`, `opening.ts`, `ceiling.ts`, `ceilingOpening.ts`, `roof.ts`, `roofHole.ts`, `roofWindow.ts`, `dormer.ts`, `stair.ts`, `column.ts`, `room.ts`, `grid.ts`, `tree.ts`, `terrain.ts`, `excavation.ts` |
|
||||
| Bauteile | `wall.ts`, `opening.ts`, `ceiling.ts`, `ceilingOpening.ts`, `roof.ts`, `roofHole.ts`, `roofWindow.ts`, `dormer.ts`, `stair.ts`, `column.ts`, `room.ts`, `grid.ts`, `tree.ts`, `railing.ts`, `terrain.ts`, `excavation.ts` |
|
||||
| Körper | `solid.ts`, `solidbool.ts`, `solidToParts.ts` (Körper → Bauteile, [222]), `voidbox.ts`, `extrude.ts`, `revolve.ts`, `loft.ts` |
|
||||
| 2D zeichnen | `line.ts`, `xline.ts`, `ray.ts`, `polyline.ts`, `polygon.ts`, `rect.ts`, `circle.ts`, `arc.ts`, `ellipse.ts`, `bezier.ts`, `spline.ts`, `multiline.ts`, `revcloud.ts`, `wipeout.ts`, `block.ts`, `defblock.ts`, `libobj.ts` (Objekt aus der Bibliothek setzen, [253]) |
|
||||
| Beschriften | `text.ts`, `textbox.ts`, `textpath.ts`, `leader.ts`, `dimension.ts`, `dimround.ts`, `dimdetach.ts`, `autodim.ts`, `kote.ts`, `detailref.ts`, `pointmarker.ts`, `scalebar.ts`, `sectionline.ts` |
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* [279] Befehl „gelaender": Polylinie auf dem aktiven Geschoss, Enter beendet (offen), „Schliessen" und Klick auf den
|
||||
* Startpunkt schliessen den Zug; Zahl = Höhe, Option = Art; die Ops baut der Kern (Ebene 41, Vorgaben).
|
||||
*/
|
||||
|
||||
import { describe, it, expect, beforeEach } from "vitest";
|
||||
import { railingCommand, railingDefaults } from "./railing";
|
||||
import type { CommandContext, Project } from "../types";
|
||||
|
||||
function project(): Project {
|
||||
return {
|
||||
id: "t",
|
||||
name: "T",
|
||||
lineStyles: [],
|
||||
hatches: [],
|
||||
components: [],
|
||||
wallTypes: [],
|
||||
drawingLevels: [{ id: "eg", name: "EG", kind: "floor", visible: true, locked: false, floorHeight: 2.6, cutHeight: 1.0, baseElevation: 0 }],
|
||||
layers: [
|
||||
{ code: "41", name: "Geländer", color: "#0a0a0a", lw: 0.18, visible: true, locked: false },
|
||||
{ code: "20", name: "Zeichnung", color: "#0a0a0a", lw: 0.5, visible: true, locked: false },
|
||||
],
|
||||
walls: [],
|
||||
openings: [],
|
||||
ceilings: [],
|
||||
stairs: [],
|
||||
rooms: [],
|
||||
drawings2d: [],
|
||||
context: [],
|
||||
};
|
||||
}
|
||||
|
||||
function makeCtx(p: Project): CommandContext {
|
||||
return { project: p, level: p.drawingLevels[0], defaultCategoryCode: "20", activeLineStyleId: "solid", activeWallTypeId: "aw", lastPoint: null, selection: { wallIds: [], drawingId: null } };
|
||||
}
|
||||
|
||||
describe("railingCommand (gelaender)", () => {
|
||||
beforeEach(() => {
|
||||
Object.assign(railingDefaults, { kind: "bars", height: 1.0 });
|
||||
});
|
||||
|
||||
it("Punkte, Enter: offenes Geländer auf Ebene 41 mit Vorgaben (Höhe 1.00 m, Stäbe)", () => {
|
||||
const p = project();
|
||||
const ctx = makeCtx(p);
|
||||
let st = railingCommand.init();
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 0, y: 0 } }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 3, y: 0 } }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 3, y: 2 } }, ctx);
|
||||
// Vorschau: Zug samt Gummiband.
|
||||
const [, mv] = railingCommand.onMove!(st, { x: 5, y: 2 }, null, ctx);
|
||||
expect(mv.draft?.preview?.length).toBeGreaterThan(0);
|
||||
const [, r] = railingCommand.onConfirm!(st, ctx);
|
||||
expect(r.done).toBe(true);
|
||||
const next = r.commit!(p);
|
||||
expect(next.railings?.length).toBe(1);
|
||||
expect(next.railings![0]).toMatchObject({
|
||||
type: "railing",
|
||||
floorId: "eg",
|
||||
categoryCode: "41",
|
||||
kind: "bars",
|
||||
height: 1,
|
||||
points: [{ x: 0, y: 0 }, { x: 3, y: 0 }, { x: 3, y: 2 }],
|
||||
});
|
||||
expect(next.railings![0].closed).toBeUndefined();
|
||||
});
|
||||
|
||||
it("Zahl = Höhe, Option wechselt die Art; Schliessen ab drei Punkten, Klick auf den Start schliesst auch", () => {
|
||||
const p = project();
|
||||
const ctx = makeCtx(p);
|
||||
let st = railingCommand.init();
|
||||
[st] = railingCommand.onInput(st, { kind: "number", value: 1.1 }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "option", id: "kind" }, ctx);
|
||||
expect(railingDefaults).toMatchObject({ kind: "glass", height: 1.1 });
|
||||
for (const q of [{ x: 0, y: 0 }, { x: 2, y: 0 }, { x: 2, y: 2 }]) [st] = railingCommand.onInput(st, { kind: "point", point: q }, ctx);
|
||||
expect(railingCommand.options(st).map((o) => o.id)).toContain("close");
|
||||
const [, r] = railingCommand.onInput(st, { kind: "option", id: "close" }, ctx);
|
||||
expect(r.done).toBe(true);
|
||||
expect(r.commit!(p).railings![0]).toMatchObject({ kind: "glass", height: 1.1, closed: true });
|
||||
// Klick nahe am Startpunkt schliesst ebenfalls.
|
||||
const [, r2] = railingCommand.onInput(st, { kind: "point", point: { x: 0.02, y: 0.01 } }, ctx);
|
||||
expect(r2.commit!(p).railings![0].closed).toBe(true);
|
||||
// Unsinn: Höhe 0 oder riesig wird nicht übernommen; ein einzelner Punkt gibt kein Geländer.
|
||||
[st] = railingCommand.onInput(railingCommand.init(), { kind: "number", value: 0 }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "number", value: 99 }, ctx);
|
||||
expect(railingDefaults.height).toBe(1.1);
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 1, y: 1 } }, ctx);
|
||||
expect(railingCommand.onConfirm!(st, ctx)[1].commit).toBeUndefined();
|
||||
});
|
||||
|
||||
it("Zurück nimmt den letzten Punkt weg; ein Klick auf denselben Punkt zählt nicht", () => {
|
||||
const ctx = makeCtx(project());
|
||||
let st = railingCommand.init();
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 0, y: 0 } }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 1, y: 0 } }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "point", point: { x: 1, y: 0 } }, ctx);
|
||||
[st] = railingCommand.onInput(st, { kind: "option", id: "undo" }, ctx);
|
||||
const [, r] = railingCommand.onConfirm!(st, ctx);
|
||||
expect(r.commit).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,178 @@
|
||||
// [279] Geländer als Engine-Befehl (`gelaender`): Polylinie auf dem aktiven Geschoss (Balkon, Galerie, Treppenauge,
|
||||
// Terrasse), Ablauf wie die Polylinie/Decke:
|
||||
// 1) „Erster Punkt des Geländers:" → Punkt
|
||||
// 2) „Nächster Punkt ( Schliessen Zurück Art ):" → Punkt … Enter beendet (offen, ≥ 2 Punkte), „Schliessen" (C) oder
|
||||
// ein Klick auf den Startpunkt schliesst den Zug (≥ 3 Punkte, Treppenauge/Galerie ringsum).
|
||||
// Eine getippte Zahl setzt die Höhe (Vorgabe 1.00 m, SIA 358); sie bleibt über Aufrufe. Optionen (Klick wechselt): Art
|
||||
// Stäbe/Glas/Brüstung/Lochblech. Fusshöhe, Handlauf, Stababstand, Dicke danach in der Objekt-Info.
|
||||
//
|
||||
// Die Ops baut der Kern (`cmd_create.rs`, Befehl „railing"): Ebene „41" (Geländer), falls vorhanden, sonst die aktive.
|
||||
//
|
||||
// Bezeichner englisch, sichtbarer Text via t().
|
||||
|
||||
import type { Command, CommandContext, CommandField, CommandResult, CommandState, CmdOption, DraftShape, ToolDraft, Vec2 } from "../types";
|
||||
import type { RailingKind } from "../../model/types";
|
||||
import { createMutation, xy } from "../createCore";
|
||||
import { t, type TranslationKey } from "../../i18n";
|
||||
|
||||
const EPS = 1e-6;
|
||||
const DEG = Math.PI / 180;
|
||||
/** Klick so nah am Startpunkt (Modell-Meter) schliesst den Zug. */
|
||||
const CLOSE_HIT = 0.08;
|
||||
|
||||
const KINDS: RailingKind[] = ["bars", "glass", "solid", "perforated"];
|
||||
|
||||
/** Vorgaben des Werkzeugs (modulweit, leben über Befehls-Instanzen hinweg). */
|
||||
export const railingDefaults: { kind: RailingKind; height: number } = { kind: "bars", height: 1.0 };
|
||||
|
||||
const next = <T>(list: readonly T[], v: T): T => list[(list.indexOf(v) + 1) % list.length];
|
||||
|
||||
const segLen = (a: Vec2, b: Vec2): number => Math.hypot(b.x - a.x, b.y - a.y);
|
||||
const segAngleDeg = (a: Vec2, b: Vec2): number => (Math.atan2(b.y - a.y, b.x - a.x) * 180) / Math.PI;
|
||||
|
||||
/** Tab-Felder je weiteren Punkt: Länge + Winkel relativ zum letzten Punkt. */
|
||||
const FIELDS: CommandField[] = [
|
||||
{ id: "length", labelKey: "cmd.field.length" },
|
||||
{ id: "angle", labelKey: "cmd.field.angle" },
|
||||
];
|
||||
|
||||
/** Nächster Punkt aus gelockten Feldern (length/angle) + Cursor, relativ zu `last`. */
|
||||
function nextFromFields(last: Vec2, locks: Record<string, number>, cursor: Vec2 | null): Vec2 {
|
||||
const ref = cursor ?? last;
|
||||
const length = "length" in locks ? locks.length : segLen(last, ref);
|
||||
const ang = ("angle" in locks ? locks.angle : segAngleDeg(last, ref)) * DEG;
|
||||
return { x: last.x + Math.cos(ang) * length, y: last.y + Math.sin(ang) * length };
|
||||
}
|
||||
|
||||
/** Anfrage an den Kern (Werkzeug-Vorgaben). */
|
||||
export const railingReq = (pts: Vec2[], closed: boolean) => ({
|
||||
cmd: "railing",
|
||||
kind: railingDefaults.kind,
|
||||
height: railingDefaults.height,
|
||||
closed,
|
||||
pts: pts.map(xy),
|
||||
});
|
||||
|
||||
const appendRailing = (pts: Vec2[], closed: boolean, ctx: CommandContext) => createMutation(ctx, railingReq(pts, closed));
|
||||
|
||||
interface RailIdle extends CommandState {
|
||||
phase: "start";
|
||||
}
|
||||
interface RailDrawing extends CommandState {
|
||||
phase: "next";
|
||||
points: Vec2[];
|
||||
cursor: Vec2 | null;
|
||||
}
|
||||
type RailState = RailIdle | RailDrawing;
|
||||
|
||||
const CLOSE: CmdOption = { id: "close", labelKey: "cmd.polyline.close" };
|
||||
const UNDO: CmdOption = { id: "undo", labelKey: "cmd.polyline.undo" };
|
||||
|
||||
const idle = (): [CommandState, CommandResult] => [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true }];
|
||||
|
||||
/** Vorschau: Zug samt Gummiband, bei geschlossenem Zug der Ring; HUD mit Länge, Winkel und Höhe. */
|
||||
function railingDraft(points: Vec2[], cursor: Vec2 | null, closed = false): ToolDraft {
|
||||
const pts = cursor ? [...points, cursor] : points;
|
||||
const preview: DraftShape[] = [{ kind: "poly", pts, closed }];
|
||||
const draft: ToolDraft = { preview, vertices: points };
|
||||
const last = points[points.length - 1];
|
||||
if (cursor && last && segLen(last, cursor) >= EPS) {
|
||||
draft.hud = {
|
||||
at: cursor,
|
||||
text: `${segLen(last, cursor).toFixed(2)} m · ${((segAngleDeg(last, cursor) + 360) % 360).toFixed(0)}° · h ${railingDefaults.height.toFixed(2)} m`,
|
||||
};
|
||||
}
|
||||
return draft;
|
||||
}
|
||||
|
||||
export const railingCommand: Command = {
|
||||
name: "gelaender",
|
||||
labelKey: "cmd.gelaender.label",
|
||||
// Geländer stehen auf Geschossen — wie die Wand nur dort aktiv.
|
||||
floorOnly: true,
|
||||
prompt: (s) => ((s as RailState).phase === "next" ? "cmd.gelaender.next" : "cmd.gelaender.start"),
|
||||
accepts: (s) => ((s as RailState).phase === "next" ? ["point", "number", "option"] : ["point", "number", "option"]),
|
||||
options: (s): CmdOption[] => {
|
||||
const ps = s as RailState;
|
||||
const kind: CmdOption = { id: "kind", labelKey: "cmd.gelaender.kind", value: t(`objinfo.railing.kind.${railingDefaults.kind}` as TranslationKey) };
|
||||
if (ps.phase !== "next") return [kind];
|
||||
return ps.points.length >= 3 ? [CLOSE, UNDO, kind] : [UNDO, kind];
|
||||
},
|
||||
init: (): RailIdle => ({ phase: "start", lastPoint: null }),
|
||||
|
||||
onInput: (state, input, ctx): [CommandState, CommandResult] => {
|
||||
const s = state as RailState;
|
||||
const draft = (closed = false) => (s.phase === "next" ? railingDraft(s.points, s.cursor, closed) : null);
|
||||
|
||||
if (input.kind === "number") {
|
||||
const v = Math.abs(input.value);
|
||||
if (v >= 0.1 && v <= 5 && Number.isFinite(v)) railingDefaults.height = v;
|
||||
return [s, { draft: draft() }];
|
||||
}
|
||||
|
||||
if (input.kind === "option") {
|
||||
if (input.id === "kind") {
|
||||
railingDefaults.kind = next(KINDS, railingDefaults.kind);
|
||||
return [s, { draft: draft() }];
|
||||
}
|
||||
if (s.phase !== "next") return [s, { draft: null }];
|
||||
if (input.id === "undo") {
|
||||
const pts = s.points.slice(0, -1);
|
||||
if (pts.length === 0) return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null }];
|
||||
const ns: RailDrawing = { phase: "next", points: pts, cursor: s.cursor, lastPoint: pts[pts.length - 1] };
|
||||
return [ns, { draft: railingDraft(pts, s.cursor) }];
|
||||
}
|
||||
// Schliessen: Treppenauge/Galerie ringsum (≥ 3 Punkte).
|
||||
if (input.id === "close" && s.points.length >= 3) {
|
||||
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx) }];
|
||||
}
|
||||
return [s, { draft: draft() }];
|
||||
}
|
||||
|
||||
if (input.kind !== "point") return [s, { draft: draft() }];
|
||||
const pt = input.point;
|
||||
if (s.phase !== "next") {
|
||||
const ns: RailDrawing = { phase: "next", points: [pt], cursor: pt, lastPoint: pt };
|
||||
return [ns, { draft: railingDraft([pt], pt) }];
|
||||
}
|
||||
// Klick nahe Startpunkt → Zug schliessen und committen.
|
||||
if (s.points.length >= 3 && segLen(s.points[0], pt) < CLOSE_HIT) {
|
||||
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, true, ctx) }];
|
||||
}
|
||||
// Null-Strecke (Klick auf denselben Punkt) ignorieren.
|
||||
if (segLen(s.points[s.points.length - 1], pt) < EPS) return [s, { draft: draft() }];
|
||||
const points = [...s.points, pt];
|
||||
const ns: RailDrawing = { phase: "next", points, cursor: pt, lastPoint: pt };
|
||||
return [ns, { draft: railingDraft(points, pt) }];
|
||||
},
|
||||
|
||||
onMove: (state, point): [CommandState, CommandResult] => {
|
||||
const s = state as RailState;
|
||||
if (s.phase !== "next") return [s, { draft: null }];
|
||||
const ns: RailDrawing = { ...s, cursor: point };
|
||||
return [ns, { draft: railingDraft(s.points, point) }];
|
||||
},
|
||||
|
||||
// Enter/Rechtsklick: offenen Zug committen (≥ 2 Punkte).
|
||||
onConfirm: (state, ctx): [CommandState, CommandResult] => {
|
||||
const s = state as RailState;
|
||||
if (s.phase === "next" && s.points.length >= 2) {
|
||||
return [{ phase: "start", lastPoint: null } as RailIdle, { draft: null, done: true, commit: appendRailing(s.points, false, ctx) }];
|
||||
}
|
||||
return idle();
|
||||
},
|
||||
onCancel: (): [CommandState, CommandResult] => idle(),
|
||||
|
||||
fields: (state) => ((state as RailState).phase === "next" ? FIELDS : []),
|
||||
pointFromFields: (state, locks, cursor) => {
|
||||
const s = state as RailState;
|
||||
if (s.phase !== "next" || s.points.length === 0) return null;
|
||||
return nextFromFields(s.points[s.points.length - 1], locks, cursor);
|
||||
},
|
||||
fieldValues: (state, _locks, cursor): Record<string, number> => {
|
||||
const s = state as RailState;
|
||||
if (s.phase !== "next" || s.points.length === 0 || !cursor) return {};
|
||||
const last = s.points[s.points.length - 1];
|
||||
return { length: segLen(last, cursor), angle: ((segAngleDeg(last, cursor) % 360) + 360) % 360 };
|
||||
},
|
||||
};
|
||||
@@ -14,6 +14,7 @@ import { openingCommand, fensterCommand, tuerCommand } from "./cmds/opening";
|
||||
import { stairCommand } from "./cmds/stair";
|
||||
import { columnCommand } from "./cmds/column";
|
||||
import { circlesToTreesCommand, treeCommand } from "./cmds/tree";
|
||||
import { railingCommand } from "./cmds/railing";
|
||||
import { roofCommand } from "./cmds/roof";
|
||||
import { solidCommand } from "./cmds/solid";
|
||||
import { solidBoolCommand } from "./cmds/solidbool";
|
||||
@@ -94,6 +95,7 @@ export const COMMANDS: Record<string, Command> = {
|
||||
stair: stairCommand,
|
||||
column: columnCommand,
|
||||
tree: treeCommand,
|
||||
gelaender: railingCommand,
|
||||
circlestotrees: circlesToTreesCommand,
|
||||
roof: roofCommand,
|
||||
solid: solidCommand,
|
||||
@@ -196,6 +198,9 @@ export const ALIASES: Record<string, string> = {
|
||||
stuetze: "column",
|
||||
stütze: "column",
|
||||
baum: "tree",
|
||||
geländer: "gelaender",
|
||||
railing: "gelaender",
|
||||
gl: "gelaender",
|
||||
kreiseinbaeume: "circlestotrees",
|
||||
koerperinbauteile: "solidtoparts",
|
||||
volumenzubauteilen: "solidtoparts",
|
||||
|
||||
@@ -88,6 +88,8 @@ export interface CommandSelection {
|
||||
openingIds?: string[];
|
||||
/** [149] Gewählte Bäume (Verschieben/Kopieren/Spiegeln/Drehen: Stammmitte). */
|
||||
treeIds?: string[];
|
||||
/** [279] Gewählte Geländer (Verschieben/Kopieren/Spiegeln/Drehen: alle Punkte der Achse). */
|
||||
railingIds?: string[];
|
||||
/** [213] Gewählte Kameras (Verschieben/Kopieren/Drehen/Spiegeln: Standpunkt und Ziel). */
|
||||
cameraIds?: string[];
|
||||
/** [193] Gewählte Gelände-/Umgebungs-Elemente (`Project.context`: Gelände, Höhenlinien, Baugrube, Netze, Bilder). */
|
||||
|
||||
@@ -206,6 +206,7 @@ export type QueryName =
|
||||
| "materialMaps"
|
||||
| "slabs"
|
||||
| "columnMeshes"
|
||||
| "railingInfo"
|
||||
| "walls"
|
||||
| "openingMeshes"
|
||||
| "stairSlabs"
|
||||
|
||||
@@ -161,6 +161,7 @@ export {
|
||||
type PickContextMesh,
|
||||
type PickColumnMesh,
|
||||
type PickTreeMesh,
|
||||
type PickRailingMesh,
|
||||
type PickSolidMesh,
|
||||
type PickOpeningMesh,
|
||||
type PickStairMesh,
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
Room,
|
||||
Stair,
|
||||
Tree,
|
||||
Railing,
|
||||
Wall,
|
||||
} from "../model/types";
|
||||
import { uniqueStamp } from "../tools/types";
|
||||
@@ -51,6 +52,8 @@ export interface ElementSelectionIds {
|
||||
treeIds?: string[];
|
||||
/** [213] Kameras. */
|
||||
cameraIds?: string[];
|
||||
/** [279] Geländer. */
|
||||
railingIds?: string[];
|
||||
}
|
||||
|
||||
/** Tiefe Kopie der gewählten Elemente über alle Bauteil-Arten hinweg. */
|
||||
@@ -68,6 +71,8 @@ export interface ElementClipboard {
|
||||
trees?: Tree[];
|
||||
/** [213] Kameras (optional: ältere Zwischenablagen haben sie nicht). */
|
||||
cameras?: Camera[];
|
||||
/** [279] Geländer (optional). */
|
||||
railings?: Railing[];
|
||||
}
|
||||
|
||||
const EMPTY_CLIPBOARD: ElementClipboard = {
|
||||
@@ -95,7 +100,8 @@ export function isClipboardEmpty(c: ElementClipboard): boolean {
|
||||
c.extrudedSolids.length === 0 &&
|
||||
c.columns.length === 0 &&
|
||||
(c.trees?.length ?? 0) === 0 &&
|
||||
(c.cameras?.length ?? 0) === 0
|
||||
(c.cameras?.length ?? 0) === 0 &&
|
||||
(c.railings?.length ?? 0) === 0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -136,6 +142,8 @@ export function collectElementClipboard(
|
||||
const columns = (project.columns ?? []).filter((c) => columnIds.has(c.id));
|
||||
const treeIds = new Set(sel.treeIds ?? []);
|
||||
const trees = (project.trees ?? []).filter((t) => treeIds.has(t.id));
|
||||
const railingIds = new Set(sel.railingIds ?? []);
|
||||
const railings = (project.railings ?? []).filter((r) => railingIds.has(r.id));
|
||||
const cameraIds = new Set(sel.cameraIds ?? []);
|
||||
const cameras = (project.cameras ?? []).filter((c) => cameraIds.has(c.id));
|
||||
|
||||
@@ -151,6 +159,7 @@ export function collectElementClipboard(
|
||||
columns: columns.map((c) => structuredClone(c)),
|
||||
trees: trees.map((t) => structuredClone(t)),
|
||||
cameras: cameras.map((c) => structuredClone(c)),
|
||||
railings: railings.map((r) => structuredClone(r)),
|
||||
};
|
||||
return isClipboardEmpty(clip) ? null : clip;
|
||||
}
|
||||
@@ -168,6 +177,7 @@ export interface PastedIds {
|
||||
columnIds: string[];
|
||||
treeIds: string[];
|
||||
cameraIds: string[];
|
||||
railingIds: string[];
|
||||
}
|
||||
|
||||
/** Projekt-Liste → Feld in {@link PastedIds}. */
|
||||
@@ -183,6 +193,7 @@ const PASTED_KEY: Record<string, keyof PastedIds> = {
|
||||
columns: "columnIds",
|
||||
trees: "treeIds",
|
||||
cameras: "cameraIds",
|
||||
railings: "railingIds",
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -214,6 +225,7 @@ export function addedIds(ops: readonly CoreOp[]): PastedIds {
|
||||
columnIds: [],
|
||||
treeIds: [],
|
||||
cameraIds: [],
|
||||
railingIds: [],
|
||||
};
|
||||
for (const op of ops) {
|
||||
const key = op.kind === "add" ? PASTED_KEY[op.collection] : undefined;
|
||||
|
||||
@@ -1552,6 +1552,7 @@ export const de = {
|
||||
"resources.overrides.val.view_kind.elevation": "Ansicht",
|
||||
"resources.overrides.val.element_kind.stair": "Treppe",
|
||||
"resources.overrides.val.element_kind.column": "Stütze",
|
||||
"resources.overrides.val.element_kind.railing": "Geländer",
|
||||
"resources.overrides.val.element_kind.opening": "Fenster / Tür",
|
||||
"resources.overrides.val.element_kind.room": "Raum",
|
||||
"resources.overrides.val.element_kind.shadow": "Schatten",
|
||||
@@ -2162,6 +2163,35 @@ export const de = {
|
||||
"cmd.tree.status": "Bestand",
|
||||
"cmd.tree.foliage": "Laub/Nadel",
|
||||
"cmd.circlestotrees.label": "Kreise in Bäume umwandeln",
|
||||
"cmd.gelaender.label": "Geländer",
|
||||
"cmd.gelaender.start": "Erster Punkt des Geländers (Zahl = Höhe in m):",
|
||||
"cmd.gelaender.next": "Nächster Punkt (Enter beendet, Zahl = Höhe):",
|
||||
"cmd.gelaender.kind": "Art",
|
||||
"objinfo.kind.railing": "Geländer",
|
||||
"objinfo.railing.many": "{n} Geländer",
|
||||
"objinfo.railing.section": "Geländer",
|
||||
"objinfo.railing.kind": "Art",
|
||||
"objinfo.railing.kind.bars": "Stäbe",
|
||||
"objinfo.railing.kind.glass": "Glas",
|
||||
"objinfo.railing.kind.solid": "Brüstung (massiv)",
|
||||
"objinfo.railing.kind.perforated": "Lochblech",
|
||||
"objinfo.railing.height": "Höhe",
|
||||
"objinfo.railing.heightHint": "Vorgabe 1.00 m nach SIA 358 (Absturzhöhe bis 12 m)",
|
||||
"objinfo.railing.baseOffset": "Fusshöhe über Geschoss",
|
||||
"objinfo.railing.baseOffsetHint": "z. B. 0.18 m auf einer Balkonplatte",
|
||||
"objinfo.railing.handrail": "Handlauf",
|
||||
"objinfo.railing.handrailSize": "Handlauf-Ø",
|
||||
"objinfo.railing.barSpacing": "Stababstand (Achse)",
|
||||
"objinfo.railing.barSize": "Stabquerschnitt",
|
||||
"objinfo.railing.thickness": "Dicke",
|
||||
"objinfo.railing.component": "Bauteil",
|
||||
"objinfo.railing.componentNone": "ohne",
|
||||
"objinfo.railing.closed": "Geschlossen (ringsum)",
|
||||
"objinfo.railing.length": "Länge",
|
||||
"objinfo.railing.counts": "Stäbe / Pfosten",
|
||||
"objinfo.railing.points": "Punkte",
|
||||
"objinfo.railing.locked": "Gesperrt — Werte nicht änderbar.",
|
||||
"newProject.layer.41": "Geländer",
|
||||
"objinfo.kind.tree": "Baum",
|
||||
"objinfo.tree.many": "{n} Bäume",
|
||||
"camera.title": "Kameras",
|
||||
@@ -2275,6 +2305,7 @@ export const de = {
|
||||
"objinfo.tree.trunkDiameter": "Stamm-Ø",
|
||||
"objinfo.tree.locked": "Gesperrt — Werte nicht änderbar.",
|
||||
"pick.kind.tree": "Baum",
|
||||
"pick.kind.railing": "Geländer",
|
||||
"cmd.column.label": "Stütze",
|
||||
"cmd.column.place": "Stütze setzen:",
|
||||
"cmd.column.profile": "Profil",
|
||||
@@ -4332,6 +4363,7 @@ export const de = {
|
||||
"anonymity.area.ceilings": "Decken",
|
||||
"anonymity.area.roofs": "Dächer",
|
||||
"anonymity.area.trees": "Bäume",
|
||||
"anonymity.area.railings": "Geländer",
|
||||
"anonymity.kind.name": "Projektname",
|
||||
"anonymity.kind.number": "Projektnummer",
|
||||
"anonymity.kind.titleBlock": "Büro / Bearbeiter:in",
|
||||
|
||||
@@ -1546,6 +1546,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"resources.overrides.val.view_kind.elevation": "Elevation",
|
||||
"resources.overrides.val.element_kind.stair": "Stair",
|
||||
"resources.overrides.val.element_kind.column": "Column",
|
||||
"resources.overrides.val.element_kind.railing": "Railing",
|
||||
"resources.overrides.val.element_kind.opening": "Window / door",
|
||||
"resources.overrides.val.element_kind.room": "Room",
|
||||
"resources.overrides.val.element_kind.shadow": "Shadow",
|
||||
@@ -2150,6 +2151,35 @@ export const en: Record<TranslationKey, string> = {
|
||||
"cmd.tree.shape": "Shape",
|
||||
"cmd.tree.status": "Status",
|
||||
"cmd.tree.foliage": "Foliage",
|
||||
"cmd.gelaender.label": "Railing",
|
||||
"cmd.gelaender.start": "First railing point (number = height in m):",
|
||||
"cmd.gelaender.next": "Next point (Enter finishes, number = height):",
|
||||
"cmd.gelaender.kind": "Type",
|
||||
"objinfo.kind.railing": "Railing",
|
||||
"objinfo.railing.many": "{n} railings",
|
||||
"objinfo.railing.section": "Railing",
|
||||
"objinfo.railing.kind": "Type",
|
||||
"objinfo.railing.kind.bars": "Bars",
|
||||
"objinfo.railing.kind.glass": "Glass",
|
||||
"objinfo.railing.kind.solid": "Solid parapet",
|
||||
"objinfo.railing.kind.perforated": "Perforated sheet",
|
||||
"objinfo.railing.height": "Height",
|
||||
"objinfo.railing.heightHint": "Default 1.00 m per SIA 358 (fall height up to 12 m)",
|
||||
"objinfo.railing.baseOffset": "Base above storey",
|
||||
"objinfo.railing.baseOffsetHint": "e.g. 0.18 m on a balcony slab",
|
||||
"objinfo.railing.handrail": "Handrail",
|
||||
"objinfo.railing.handrailSize": "Handrail Ø",
|
||||
"objinfo.railing.barSpacing": "Bar spacing (axis)",
|
||||
"objinfo.railing.barSize": "Bar section",
|
||||
"objinfo.railing.thickness": "Thickness",
|
||||
"objinfo.railing.component": "Component",
|
||||
"objinfo.railing.componentNone": "none",
|
||||
"objinfo.railing.closed": "Closed (all round)",
|
||||
"objinfo.railing.length": "Length",
|
||||
"objinfo.railing.counts": "Bars / posts",
|
||||
"objinfo.railing.points": "Points",
|
||||
"objinfo.railing.locked": "Locked — values cannot be changed.",
|
||||
"newProject.layer.41": "Railings",
|
||||
"cmd.circlestotrees.label": "Convert circles to trees",
|
||||
"objinfo.kind.tree": "Tree",
|
||||
"objinfo.tree.many": "{n} trees",
|
||||
@@ -2264,6 +2294,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"objinfo.tree.trunkDiameter": "Trunk Ø",
|
||||
"objinfo.tree.locked": "Locked — values cannot be changed.",
|
||||
"pick.kind.tree": "Tree",
|
||||
"pick.kind.railing": "Railing",
|
||||
"cmd.column.label": "Column",
|
||||
"cmd.column.place": "Place column:",
|
||||
"cmd.column.profile": "Profile",
|
||||
@@ -4318,6 +4349,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"anonymity.area.ceilings": "Ceilings",
|
||||
"anonymity.area.roofs": "Roofs",
|
||||
"anonymity.area.trees": "Trees",
|
||||
"anonymity.area.railings": "Railings",
|
||||
"anonymity.kind.name": "project name",
|
||||
"anonymity.kind.number": "project number",
|
||||
"anonymity.kind.titleBlock": "office / author",
|
||||
|
||||
@@ -8,7 +8,7 @@ import { patchItem, setField } from "../core/opsBuild";
|
||||
import type { DesignOption, DesignOptionCombination, DesignOptionRef, DesignOptionSet, DrawingLevel, Project } from "./types";
|
||||
|
||||
/** Listen, deren Elemente einer Variante angehören können (gleich wie `design_options::COLLECTIONS`). */
|
||||
export const DESIGN_OPTION_COLLECTIONS = ["walls", "openings", "ceilings", "roofs", "stairs", "columns", "extrudedSolids", "rooms", "drawings2d"] as const;
|
||||
export const DESIGN_OPTION_COLLECTIONS = ["walls", "openings", "ceilings", "roofs", "stairs", "columns", "extrudedSolids", "rooms", "drawings2d", "railings"] as const;
|
||||
export type DesignOptionCollection = (typeof DESIGN_OPTION_COLLECTIONS)[number];
|
||||
|
||||
/** Kombination: Satz-Id → Varianten-Id. */
|
||||
@@ -490,6 +490,7 @@ const KIND_COLLECTION: Record<string, DesignOptionCollection> = {
|
||||
solids: "extrudedSolids",
|
||||
rooms: "rooms",
|
||||
drawings: "drawings2d",
|
||||
railings: "railings",
|
||||
};
|
||||
|
||||
/** Modell-Arten ohne Variante (immer ausserhalb einer Bearbeitungsvariante). */
|
||||
|
||||
@@ -20,6 +20,8 @@ export interface GroupMembership {
|
||||
treeIds: string[];
|
||||
/** [213] Kameras. */
|
||||
cameraIds: string[];
|
||||
/** [279] Geländer. */
|
||||
railingIds: string[];
|
||||
}
|
||||
|
||||
export type MemberKind = keyof GroupMembership;
|
||||
@@ -35,6 +37,7 @@ export const EMPTY_MEMBERSHIP: GroupMembership = {
|
||||
openingIds: [],
|
||||
treeIds: [],
|
||||
cameraIds: [],
|
||||
railingIds: [],
|
||||
};
|
||||
|
||||
/** Letzte transitive Mitgliedschaft (Projekt + Gruppe): Klick-/Rahmen-Filter fragen je Element. */
|
||||
|
||||
@@ -16,7 +16,7 @@ export const RENOVATION_STATUSES: readonly RenovationStatus[] = ["existing", "de
|
||||
* Listen mit Umbau-Status (Räume nur Sichtbarkeit/Flächen, keine Farbe). `drawings2d`: Möbel und Symbole der Bibliothek
|
||||
* (ohne Angabe = Bestand) sowie 2D-Elemente mit ausdrücklichem Status (Linienwerk, Masse …; Kern `drawing_takes_part`).
|
||||
*/
|
||||
export const RENOVATION_COLLECTIONS = ["walls", "openings", "ceilings", "roofs", "stairs", "columns", "extrudedSolids", "rooms", "drawings2d"] as const;
|
||||
export const RENOVATION_COLLECTIONS = ["walls", "openings", "ceilings", "roofs", "stairs", "columns", "extrudedSolids", "rooms", "drawings2d", "railings"] as const;
|
||||
export type RenovationCollection = (typeof RENOVATION_COLLECTIONS)[number];
|
||||
|
||||
/**
|
||||
@@ -273,6 +273,7 @@ const SELECTION_KEY: Record<RenovationCollection, string> = {
|
||||
extrudedSolids: "solids",
|
||||
rooms: "rooms",
|
||||
drawings2d: "drawings",
|
||||
railings: "railings",
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -409,6 +409,8 @@ export const sampleProject: Project = {
|
||||
{ code: "30", name: "Decken", color: "#1a1a1a", lw: 0.18, visible: true, locked: false },
|
||||
{ code: "31", name: "Dächer", color: "#1a1a1a", lw: 0.18, visible: true, locked: false },
|
||||
{ code: "40", name: "Treppen", color: "#1a1a1a", lw: 0.18, visible: true, locked: false },
|
||||
// [279] Geländer (Balkon, Galerie, Treppenauge): eigene Klasse, wie jedes Bauteil abschaltbar.
|
||||
{ code: "41", name: "Geländer", color: "#1a1a1a", lw: 0.18, visible: true, locked: false },
|
||||
{ code: "35", name: "Träger", color: "#0a0a0a", lw: 0.25, visible: true, locked: false },
|
||||
{ code: "50", name: "Text", color: "#1a1a1a", lw: 0.13, visible: true, locked: false },
|
||||
{ code: "60", name: "Räume", color: "#4a4a4a", lw: 0.13, visible: true, locked: false },
|
||||
|
||||
@@ -35,7 +35,9 @@ describe("Beispielprojekt Wettbewerb", () => {
|
||||
expect(p.walls.filter((w) => w.floorId === f && w.isExternal).length).toBe(4);
|
||||
expect(p.rooms!.filter((r) => r.floorId === f).length).toBe(10);
|
||||
}
|
||||
expect(p.ceilings!.length).toBe(3);
|
||||
// [279] zwei Balkonplatten mit Geländer (Stäbe 1. OG, Glas 2. OG)
|
||||
expect(p.ceilings!.length).toBe(5);
|
||||
expect(p.railings!.map((r) => r.kind)).toEqual(["bars", "glass"]);
|
||||
expect(p.roofs![0].shape).toBe("flach");
|
||||
expect(p.stairs!.length).toBe(2);
|
||||
expect(p.rooms!.length).toBe(30);
|
||||
|
||||
@@ -149,6 +149,18 @@ const ceilings: NonNullable<Project["ceilings"]> = [
|
||||
{ id: "c-eg", type: "ceiling", floorId: "eg", categoryCode: "30", outline: slab, openings: [HOLE], wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
{ id: "c-og1", type: "ceiling", floorId: "og1", categoryCode: "30", outline: slab, openings: [HOLE], wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
];
|
||||
// [279] Balkone an der Südfassade (Wohnung West): Betonplatte 1.4 m tief über dem EG bzw. 1. OG, Geländer an den drei freien
|
||||
// Seiten — Stäbe im 1. OG, Glas im 2. OG. Fusshöhe auf der Plattenoberkante (Geschoss-UK), Höhe 1.00 m nach SIA 358.
|
||||
const BALCONY = [P(0.6, -HA), P(7.4, -HA), P(7.4, -1.6), P(0.6, -1.6)];
|
||||
ceilings.push(
|
||||
{ id: "c-balkon-og1", type: "ceiling", floorId: "eg", categoryCode: "30", outline: BALCONY, wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
{ id: "c-balkon-og2", type: "ceiling", floorId: "og1", categoryCode: "30", outline: BALCONY, wallTypeId: "", ceilingTypeId: "wb-ct-decke", loadBearing: true },
|
||||
);
|
||||
const BALCONY_RAIL = [P(0.7, -HA), P(0.7, -1.5), P(7.3, -1.5), P(7.3, -HA)];
|
||||
const railings: NonNullable<Project["railings"]> = [
|
||||
{ id: "gl-balkon-og1", type: "railing", floorId: "og1", categoryCode: "41", points: BALCONY_RAIL, height: 1.0, kind: "bars", handrail: true },
|
||||
{ id: "gl-balkon-og2", type: "railing", floorId: "og2", categoryCode: "41", points: BALCONY_RAIL, height: 1.0, kind: "glass", handrail: true },
|
||||
];
|
||||
const stairs: NonNullable<Project["stairs"]> = ["eg", "og1"].map((f) => ({
|
||||
id: `tr-${f}`, type: "stair" as const, floorId: f, categoryCode: "40", shape: "straight" as const, typeId: "wb-tr-beton", start: P(10, 1.4), dir: P(0, 1), runLength: 4.3, width: 1.1, totalRise: FH, stepCount: 17,
|
||||
}));
|
||||
@@ -293,6 +305,7 @@ export function buildWettbewerbSampleProject(): Project {
|
||||
ceilings,
|
||||
roofs,
|
||||
stairs,
|
||||
railings,
|
||||
rooms: [],
|
||||
units: units(),
|
||||
drawings2d: cadastre(),
|
||||
|
||||
@@ -1763,6 +1763,8 @@ export type Group = {
|
||||
treeIds?: Array<string>;
|
||||
/** [213] Kameras (fehlt in älteren Dateien). */
|
||||
cameraIds?: Array<string>;
|
||||
/** [279] Geländer (fehlt in älteren Dateien). */
|
||||
railingIds?: Array<string>;
|
||||
/** Verschachtelte Gruppen (diese Gruppe enthält andere Gruppen als Ganzes). */
|
||||
groupIds: Array<string>;
|
||||
};
|
||||
@@ -3252,6 +3254,10 @@ export type Project = {
|
||||
* bestehende Projekte ohne `trees` gültig bleiben (Default: leer behandeln).
|
||||
*/
|
||||
trees?: Array<Tree>;
|
||||
/**
|
||||
* Geländer ([279]) — eigenes Bauteil (Balkon, Galerie, Treppenauge), siehe {@link Railing}. Optional.
|
||||
*/
|
||||
railings?: Array<Railing>;
|
||||
/**
|
||||
* Kameras ([213]) — gespeicherte Standpunkte für 3D-Ansicht und Rendering, siehe {@link Camera}. Optional
|
||||
* (Default: leer behandeln).
|
||||
@@ -3427,6 +3433,61 @@ export type PublishSet = {
|
||||
pdfLayers?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ein Geländer ([279]) — eigenes Bauteil für Balkon, Galerie, Treppenauge und Terrasse (Absturzsicherung,
|
||||
* Vorgabe 1.00 m nach SIA 358): Polylinie `points` auf einem Geschoss, Höhe, Art der Füllung, Handlauf. Grundriss
|
||||
* (Linie bzw. Doppellinie je Art), Schnitt/Ansicht (Stäbe, Glasfläche, Brüstung), 3D, IFC (`IfcRailing`).
|
||||
* Fusshöhe = Geschoss-UK + `baseOffset` (z. B. auf einer Balkonplatte).
|
||||
*/
|
||||
export type Railing = {
|
||||
id: string;
|
||||
type: "railing";
|
||||
/** Zugehörige Zeichnungsebene (Geschoss). */
|
||||
floorId: string;
|
||||
/** Grafik-Kategorie (Ebene), Vorgabe "55" (Geländer). */
|
||||
categoryCode: string;
|
||||
/** IFC-GlobalId des Quell-Bauteils (IFC-Import/Rundreise). */
|
||||
ifcGlobalId?: string;
|
||||
/** Objekt-Sperre, analog `Wall.locked`. */
|
||||
locked?: boolean;
|
||||
/** Achse des Geländers (Polylinie im Grundriss, Meter, mindestens 2 Punkte). */
|
||||
points: Array<Vec2>;
|
||||
/** Geschlossener Zug (Treppenauge, Galerie ringsum); fehlt = offen. */
|
||||
closed?: boolean;
|
||||
/** Höhe über dem Fuss bis Oberkante Handlauf bzw. Füllung (m, Vorgabe 1.00 nach SIA 358). */
|
||||
height: number;
|
||||
/** Fusshöhe relativ zur Geschoss-UK (m, Vorgabe 0), z. B. 0.18 auf einer Balkonplatte. */
|
||||
baseOffset?: number;
|
||||
/** Art der Füllung. */
|
||||
kind: RailingKind;
|
||||
/** Stäbe: Achsabstand der Stäbe (m, Vorgabe 0.12; lichtes Mass bleibt unter 12 cm). */
|
||||
barSpacing?: number;
|
||||
/** Stäbe: Querschnitt (Kantenlänge bzw. Durchmesser, m, Vorgabe 0.014). */
|
||||
barSize?: number;
|
||||
/**
|
||||
* Dicke der Füllung (m): Glas (Vorgabe 0.02), Brüstung (Vorgabe 0.15), Lochblech (Vorgabe 0.004); bei Stäben ohne Wirkung.
|
||||
*/
|
||||
thickness?: number;
|
||||
/** Handlauf auf der Oberkante; fehlt = bei Stäben und Glas ja, sonst nein. */
|
||||
handrail?: boolean;
|
||||
/** Handlauf: Durchmesser (m, Vorgabe 0.04). */
|
||||
handrailSize?: number;
|
||||
/** Optionales Bauteil (Component) für Füllung/Farbe, v. a. der massiven Brüstung. */
|
||||
componentId?: string;
|
||||
/** Optionale Übersteuerung der Strichfarbe; sonst gilt die Kategorie-Farbe. */
|
||||
color?: string;
|
||||
/** [271] Umbau: Status (Bestand, Abbruch, Neu) und Etappe. Fehlt ⇒ Bestand. */
|
||||
renovation?: Renovation;
|
||||
/** [272] Variante, zu der das Element gehört. Fehlt ⇒ Hauptmodell (immer sichtbar). */
|
||||
designOption?: DesignOptionRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Art der Füllung eines Geländers ([279]): Stäbe (Rundstahl/Flachstahl, lotrecht), Glas (Ganzglas-Brüstung),
|
||||
* massive Brüstung (Mauer/Beton) oder Lochblech.
|
||||
*/
|
||||
export type RailingKind = "bars" | "glass" | "solid" | "perforated";
|
||||
|
||||
/**
|
||||
* Referenzlinien-Regel: setzt die `referenceLine`-Eigenschaft bei passenden
|
||||
* Wänden einheitlich (Vectorworks-Stil).
|
||||
|
||||
@@ -31,6 +31,7 @@ import { ContextObjectProps } from "./ContextObjectProps";
|
||||
import { SunStudySection } from "./SunStudySection";
|
||||
import { SiteRulesSection } from "./SiteRulesSection";
|
||||
import { TreeSection } from "./objectInfo/TreeSection";
|
||||
import { RailingSection } from "./objectInfo/RailingSection";
|
||||
import { CameraSection } from "./objectInfo/CameraSection";
|
||||
import { ViewShadowsInfo, MeasurementSection } from "./objectInfo/InfoBlocks";
|
||||
import { DimensionField, RotateField } from "./objectInfo/fields";
|
||||
@@ -85,6 +86,7 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
// [137] Lage-Darstellung angeklickt (Schattenfläche / Baurechtslinie): Einstellungen der Quelle.
|
||||
const site = useStore((s) => s.selection.site);
|
||||
const treeSel = useStore((s) => s.selection.trees);
|
||||
const railingSel = useStore((s) => s.selection.railings);
|
||||
const cameraSel = useStore((s) => s.selection.cameras);
|
||||
const ctxObj = sel?.kind === "contextObject" ? (storeProject.context ?? []).find((o) => o.id === sel.id) : undefined;
|
||||
const quantities = useMemo(
|
||||
@@ -95,6 +97,8 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
// ── Leerzustand ───────────────────────────────────────────────────────────
|
||||
// [149] Baum gewählt: eigene Felder (Lage, Masse, Form, Bestand).
|
||||
if (sel === null && treeSel.length > 0) return <TreeSection ids={treeSel} />;
|
||||
// [279] Geländer gewählt: Art, Höhe, Fusshöhe, Handlauf, Stäbe/Dicke.
|
||||
if (sel === null && railingSel.length > 0) return <RailingSection ids={railingSel} />;
|
||||
// [213] Kamera gewählt: Standpunkt, Ziel, Bildwinkel, Projektion, Sonne und „Kamera öffnen".
|
||||
if (sel === null && cameraSel.length > 0) return <CameraSection ids={cameraSel} />;
|
||||
if (sel === null && site[0] === "viewShadows") return <ViewShadowsInfo />;
|
||||
|
||||
@@ -379,7 +379,7 @@ const TOOLS_2D: ToolId[] = [
|
||||
"image",
|
||||
];
|
||||
const TOOLS_3D: ToolId[] = ["wall", "ceiling", "window", "door", "stair", "room"];
|
||||
const COMMANDS_3D = ["column", "tree", "circlestotrees", "ceilingopening", "roof", "roofhole", "roofwindow", "dormer", "extrude", "revolve", "loft", "solid", "solidbool", "solidtoparts", "sectionline", "viewline", "ansichten", "autodim", "excavation"];
|
||||
const COMMANDS_3D = ["column", "gelaender", "tree", "circlestotrees", "ceilingopening", "roof", "roofhole", "roofwindow", "dormer", "extrude", "revolve", "loft", "solid", "solidbool", "solidtoparts", "sectionline", "viewline", "ansichten", "autodim", "excavation"];
|
||||
const COMMANDS_EDIT = ["move", "copy", "array", "rotate", "mirror", "offset", "multiline", "trim", "break", "split", "extend", "fillet", "chamfer", "join", "defblock", "measure", "erkennen"];
|
||||
|
||||
type ToolsView = "list" | "icons";
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
// Abschnitt „Geländer" der Objekt-Info ([279]): Art (Stäbe, Glas, Brüstung, Lochblech), Höhe (Vorgabe 1.00 m nach
|
||||
// SIA 358), Fusshöhe über dem Geschoss (z. B. auf einer Balkonplatte), Handlauf, Stababstand/-querschnitt, Dicke und
|
||||
// Bauteil der Brüstung. Kennzahlen (Länge, Stäbe, Pfosten) rechnet der Kern (`analysis/railingInfo.ts`). Jede Änderung
|
||||
// ist ein Undo-Schritt (der Kern prüft die Op); bei mehreren gewählten Geländern wirken die Felder auf alle.
|
||||
//
|
||||
// Gerufen von `ObjectInfoPanel`.
|
||||
|
||||
import { useMemo } from "react";
|
||||
import type { Railing, RailingKind } from "../../model/types";
|
||||
import { useStore } from "../../state/appStore";
|
||||
import { t, type TranslationKey } from "../../i18n";
|
||||
import { patchItem } from "../../core";
|
||||
import { Dropdown } from "../../ui/Dropdown";
|
||||
import { railingInfo } from "../../analysis/railingInfo";
|
||||
import { DimensionField } from "./fields";
|
||||
|
||||
const KINDS: RailingKind[] = ["bars", "glass", "solid", "perforated"];
|
||||
/** Vorgabe des Handlaufs je Art, wenn nichts angegeben ist (Kern `railing::has_handrail`). */
|
||||
const handrailDefault = (kind: RailingKind): boolean => kind === "bars" || kind === "glass";
|
||||
|
||||
export function RailingSection({ ids }: { ids: readonly string[] }) {
|
||||
const project = useStore((st) => st.project);
|
||||
const applyChange = useStore((s) => s.applyChange);
|
||||
const list = (project.railings ?? []).filter((x) => ids.includes(x.id));
|
||||
const rail = list[0];
|
||||
const info = useMemo(() => (rail ? railingInfo(project, rail.id) : null), [project, rail]);
|
||||
if (!rail) return <div className="objinfo-panel"><div className="objinfo-empty">{t("objinfo.empty")}</div></div>;
|
||||
const locked = !!rail.locked;
|
||||
const set = (patch: Partial<Railing>, all = false) =>
|
||||
applyChange((p) => (all ? list : [rail]).filter((x) => !x.locked).flatMap((x) => patchItem(p, "railings", x.id, patch)));
|
||||
const level = project.drawingLevels.find((l) => l.id === rail.floorId);
|
||||
const handrail = rail.handrail ?? handrailDefault(rail.kind);
|
||||
const bars = rail.kind === "bars";
|
||||
const panel = rail.kind === "glass" || rail.kind === "solid" || rail.kind === "perforated";
|
||||
const dflt = rail.kind === "glass" ? 0.02 : rail.kind === "solid" ? 0.15 : 0.004;
|
||||
return (
|
||||
<div className="objinfo-panel objinfo-railing">
|
||||
<div className="objinfo-head">
|
||||
<span className="objinfo-kind">{list.length > 1 ? t("objinfo.railing.many", { n: list.length }) : t("objinfo.kind.railing")}</span>
|
||||
</div>
|
||||
<div className="objinfo-section-label">{t("objinfo.railing.section")}</div>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.kind")}</span>
|
||||
<Dropdown
|
||||
value={rail.kind}
|
||||
onChange={(v) => set({ kind: v as RailingKind }, true)}
|
||||
options={KINDS.map((v) => ({ value: v, label: t(`objinfo.railing.kind.${v}` as TranslationKey) }))}
|
||||
title={t("objinfo.railing.kind")}
|
||||
width={150}
|
||||
/>
|
||||
</div>
|
||||
<div title={t("objinfo.railing.heightHint")}>
|
||||
<DimensionField label={t("objinfo.railing.height")} value={rail.height} min={0.1} onCommit={(v) => set({ height: v }, true)} />
|
||||
</div>
|
||||
<div title={t("objinfo.railing.baseOffsetHint")}>
|
||||
<DimensionField label={t("objinfo.railing.baseOffset")} value={rail.baseOffset ?? 0} min={-Infinity} onCommit={(v) => set({ baseOffset: v === 0 ? undefined : v }, true)} />
|
||||
</div>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.handrail")}</span>
|
||||
<input type="checkbox" checked={handrail} disabled={locked} onChange={(e) => set({ handrail: e.target.checked }, true)} data-testid="railing-handrail" />
|
||||
</div>
|
||||
{handrail && <DimensionField label={t("objinfo.railing.handrailSize")} value={rail.handrailSize ?? 0.04} min={0.02} onCommit={(v) => set({ handrailSize: v })} />}
|
||||
{bars && <DimensionField label={t("objinfo.railing.barSpacing")} value={rail.barSpacing ?? 0.12} min={0.03} onCommit={(v) => set({ barSpacing: v })} />}
|
||||
{bars && <DimensionField label={t("objinfo.railing.barSize")} value={rail.barSize ?? 0.014} min={0.004} onCommit={(v) => set({ barSize: v })} />}
|
||||
{panel && <DimensionField label={t("objinfo.railing.thickness")} value={rail.thickness ?? dflt} min={0.002} onCommit={(v) => set({ thickness: v })} />}
|
||||
{rail.kind === "solid" && (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.component")}</span>
|
||||
<Dropdown
|
||||
value={rail.componentId ?? ""}
|
||||
onChange={(v) => set({ componentId: v || undefined })}
|
||||
options={[{ value: "", label: t("objinfo.railing.componentNone") }, ...project.components.map((c) => ({ value: c.id, label: c.name }))]}
|
||||
title={t("objinfo.railing.component")}
|
||||
width={150}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.closed")}</span>
|
||||
<input type="checkbox" checked={rail.closed === true} disabled={locked || rail.points.length < 3} onChange={(e) => set({ closed: e.target.checked || undefined })} data-testid="railing-closed" />
|
||||
</div>
|
||||
{info && (
|
||||
<>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.length")}</span>
|
||||
<span className="objinfo-fval" data-testid="railing-length">{info.length.toFixed(2)} m</span>
|
||||
</div>
|
||||
{bars && (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.railing.counts")}</span>
|
||||
<span className="objinfo-fval">{info.bars} / {info.posts}</span>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.column.floor")}</span>
|
||||
<span className="objinfo-fval">{level?.name ?? rail.floorId}</span>
|
||||
</div>
|
||||
{locked && <div className="objinfo-muted">{t("objinfo.railing.locked")}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -18,7 +18,7 @@ const AREA_TITLE = { object: "objsettings.area.object", appearance: "objsettings
|
||||
export function ObjectSettingsPanel() {
|
||||
const host = usePanelHost();
|
||||
const sel = useSelectionInfo();
|
||||
const otherSelected = useStore((s) => s.selection.trees.length + s.selection.cameras.length + s.selection.site.length > 0);
|
||||
const otherSelected = useStore((s) => s.selection.trees.length + s.selection.railings.length + s.selection.cameras.length + s.selection.site.length > 0);
|
||||
const isGrid = useStore((s) => (sel?.kind === "drawing2d" ? s.project.drawings2d.find((d) => d.id === sel.id)?.geom.shape === "grid" : false));
|
||||
const wanted = useSyncExternalStore(subscribeSettingsArea, getSettingsArea, getSettingsArea);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { flattenCategories } from "../model/types";
|
||||
/** Art eines auswählbaren Objekts an einer Klickstelle (Reihenfolge = Standard-Priorität). */
|
||||
export type PickKind =
|
||||
| "section" | "opening" | "wall" | "column" | "drawing" | "solid"
|
||||
| "tree" | "camera" | "ceiling" | "stair" | "room" | "roof" | "site" | "context";
|
||||
| "tree" | "railing" | "camera" | "ceiling" | "stair" | "room" | "roof" | "site" | "context";
|
||||
|
||||
type WithCategory = { id: string; categoryCode?: string };
|
||||
|
||||
@@ -26,6 +26,7 @@ function collection(project: Project, kind: PickKind): readonly WithCategory[] {
|
||||
case "context": return p.context ?? [];
|
||||
case "solid": return p.extrudedSolids ?? [];
|
||||
case "tree": return p.trees ?? [];
|
||||
case "railing": return p.railings ?? [];
|
||||
case "camera": return p.cameras ?? [];
|
||||
case "section":
|
||||
case "site": return [];
|
||||
|
||||
@@ -110,6 +110,12 @@ export interface PickTreeMesh {
|
||||
treeId: string;
|
||||
}
|
||||
|
||||
/** [279] Geländer für den Raycast: WORLD-Dreiecke aller Teile (x, Höhe, y). */
|
||||
export interface PickRailingMesh {
|
||||
tris: ReadonlyArray<readonly [Vec3, Vec3, Vec3]>;
|
||||
railingId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* [137] Freier Körper (`extrudedSolids`, Loft/Rotation/Abzug/B-Rep) für den Raycast: WORLD-Dreiecke
|
||||
* (x, Höhe, y) des Kern-Netzes ([115], dasselbe wie im 3D-Bild; ohne Netz das Prisma über dem Umriss).
|
||||
|
||||
@@ -46,7 +46,7 @@ import { collectVisibleCodes, flattenCategories } from "../model/types";
|
||||
import type { DetailLevel } from "../model/viewTypes";
|
||||
import { documentFor } from "../core/document";
|
||||
import { coreEpoch } from "../engine/coreWasm";
|
||||
import type { PickOpening, PickRoof, PickStair, PickContextMesh, PickColumnMesh, PickSolidMesh, PickOpeningMesh, PickDrawingSeg, PickStairMesh, PickDrawingMesh, PickTreeMesh } from "./pickTypes";
|
||||
import type { PickOpening, PickRoof, PickStair, PickContextMesh, PickColumnMesh, PickSolidMesh, PickOpeningMesh, PickDrawingSeg, PickStairMesh, PickDrawingMesh, PickTreeMesh, PickRailingMesh } from "./pickTypes";
|
||||
import {
|
||||
type RMesh,
|
||||
type RModel3d,
|
||||
@@ -506,6 +506,8 @@ export function pickGeometry(
|
||||
drawingMeshes: PickDrawingMesh[];
|
||||
/** [149] Bäume (Stamm + Krone). */
|
||||
trees: PickTreeMesh[];
|
||||
/** [279] Geländer (alle Teile). */
|
||||
railings: PickRailingMesh[];
|
||||
} {
|
||||
// [137]/[115] Freie Körper als Dreiecke ihres Kern-Netzes (dasselbe wie im Bild, mit der Explosion angehoben).
|
||||
return documentFor(project).query("pickGeometry", [explodeGap(explode)], classFilterText(hide)) as ReturnType<typeof pickGeometry>;
|
||||
@@ -555,8 +557,10 @@ export function selectionHighlightLines(
|
||||
solidIds: string[] = [],
|
||||
/** [149] Bäume (Kronen-Zylinder vom Fuss bis zur Spitze). */
|
||||
treeIds: string[] = [],
|
||||
/** [279] Geländer (Umriss der Achse, Fuss bis Oberkante). */
|
||||
railingIds: string[] = [],
|
||||
): Float32Array {
|
||||
const sel = { walls: wallIds, ceilings: ceilingIds, openings: openingIds, stairs: stairIds, roofs: roofIds, context: contextObjectIds, columns: columnIds, solids: solidIds, trees: treeIds };
|
||||
const sel = { walls: wallIds, ceilings: ceilingIds, openings: openingIds, stairs: stairIds, roofs: roofIds, context: contextObjectIds, columns: columnIds, solids: solidIds, trees: treeIds, railings: railingIds };
|
||||
if (Object.values(sel).every((l) => l.length === 0)) return new Float32Array(0);
|
||||
// Gerechnet im Kern (`highlight3d.rs`); Antwort f32-LE.
|
||||
const b = documentFor(project).queryBin("selectionHighlight", [], JSON.stringify({ ...sel, rgb, explode: explodeGap(explode) }));
|
||||
|
||||
@@ -36,6 +36,7 @@ const EMPTY_MEM = {
|
||||
openingIds: [] as string[],
|
||||
treeIds: [] as string[],
|
||||
cameraIds: [] as string[],
|
||||
railingIds: [] as string[],
|
||||
};
|
||||
|
||||
function project(groups: Group[]): Project {
|
||||
|
||||
@@ -28,6 +28,7 @@ const KEYS: MemberKind[] = [
|
||||
"openingIds",
|
||||
"treeIds",
|
||||
"cameraIds",
|
||||
"railingIds",
|
||||
];
|
||||
|
||||
/** Vereinigung je Art (erste Vorkommen in Reihenfolge) — für Auswahl-Mengen in der Hülle. */
|
||||
@@ -46,6 +47,7 @@ const PICK3D_KIND: Partial<Record<string, MemberKind>> = {
|
||||
roof: "roofIds",
|
||||
column: "columnIds",
|
||||
tree: "treeIds",
|
||||
railing: "railingIds",
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -61,6 +63,7 @@ export function pick3dGroup(project: Project, kind: string, id: string, groupPat
|
||||
|
||||
/** [149] Präfix der Baum-Pick-Id im Feld `contextObjectId` (Kern `tree::TREE_PICK_PREFIX`). */
|
||||
const TREE_PICK = "@tree:";
|
||||
const RAILING_PICK = "@railing:";
|
||||
/** [213] Präfix der Kamera-Pick-Id im Feld `contextObjectId` (Kern `plan/cameras.rs`). */
|
||||
const CAMERA_PICK = "@camera:";
|
||||
|
||||
@@ -104,6 +107,7 @@ export function applyGroupDimming(
|
||||
openingIds: new Set(mem.openingIds),
|
||||
treeIds: new Set(mem.treeIds),
|
||||
cameraIds: new Set(mem.cameraIds),
|
||||
railingIds: new Set(mem.railingIds),
|
||||
};
|
||||
return primitives.map((p) => {
|
||||
const rec = p as unknown as Record<string, unknown>;
|
||||
@@ -121,6 +125,11 @@ export function applyGroupDimming(
|
||||
hasId = true;
|
||||
if (sets.treeIds.has(ctx.slice(TREE_PICK.length))) inside = true;
|
||||
}
|
||||
// [279] Geländer: `contextObjectId = "@railing:<id>"`.
|
||||
if (typeof ctx === "string" && ctx.startsWith(RAILING_PICK)) {
|
||||
hasId = true;
|
||||
if (sets.railingIds.has(ctx.slice(RAILING_PICK.length))) inside = true;
|
||||
}
|
||||
// [213] Kameras: `contextObjectId = "@camera:<id>"`.
|
||||
if (typeof ctx === "string" && ctx.startsWith(CAMERA_PICK)) {
|
||||
hasId = true;
|
||||
@@ -179,6 +188,7 @@ export function groupSelection(
|
||||
openingIds: sel.openingIds,
|
||||
...(sel.treeIds.length ? { treeIds: sel.treeIds } : {}),
|
||||
...(sel.cameraIds.length ? { cameraIds: sel.cameraIds } : {}),
|
||||
...(sel.railingIds.length ? { railingIds: sel.railingIds } : {}),
|
||||
groupIds: [...selectedGroupIds],
|
||||
};
|
||||
return { ops: addItems("groups", [g]), groupId: id };
|
||||
@@ -210,6 +220,7 @@ export function ungroup(
|
||||
openingIds: g.openingIds,
|
||||
treeIds: g.treeIds ?? [],
|
||||
cameraIds: g.cameraIds ?? [],
|
||||
railingIds: g.railingIds ?? [],
|
||||
},
|
||||
subGroupIds: g.groupIds,
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface SelectionAppearance {
|
||||
|
||||
/** Zahl der gewählten Elemente (ohne Gruppen, Schnittlinien, Lage-Darstellung, Bäume). */
|
||||
export function selectedCount(sel: Selection): number {
|
||||
return ELEMENT_KINDS.filter((k) => k !== "sectionLines" && k !== "site" && k !== "trees" && k !== "cameras").reduce((n, k) => n + sel[k].length, 0);
|
||||
return ELEMENT_KINDS.filter((k) => k !== "sectionLines" && k !== "site" && k !== "trees" && k !== "railings" && k !== "cameras").reduce((n, k) => n + sel[k].length, 0);
|
||||
}
|
||||
|
||||
/** Effektive Strichstärke und Farbe über die gewählten Wände/Decken/2D-Elemente. */
|
||||
|
||||
@@ -38,6 +38,8 @@ export function isLocked(project: Project, kind: MemberKind, id: string): boolea
|
||||
return !!(project.trees ?? []).find((t) => t.id === id)?.locked;
|
||||
case "cameraIds":
|
||||
return !!(project.cameras ?? []).find((c) => c.id === id)?.locked;
|
||||
case "railingIds":
|
||||
return !!(project.railings ?? []).find((c) => c.id === id)?.locked;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +66,8 @@ export function lockOps(project: Project, kind: MemberKind, id: string, locked:
|
||||
return patchItem(project, "trees", id, { locked });
|
||||
case "cameraIds":
|
||||
return patchItem(project, "cameras", id, { locked });
|
||||
case "railingIds":
|
||||
return patchItem(project, "railings", id, { locked });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export function openObjectSettings(deps: ObjectSettingsDeps, group?: InfoGroupId
|
||||
const sel = selectionInfoFor(project, selection);
|
||||
let target = objectSettingsTarget(sel, deps.activeTool, isGridDrawing(sel?.kind === "drawing2d" ? sel.id : undefined));
|
||||
// Baum, Lage-Darstellung und Schnittlinie sind keine `SelectionInfo`, haben aber ihre Felder in der Objekt-Info.
|
||||
if (!target && (selection.trees.length > 0 || selection.cameras.length > 0 || selection.site.length > 0 || selection.sectionLines.length > 0)) {
|
||||
if (!target && (selection.trees.length > 0 || selection.railings.length > 0 || selection.cameras.length > 0 || selection.site.length > 0 || selection.sectionLines.length > 0)) {
|
||||
target = { group: selection.sectionLines.length > 0 ? "sectionLine" : null };
|
||||
}
|
||||
if (!target) return false;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { Railing } from "../model/types";
|
||||
import { railingGripPatch, railingGripPoints } from "./railingGrips";
|
||||
|
||||
const base = {
|
||||
id: "g",
|
||||
type: "railing",
|
||||
floorId: "eg",
|
||||
categoryCode: "41",
|
||||
points: [{ x: 0, y: 0 }, { x: 3, y: 0 }, { x: 3, y: 2 }],
|
||||
height: 1,
|
||||
kind: "bars",
|
||||
} as unknown as Railing;
|
||||
|
||||
describe("[279] Geländer-Griffe", () => {
|
||||
it("ein Griff je Achsenpunkt", () => {
|
||||
expect(railingGripPoints(base)).toEqual([{ x: 0, y: 0 }, { x: 3, y: 0 }, { x: 3, y: 2 }]);
|
||||
});
|
||||
|
||||
it("Ziehen ersetzt genau diesen Punkt; Unsinn ändert nichts", () => {
|
||||
expect(railingGripPatch(base, 1, { x: 4, y: 1 })).toEqual({ points: [{ x: 0, y: 0 }, { x: 4, y: 1 }, { x: 3, y: 2 }] });
|
||||
expect(railingGripPatch(base, 5, { x: 4, y: 1 })).toEqual({});
|
||||
expect(railingGripPatch(base, -1, { x: 4, y: 1 })).toEqual({});
|
||||
expect(railingGripPatch(base, 0, { x: NaN, y: 1 })).toEqual({});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
// [279] Griffe eines Geländers im Grundriss: jeder Punkt der Achse (verschieben). Die Punkte folgen dem Modell
|
||||
// (`Railing.points`); ein Ziehen ersetzt genau diesen Punkt, Höhe, Art und Teilung bleiben.
|
||||
//
|
||||
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
|
||||
|
||||
import type { Railing, Vec2 } from "../model/types";
|
||||
|
||||
/** Griff-Punkte: alle Punkte der Achse in Reihenfolge. */
|
||||
export function railingGripPoints(r: Railing): Vec2[] {
|
||||
return r.points.map((p) => ({ x: p.x, y: p.y }));
|
||||
}
|
||||
|
||||
/** Änderung beim Ziehen des Griffs `index` an `pt`; unbekannter Index ändert nichts. */
|
||||
export function railingGripPatch(r: Railing, index: number, pt: Vec2): Partial<Railing> {
|
||||
if (!Number.isFinite(pt.x) || !Number.isFinite(pt.y) || index < 0 || index >= r.points.length) return {};
|
||||
return { points: r.points.map((p, i) => (i === index ? { x: pt.x, y: pt.y } : p)) };
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export function renovationFilterLabel(id: string, own: readonly { id: string; na
|
||||
|
||||
/** Ids der Auswahl, die einen Umbau-Status tragen (Wände, Öffnungen, Decken, Dächer, Treppen, Stützen, Körper, Räume, 2D-Elemente, Bäume). */
|
||||
export function selectionRenovationIds(sel: Selection): string[] {
|
||||
return [...sel.walls, ...sel.openings, ...sel.ceilings, ...sel.roofs, ...sel.stairs, ...sel.columns, ...sel.solids, ...sel.rooms, ...sel.drawings, ...sel.trees];
|
||||
return [...sel.walls, ...sel.openings, ...sel.ceilings, ...sel.roofs, ...sel.stairs, ...sel.columns, ...sel.solids, ...sel.rooms, ...sel.drawings, ...sel.trees, ...sel.railings];
|
||||
}
|
||||
|
||||
const NO_PHASES: readonly RenovationPhase[] = [];
|
||||
|
||||
@@ -86,6 +86,7 @@ describe("Selection", () => {
|
||||
roomIds: [],
|
||||
openingIds: [],
|
||||
treeIds: [],
|
||||
railingIds: [],
|
||||
cameraIds: [],
|
||||
contextIds: [],
|
||||
});
|
||||
|
||||
@@ -41,6 +41,8 @@ export interface Selection {
|
||||
trees: string[];
|
||||
/** [213] Kameras (`Project.cameras`). */
|
||||
cameras: string[];
|
||||
/** [279] Geländer (`Project.railings`). */
|
||||
railings: string[];
|
||||
/**
|
||||
* Gewählte Gruppen — rein informativ (Bounding-Box, Doppelklick-Ziel); die
|
||||
* Mitglieder stehen zusätzlich in den übrigen Arten (s. `groupActions.ts`).
|
||||
@@ -66,6 +68,7 @@ export const SELECTION_KINDS: readonly SelectionKind[] = [
|
||||
"site",
|
||||
"trees",
|
||||
"cameras",
|
||||
"railings",
|
||||
"groups",
|
||||
];
|
||||
|
||||
@@ -145,6 +148,7 @@ export function toCommandSelection(sel: Selection): CommandSelection {
|
||||
roomIds: sel.rooms,
|
||||
openingIds: sel.openings,
|
||||
treeIds: sel.trees,
|
||||
railingIds: sel.railings,
|
||||
cameraIds: sel.cameras,
|
||||
contextIds: sel.contextObjects,
|
||||
};
|
||||
@@ -168,6 +172,7 @@ export function hasTransformable(sel: Selection): boolean {
|
||||
sel.rooms.length > 0 ||
|
||||
sel.openings.length > 0 ||
|
||||
sel.trees.length > 0 ||
|
||||
sel.railings.length > 0 ||
|
||||
sel.cameras.length > 0 ||
|
||||
sel.contextObjects.length > 0
|
||||
);
|
||||
@@ -191,6 +196,8 @@ export interface SelectionIdLists {
|
||||
treeIds?: string[];
|
||||
/** [213] Kameras (gruppierbar wie Bäume). */
|
||||
cameraIds?: string[];
|
||||
/** [279] Geländer (gruppierbar). */
|
||||
railingIds?: string[];
|
||||
}
|
||||
|
||||
const ID_LIST_KEYS: [SelectionKind, keyof SelectionIdLists][] = [
|
||||
@@ -208,6 +215,7 @@ const ID_LIST_KEYS: [SelectionKind, keyof SelectionIdLists][] = [
|
||||
["groups", "groupIds"],
|
||||
["trees", "treeIds"],
|
||||
["cameras", "cameraIds"],
|
||||
["railings", "railingIds"],
|
||||
];
|
||||
|
||||
/** Auswahl → `…Ids`-Listen (passt strukturell auf `GroupMembership` und `BcfSelection`). */
|
||||
@@ -240,5 +248,6 @@ export function toMembership(sel: Selection): GroupMembership {
|
||||
openingIds: sel.openings,
|
||||
treeIds: sel.trees,
|
||||
cameraIds: sel.cameras,
|
||||
railingIds: sel.railings,
|
||||
};
|
||||
}
|
||||
@@ -73,5 +73,5 @@ export function hideSelectionIn3d(): void {
|
||||
const ids = selectionIds3d(st.selection);
|
||||
if (!ids.length) return;
|
||||
setView3dFilter(hideSelection3d(getView3dFilter(), ids));
|
||||
st.setSelection(clearKinds("walls", "ceilings", "openings", "stairs", "solids", "columns", "roofs", "contextObjects", "trees", "cameras", "drawings", "groups"));
|
||||
st.setSelection(clearKinds("walls", "ceilings", "openings", "stairs", "solids", "columns", "roofs", "contextObjects", "trees", "railings", "cameras", "drawings", "groups"));
|
||||
}
|
||||
@@ -51,6 +51,7 @@ import { getPlanViewport, subscribePlanViewport } from "./planViewport";
|
||||
import { growRect, meshGripIndices } from "../core";
|
||||
import { patchItem, verticalExtents } from "../core";
|
||||
import { treeGripPatch, treeGripPoints } from "./treeGrips";
|
||||
import { railingGripPatch, railingGripPoints } from "./railingGrips";
|
||||
import { cameraGripPoints } from "../core";
|
||||
import type { Selection } from "./selection";
|
||||
|
||||
@@ -213,6 +214,9 @@ export function useGripEditing(opts: {
|
||||
);
|
||||
const selectedTreeId = single(selection, "trees");
|
||||
const selectedTree = selectedTreeId ? (project.trees ?? []).find((x) => x.id === selectedTreeId) : undefined;
|
||||
// [279] Geländer: Griffe an allen Achsenpunkten (nur auf dem Geschoss des Geländers).
|
||||
const selectedRailingId = single(selection, "railings");
|
||||
const selectedRailing = selectedRailingId ? (project.railings ?? []).find((x) => x.id === selectedRailingId && x.floorId === levelId) : undefined;
|
||||
// [213] Kamera: Griffe an Standpunkt, Ziel und Sichtkegel-Rand (Bildwinkel); nur auf dem Geschoss der Kamera.
|
||||
const selectedCameraId = single(selection, "cameras");
|
||||
const selectedCamera = selectedCameraId ? (project.cameras ?? []).find((x) => x.id === selectedCameraId && x.floorId === levelId) : undefined;
|
||||
@@ -278,7 +282,7 @@ export function useGripEditing(opts: {
|
||||
// [26] Dach-Griffe: nur bei einzeln gewähltem, nicht gesperrtem Dach und ohne andere Griff-Träger in der Auswahl.
|
||||
const roofGripsOn =
|
||||
modelEditable && !!selectedRoof && !selectedRoof.locked && !!opts.moveRoofVertex && !selectedCeiling && !selectedRoom &&
|
||||
!selectedExcavation && !selectedTree && !selectedSectionLine && effectiveDrawingIds.length === 0 && selectedWallIds.length === 0;
|
||||
!selectedExcavation && !selectedTree && !selectedRailing && !selectedSectionLine && effectiveDrawingIds.length === 0 && selectedWallIds.length === 0;
|
||||
/** Ringe des Dachs in der Reihenfolge des flachen Index (Umriss, dann Höfe) samt Start-Index. */
|
||||
const roofRings = (r: Roof): { pts: Vec2[]; off: number; bulge?: number[] }[] => {
|
||||
let off = 0;
|
||||
@@ -522,6 +526,11 @@ export function useGripEditing(opts: {
|
||||
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
|
||||
return pts;
|
||||
}
|
||||
if (selectedRailing && modelEditable && !selectedRailing.locked) {
|
||||
const pts = railingGripPoints(selectedRailing);
|
||||
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
|
||||
return pts;
|
||||
}
|
||||
if (selectedTree && modelEditable && !selectedTree.locked) {
|
||||
const pts = treeGrips(selectedTree);
|
||||
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
|
||||
@@ -1261,6 +1270,14 @@ export function useGripEditing(opts: {
|
||||
if (!selectedCamera.locked) storeState().moveCameraGrip(selectedCamera.id, index, pt);
|
||||
return;
|
||||
}
|
||||
// [279] Geländer: Achsenpunkt live, ein Undo-Schritt je Zug (gleicher coalesceKey).
|
||||
if (selectedRailing) {
|
||||
const rl = selectedRailing;
|
||||
if (rl.locked) return;
|
||||
const patch = railingGripPatch(rl, index, pt);
|
||||
if (patch.points) storeState().applyChange((p) => patchItem(p, "railings", rl.id, patch), `railingGrip:${rl.id}:${index}`);
|
||||
return;
|
||||
}
|
||||
// [149] Baum: Stammmitte, Kronenrand bzw. Beschriftung live, ein Undo-Schritt je Zug (gleicher coalesceKey).
|
||||
if (selectedTree) {
|
||||
const tr = selectedTree;
|
||||
|
||||
@@ -40,6 +40,7 @@ function selHit(sel: PlanSelection): { kind: MemberKind; id: string } | null {
|
||||
if (sel.columnId) return { kind: "columnIds", id: sel.columnId };
|
||||
if (sel.roofId) return { kind: "roofIds", id: sel.roofId };
|
||||
if (sel.treeId) return { kind: "treeIds", id: sel.treeId };
|
||||
if (sel.railingId) return { kind: "railingIds", id: sel.railingId };
|
||||
if (sel.cameraId) return { kind: "cameraIds", id: sel.cameraId };
|
||||
return null;
|
||||
}
|
||||
@@ -218,6 +219,7 @@ export function useMouseSelectionHandlers(opts: {
|
||||
context: "contextObjects",
|
||||
site: "site",
|
||||
tree: "trees",
|
||||
railing: "railings",
|
||||
camera: "cameras",
|
||||
} as const satisfies Record<string, SelectionKind>;
|
||||
type Kind = keyof typeof channels;
|
||||
@@ -239,6 +241,8 @@ export function useMouseSelectionHandlers(opts: {
|
||||
? { kind: "solid", id: sel.extrudedSolidId }
|
||||
: sel.treeId
|
||||
? { kind: "tree", id: sel.treeId }
|
||||
: sel.railingId
|
||||
? { kind: "railing", id: sel.railingId }
|
||||
: sel.cameraId
|
||||
? { kind: "camera", id: sel.cameraId }
|
||||
: sel.columnId
|
||||
@@ -307,6 +311,8 @@ export function useMouseSelectionHandlers(opts: {
|
||||
? ["site", sel.siteId]
|
||||
: sel.treeId
|
||||
? ["trees", sel.treeId]
|
||||
: sel.railingId
|
||||
? ["railings", sel.railingId]
|
||||
: sel.cameraId
|
||||
? ["cameras", sel.cameraId]
|
||||
: null;
|
||||
@@ -330,6 +336,7 @@ export function useMouseSelectionHandlers(opts: {
|
||||
openingIds: [],
|
||||
treeIds: sel.treeIds ?? [],
|
||||
cameraIds: sel.cameraIds ?? [],
|
||||
railingIds: sel.railingIds ?? [],
|
||||
};
|
||||
// Gruppen-Isolation: ausserhalb der aktiven Gruppe getroffene Elemente
|
||||
// sind gesperrt (werden ignoriert), wie beim Einzelklick.
|
||||
@@ -347,6 +354,7 @@ export function useMouseSelectionHandlers(opts: {
|
||||
openingIds: [],
|
||||
treeIds: raw.treeIds.filter((id) => isInsideActiveGroup(project, "treeIds", id, groupPath)),
|
||||
cameraIds: raw.cameraIds.filter((id) => isInsideActiveGroup(project, "cameraIds", id, groupPath)),
|
||||
railingIds: raw.railingIds.filter((id) => isInsideActiveGroup(project, "railingIds", id, groupPath)),
|
||||
};
|
||||
// Gruppen-Erweiterung: jedes getroffene Element, das zu einer sichtbaren
|
||||
// Gruppe gehört, zieht deren ganze (transitive) Mitgliedschaft nach.
|
||||
@@ -363,6 +371,7 @@ export function useMouseSelectionHandlers(opts: {
|
||||
stairs: expanded.stairIds,
|
||||
rooms: expanded.roomIds,
|
||||
trees: expanded.treeIds,
|
||||
railings: expanded.railingIds,
|
||||
cameras: expanded.cameraIds,
|
||||
groups: groupIds,
|
||||
});
|
||||
@@ -428,6 +437,11 @@ export function useMouseSelectionHandlers(opts: {
|
||||
setSelection({ ...clearKinds(), trees: [hit.id] });
|
||||
return;
|
||||
}
|
||||
// [279] Geländer: Objekt-Info wie im Grundriss.
|
||||
if (hit.kind === "railing") {
|
||||
setSelection({ ...clearKinds(), railings: [hit.id] });
|
||||
return;
|
||||
}
|
||||
// [137] Freier Körper (Loft, Rotation, Extrusion): Objekt-Info wie im Grundriss.
|
||||
if (hit.kind === "solid") {
|
||||
setSelection({ ...clearKinds(), solids: [hit.id] });
|
||||
|
||||
@@ -151,6 +151,8 @@ export function useSelectionCommands(opts: {
|
||||
const ctxids = new Set(selection.contextObjects);
|
||||
// [149] Bäume (gesperrte bleiben).
|
||||
const treeids = new Set(selection.trees.filter((id) => !(project.trees ?? []).find((t) => t.id === id)?.locked));
|
||||
// [279] Geländer (gesperrte bleiben).
|
||||
const railids = new Set(selection.railings.filter((id) => !(project.railings ?? []).find((r) => r.id === id)?.locked));
|
||||
// [213] Kameras (gesperrte bleiben).
|
||||
const camids = new Set(selection.cameras.filter((id) => !(project.cameras ?? []).find((c) => c.id === id)?.locked));
|
||||
// [193] Abgeleitete Lage-Darstellung (Schatten, Baurecht) ist kein Element: Entf blendet sie aus
|
||||
@@ -177,6 +179,7 @@ export function useSelectionCommands(opts: {
|
||||
...removeItems(p, "openings", (o) => oids.has(o.id) || wids.has(o.hostWallId) || (!!o.hostRoofId && rfids.has(o.hostRoofId)) || (!!o.hostCeilingId && cids.has(o.hostCeilingId))),
|
||||
...removeItems(p, "context", ctxids),
|
||||
...removeItems(p, "trees", treeids),
|
||||
...removeItems(p, "railings", railids),
|
||||
...removeItems(p, "cameras", camids),
|
||||
// Gelöschte Elemente verlassen ihre Gruppen.
|
||||
...pruneGroupMembers(p, {
|
||||
@@ -189,6 +192,7 @@ export function useSelectionCommands(opts: {
|
||||
columnIds: colids,
|
||||
treeIds: treeids,
|
||||
cameraIds: camids,
|
||||
railingIds: railids,
|
||||
}),
|
||||
]),
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ export interface View3dFilter {
|
||||
export const NO_VIEW3D_FILTER: View3dFilter = Object.freeze({ only: null, hidden: [] }) as View3dFilter;
|
||||
|
||||
/** Element-Arten, die im 3D vorkommen (Räume, Schnittlinien, Lage-Darstellung und Gruppen nicht). */
|
||||
const KINDS_3D: readonly SelectionKind[] = ["walls", "ceilings", "openings", "stairs", "solids", "columns", "roofs", "contextObjects", "trees", "drawings"];
|
||||
const KINDS_3D: readonly SelectionKind[] = ["walls", "ceilings", "openings", "stairs", "solids", "columns", "roofs", "contextObjects", "trees", "railings", "drawings"];
|
||||
|
||||
/** Element-ids der Auswahl, die im 3D vorkommen (ohne Doppel, in Wahl-Reihenfolge). */
|
||||
export function selectionIds3d(sel: Selection): string[] {
|
||||
|
||||
@@ -55,6 +55,8 @@ export interface TransformSelection {
|
||||
openingIds?: string[];
|
||||
/** [149] Gewählte Bäume (Stammmitte wird transformiert). */
|
||||
treeIds?: string[];
|
||||
/** [279] Gewählte Geländer (alle Punkte der Achse werden transformiert). */
|
||||
railingIds?: string[];
|
||||
/** [213] Gewählte Kameras (Standpunkt und Ziel werden transformiert, Höhen/Bildwinkel bleiben). */
|
||||
cameraIds?: string[];
|
||||
/** [193] Gewählte Gelände-/Umgebungs-Elemente (alle Punkte x/y werden abgebildet). */
|
||||
@@ -75,6 +77,7 @@ export function toTransformSel(sel: CommandSelection): TransformSelection {
|
||||
roomIds: sel.roomIds,
|
||||
openingIds: sel.openingIds,
|
||||
treeIds: sel.treeIds,
|
||||
railingIds: sel.railingIds,
|
||||
cameraIds: sel.cameraIds,
|
||||
contextIds: sel.contextIds,
|
||||
};
|
||||
@@ -98,6 +101,7 @@ export function hasTransformSelection(sel: CommandSelection, op?: string): boole
|
||||
(sel.stairIds?.length ?? 0) > 0 ||
|
||||
(sel.roomIds?.length ?? 0) > 0 ||
|
||||
(sel.treeIds?.length ?? 0) > 0 ||
|
||||
(sel.railingIds?.length ?? 0) > 0 ||
|
||||
(sel.cameraIds?.length ?? 0) > 0 ||
|
||||
(sel.contextIds?.length ?? 0) > 0
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ import { anonymityPlaceParts } from "./anonymityPlace";
|
||||
const AREA_KEYS = new Set([
|
||||
"rooms", "drawingLevels", "layers", "groups", "blockDefs", "layouts", "masterLayouts", "drawings2d", "walls", "openings",
|
||||
"stairs", "columns", "context", "extrudedSolids", "viewSnapshots", "viewSnapshotFolders", "viewTemplates", "layoutFolders",
|
||||
"publishSets", "roomProgram", "export", "cameras", "components", "wallTypes", "textStyles", "ceilings", "roofs", "trees",
|
||||
"publishSets", "roomProgram", "export", "cameras", "components", "wallTypes", "textStyles", "ceilings", "roofs", "trees", "railings",
|
||||
"hatches", "lineStyles", "materials",
|
||||
]);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ const OVERRIDE_TYPE_OPTIONS: { value: OverrideConditionType; labelKey: string }[
|
||||
|
||||
/** [33] Feste Werte je Kriterium (Auswahl statt Freitext); Beschriftung `resources.overrides.val.<typ>.<wert>`. */
|
||||
const ENUM_VALUES: Partial<Record<OverrideConditionType, readonly string[]>> = {
|
||||
element_kind: ["wall", "slab", "ground_slab", "roof", "stair", "column", "opening", "room", "shadow", "terrain", "mesh", "floor_finish"],
|
||||
element_kind: ["wall", "slab", "ground_slab", "roof", "stair", "column", "railing", "opening", "room", "shadow", "terrain", "mesh", "floor_finish"],
|
||||
layer_function: ["structure", "insulation", "screed", "finish", "plaster", "substructure", "membrane", "cladding", "air"],
|
||||
layer_position: ["above", "structure", "below"],
|
||||
view_kind: ["plan", "section", "elevation"],
|
||||
|
||||
@@ -186,6 +186,19 @@ export const CommandIcon = memo(function CommandIcon({ name }: { name: string })
|
||||
<line x1="12.5" y1="9.5" x2="12.5" y2="13.5" />
|
||||
</svg>
|
||||
);
|
||||
case "gelaender":
|
||||
// [279] Geländer: Handlauf mit Pfosten und Stäben.
|
||||
return (
|
||||
<svg {...common}>
|
||||
<line x1="1.5" y1="4.5" x2="14.5" y2="4.5" />
|
||||
<line x1="1.5" y1="12.5" x2="14.5" y2="12.5" />
|
||||
<line x1="2.5" y1="4.5" x2="2.5" y2="12.5" />
|
||||
<line x1="8" y1="4.5" x2="8" y2="12.5" />
|
||||
<line x1="13.5" y1="4.5" x2="13.5" y2="12.5" />
|
||||
<line x1="5.2" y1="4.5" x2="5.2" y2="12.5" strokeWidth="0.7" />
|
||||
<line x1="10.8" y1="4.5" x2="10.8" y2="12.5" strokeWidth="0.7" />
|
||||
</svg>
|
||||
);
|
||||
case "tree":
|
||||
// [149] Baum: Krone (Kreis) mit Stamm.
|
||||
return (
|
||||
|
||||
@@ -91,7 +91,7 @@ import { cameraAfterReady, createViewportCameraApi } from "./viewportCameraApi";
|
||||
|
||||
/** Ein per 3D-Klick getroffenes Bauteil, oder null (Leerraum). */
|
||||
export type Pick3dHit =
|
||||
| { kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column" | "solid" | "tree"; id: string }
|
||||
| { kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column" | "solid" | "tree" | "railing"; id: string }
|
||||
| null;
|
||||
|
||||
/** Klick-vs-Drag-Schwelle (Pixel): bleibt die Maus zwischen pointerdown und
|
||||
@@ -1653,7 +1653,7 @@ export function Wasm3DViewport({
|
||||
const ndc = toNdc(clientX, clientY);
|
||||
if (!cb || !o || !ndc) return;
|
||||
const ray = cameraRay(orbitCamera(o), ndc.ndcX, ndc.ndcY, ndc.aspect);
|
||||
const { walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns, solids, openingMeshes, stairMeshes, drawingMeshes, trees } = pickGeometry(
|
||||
const { walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns, solids, openingMeshes, stairMeshes, drawingMeshes, trees, railings } = pickGeometry(
|
||||
projectRef.current,
|
||||
explodeRef.current,
|
||||
hideRef.current,
|
||||
@@ -1662,7 +1662,7 @@ export function Wasm3DViewport({
|
||||
// Meshes + freie 2D-Zeichnungen (Linie/Polylinie/Rechteck, s.
|
||||
// `pickDrawingSegs`) — sonst wären im WASM-Viewport 2D-Elemente NIE
|
||||
// anwählbar gewesen (Nutzer-Report).
|
||||
const hit = pickNearest(ray, walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns, solids, openingMeshes, stairMeshes, drawingMeshes, trees);
|
||||
const hit = pickNearest(ray, walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns, solids, openingMeshes, stairMeshes, drawingMeshes, trees, railings);
|
||||
cb(hit ? { kind: hit.kind, id: hit.id } : null, additive);
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
import { DRAWING_PICK_TOLERANCE } from "../core";
|
||||
import { screenRight } from "./cameraBridge";
|
||||
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh, PickColumnMesh, PickSolidMesh, PickOpeningMesh, PickStairMesh, PickDrawingMesh, PickTreeMesh } from "../core";
|
||||
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh, PickColumnMesh, PickSolidMesh, PickOpeningMesh, PickStairMesh, PickDrawingMesh, PickTreeMesh, PickRailingMesh } from "../core";
|
||||
|
||||
/** Kamera-Parameter für den Pick-Strahl (Teilmenge von Camera3d). */
|
||||
export interface RayCamera {
|
||||
@@ -43,7 +43,7 @@ export interface Ray {
|
||||
|
||||
/** Ergebnis eines Picks: getroffenes Bauteil + Distanz entlang des Strahls. */
|
||||
export interface PickHit {
|
||||
kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column" | "solid" | "tree";
|
||||
kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column" | "solid" | "tree" | "railing";
|
||||
id: string;
|
||||
t: number;
|
||||
/** Bei `kind:"opening"` dieselbe Id wie `id` (ausdrucksstärkerer Zugriff). */
|
||||
@@ -364,6 +364,7 @@ export function pickNearest(
|
||||
stairMeshes?: readonly PickStairMesh[],
|
||||
drawingMeshes?: readonly PickDrawingMesh[],
|
||||
trees?: readonly PickTreeMesh[],
|
||||
railings?: readonly PickRailingMesh[],
|
||||
): PickHit | null;
|
||||
/**
|
||||
* Nächstes getroffenes Bauteil (kleinstes t) über Wände, Decken, Öffnungen und
|
||||
@@ -389,6 +390,7 @@ export function pickNearest(
|
||||
stairMeshes: readonly PickStairMesh[] = [],
|
||||
drawingMeshes: readonly PickDrawingMesh[] = [],
|
||||
trees: readonly PickTreeMesh[] = [],
|
||||
railings: readonly PickRailingMesh[] = [],
|
||||
): PickHit | null {
|
||||
const TIE_EPS = 1e-6;
|
||||
let hit: PickHit | null = null;
|
||||
@@ -449,6 +451,11 @@ export function pickNearest(
|
||||
const t = rayContextMeshTris(ray, { tris: tr.tris, contextObjectId: tr.treeId });
|
||||
if (t !== null) consider({ kind: "tree", id: tr.treeId, t }, 1);
|
||||
}
|
||||
// [279] Geländer (alle Teile), Rang wie Wand/Decke.
|
||||
for (const r of railings) {
|
||||
const t = rayContextMeshTris(ray, { tris: r.tris, contextObjectId: r.railingId });
|
||||
if (t !== null) consider({ kind: "railing", id: r.railingId, t }, 1);
|
||||
}
|
||||
// [137] Freie Körper (Kern-Netz, [115]), Rang wie Wand/Decke.
|
||||
for (const s of solids) {
|
||||
const t = rayContextMeshTris(ray, { tris: s.tris, contextObjectId: s.solidId });
|
||||
|
||||
@@ -154,6 +154,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
drawings: selectedDrawingIds,
|
||||
site: selectedSite,
|
||||
trees: selectedTreeIds,
|
||||
railings: selectedRailingIds,
|
||||
cameras: selectedCameraIds,
|
||||
} = selection;
|
||||
const selectedDrawingId = single(selection, "drawings");
|
||||
@@ -320,6 +321,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
pickSectionLine,
|
||||
pickSiteAt,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickContextObject,
|
||||
pickExtrudedSolid,
|
||||
@@ -428,6 +430,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
pickColumn,
|
||||
pickExtrudedSolid,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickStair,
|
||||
pickRoof,
|
||||
@@ -467,6 +470,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
pickRoom,
|
||||
pickRoof,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickSiteAt,
|
||||
pickContextObject,
|
||||
@@ -565,6 +569,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
selectedContextObjectIds,
|
||||
selectedSite,
|
||||
selectedTreeIds,
|
||||
selectedRailingIds,
|
||||
selectedCameraIds,
|
||||
selectedSectionLineIds,
|
||||
selectedExtrudedSolidIds,
|
||||
|
||||
@@ -35,6 +35,7 @@ const KIND_FIELD: Record<PickKind, SelectionKind> = {
|
||||
drawing: "drawings",
|
||||
solid: "solids",
|
||||
tree: "trees",
|
||||
railing: "railings",
|
||||
camera: "cameras",
|
||||
ceiling: "ceilings",
|
||||
stair: "stairs",
|
||||
|
||||
@@ -71,7 +71,7 @@ export const GRIP_HIT_PX = 9;
|
||||
export const LINE_PICK_PX = 6;
|
||||
|
||||
export const PICK_ORDER: readonly PickKind[] = [
|
||||
"section", "opening", "wall", "column", "drawing", "solid", "tree", "camera",
|
||||
"section", "opening", "wall", "column", "drawing", "solid", "tree", "railing", "camera",
|
||||
"ceiling", "stair", "room", "roof", "site", "context",
|
||||
];
|
||||
|
||||
@@ -90,12 +90,15 @@ export const EMPTY_PICK: PickIds = {
|
||||
contextObjectId: null,
|
||||
siteId: null,
|
||||
treeId: null,
|
||||
railingId: null,
|
||||
cameraId: null,
|
||||
};
|
||||
|
||||
/** Mac: Cmd+Klick; sonst Strg+Klick (Alt+Klick ist die Schere, Ctrl+Klick unter macOS das Kontextmenü). */
|
||||
/** [149] Präfix der Baum-Pick-Id im Feld `contextObjectId` (Kern `tree::TREE_PICK_PREFIX`). */
|
||||
export const TREE_PICK = "@tree:";
|
||||
/** [279] Präfix der Geländer-Pick-Id im Feld `contextObjectId` (Kern `railing::PICK_PREFIX`). */
|
||||
export const RAILING_PICK = "@railing:";
|
||||
/** [213] Präfix der Kamera-Pick-Id im Feld `contextObjectId` (Kern `camera::CAMERA_PICK_PREFIX`). */
|
||||
export const CAMERA_PICK = "@camera:";
|
||||
|
||||
|
||||
@@ -156,6 +156,8 @@ export interface PlanSelection {
|
||||
* Öffnung/Wand/Stütze/2D-Element/Körper getroffen wurde; Vorrang vor Decke, Raum, Dach und Gelände.
|
||||
*/
|
||||
treeId?: string | null;
|
||||
/** [279] Getroffenes Geländer (Pick-Fläche um die Achse, Pick-Id `@railing:<id>` im Feld `contextObjectId`); Vorrang wie der Baum. */
|
||||
railingId?: string | null;
|
||||
/** [213] Getroffene Kamera (Sichtkegel/Gehäuse, Pick-Id `@camera:<id>` im Feld `contextObjectId`); Vorrang vor allem ausser Öffnung/Wand/Stütze/2D-Element/Körper/Baum. */
|
||||
cameraId?: string | null;
|
||||
/**
|
||||
@@ -187,6 +189,8 @@ export interface MarqueeSelection {
|
||||
stairIds: string[];
|
||||
/** [149] Getroffene Bäume (Kronenfläche, gleiche Konvention). */
|
||||
treeIds?: string[];
|
||||
/** [279] Getroffene Geländer (Pick-Flächen um die Achse, gleiche Konvention). */
|
||||
railingIds?: string[];
|
||||
/** [213] Getroffene Kameras (Pick-Flächen von Gehäuse und Sichtgrenzen, gleiche Konvention). */
|
||||
cameraIds?: string[];
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Primitive, OwnerField, PickKind } from "../../../core";
|
||||
import { useMemo, useEffect } from "react";
|
||||
import { planPrimAt } from "../../../core";
|
||||
import { textFrameCorners } from "../../../text/textFrame";
|
||||
import { CAMERA_PICK, TREE_PICK } from "./constants";
|
||||
import { CAMERA_PICK, RAILING_PICK, TREE_PICK } from "./constants";
|
||||
import { PlanPickIndex } from "../../../core";
|
||||
import type { Plan } from "../../../core";
|
||||
import type { UnderlayGroup } from "../../../core";
|
||||
@@ -36,6 +36,7 @@ export interface UsePlanHighlightsArgs {
|
||||
selectedContextObjectIds: string[];
|
||||
selectedSite: string[];
|
||||
selectedTreeIds: string[];
|
||||
selectedRailingIds?: string[];
|
||||
selectedCameraIds?: string[];
|
||||
selectedSectionLineIds: string[];
|
||||
selectedExtrudedSolidIds: string[];
|
||||
@@ -65,6 +66,7 @@ export function usePlanHighlights(inp: UsePlanHighlightsArgs) {
|
||||
selectedContextObjectIds,
|
||||
selectedSite,
|
||||
selectedTreeIds,
|
||||
selectedRailingIds,
|
||||
selectedCameraIds,
|
||||
selectedSectionLineIds,
|
||||
selectedExtrudedSolidIds,
|
||||
@@ -240,11 +242,12 @@ export function usePlanHighlights(inp: UsePlanHighlightsArgs) {
|
||||
...(selectedContextObjectIds ?? []),
|
||||
...(selectedSite ?? []).map((s) => "@" + s),
|
||||
...(selectedTreeIds ?? []).map((s) => TREE_PICK + s),
|
||||
...(selectedRailingIds ?? []).map((s) => RAILING_PICK + s),
|
||||
...(selectedCameraIds ?? []).map((s) => CAMERA_PICK + s),
|
||||
];
|
||||
if (!ids.length) return [];
|
||||
return primsOwnedBy("contextObjectId", ids, (p): p is Extract<Primitive, { kind: "polygon" }> => p.kind === "polygon");
|
||||
}, [plan, selectedContextObjectIds, selectedSite, selectedTreeIds, selectedCameraIds]);
|
||||
}, [plan, selectedContextObjectIds, selectedSite, selectedTreeIds, selectedRailingIds, selectedCameraIds]);
|
||||
|
||||
// Hervorhebung der selektierten Schnitt-/Ansichtslinie: das (unsichtbare)
|
||||
// Pick-Band (Polygon mit sectionLineId) mit Akzentkontur überzeichnen.
|
||||
@@ -283,8 +286,9 @@ export function usePlanHighlights(inp: UsePlanHighlightsArgs) {
|
||||
if (!hoverPick) return [];
|
||||
if (hoverPick.kind === "site") return primsOwnedBy("contextObjectId", ["@" + hoverPick.id], (_p): _p is Primitive => true);
|
||||
if (hoverPick.kind === "tree") return primsOwnedBy("contextObjectId", [TREE_PICK + hoverPick.id], (_p): _p is Primitive => true);
|
||||
if (hoverPick.kind === "railing") return primsOwnedBy("contextObjectId", [RAILING_PICK + hoverPick.id], (_p): _p is Primitive => true);
|
||||
if (hoverPick.kind === "camera") return primsOwnedBy("contextObjectId", [CAMERA_PICK + hoverPick.id], (_p): _p is Primitive => true);
|
||||
const field: Record<Exclude<PickKind, "site" | "tree" | "camera">, OwnerField> = {
|
||||
const field: Record<Exclude<PickKind, "site" | "tree" | "railing" | "camera">, OwnerField> = {
|
||||
wall: "wallId", drawing: "drawingId", ceiling: "ceilingId", opening: "openingId",
|
||||
stair: "stairId", room: "roomId", roof: "roofId", context: "contextObjectId",
|
||||
section: "sectionLineId", solid: "extrudedSolidId", column: "columnId",
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { Vec2 } from "../../../model/types";
|
||||
import type { PlainCycle } from "../pickCycle";
|
||||
import { selectionHas, plainCycleNext, cycleHint } from "../pickCycle";
|
||||
import { t } from "../../../i18n";
|
||||
import { CAMERA_PICK, LINE_PICK_PX, TREE_PICK, PICK_ORDER, EMPTY_PICK, MARQUEE_THRESHOLD_PX, cycleModifier } from "./constants";
|
||||
import { CAMERA_PICK, LINE_PICK_PX, RAILING_PICK, TREE_PICK, PICK_ORDER, EMPTY_PICK, MARQUEE_THRESHOLD_PX, cycleModifier } from "./constants";
|
||||
import { planPrimAt, drawingsWithinDistance } from "../../../core";
|
||||
import type { ViewBox__plan_planView_geometry as ViewBox } from "../../../core";
|
||||
import { PlanPickIndex } from "../../../core";
|
||||
@@ -47,6 +47,7 @@ export interface UsePlanPickCycleArgs {
|
||||
pickRoom: (clientX: number, clientY: number) => string | null;
|
||||
pickRoof: (clientX: number, clientY: number) => string | null;
|
||||
pickTree: (clientX: number, clientY: number) => string | null;
|
||||
pickRailing: (clientX: number, clientY: number) => string | null;
|
||||
pickCamera: (clientX: number, clientY: number) => string | null;
|
||||
pickSiteAt: (clientX: number, clientY: number) => string | null;
|
||||
pickContextObject: (clientX: number, clientY: number) => string | null;
|
||||
@@ -100,6 +101,7 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
pickRoom,
|
||||
pickRoof,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickSiteAt,
|
||||
pickContextObject,
|
||||
@@ -262,6 +264,7 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
add("drawing", dp.drawingId, dp.hitIndex);
|
||||
add("solid", dp.extrudedSolidId, dp.hitIndex);
|
||||
add("tree", dp.treeId, dp.hitIndex);
|
||||
add("railing", dp.railingId, dp.hitIndex);
|
||||
add("camera", dp.cameraId, dp.hitIndex);
|
||||
add("ceiling", dp.ceilingId, dp.hitIndex);
|
||||
add("stair", dp.stairId, dp.hitIndex);
|
||||
@@ -290,6 +293,7 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
addRest("room", p.roomId, idx);
|
||||
addRest("roof", p.roofId, idx);
|
||||
if (p.contextObjectId?.startsWith(TREE_PICK)) addRest("tree", p.contextObjectId.slice(TREE_PICK.length), idx);
|
||||
else if (p.contextObjectId?.startsWith(RAILING_PICK)) addRest("railing", p.contextObjectId.slice(RAILING_PICK.length), idx);
|
||||
else if (p.contextObjectId?.startsWith(CAMERA_PICK)) addRest("camera", p.contextObjectId.slice(CAMERA_PICK.length), idx);
|
||||
else if (p.contextObjectId?.startsWith("@")) addRest("site", p.contextObjectId.slice(1), idx);
|
||||
else addRest("context", p.contextObjectId, idx);
|
||||
@@ -303,6 +307,7 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
addRest("room", pickRoom(clientX, clientY), null);
|
||||
addRest("roof", pickRoof(clientX, clientY), null);
|
||||
addRest("tree", pickTree(clientX, clientY), null);
|
||||
addRest("railing", pickRailing(clientX, clientY), null);
|
||||
addRest("camera", pickCamera(clientX, clientY), null);
|
||||
addRest("site", pickSiteAt(clientX, clientY), null);
|
||||
addRest("context", pickContextObject(clientX, clientY), null);
|
||||
@@ -342,6 +347,7 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
contextObjectId: c.kind === "context" ? c.id : null,
|
||||
siteId: c.kind === "site" ? c.id : null,
|
||||
treeId: c.kind === "tree" ? c.id : null,
|
||||
railingId: c.kind === "railing" ? c.id : null,
|
||||
cameraId: c.kind === "camera" ? c.id : null,
|
||||
});
|
||||
};
|
||||
@@ -542,6 +548,15 @@ export function usePlanPickCycle(inp: UsePlanPickCycleArgs) {
|
||||
.marquee("contextObjectId", rect, crossing)
|
||||
.filter((id) => id.startsWith(TREE_PICK))
|
||||
.map((id) => id.slice(TREE_PICK.length)),
|
||||
// [279] Geländer: Pick-Flächen (`contextObjectId = "@railing:<id>"`, je Teilstrecke eine).
|
||||
railingIds: [
|
||||
...new Set(
|
||||
getPick()
|
||||
.marquee("contextObjectId", rect, crossing)
|
||||
.filter((id) => id.startsWith(RAILING_PICK))
|
||||
.map((id) => id.slice(RAILING_PICK.length)),
|
||||
),
|
||||
],
|
||||
// [213] Kameras: Pick-Flächen (`contextObjectId = "@camera:<id>"`).
|
||||
cameraIds: [
|
||||
...new Set(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import type { GroupableHit, BodyTarget } from "./types";
|
||||
import { planPrimAt, nearestInDrawings, marqueeHitUnderlay } from "../../../core";
|
||||
import { CAMERA_PICK, LINE_PICK_PX, TREE_PICK } from "./constants";
|
||||
import { CAMERA_PICK, LINE_PICK_PX, RAILING_PICK, TREE_PICK } from "./constants";
|
||||
import type { Primitive, ModelRect } from "../../../core";
|
||||
import type { Vec2 } from "../../../model/types";
|
||||
import { useState, useRef, useEffect } from "react";
|
||||
@@ -257,7 +257,7 @@ export function usePlanPicking(inp: UsePlanPickingArgs) {
|
||||
|
||||
// [137] Getroffene Lage-Darstellung: Quelle `"sunStudy"`/`"siteRules"` (Baurechtslinie vor Schatten) oder null.
|
||||
const pickSiteAt = (clientX: number, clientY: number): string | null => {
|
||||
const all = contextIdsAt(clientX, clientY).filter((id) => !id.startsWith(TREE_PICK) && !id.startsWith(CAMERA_PICK));
|
||||
const all = contextIdsAt(clientX, clientY).filter((id) => !id.startsWith(TREE_PICK) && !id.startsWith(CAMERA_PICK) && !id.startsWith(RAILING_PICK));
|
||||
// [193] Liegt ein Kontext-Element (Baugrube, Netz) über der Schattenfläche, gehört der Klick ihm — sonst wäre
|
||||
// die Baugrube unter dem Schatten des Hauses nicht anzuwählen. Die Baurechtslinie (unsichtbares Band) gewinnt immer.
|
||||
if (all.includes("@siteRules")) return "siteRules";
|
||||
@@ -271,6 +271,12 @@ export function usePlanPicking(inp: UsePlanPickingArgs) {
|
||||
return id ? id.slice(TREE_PICK.length) : null;
|
||||
};
|
||||
|
||||
// [279] Getroffenes Geländer (oberste Pickfläche um die Achse) oder null.
|
||||
const pickRailing = (clientX: number, clientY: number): string | null => {
|
||||
const id = contextIdsAt(clientX, clientY).find((x) => x.startsWith(RAILING_PICK));
|
||||
return id ? id.slice(RAILING_PICK.length) : null;
|
||||
};
|
||||
|
||||
// [213] Getroffene Kamera (oberste Pickfläche aus Gehäuse und Sichtkegel) oder null.
|
||||
const pickCamera = (clientX: number, clientY: number): string | null => {
|
||||
const id = contextIdsAt(clientX, clientY).find((x) => x.startsWith(CAMERA_PICK));
|
||||
@@ -413,6 +419,7 @@ export function usePlanPicking(inp: UsePlanPickingArgs) {
|
||||
pickSectionLine,
|
||||
pickSiteAt,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickContextObject,
|
||||
pickExtrudedSolid,
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface UsePlanPointerArgs {
|
||||
pickColumn: (clientX: number, clientY: number) => string | null;
|
||||
pickExtrudedSolid: (clientX: number, clientY: number) => string | null;
|
||||
pickTree: (clientX: number, clientY: number) => string | null;
|
||||
pickRailing: (clientX: number, clientY: number) => string | null;
|
||||
pickCamera: (clientX: number, clientY: number) => string | null;
|
||||
pickStair: (clientX: number, clientY: number) => string | null;
|
||||
pickRoof: (clientX: number, clientY: number) => string | null;
|
||||
@@ -142,6 +143,7 @@ export function usePlanPointer(inp: UsePlanPointerArgs) {
|
||||
pickColumn,
|
||||
pickExtrudedSolid,
|
||||
pickTree,
|
||||
pickRailing,
|
||||
pickCamera,
|
||||
pickStair,
|
||||
pickRoof,
|
||||
@@ -618,30 +620,33 @@ export function usePlanPointer(inp: UsePlanPointerArgs) {
|
||||
// [149] Baum (Kronenfläche) vor Decke, Raum, Dach und Gelände.
|
||||
const treeId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId ? null : pickTree(clientX, clientY);
|
||||
// [279] Geländer (Pickfläche um die Achse) wie der Baum vor Decke, Raum, Dach und Gelände.
|
||||
const railingId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId ? null : pickRailing(clientX, clientY);
|
||||
// [213] Kamera (schmale Pickflächen von Gehäuse, Sichtgrenzen und Ziel) wie der Baum vor Decke, Raum, Dach.
|
||||
const cameraId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId ? null : pickCamera(clientX, clientY);
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId ? null : pickCamera(clientX, clientY);
|
||||
// Decke nur, wenn weder Öffnung/Wand noch 2D-Element getroffen wurde. Da die
|
||||
// Decken-Polygone UNTER der Wand-Poché liegen, trifft ein direkter Klick
|
||||
// auf die Wand zuerst die Wand; freie Deckenfläche trifft die Decke.
|
||||
const hitCeilingId =
|
||||
hit && hit.kind === "polygon" ? hit.ceilingId ?? null : null;
|
||||
const ceilingId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId ? null : hitCeilingId;
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId ? null : hitCeilingId;
|
||||
// Treppe nur, wenn nichts anderes getroffen wurde (Tritte liegen frei).
|
||||
const stairId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId || ceilingId
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId || ceilingId
|
||||
? null
|
||||
: pickStair(clientX, clientY);
|
||||
// Raum als vorletzte Priorität: die Raum-Fläche liegt UNTER allem anderen.
|
||||
const roomId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId || ceilingId || stairId
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId || ceilingId || stairId
|
||||
? null
|
||||
: pickRoom(clientX, clientY);
|
||||
// Dach als LETZTE Priorität: die Traufe-Fläche deckt den ganzen Grundriss
|
||||
// ab, daher erst wählen, wenn wirklich nichts anderes getroffen wurde.
|
||||
const roofId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId || ceilingId || stairId || roomId
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId || ceilingId || stairId || roomId
|
||||
? null
|
||||
: pickRoof(clientX, clientY);
|
||||
// Kontext-Objekt (Gebäude/Terrain) als ALLERLETZTE Priorität — seine
|
||||
@@ -649,11 +654,11 @@ export function usePlanPointer(inp: UsePlanPointerArgs) {
|
||||
// nichts anderes getroffen wurde.
|
||||
// [137] Schatten/Baurechtslinien (Lage-Darstellung) über dem Gelände, unter allen Bauteilen.
|
||||
const siteId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId || ceilingId || stairId || roomId || roofId
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId || ceilingId || stairId || roomId || roofId
|
||||
? null
|
||||
: pickSiteAt(clientX, clientY);
|
||||
const contextObjectId =
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || cameraId || ceilingId || stairId || roomId || roofId || siteId
|
||||
openingId || wallId || columnId || drawingId || extrudedSolidId || treeId || railingId || cameraId || ceilingId || stairId || roomId || roofId || siteId
|
||||
? null
|
||||
: pickContextObject(clientX, clientY);
|
||||
return {
|
||||
@@ -671,6 +676,7 @@ export function usePlanPointer(inp: UsePlanPointerArgs) {
|
||||
contextObjectId,
|
||||
siteId,
|
||||
treeId,
|
||||
railingId,
|
||||
cameraId,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -285,7 +285,7 @@ export const Content = memo(function Content({
|
||||
() => (explode > 0 ? (explodeFloorOffsets(project, explode)[level.id] ?? 0) : 0),
|
||||
[project, explode, level.id],
|
||||
);
|
||||
const { walls, ceilings, openings, stairs, roofs, contextObjects, columns, solids, trees } = selection;
|
||||
const { walls, ceilings, openings, stairs, roofs, contextObjects, columns, solids, trees, railings } = selection;
|
||||
const selectionLines = useMemo(
|
||||
() =>
|
||||
walls.length === 0 &&
|
||||
@@ -296,10 +296,11 @@ export const Content = memo(function Content({
|
||||
contextObjects.length === 0 &&
|
||||
columns.length === 0 &&
|
||||
solids.length === 0 &&
|
||||
trees.length === 0
|
||||
trees.length === 0 &&
|
||||
railings.length === 0
|
||||
? null
|
||||
: selectionHighlightLines(project, walls, ceilings, HIGHLIGHT_RGB, openings, stairs, roofs, contextObjects, explode, columns, solids, trees),
|
||||
[project, explode, walls, ceilings, openings, stairs, roofs, contextObjects, columns, solids, trees],
|
||||
: selectionHighlightLines(project, walls, ceilings, HIGHLIGHT_RGB, openings, stairs, roofs, contextObjects, explode, columns, solids, trees, railings),
|
||||
[project, explode, walls, ceilings, openings, stairs, roofs, contextObjects, columns, solids, trees, railings],
|
||||
);
|
||||
// Kollisionen der letzten Prüfung: rote Hüllquader zusätzlich zur Auswahl-Hervorhebung.
|
||||
const highlightLines = useMemo(() => {
|
||||
|
||||
Reference in new issue
Block a user