From eaf57e22922adc476ff6938e4deb53e5dd3c711a Mon Sep 17 00:00:00 2001 From: Karim Date: Fri, 10 Jul 2026 00:33:35 +0200 Subject: [PATCH] Dach: Auswahl-Hervorhebung im 2D-Grundriss (Traufe-Umriss) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ein selektiertes Dach wird jetzt im Grundriss mit der Akzentkontur markiert (highlightRoofPolys über das Traufe-Pick-Polygon), analog Decke/Raum — selectedRoofIds von App durch die Content-Sichten an PlanView durchgereicht. tsc + vitest 642 grün. --- src/App.tsx | 12 ++++++++++++ src/plan/PlanView.tsx | 27 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 40aaf2b..5c10c18 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4728,6 +4728,7 @@ export default function App() { selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={moveRoomStamp} onStampEdit={onOpenStampEditor} @@ -5839,6 +5840,7 @@ function Content({ selectedExtrudedSolidIds, selectedColumnIds, selectedRoomIds, + selectedRoofIds, roomStamp, onStampMove, onStampEdit, @@ -5914,6 +5916,7 @@ function Content({ selectedExtrudedSolidIds: string[]; selectedColumnIds: string[]; selectedRoomIds: string[]; + selectedRoofIds: string[]; roomStamp: { roomId: string; anchor: Vec2 } | null; onStampMove: (roomId: string, delta: Vec2) => void; onStampEdit: (roomId: string) => void; @@ -6025,6 +6028,7 @@ function Content({ selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={onStampMove} onStampEdit={onStampEdit} @@ -6079,6 +6083,7 @@ function Content({ selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={onStampMove} onStampEdit={onStampEdit} @@ -6171,6 +6176,7 @@ function Content({ selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={onStampMove} onStampEdit={onStampEdit} @@ -6215,6 +6221,7 @@ function LevelPlanView({ selectedExtrudedSolidIds, selectedColumnIds, selectedRoomIds, + selectedRoofIds, roomStamp, onStampMove, onStampEdit, @@ -6252,6 +6259,7 @@ function LevelPlanView({ selectedExtrudedSolidIds: string[]; selectedColumnIds: string[]; selectedRoomIds: string[]; + selectedRoofIds: string[]; roomStamp: { roomId: string; anchor: Vec2 } | null; onStampMove: (roomId: string, delta: Vec2) => void; onStampEdit: (roomId: string) => void; @@ -6328,6 +6336,7 @@ function LevelPlanView({ selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={onStampMove} onStampEdit={onStampEdit} @@ -6380,6 +6389,7 @@ function SectionPlanView({ selectedExtrudedSolidIds, selectedColumnIds, selectedRoomIds, + selectedRoofIds, roomStamp, onStampMove, onStampEdit, @@ -6413,6 +6423,7 @@ function SectionPlanView({ selectedExtrudedSolidIds: string[]; selectedColumnIds: string[]; selectedRoomIds: string[]; + selectedRoofIds: string[]; roomStamp: { roomId: string; anchor: Vec2 } | null; onStampMove: (roomId: string, delta: Vec2) => void; onStampEdit: (roomId: string) => void; @@ -6499,6 +6510,7 @@ function SectionPlanView({ selectedExtrudedSolidIds={selectedExtrudedSolidIds} selectedColumnIds={selectedColumnIds} selectedRoomIds={selectedRoomIds} + selectedRoofIds={selectedRoofIds} roomStamp={roomStamp} onStampMove={onStampMove} onStampEdit={onStampEdit} diff --git a/src/plan/PlanView.tsx b/src/plan/PlanView.tsx index 8c3a12e..03bf6b0 100644 --- a/src/plan/PlanView.tsx +++ b/src/plan/PlanView.tsx @@ -285,6 +285,8 @@ export interface PlanViewProps { * Fläche JEDES dieser Räume mit einer Akzentkontur. */ selectedRoomIds?: string[]; + /** Aktuell ausgewählte Dach-IDs (von App); die Ansicht markiert die Traufe. */ + selectedRoofIds?: string[]; /** * Aktuell ausgewählte IDs extrudierter Körper (truck-Integration; kontrolliert * von App). Die Ansicht markiert den Footprint-Umriss JEDES dieser Körper mit @@ -413,6 +415,7 @@ export const PlanView = forwardRef( selectedOpeningIds, selectedStairIds, selectedRoomIds, + selectedRoofIds, selectedExtrudedSolidIds, selectedColumnIds, roomStamp, @@ -1765,6 +1768,18 @@ export const PlanView = forwardRef( ); }, [plan, selectedRoomIds]); + // Hervorhebung der selektierten Dächer: das (unsichtbare) Traufe-Pick-Polygon + // mit roofId als Akzentkontur überzeichnen — analog zur Raum-/Decken-Auswahl. + const highlightRoofPolys = useMemo(() => { + const ids = + selectedRoofIds && selectedRoofIds.length ? new Set(selectedRoofIds) : null; + if (!ids) return []; + return plan.primitives.filter( + (p): p is Extract => + p.kind === "polygon" && p.roofId != null && ids.has(p.roofId), + ); + }, [plan, selectedRoofIds]); + // Hervorhebung der selektierten extrudierten Körper (truck-Integration): der // Footprint-Umriss (Polygon mit extrudedSolidId) mit Akzentkontur überzeichnen // — analog zur Raum-Auswahl. @@ -1997,6 +2012,18 @@ export const PlanView = forwardRef( pointerEvents="none" /> ))} + {/* Auswahl-Hervorhebung der gewählten Dächer (Traufe-Umriss). */} + {highlightRoofPolys.map((poly, i) => ( + `${s.x},${s.y}`) + .join(" ")} + pointerEvents="none" + /> + ))} {/* Auswahl-Hervorhebung der gewählten extrudierten Körper (truck-Integration). */} {highlightExtrudedSolidPolys.map((poly, i) => (