From b00bef0959024eebe9ee872d12b1891b17eab4b0 Mon Sep 17 00:00:00 2001 From: karim Date: Tue, 27 Oct 2026 19:26:22 +0100 Subject: [PATCH] Kern/Huelle Phase A.2: React/Tauri-Teile aus plan/ nach views/plan, RichTextEditor nach editors; PickKind in den Kern --- scripts/move-modules.py | 34 ++++++++++++++ src/App.tsx | 2 +- src/{text => editors}/RichTextEditor.tsx | 6 +-- src/plan/pickLabels.ts | 5 +- src/state/useGripEditing.ts | 2 +- src/state/useMouseSelectionHandlers.ts | 2 +- src/state/usePanelHostBase.ts | 2 +- src/state/useProjectActions.ts | 2 +- src/state/useProjectFileActions.ts | 2 +- src/ui/LayoutSheet.tsx | 2 +- src/ui/TextEditorDialog.tsx | 2 +- .../plan/PlanView.cssImageFilter.test.ts | 0 src/{ => views}/plan/PlanView.tsx | 47 +++++++++---------- src/{ => views}/plan/cssColor.ts | 0 .../glPlan => views/plan}/nativeGl.test.ts | 0 src/{plan/glPlan => views/plan}/nativeGl.ts | 2 +- src/{ => views}/plan/nativeSync.ts | 10 ++-- src/{ => views}/plan/planView/PlanGrid.tsx | 2 +- src/{ => views}/plan/planView/PlanRulers.tsx | 4 +- src/{ => views}/plan/planView/liveMeet.tsx | 0 src/{ => views}/plan/planView/overlays.tsx | 6 +-- .../plan/planView/primitives.gradient.test.ts | 2 +- src/{ => views}/plan/planView/primitives.tsx | 16 +++---- src/{ => views}/plan/useNativePlanRenderer.ts | 14 +++--- src/{ => views}/plan/useWasmPlanRenderer.ts | 6 +-- src/views/viewportContent.tsx | 8 ++-- 26 files changed, 106 insertions(+), 72 deletions(-) create mode 100755 scripts/move-modules.py rename src/{text => editors}/RichTextEditor.tsx (99%) rename src/{ => views}/plan/PlanView.cssImageFilter.test.ts (100%) rename src/{ => views}/plan/PlanView.tsx (99%) rename src/{ => views}/plan/cssColor.ts (100%) rename src/{plan/glPlan => views/plan}/nativeGl.test.ts (100%) rename src/{plan/glPlan => views/plan}/nativeGl.ts (99%) rename src/{ => views}/plan/nativeSync.ts (92%) rename src/{ => views}/plan/planView/PlanGrid.tsx (96%) rename src/{ => views}/plan/planView/PlanRulers.tsx (97%) rename src/{ => views}/plan/planView/liveMeet.tsx (100%) rename src/{ => views}/plan/planView/overlays.tsx (98%) rename src/{ => views}/plan/planView/primitives.gradient.test.ts (95%) rename src/{ => views}/plan/planView/primitives.tsx (98%) rename src/{ => views}/plan/useNativePlanRenderer.ts (96%) rename src/{ => views}/plan/useWasmPlanRenderer.ts (96%) diff --git a/scripts/move-modules.py b/scripts/move-modules.py new file mode 100755 index 00000000..ad423285 --- /dev/null +++ b/scripts/move-modules.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +"""Verschiebt TS-Module (git mv) und schreibt alle relativen Imports im Projekt um. +Aufruf: scripts/move-modules.py alt1=neu1 alt2=neu2 … (Pfade mit Endung, relativ zum Repo) +Importe werden über den aufgelösten Zielpfad (ohne Endung) erkannt — auch aus den verschobenen +Dateien selbst und aus Testdateien.""" +import re, glob, os, subprocess, sys + +moves = dict(a.split('=') for a in sys.argv[1:]) +strip = lambda p: re.sub(r'\.(tsx?|test\.tsx?)$', '', p) +base_moves = {strip(o): strip(n) for o, n in moves.items()} +old_loc = {n: o for o, n in moves.items()} # neuer Pfad -> alter Pfad + +for o, n in moves.items(): + os.makedirs(os.path.dirname(n), exist_ok=True) + subprocess.check_call(['git', 'mv', o, n]) + +def rel(frm, to): + r = os.path.relpath(to, os.path.dirname(frm)) + return r if r.startswith('.') else './' + r + +spec_re = re.compile(r'((?:from|import)\s*\(?\s*["\'])(\.[^"\']*)(["\'])') +for f in glob.glob('src/**/*.ts*', recursive=True) + glob.glob('scripts/*.ts') + glob.glob('scripts/*.mjs'): + s = open(f).read() + where_old = old_loc.get(f, f) # Auflösung relativ zum ALTEN Ort der Datei + def fix(m): + spec = m.group(2) + target = os.path.normpath(os.path.join(os.path.dirname(where_old), spec)) + new_target = base_moves.get(target, target) + if new_target == target and where_old == f: + return m.group(0) + return m.group(1) + rel(f, new_target) + m.group(3) + n = spec_re.sub(fix, s) + if n != s: + open(f, 'w').write(n) diff --git a/src/App.tsx b/src/App.tsx index 7a49fdf5..d2325563 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -55,7 +55,7 @@ import { isTauriRuntime, PROJECT_TEMPLATE_EXT } from "./io/projectFile"; import { stepTextToImportedMeshes } from "./io/stepImport"; import { applyClashMarkers, runClashCheck } from "./analysis/clash"; import { checkForUpdate } from "./update/checkForUpdate"; -import type { PlanViewHandle } from "./plan/PlanView"; +import type { PlanViewHandle } from "./views/plan/PlanView"; import type { DisplayResolver } from "./viewport/Viewport3D"; import { neighbor3dVertex, diff --git a/src/text/RichTextEditor.tsx b/src/editors/RichTextEditor.tsx similarity index 99% rename from src/text/RichTextEditor.tsx rename to src/editors/RichTextEditor.tsx index 1523b1f2..68baf06a 100644 --- a/src/text/RichTextEditor.tsx +++ b/src/editors/RichTextEditor.tsx @@ -8,7 +8,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { t } from "../i18n"; -import { docToHtml } from "./renderHtml"; +import { docToHtml } from "../text/renderHtml"; import { Dropdown } from "../ui/Dropdown"; import { applyMark, @@ -21,14 +21,14 @@ import { normalizeDoc, serialize, toggleMark, -} from "./richText"; +} from "../text/richText"; import type { BoolMark, Marks, RichTextDoc, TextRange, TextStylePreset, -} from "./richText"; +} from "../text/richText"; // ── Props ──────────────────────────────────────────────────────────────────── diff --git a/src/plan/pickLabels.ts b/src/plan/pickLabels.ts index e2d1ac30..7147ff9f 100644 --- a/src/plan/pickLabels.ts +++ b/src/plan/pickLabels.ts @@ -5,7 +5,10 @@ import type { Project } from "../model/types"; import { flattenCategories } from "../model/types"; -import type { PickKind } from "./PlanView"; +/** Art eines auswählbaren Objekts an einer Klickstelle (Reihenfolge = Standard-Priorität). */ +export type PickKind = + | "section" | "opening" | "wall" | "column" | "drawing" | "solid" + | "ceiling" | "stair" | "room" | "roof" | "context"; type WithCategory = { id: string; categoryCode?: string }; diff --git a/src/state/useGripEditing.ts b/src/state/useGripEditing.ts index d4c96e54..1f4bbc0c 100644 --- a/src/state/useGripEditing.ts +++ b/src/state/useGripEditing.ts @@ -17,7 +17,7 @@ import type { DraftShape, SnapResult, SnapSettings, ToolDraft, ToolMods } from " import { applyAngleConstraint, computeSnap } from "../tools/snapping"; import { useCommandTabShortcut } from "./useKeyboardShortcuts"; import { sheetOwnerOutlines } from "../tools/sheetSnapGeometry"; -import type { BodyTarget } from "../plan/PlanView"; +import type { BodyTarget } from "../views/plan/PlanView"; import type { CommandLineHandle } from "../ui/CommandLine"; import type { CommandEngine } from "../commands/engine"; diff --git a/src/state/useMouseSelectionHandlers.ts b/src/state/useMouseSelectionHandlers.ts index 0e435e64..1021b5fe 100644 --- a/src/state/useMouseSelectionHandlers.ts +++ b/src/state/useMouseSelectionHandlers.ts @@ -8,7 +8,7 @@ import type { Project, Vec2 } from "../model/types"; import type { CategoryDisplayResolver } from "../plan/generatePlan"; import type { DisplayResolver } from "../viewport/Viewport3D"; -import type { PlanSelection, MarqueeSelection } from "../plan/PlanView"; +import type { PlanSelection, MarqueeSelection } from "../views/plan/PlanView"; import type { Pick3dHit } from "../viewport/Wasm3DViewport"; import type { RichTextDoc } from "../text/richText"; import { plainText } from "../text/richText"; diff --git a/src/state/usePanelHostBase.ts b/src/state/usePanelHostBase.ts index 4c89eeb1..fa2f48e6 100644 --- a/src/state/usePanelHostBase.ts +++ b/src/state/usePanelHostBase.ts @@ -14,7 +14,7 @@ import { resolvePenColor } from "../model/penSets"; import type { ToolId } from "../tools/types"; import type { ViewType } from "../model/viewTypes"; import type { TransformSelection } from "../tools/transform"; -import type { PlanViewHandle } from "../plan/PlanView"; +import type { PlanViewHandle } from "../views/plan/PlanView"; import type { PanelHostValue } from "../panels/host"; import type { Selection } from "./selectionInfo"; import type { EngineView } from "../commands/engine"; diff --git a/src/state/useProjectActions.ts b/src/state/useProjectActions.ts index 7e94b994..c60a2911 100644 --- a/src/state/useProjectActions.ts +++ b/src/state/useProjectActions.ts @@ -22,7 +22,7 @@ import type { WallType, WindowType, } from "../model/types"; -import type { PlanViewHandle } from "../plan/PlanView"; +import type { PlanViewHandle } from "../views/plan/PlanView"; import type { NotifyKind } from "./notifySlice"; /** diff --git a/src/state/useProjectFileActions.ts b/src/state/useProjectFileActions.ts index f28e41eb..ed628942 100644 --- a/src/state/useProjectFileActions.ts +++ b/src/state/useProjectFileActions.ts @@ -41,7 +41,7 @@ import { addRecentProject, removeRecentProject } from "./recentProjects"; import { emptyProject, sampleProject } from "../model/sampleProject"; import { flattenCategories } from "../model/types"; import type { ContextObject, Drawing2D, Project, Vec2 } from "../model/types"; -import type { PlanViewHandle } from "../plan/PlanView"; +import type { PlanViewHandle } from "../views/plan/PlanView"; /** Umriss (bbox) aller Drawing2D-Geometrien in Modell-Metern (null = leer). */ function drawingsBBox( diff --git a/src/ui/LayoutSheet.tsx b/src/ui/LayoutSheet.tsx index 195212bf..e5c52a5f 100644 --- a/src/ui/LayoutSheet.tsx +++ b/src/ui/LayoutSheet.tsx @@ -57,7 +57,7 @@ import { type RectMm, type SheetTransform, } from "./layoutSheetMath"; -import { RichTextEditor } from "../text/RichTextEditor"; +import { RichTextEditor } from "../editors/RichTextEditor"; import { docFromText } from "../text/richText"; import { wrapDocToLines, type SvgLine } from "../text/renderHtml"; import { contentFontBaselineFromTop, TEXT_LINE_HEIGHT_MULT } from "../text/fontMetrics"; diff --git a/src/ui/TextEditorDialog.tsx b/src/ui/TextEditorDialog.tsx index bda32001..47d72e4f 100644 --- a/src/ui/TextEditorDialog.tsx +++ b/src/ui/TextEditorDialog.tsx @@ -6,7 +6,7 @@ import { useState } from "react"; import { t } from "../i18n"; -import { RichTextEditor } from "../text/RichTextEditor"; +import { RichTextEditor } from "../editors/RichTextEditor"; import type { RichTextDoc } from "../text/richText"; export interface TextEditorDialogProps { diff --git a/src/plan/PlanView.cssImageFilter.test.ts b/src/views/plan/PlanView.cssImageFilter.test.ts similarity index 100% rename from src/plan/PlanView.cssImageFilter.test.ts rename to src/views/plan/PlanView.cssImageFilter.test.ts diff --git a/src/plan/PlanView.tsx b/src/views/plan/PlanView.tsx similarity index 99% rename from src/plan/PlanView.tsx rename to src/views/plan/PlanView.tsx index e13045fd..b27ec91b 100644 --- a/src/plan/PlanView.tsx +++ b/src/views/plan/PlanView.tsx @@ -5,6 +5,7 @@ // Polygon wird ein eigenes in definiert, damit Maßstab/Winkel/ // Farbe variieren können. +import type { PickKind } from "../../plan/pickLabels"; import { forwardRef, useEffect, @@ -14,22 +15,22 @@ import { useState, } from "react"; import type { ComponentProps, CSSProperties } from "react"; -import type { HatchRender, Plan, PlanImage, Primitive } from "./generatePlan"; -import { materializeGreyed, materializeUnderlay, type UnderlayGroup } from "./generatePlan"; -import type { Drawing2D, EdgeGrip, Vec2 } from "../model/types"; -import { t } from "../i18n"; -import type { ToolHandlers, ToolId, ToolMods } from "../tools/types"; -import type { HudFieldsState } from "../tools/hudFormat"; -import type { RichTextDoc } from "../text/richText"; -import { docFromText } from "../text/richText"; -import { contentFontBaselineFromTop, TEXT_LINE_HEIGHT_MULT } from "../text/fontMetrics"; -import { textFrameCorners } from "../text/textFrame"; -import { RichTextEditor } from "../text/RichTextEditor"; +import type { HatchRender, Plan, PlanImage, Primitive } from "../../plan/generatePlan"; +import { materializeGreyed, materializeUnderlay, type UnderlayGroup } from "../../plan/generatePlan"; +import type { Drawing2D, EdgeGrip, Vec2 } from "../../model/types"; +import { t } from "../../i18n"; +import type { ToolHandlers, ToolId, ToolMods } from "../../tools/types"; +import type { HudFieldsState } from "../../tools/hudFormat"; +import type { RichTextDoc } from "../../text/richText"; +import { docFromText } from "../../text/richText"; +import { contentFontBaselineFromTop, TEXT_LINE_HEIGHT_MULT } from "../../text/fontMetrics"; +import { textFrameCorners } from "../../text/textFrame"; +import { RichTextEditor } from "../../editors/RichTextEditor"; import { useNativeAvailable, useNativePlanRenderer } from "./useNativePlanRenderer"; -import { isGpuText } from "./nativeText"; +import { isGpuText } from "../../plan/nativeText"; import { LiveMeet, LiveValue, createMeetStore, createValueStore } from "./planView/liveMeet"; import { useWasmPlanRenderer } from "./useWasmPlanRenderer"; -import { DEFAULT_MARQUEE_COLOR, DEFAULT_SNAP_COLOR } from "../theme/accents"; +import { DEFAULT_MARQUEE_COLOR, DEFAULT_SNAP_COLOR } from "../../theme/accents"; import { type ViewBox, PX_PER_M, @@ -49,7 +50,7 @@ import { marqueeHitCeilings, marqueeHitRooms, marqueeHitStairs, -} from "./planView/geometry"; +} from "../../plan/planView/geometry"; import { polyUsesPattern, HatchPattern, @@ -61,25 +62,25 @@ import { import { DraftOverlay } from "./planView/overlays"; import { PlanRulers } from "./planView/PlanRulers"; import { PlanGrid } from "./planView/PlanGrid"; -import { expandRegion, indexedInRegion, regionContains, type Bounds } from "./planView/cullPrimitives"; -import { buildSegmentIndex, nearestSegment, pointSegDist, segmentsNear } from "./planView/segmentIndex"; -import { buildOwnerIndex, ownedBy, type OwnerField, type OwnerIndex } from "./planView/ownerIndex"; +import { expandRegion, indexedInRegion, regionContains, type Bounds } from "../../plan/planView/cullPrimitives"; +import { buildSegmentIndex, nearestSegment, pointSegDist, segmentsNear } from "../../plan/planView/segmentIndex"; +import { buildOwnerIndex, ownedBy, type OwnerField, type OwnerIndex } from "../../plan/planView/ownerIndex"; import { buildDrawingIndex, drawingsWithinDistance, marqueeHitUnderlay, nearestInDrawings, type DrawingIndex, -} from "./planView/underlayAccess"; -import { endBusyAfterPaint } from "../state/busyStore"; -import { createCursorStore, useCursorValue, type CursorStore } from "../state/cursorStore"; +} from "../../plan/planView/underlayAccess"; +import { endBusyAfterPaint } from "../../state/busyStore"; +import { createCursorStore, useCursorValue, type CursorStore } from "../../state/cursorStore"; /** * Feld-Status der Befehlszeile fürs Cursor-HUD (Tab-Feld-Zyklus §2.7) — Typ * lebt in `tools/hudFormat.ts` (dort auch von der 3D-Ansicht genutzt); * hier nur re-exportiert (bestehende Importe aus `./PlanView` bleiben gültig). */ -export type { HudFieldsState } from "../tools/hudFormat"; +export type { HudFieldsState } from "../../tools/hudFormat"; // Viewport-Culling (s. `cullPrimitives.ts`): erst ab dieser Primitiv-Anzahl // aktiv — normale Projekte liegen weit darunter und bleiben unverändert. @@ -203,10 +204,6 @@ export interface PlanViewHandle { confirmEdgeEdit: () => void; } -/** Art eines auswählbaren Objekts an einer Klickstelle (Reihenfolge = Standard-Priorität). */ -export type PickKind = - | "section" | "opening" | "wall" | "column" | "drawing" | "solid" - | "ceiling" | "stair" | "room" | "roof" | "context"; const PICK_ORDER: readonly PickKind[] = [ "section", "opening", "wall", "column", "drawing", "solid", diff --git a/src/plan/cssColor.ts b/src/views/plan/cssColor.ts similarity index 100% rename from src/plan/cssColor.ts rename to src/views/plan/cssColor.ts diff --git a/src/plan/glPlan/nativeGl.test.ts b/src/views/plan/nativeGl.test.ts similarity index 100% rename from src/plan/glPlan/nativeGl.test.ts rename to src/views/plan/nativeGl.test.ts diff --git a/src/plan/glPlan/nativeGl.ts b/src/views/plan/nativeGl.ts similarity index 99% rename from src/plan/glPlan/nativeGl.ts rename to src/views/plan/nativeGl.ts index e7fda2c7..43a2e73e 100644 --- a/src/plan/glPlan/nativeGl.ts +++ b/src/views/plan/nativeGl.ts @@ -8,7 +8,7 @@ * Frame wandert danach nur noch der Ausschnitt. */ -import type { BufferGl, GpuGeometry } from './glPlanTypes'; +import type { BufferGl, GpuGeometry } from '../../plan/glPlan/glPlanTypes'; export type NativeInvoke = (cmd: string, args?: unknown, options?: unknown) => Promise; diff --git a/src/plan/nativeSync.ts b/src/views/plan/nativeSync.ts similarity index 92% rename from src/plan/nativeSync.ts rename to src/views/plan/nativeSync.ts index 7c699e31..0e69d14e 100644 --- a/src/plan/nativeSync.ts +++ b/src/views/plan/nativeSync.ts @@ -9,11 +9,11 @@ // Tauri an `window.__TAURI_INTERNALS__`; Fehler beim Invoke werden still // geschluckt (console.debug), damit die App nie daran scheitert. -import type { Plan } from "./generatePlan"; -import { materializeGreyed, materializeUnderlay } from "./generatePlan"; -import type { Project } from "../model/types"; -import { planToRenderScene } from "./toRenderScene"; -import { projectToModel3d, TRUCK_MESH_READY_EVENT } from "./toWalls3d"; +import type { Plan } from "../../plan/generatePlan"; +import { materializeGreyed, materializeUnderlay } from "../../plan/generatePlan"; +import type { Project } from "../../model/types"; +import { planToRenderScene } from "../../plan/toRenderScene"; +import { projectToModel3d, TRUCK_MESH_READY_EVENT } from "../../plan/toWalls3d"; /** Sammel-Fenster: Modelländerungen werden gebündelt gepusht (nicht je Frame). */ const DEBOUNCE_MS = 200; diff --git a/src/plan/planView/PlanGrid.tsx b/src/views/plan/planView/PlanGrid.tsx similarity index 96% rename from src/plan/planView/PlanGrid.tsx rename to src/views/plan/planView/PlanGrid.tsx index 82efeef7..bdce721d 100644 --- a/src/plan/planView/PlanGrid.tsx +++ b/src/views/plan/planView/PlanGrid.tsx @@ -6,7 +6,7 @@ // (`ZOOM_MIN`/`ZOOM_MAX` in PlanView.tsx) auf ≤ ~Bildschirmbreite/64px // begrenzt, unabhängig davon, wie weit heraus- oder hereingezoomt ist. -import { PX_PER_M } from "./geometry"; +import { PX_PER_M } from "../../../plan/planView/geometry"; import { rulerStep } from "./PlanRulers"; export function PlanGrid({ diff --git a/src/plan/planView/PlanRulers.tsx b/src/views/plan/planView/PlanRulers.tsx similarity index 97% rename from src/plan/planView/PlanRulers.tsx rename to src/views/plan/planView/PlanRulers.tsx index 0fc64893..5e39190f 100644 --- a/src/plan/planView/PlanRulers.tsx +++ b/src/views/plan/planView/PlanRulers.tsx @@ -1,7 +1,7 @@ // Lineale oben + links (Vectorworks-Stil) am Rand der Plan-Ansicht. -import type { Vec2 } from "../../model/types"; -import { PX_PER_M } from "./geometry"; +import type { Vec2 } from "../../../model/types"; +import { PX_PER_M } from "../../../plan/planView/geometry"; /** * Schrittweite (Meter) fürs Lineal: 1/2/5·10^n, sodass Major-Ticks ≥ ~64 px diff --git a/src/plan/planView/liveMeet.tsx b/src/views/plan/planView/liveMeet.tsx similarity index 100% rename from src/plan/planView/liveMeet.tsx rename to src/views/plan/planView/liveMeet.tsx diff --git a/src/plan/planView/overlays.tsx b/src/views/plan/planView/overlays.tsx similarity index 98% rename from src/plan/planView/overlays.tsx rename to src/views/plan/planView/overlays.tsx index fbc34bf9..3addd5bb 100644 --- a/src/plan/planView/overlays.tsx +++ b/src/views/plan/planView/overlays.tsx @@ -2,9 +2,9 @@ // Winkel-Führungslinie, Snap-Marker. Reine Darstellung, bekommt `toScreen` + // Massstab-Parameter als Props gereicht. -import type { Vec2 } from "../../model/types"; -import type { SnapResult, ToolDraft } from "../../tools/types"; -import { hudSegments, type HudFieldsState } from "../../tools/hudFormat"; +import type { Vec2 } from "../../../model/types"; +import type { SnapResult, ToolDraft } from "../../../tools/types"; +import { hudSegments, type HudFieldsState } from "../../../tools/hudFormat"; /** * Zeichnet die Werkzeug-Vorschau: Vorschau-Formen (gestrichelte Akzentlinien / diff --git a/src/plan/planView/primitives.gradient.test.ts b/src/views/plan/planView/primitives.gradient.test.ts similarity index 95% rename from src/plan/planView/primitives.gradient.test.ts rename to src/views/plan/planView/primitives.gradient.test.ts index 8acb2877..86db23bf 100644 --- a/src/plan/planView/primitives.gradient.test.ts +++ b/src/views/plan/planView/primitives.gradient.test.ts @@ -11,7 +11,7 @@ import { describe, expect, it } from "vitest"; import { polyUsesPattern } from "./primitives"; -import type { HatchRender } from "../generatePlan/shared"; +import type { HatchRender } from "../../../plan/generatePlan/shared"; function hatch(over: Partial = {}): HatchRender { return { diff --git a/src/plan/planView/primitives.tsx b/src/views/plan/planView/primitives.tsx similarity index 98% rename from src/plan/planView/primitives.tsx rename to src/views/plan/planView/primitives.tsx index 7d9276c6..3b9a98e3 100644 --- a/src/plan/planView/primitives.tsx +++ b/src/views/plan/planView/primitives.tsx @@ -3,14 +3,14 @@ // Renderer. Bekommt `toScreen`/Massstab-Parameter gereicht, kein eigener // Zugriff auf PlanView-internen State. -import type { HatchRender, Primitive } from "../generatePlan"; -import { NO_HATCH } from "../generatePlan/shared"; -import { docToLines, wrapDocToLines, type SvgLine } from "../../text/renderHtml"; -import type { Vec2 } from "../../model/types"; -import { quantizePen } from "../../export/sceneToPrintSvg"; -import { buildRandomHatchRuns, zigzagPoints, motifPoints, DASH_MM_TO_M } from "../glPlan/glPlanHatch"; -import { dashHasDot } from "../../geometry/lineSegments"; -import { HAIRLINE_PX, PX_PER_M, mmToPx, printStrokeVb, visibleEdgeRuns } from "./geometry"; +import type { HatchRender, Primitive } from "../../../plan/generatePlan"; +import { NO_HATCH } from "../../../plan/generatePlan/shared"; +import { docToLines, wrapDocToLines, type SvgLine } from "../../../text/renderHtml"; +import type { Vec2 } from "../../../model/types"; +import { quantizePen } from "../../../export/sceneToPrintSvg"; +import { buildRandomHatchRuns, zigzagPoints, motifPoints, DASH_MM_TO_M } from "../../../plan/glPlan/glPlanHatch"; +import { dashHasDot } from "../../../geometry/lineSegments"; +import { HAIRLINE_PX, PX_PER_M, mmToPx, printStrokeVb, visibleEdgeRuns } from "../../../plan/planView/geometry"; /** Basis-Kachelmaß (viewBox-Einheiten) einer Bild-Schraffur bei scaleX/scaleY = 1. */ const IMG_TILE_VB = 40; diff --git a/src/plan/useNativePlanRenderer.ts b/src/views/plan/useNativePlanRenderer.ts similarity index 96% rename from src/plan/useNativePlanRenderer.ts rename to src/views/plan/useNativePlanRenderer.ts index b4a2b8bd..a5bde82a 100644 --- a/src/plan/useNativePlanRenderer.ts +++ b/src/views/plan/useNativePlanRenderer.ts @@ -9,14 +9,14 @@ */ import { useCallback, useEffect, useRef, useState } from 'react'; -import type { Plan } from './generatePlan'; -import { GpuChunkCache } from './glPlan/glPlanChunks'; -import { compilePrimitivesToGpu } from './glPlan/glPlanCompile'; -import type { GpuGeometry, ViewBox } from './glPlan/glPlanTypes'; -import type { Primitive } from './generatePlan'; -import { NativeGl, type NativeInvoke } from './glPlan/nativeGl'; +import type { Plan } from '../../plan/generatePlan'; +import { GpuChunkCache } from '../../plan/glPlan/glPlanChunks'; +import { compilePrimitivesToGpu } from '../../plan/glPlan/glPlanCompile'; +import type { GpuGeometry, ViewBox } from '../../plan/glPlan/glPlanTypes'; +import type { Primitive } from '../../plan/generatePlan'; +import { NativeGl, type NativeInvoke } from './nativeGl'; import { readCssColor } from './cssColor'; -import { NativeTextSync } from './nativeText'; +import { NativeTextSync } from '../../plan/nativeText'; /** Läuft die App in einer Tauri-Webview? */ const isTauri = (): boolean => typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window; diff --git a/src/plan/useWasmPlanRenderer.ts b/src/views/plan/useWasmPlanRenderer.ts similarity index 96% rename from src/plan/useWasmPlanRenderer.ts rename to src/views/plan/useWasmPlanRenderer.ts index 9c9d7357..6cc17d70 100644 --- a/src/plan/useWasmPlanRenderer.ts +++ b/src/views/plan/useWasmPlanRenderer.ts @@ -13,8 +13,8 @@ */ import { useCallback, useEffect, useRef, useState } from "react"; -import type { Plan } from "./generatePlan"; -import { planToRenderScene } from "./toRenderScene"; +import type { Plan } from "../../plan/generatePlan"; +import { planToRenderScene } from "../../plan/toRenderScene"; interface ViewBox { x: number; @@ -43,7 +43,7 @@ let enginePromise: Promise | null = null; function loadEngine(): Promise { if (!enginePromise) { enginePromise = (async () => { - const mod: any = await import("../engine/pkg/render2d.js"); + const mod: any = await import("../../engine/pkg/render2d.js"); await mod.default(); // lädt render2d_bg.wasm return mod; })(); diff --git a/src/views/viewportContent.tsx b/src/views/viewportContent.tsx index ab9f697f..980b3014 100644 --- a/src/views/viewportContent.tsx +++ b/src/views/viewportContent.tsx @@ -20,7 +20,7 @@ import type { Wall, } from "../model/types"; import { categoryNameForPick } from "../plan/pickLabels"; -import type { PickKind } from "../plan/PlanView"; +import type { PickKind } from "../plan/pickLabels"; import { generatePlan, generateSectionPlan, generateVisibleLevelsPlan } from "../plan/generatePlan"; import type { CategoryDisplayResolver, Plan, Primitive } from "../plan/generatePlan"; import type { RichTextDoc } from "../text/richText"; @@ -31,10 +31,10 @@ import { crossKindOverlayAllowed, planUnderlayPrimitives } from "../plan/planUnd import { sectionOpeningPrimitives } from "../plan/sectionOpenings"; import { levelMarkerPrimitives, levelMarksEnabled } from "../plan/levelMarkers"; import { setSheetOwnerOutlines, setSheetSnapSegments, snapSegmentsFromPrimitives } from "../tools/sheetSnapGeometry"; -import { pushNativeScene, pushNativeWalls } from "../plan/nativeSync"; +import { pushNativeScene, pushNativeWalls } from "./plan/nativeSync"; import { selectionHighlightLines } from "../plan/toWalls3d"; import { applyGroupDimmingToPlan } from "../state/groupActions"; -import { PlanView } from "../plan/PlanView"; +import { PlanView } from "./plan/PlanView"; import type { GripHandlers, GroupableHit, @@ -42,7 +42,7 @@ import type { MarqueeSelection, PlanSelection, PlanViewHandle, -} from "../plan/PlanView"; +} from "./plan/PlanView"; import { Viewport3D } from "../viewport/Viewport3D"; import type { DisplayResolver } from "../viewport/Viewport3D"; import type { Pick3dHit } from "../viewport/Wasm3DViewport";