From 2f06993c7d1adde27f12f977e1771fb34d42b61c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 22 Oct 2026 20:16:50 +0900 Subject: [PATCH] =?UTF-8?q?refactor(513-3=20=EB=8D=A7=20RouteEdit=20?= =?UTF-8?q?=EC=A4=84=20=EC=88=98):=20=EC=83=81=ED=83=9C=EC=A4=84=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20=C2=B7=20=EA=B3=A0=EB=A5=B8=20=EB=93=B1?= =?UTF-8?q?=EA=B3=A0=EC=84=A0=20=EA=B8=80=20=EC=A7=93=EA=B8=B0=20=3D=20rou?= =?UTF-8?q?teHeadText(=5FRender)=20=C2=B7=20contourHintText(=5FContour)=20?= =?UTF-8?q?=EB=A1=9C=20=EC=98=AE=EA=B9=80=20=E2=80=94=20RouteEdit.ts=20699?= =?UTF-8?q?=20=E2=86=92=20691=20=EC=A4=84=20=C2=B7=20test=5F430=20?= =?UTF-8?q?=ED=8E=B8=EC=A7=91=EA=B8=B0=20=EB=B0=B0=EC=84=A0=20=C2=B7=20tes?= =?UTF-8?q?t=5F399=20=EC=A4=84=20=EC=88=98=20=ED=95=9C=EB=8F=84=20695=20?= =?UTF-8?q?=ED=86=B5=EA=B3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- B05_Profile/B05_Profile_UI_RouteEdit.ts | 18 +++++------------- .../B05_Profile_UI_RouteEdit_Contour.ts | 7 +++++++ B05_Profile/B05_Profile_UI_RouteEdit_Render.ts | 10 ++++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/B05_Profile/B05_Profile_UI_RouteEdit.ts b/B05_Profile/B05_Profile_UI_RouteEdit.ts index fc9e6b628..85faf4c1d 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit.ts @@ -28,6 +28,7 @@ import { createSheetFollow, fetchRouteSheets, loadRouteEditBackground, + contourHintText, type RouteEditContours, type SheetLayers, } from "./B05_Profile_UI_RouteEdit_Contour"; @@ -39,7 +40,7 @@ import { } from "./B05_Profile_Api_Replan"; import { bindRouteApply } from "./B05_Profile_UI_RouteEdit_Apply"; import type { EditedCurve, EditedNode } from "./logic/B05_Profile_UI_RouteEdit_Curve"; -import { drawRouteEditScene, polylineLengthM, watchTheme } from "./B05_Profile_UI_RouteEdit_Render"; +import { drawRouteEditScene, routeHeadText, watchTheme } from "./B05_Profile_UI_RouteEdit_Render"; import { bindNodeSplice, bindRouteEditNavigation } from "./B05_Profile_UI_RouteEdit_Input"; import { bindRouteEditPointer } from "./B05_Profile_UI_RouteEdit_Pointer"; import { createCrossPreview } from "./B05_Profile_UI_RouteEdit_Cross"; @@ -372,19 +373,10 @@ export async function mountRouteEditor( nodeInfo = built.nodes; } - /** 상태줄 머리 — 지금 그려진 계획노선 길이와 노드 수(계획서 0-9 ①). 원호가 정점으로 - * 펴져 있어 브라우저에서 바로 잴 수 있다 — 서버에 묻지 않는다. */ + /** 상태줄 머리 · 고른 등고선 글 — 짓기는 `_Render` · `_Contour` 몫. */ const routeHead = (): string => - `예상노선 ${polylineLengthM(expected).toFixed(1)}m · ` + - `계획노선 ${polylineLengthM(plannedLine.length ? plannedLine : planned).toFixed(1)}m · ` + - `노드 ${planned.length}개`; - - /** 고른 등고선의 높이 — 못 읽었으면 높이 없이 「고른 등고선」만(계획서 0-9 ⑦). */ - const contourHint = (): string => { - if (pickedContour < 0) return "등고선을 누르면 그 줄의 높이가 보입니다."; - const level = contours?.layer.features[pickedContour]?.labelValue ?? null; - return level === null ? "등고선 한 줄을 골랐습니다." : `고른 등고선 ${level}m.`; - }; + routeHeadText(expected, plannedLine.length ? plannedLine : planned, planned.length); + const contourHint = (): string => contourHintText(contours, pickedContour); /** 상태줄 꼬리 — 셈은 `_Edits` 몫. */ const curveHint = (): string => diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Contour.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Contour.ts index 1ae97349d..84796ff7d 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Contour.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Contour.ts @@ -48,6 +48,13 @@ export interface RouteEditContours { minor: (() => PreparedLayer) | null; } +/** 고른 등고선의 높이 — 못 읽었으면 높이 없이 「고른 등고선」만(계획서 0-9 ⑦). */ +export function contourHintText(contours: RouteEditContours | null, picked: number): string { + if (picked < 0) return "등고선을 누르면 그 줄의 높이가 보입니다."; + const level = contours?.layer.features[picked]?.labelValue ?? null; + return level === null ? "등고선 한 줄을 골랐습니다." : `고른 등고선 ${level}m.`; +} + interface ContourResponse { contours: Array<{ level: number; coordinates: Array<[number, number, number]> }>; } diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Render.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Render.ts index 6aedb6f1f..2f1658c37 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Render.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Render.ts @@ -66,6 +66,16 @@ export function polylineLengthM(points: ReadonlyArray): number { return total; } +/** 상태줄 머리 — 지금 그려진 계획노선 길이와 노드 수(계획서 0-9 ①). 원호가 정점으로 + * 펴져 있어 브라우저에서 바로 잴 수 있다 — 서버에 묻지 않는다. */ +export const routeHeadText = ( + expected: ReadonlyArray, + line: ReadonlyArray, + nodeCount: number, +): string => + `예상노선 ${polylineLengthM(expected).toFixed(1)}m · ` + + `계획노선 ${polylineLengthM(line).toFixed(1)}m · 노드 ${nodeCount}개`; + export interface RouteEditScene { view: ViewState; /** 사업지 좌표(m) → 캔버스 px. */