[185] Navigation wie Archicad: Geschosswechsel behält Zoom, Cmd+5/6 Geschoss, Cmd+3/4 Auswahl im 3D
Grundriss: Geschosse teilen den Einpass-Schlüssel (planFitKey, PlanView fitKey), Wechsel behält Ausschnitt und Massstab exakt. Cmd/Ctrl+5/6 Geschoss tiefer/höher im Grundriss- und 3D-Reiter. Cmd/Ctrl+3 zeigt nur die Auswahl im 3D (Reiter „3D · Auswahl“, Kamera passt ein; ohne Auswahl alles), Cmd/Ctrl+4 blendet die Auswahl im 3D aus. Zustand rein UI (state/view3dFilter.ts). Kern: model3d::ElementSelection im ClassFilter (only/hideIds für Teile, Cache, Pick). Kürzel umbelegbar, natives Menü Ansicht. PlanViewHandle.pxPerMeter liest die aktuelle viewBox.
This commit is contained in:
29 files changed
+717
-42
No files matched your search
@@ -95,6 +95,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
{
|
||||
plan: planRaw,
|
||||
resetKey,
|
||||
fitKey,
|
||||
onCursor,
|
||||
onScale,
|
||||
onSelect,
|
||||
@@ -180,10 +181,12 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
// zurücksetzen — NICHT bei jeder Bounds-Änderung durch Editieren (sonst
|
||||
// „wandert" die Ansicht beim Verschieben/Löschen mit). `defaultView` ist beim
|
||||
// resetKey-Wechsel bereits frisch (neues Geschoss), daher direkt anwendbar.
|
||||
// [185] Geschosswechsel: gleicher `fitKey`, der Ausschnitt bleibt exakt stehen (wie Archicad).
|
||||
const viewKey = fitKey ?? resetKey;
|
||||
useEffect(() => {
|
||||
setView(defaultView);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [resetKey]);
|
||||
}, [viewKey]);
|
||||
// [165] Renderer-Anbindung: Pick-Index, Engine-Wahl (nativ/WASM/SVG), Plan-Aufbereitung, Culling, Papier-Massstab, GL-Effekte.
|
||||
const {
|
||||
getPick,
|
||||
@@ -226,7 +229,7 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
|
||||
view,
|
||||
hairline,
|
||||
onScale,
|
||||
resetKey,
|
||||
resetKey: viewKey, // Papier-Massstab folgt dem Einpassen
|
||||
});
|
||||
// [165] Steuerhandle, Zieh-Zustände, Koordinaten-Umrechnung und Griff-Treffer.
|
||||
const {
|
||||
|
||||
@@ -222,6 +222,11 @@ export interface PlanViewProps {
|
||||
* Einpassen stehen (kein Auto-Reset).
|
||||
*/
|
||||
resetKey?: string;
|
||||
/**
|
||||
* [185] Schlüssel nur für das Einpassen (fehlt: `resetKey`). Geschosse teilen sich einen (`planFitKey`): der
|
||||
* Geschosswechsel behält Zoom und Ausschnitt exakt, Pick-Zyklus u. ä. folgen weiter `resetKey`.
|
||||
*/
|
||||
fitKey?: string;
|
||||
/**
|
||||
* Meldet die Cursor-Position in Modell-Koordinaten (Meter) nach oben, bzw.
|
||||
* `null`, wenn der Zeiger die Fläche verlässt. Optional — ohne Callback
|
||||
|
||||
@@ -100,7 +100,9 @@ export function usePlanCoords(inp: UsePlanCoordsArgs) {
|
||||
// nächste Massstab gewählt wird); Rad-Zoom lässt ihn unberührt.
|
||||
if (n > 0) setPaperScale(n);
|
||||
},
|
||||
pxPerMeter: () => currentPxPerMeter(),
|
||||
// [185] Aus der frischen viewBox (Ref): `currentPxPerMeter` sähe im stabilen Handle die erste viewBox
|
||||
// (Reiter/Ausschnitte merkten sonst den Start-Zoom statt des aktuellen).
|
||||
pxPerMeter: () => (meetScale(viewRef.current, canvasRef.current ?? svgRef.current) ?? 1) * PX_PER_M,
|
||||
viewCenterModel: () => {
|
||||
// Mitte der frischen viewBox (aus Ref) → Modell (inverse toScreen).
|
||||
const v = viewRef.current;
|
||||
|
||||
@@ -42,6 +42,7 @@ import { clashHighlightLines } from "../analysis/clash";
|
||||
import { useClashSession } from "../panels/clashSession";
|
||||
import { applyGroupDimmingToPlan } from "../state/groupActions";
|
||||
import { useStore } from "../state/appStore";
|
||||
import { planFitKey } from "../state/viewTabs";
|
||||
import { PlanView } from "./plan/PlanView";
|
||||
import type {
|
||||
GripHandlers,
|
||||
@@ -872,6 +873,7 @@ function LevelPlanView({
|
||||
describePick={describePick}
|
||||
onPickHint={setPickHint}
|
||||
resetKey={`${level.id}#${projectEpoch}`}
|
||||
fitKey={planFitKey(level, projectEpoch)}
|
||||
onCursor={onCursor}
|
||||
onScale={onScale}
|
||||
selection={selection}
|
||||
|
||||
Reference in new issue
Block a user