Kontext-Objekte im 3D-Viewport anwählbar (Klick, Bounding-Box-Highlight, Löschen)

Importierte Gebäude/Terrain-Meshes waren bisher nur ein Eintrag im Geo-Panel,
nicht direkt im 3D anwählbar. Raycast/Pick-Geometrie um Kontext-Meshes
erweitert, Auswahl-Kanal (selectedContextObjectIds) ergänzt, Highlight als
Bounding-Box-Umriss (volles Dreiecks-Wireframe wäre bei grossen Importen zu
dicht), Entf-Taste löscht die Auswahl, SitePanel hebt sie in der Liste hervor.
This commit is contained in:
2026-07-12 19:54:00 +02:00
parent 02c36bd35b
commit 0ab3f70277
10 changed files with 317 additions and 13 deletions
+6
View File
@@ -25,6 +25,8 @@ export interface SelectionSlice {
selectedColumnIds: string[];
// Gewählte Dächer als MENGE von IDs — getrennt von den übrigen Kanälen.
selectedRoofIds: string[];
// Gewählte Kontext-Objekte (importierte Gebäude/Terrain) als MENGE von IDs.
selectedContextObjectIds: string[];
// Gewählte Schnitt-/Ansichtslinie (DrawingLevel-Id) — EINZELauswahl (eine Linie
// zur Zeit), getrennt von den übrigen Kanälen. `null` = keine Linie gewählt.
selectedSectionLineId: string | null;
@@ -38,6 +40,7 @@ export interface SelectionSlice {
setSelectedExtrudedSolidIds: (ids: string[]) => void;
setSelectedColumnIds: (ids: string[]) => void;
setSelectedRoofIds: (ids: string[]) => void;
setSelectedContextObjectIds: (ids: string[]) => void;
setSelectedSectionLineId: (id: string | null) => void;
/** Auswahl (Wände + Decken + Öffnungen + Treppen + Dächer + 2D-Elemente) leeren. */
clearSelection: () => void;
@@ -57,6 +60,7 @@ export function createSelectionSlice(
selectedExtrudedSolidIds: [],
selectedColumnIds: [],
selectedRoofIds: [],
selectedContextObjectIds: [],
selectedSectionLineId: null,
setSelectedWallIds: (ids) => set({ selectedWallIds: ids }),
setSelectedDrawingIds: (ids) => set({ selectedDrawingIds: ids }),
@@ -67,6 +71,7 @@ export function createSelectionSlice(
setSelectedExtrudedSolidIds: (ids) => set({ selectedExtrudedSolidIds: ids }),
setSelectedColumnIds: (ids) => set({ selectedColumnIds: ids }),
setSelectedRoofIds: (ids) => set({ selectedRoofIds: ids }),
setSelectedContextObjectIds: (ids) => set({ selectedContextObjectIds: ids }),
setSelectedSectionLineId: (id) => set({ selectedSectionLineId: id }),
clearSelection: () =>
set({
@@ -79,6 +84,7 @@ export function createSelectionSlice(
selectedExtrudedSolidIds: [],
selectedColumnIds: [],
selectedRoofIds: [],
selectedContextObjectIds: [],
selectedSectionLineId: null,
}),
};