Dach: Auswahl-Hervorhebung im 2D-Grundriss (Traufe-Umriss)
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.
This commit is contained in:
+12
@@ -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}
|
||||
|
||||
@@ -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<PlanViewHandle, PlanViewProps>(
|
||||
selectedOpeningIds,
|
||||
selectedStairIds,
|
||||
selectedRoomIds,
|
||||
selectedRoofIds,
|
||||
selectedExtrudedSolidIds,
|
||||
selectedColumnIds,
|
||||
roomStamp,
|
||||
@@ -1765,6 +1768,18 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
);
|
||||
}, [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<Primitive, { kind: "polygon" }> =>
|
||||
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<PlanViewHandle, PlanViewProps>(
|
||||
pointerEvents="none"
|
||||
/>
|
||||
))}
|
||||
{/* Auswahl-Hervorhebung der gewählten Dächer (Traufe-Umriss). */}
|
||||
{highlightRoofPolys.map((poly, i) => (
|
||||
<polygon
|
||||
key={`selrf-${i}`}
|
||||
className="plan-selected"
|
||||
points={poly.pts
|
||||
.map(toScreen)
|
||||
.map((s) => `${s.x},${s.y}`)
|
||||
.join(" ")}
|
||||
pointerEvents="none"
|
||||
/>
|
||||
))}
|
||||
{/* Auswahl-Hervorhebung der gewählten extrudierten Körper (truck-Integration). */}
|
||||
{highlightExtrudedSolidPolys.map((poly, i) => (
|
||||
<polygon
|
||||
|
||||
Reference in New Issue
Block a user