Merge branch 'worktree-agent-a9d95c06e38ddd3a2' into claude/practical-noether-1hb2s1
This commit is contained in:
7 files changed
+123
-2
No files matched your search
@@ -49,6 +49,7 @@ export type GripRequest =
|
||||
// [213] Kamera: 0 = Standpunkt, 1 = Ziel, 2 = Bildwinkel bzw. Sichtbreite (Kern `camera::grip_edit`); `cameraBy` verschiebt Standpunkt und Ziel.
|
||||
| { op: "cameraGrip"; id: string; index: number; pt: P }
|
||||
| { op: "beamGrip"; id: string; index: number; pt: P }
|
||||
| { op: "ceilingSlopeGrip"; id: string; index: number; pt: P }
|
||||
| { op: "cameraBy"; id: string; delta: P }
|
||||
| { op: "sectionBendDelete"; id: string; index: number }
|
||||
| { op: "sectionLineTidy"; id: string; tol?: number }
|
||||
|
||||
@@ -386,6 +386,8 @@ export interface ProjectSlice {
|
||||
// ── Decken-Editieren ──────────────────────────────────────────────────────
|
||||
/** Verschiebt EINEN Umriss-Vertex (per Index) einer Decke. */
|
||||
moveCeilingGrip: (ceilingId: string, index: number, pt: Vec2) => void;
|
||||
/** [281] Gefällelinie einer geneigten Decke: 0 = Bezugspunkt, 1 = Endpunkt; Gefälle in % bleibt. */
|
||||
moveCeilingSlopeGrip: (ceilingId: string, index: number, pt: Vec2) => void;
|
||||
/** [68] Baugrube: Umriss-Ecke ziehen (Index = Ecke; Index = Eckenzahl: Sohlenhöhe). */
|
||||
moveExcavationGrip: (id: string, index: number, pt: Vec2) => void;
|
||||
/** [176] Griff einer Schnittlinie: 0 = Anfang, dann die Knickpunkte, zuletzt das Ende. */
|
||||
@@ -1316,6 +1318,9 @@ export function createProjectSlice(
|
||||
moveCeilingGrip: (ceilingId, index, pt) =>
|
||||
applyGrip({ op: "ceilingGrip", id: ceilingId, index, pt: gripPt(pt) }, `moveCeilingGrip:${ceilingId}:${index}`),
|
||||
|
||||
moveCeilingSlopeGrip: (ceilingId, index, pt) =>
|
||||
applyGrip({ op: "ceilingSlopeGrip", id: ceilingId, index, pt: gripPt(pt) }, `moveCeilingSlopeGrip:${ceilingId}:${index}`),
|
||||
|
||||
moveExcavationGrip: (id, index, pt) => applyGrip({ op: "excavationGrip", id, index, pt: gripPt(pt) }, `moveExcavationGrip:${id}:${index}`),
|
||||
moveSectionLineGrip: (id, index, pt, coalesceKey) =>
|
||||
applyGrip({ op: "sectionLineGrip", id, index, pt: gripPt(pt) }, coalesceKey ?? `moveSectionLineGrip:${id}:${index}`),
|
||||
|
||||
@@ -61,6 +61,8 @@ declare global {
|
||||
planLines: (cls: string) => number;
|
||||
/** [281] Neigung je Decke (`id` → {rise, ramp}; waagrecht fehlt). */
|
||||
ceilingSlopes: () => Record<string, { rise: number; ramp: boolean }>;
|
||||
/** [281] Gefällelinie einer Decke (from/to in Metern; fehlt bei waagrechter Decke). */
|
||||
ceilingSlopeLine: (id: string) => { from: { x: number; y: number }; to: { x: number; y: number } } | undefined;
|
||||
/** [173] Modelldarstellung der aktiven Ebene (Feld `modelViewOptionId`). */
|
||||
modelView: () => string | undefined;
|
||||
/** [173] Schnitt der aktiven Ebene (1:50, Detailgrad der Anzeige): Zahl der Wand-Schnittflächen und ihre Fläche (m²). */
|
||||
@@ -161,6 +163,10 @@ export function installTestHooks(): void {
|
||||
fakeRender: () => fakeRender(),
|
||||
ceilingSlopes: () =>
|
||||
Object.fromEntries((getState().project.ceilings ?? []).flatMap((c) => (c.slope ? [[c.id, { rise: c.slope.rise, ramp: !!c.slope.ramp }]] : []))),
|
||||
ceilingSlopeLine: (id) => {
|
||||
const s = (getState().project.ceilings ?? []).find((c) => c.id === id)?.slope;
|
||||
return s ? { from: { x: s.from.x, y: s.from.y }, to: { x: s.to.x, y: s.to.y } } : undefined;
|
||||
},
|
||||
planLines: (cls) => {
|
||||
const s = getState();
|
||||
const codes = new Set<string>();
|
||||
|
||||
@@ -268,6 +268,8 @@ export function useGripEditing(opts: {
|
||||
ring?: { kind: RingKind; id: string };
|
||||
/** [191] Scheitel-Griff der Bogenkante `arcSeg` (flacher Index wie `insertSeg`). */
|
||||
arcSeg?: number;
|
||||
/** [281] Ende der Gefällelinie einer geneigten Decke (0 = Bezugspunkt, 1 = Endpunkt). */
|
||||
slopeEnd?: number;
|
||||
}
|
||||
const gripOwners: GripOwner[] = [];
|
||||
// [ersterFlachIndex, letzterFlachIndex] DESSELBEN Elements — für die Anker-
|
||||
@@ -622,6 +624,13 @@ export function useGripEditing(opts: {
|
||||
const rings = [{ pts: selectedCeiling.outline, off: 0, bulge: selectedCeiling.outlineBulge }];
|
||||
pushInsertGrips(pts, rings, { kind: "ceiling", id: selectedCeiling.id });
|
||||
pushArcGrips(pts, rings, { kind: "ceiling", id: selectedCeiling.id });
|
||||
// [281] Geneigte Decke: Anfang und Ende der Gefällelinie als zwei weitere Griffe.
|
||||
const sl = selectedCeiling.slope;
|
||||
if (sl) {
|
||||
const start = pts.length;
|
||||
[sl.from, sl.to].forEach((q, i) => { pts.push({ x: q.x, y: q.y }); gripOwners.push({ localIndex: -1, slopeEnd: i, ring: { kind: "ceiling", id: selectedCeiling.id } }); });
|
||||
for (let i = start; i < pts.length; i++) gripOwnerRange.push([start, pts.length - 1]);
|
||||
}
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
@@ -982,7 +991,7 @@ export function useGripEditing(opts: {
|
||||
// Wand/Öffnung/Treppe haben keine Polygon-Nachbarn → null.
|
||||
const resolvePolygonRing = (index: number): { pts: Vec2[]; index: number; closed: boolean } | null => {
|
||||
const owner = gripOwners[index];
|
||||
if (owner?.insertSeg != null || owner?.arcSeg != null) return null;
|
||||
if (owner?.insertSeg != null || owner?.arcSeg != null || owner?.slopeEnd != null) return null;
|
||||
if (roofGripsOn && selectedRoof && !owner?.drawingId && !owner?.wallId) {
|
||||
const ring = roofRings(selectedRoof).find((rg) => index >= rg.off && index < rg.off + rg.pts.length);
|
||||
return ring ? { pts: ring.pts, index: index - ring.off, closed: true } : null;
|
||||
@@ -1238,6 +1247,11 @@ export function useGripEditing(opts: {
|
||||
storeState().setRingArc(ins.ring.kind, ins.ring.id, ins.arcSeg, pt);
|
||||
return;
|
||||
}
|
||||
// [281] Gefällelinie: Ende ziehen, Gefälle in % bleibt (ein Undo-Schritt je Zug über den Schlüssel).
|
||||
if (modelEditable && ins?.slopeEnd != null && ins.ring) {
|
||||
storeState().moveCeilingSlopeGrip(ins.ring.id, ins.slopeEnd, pt);
|
||||
return;
|
||||
}
|
||||
if (modelEditable && ins?.insertSeg != null && ins.ring) {
|
||||
const key = `ringInsert:${ins.ring.id}:${Date.now()}`;
|
||||
ringDragRef.current = { ...ins.ring, key, midIndex: index, vertex: ins.insertSeg + 1 };
|
||||
|
||||
Reference in new issue
Block a user