저장소 사고로 잃은 4개 커밋(38eb7cd4·b8a11756·281528bf·f60b488d)의 작업물을 하나로 다시 담았다. 내용은 동일하다. ■ 구조 - commands/: 명령 정의(id·AutoCAD 별칭·글리프·도구/즉시실행)를 단일 소스로 두고 리본·명령행·단축키가 모두 이 레지스트리를 읽는다. tools/tool.consts.ts 폐지. - ribbon/: 탭→패널→명령 데이터(ribbon.config.ts)와 범용 렌더러 분리. AutoCAD 배치(홈·삽입·주석·뷰·출력)와 패널 확장(▾)을 따른다. - tools/factories/sequence-tool.ts: 점·숫자·문자·객체·선택 단계를 선언하면 xstate 머신을 만들어 주는 공장. 명령당 170줄 보일러플레이트 제거. - helpers/geometry/: 3점 호·정다각형·타원·스플라인·구름형·평행이동·해치 스캔선· 점렬 샘플링 등 상태 없는 순수 함수. - Toolbar 483줄을 QuickAccessBar/Ribbon/InspectorPanel/StatusBar/CommandLine/ ViewControls/PropertiesEditor/QuickProperties로 분해. ■ 명령 (조사표 기준) - 1절 그리기 21건, 2절 수정 27건, 3절 도면층·특성·그룹·유틸리티 39건 전부 반영. - 5절 주석 34건 중 26건 반영(문자·치수 16종·지시선·표·구름형·주석 축척). - HatchEntity 추가(solid·pattern·cross·gradient) + JSON 왕복, Layer에 색·선가중치· 선종류·동결·투명도 필드 추가, 그리기 루프가 동결·숨김·투명도를 반영. ■ 화면 실측에서 고친 결함 - 명령행 포커스 상태에서 ENTER가 도구로 가지 않던 문제 - 명령행 문자 입력이 접두사가 같은 명령으로 실행되던 문제 - 명령이 끝나도 입력을 계속 먹던 문제(점 입력 명령만 반복, 나머지는 선택 도구 복귀) - 시퀀스 단계 인덱스 오사용 9건 + 단계 값 종류 검사 추가 - 해치 내부를 클릭해도 선택되지 않던 문제 미반영 8건(맞춤법 검사·꺾기 치수·치수 끊기/재연관/검사 치수·기하공차·지시선 수집· 축척 리스트 편집)은 조사표 `반영` 열과 PLAN.md에 사유를 적었다.
271 lines
6.1 KiB
TypeScript
271 lines
6.1 KiB
TypeScript
/** 홈 탭 — 특성·그룹·유틸리티·클립보드 명령 (조사표 3절) */
|
|
import type { CadCommand } from './command.types';
|
|
import { Tool } from '../tools';
|
|
import {
|
|
copyBaseToolStateMachine,
|
|
copySelectionToClipboard,
|
|
cutSelectionToClipboard,
|
|
pasteAsGroup,
|
|
pasteAtOriginalCoordinates,
|
|
pasteToolStateMachine,
|
|
} from '../tools/utility/clipboard-tools';
|
|
import {
|
|
angleToolStateMachine,
|
|
areaToolStateMachine,
|
|
distanceToolStateMachine,
|
|
idPointToolStateMachine,
|
|
listSelectedEntities,
|
|
measureGeomToolStateMachine,
|
|
quickCalcToolStateMachine,
|
|
radiusToolStateMachine,
|
|
} from '../tools/utility/inquiry-tools';
|
|
import {
|
|
colorToolStateMachine,
|
|
lineTypeToolStateMachine,
|
|
lineWeightToolStateMachine,
|
|
openPropertiesPalette,
|
|
toggleQuickProperties,
|
|
transparencyToolStateMachine,
|
|
} from '../tools/utility/property-tools';
|
|
import {
|
|
groupToolStateMachine,
|
|
hideObjectsToolStateMachine,
|
|
isolateObjectsToolStateMachine,
|
|
qSelectToolStateMachine,
|
|
selectSimilarToolStateMachine,
|
|
ungroupToolStateMachine,
|
|
unhideAllObjects,
|
|
} from '../tools/utility/selection-tools';
|
|
|
|
export const PROPERTY_COMMANDS: CadCommand[] = [
|
|
{
|
|
id: 'COLOR',
|
|
label: '색상',
|
|
aliases: ['COL'],
|
|
glyph: '🎨',
|
|
hint: '선택 객체의 색을 지정한다',
|
|
tool: Tool.COLOR,
|
|
machine: colorToolStateMachine,
|
|
},
|
|
{
|
|
id: 'LINETYPE',
|
|
label: '선종류',
|
|
aliases: ['LT'],
|
|
glyph: '┄',
|
|
hint: '실선·파선·1점쇄선·점선을 지정한다',
|
|
tool: Tool.LINETYPE,
|
|
machine: lineTypeToolStateMachine,
|
|
},
|
|
{
|
|
id: 'LWEIGHT',
|
|
label: '선가중치',
|
|
aliases: ['LW'],
|
|
glyph: '▬',
|
|
hint: '선 굵기를 지정한다',
|
|
tool: Tool.LWEIGHT,
|
|
machine: lineWeightToolStateMachine,
|
|
},
|
|
{
|
|
id: 'PROPERTIES',
|
|
label: '특성',
|
|
aliases: ['CH', 'MO', 'PR'],
|
|
glyph: '☰',
|
|
hint: '선택 객체의 특성을 보고 고친다',
|
|
run: openPropertiesPalette,
|
|
},
|
|
{
|
|
id: 'QUICKPROPERTIES',
|
|
label: '빠른 특성',
|
|
aliases: ['QP'],
|
|
glyph: '⌗',
|
|
hint: '선택 객체의 주요 특성만 화면에 띄운다',
|
|
run: toggleQuickProperties,
|
|
},
|
|
{
|
|
id: 'TRANSPARENCY',
|
|
label: '투명도',
|
|
glyph: '◍',
|
|
hint: '선택 객체의 투명도를 지정한다',
|
|
tool: Tool.TRANSPARENCY,
|
|
machine: transparencyToolStateMachine,
|
|
},
|
|
];
|
|
|
|
export const GROUP_COMMANDS: CadCommand[] = [
|
|
{
|
|
id: 'GROUP',
|
|
label: '그룹',
|
|
aliases: ['G'],
|
|
glyph: '⧉',
|
|
hint: '여러 객체를 함께 선택되는 그룹으로 묶는다',
|
|
tool: Tool.GROUP,
|
|
machine: groupToolStateMachine,
|
|
},
|
|
{
|
|
id: 'UNGROUP',
|
|
label: '그룹 해제',
|
|
glyph: '⧅',
|
|
hint: '그룹 묶음을 푼다',
|
|
tool: Tool.UNGROUP,
|
|
machine: ungroupToolStateMachine,
|
|
},
|
|
];
|
|
|
|
export const INQUIRY_COMMANDS: CadCommand[] = [
|
|
{
|
|
id: 'DIST',
|
|
label: '거리',
|
|
aliases: ['DI'],
|
|
glyph: '↔',
|
|
hint: '두 점 사이의 거리와 각도를 잰다',
|
|
tool: Tool.DIST,
|
|
machine: distanceToolStateMachine,
|
|
},
|
|
{
|
|
id: 'RADIUS',
|
|
label: '반지름',
|
|
glyph: '◜',
|
|
hint: '원 또는 호의 반지름을 잰다',
|
|
tool: Tool.RADIUS_INQUIRY,
|
|
machine: radiusToolStateMachine,
|
|
},
|
|
{
|
|
id: 'ANGLE',
|
|
label: '각도',
|
|
glyph: '∠',
|
|
hint: '세 점이 이루는 각도를 잰다',
|
|
tool: Tool.ANGLE_INQUIRY,
|
|
machine: angleToolStateMachine,
|
|
},
|
|
{
|
|
id: 'AREA',
|
|
label: '면적',
|
|
aliases: ['AA'],
|
|
glyph: '▦',
|
|
hint: '닫힌 경계의 면적과 둘레를 계산한다',
|
|
tool: Tool.AREA,
|
|
machine: areaToolStateMachine,
|
|
},
|
|
{
|
|
id: 'MEASUREGEOM',
|
|
label: '빠른 측정',
|
|
aliases: ['MEA'],
|
|
glyph: '📏',
|
|
hint: '거리·반지름·각도·면적 중 하나를 골라 잰다',
|
|
tool: Tool.MEASUREGEOM,
|
|
machine: measureGeomToolStateMachine,
|
|
},
|
|
{
|
|
id: 'ID',
|
|
label: '점 좌표',
|
|
glyph: '⌖',
|
|
hint: '지정한 점의 좌표를 표시한다',
|
|
tool: Tool.ID_POINT,
|
|
machine: idPointToolStateMachine,
|
|
},
|
|
{
|
|
id: 'LIST',
|
|
label: '리스트',
|
|
aliases: ['LI'],
|
|
glyph: '≣',
|
|
hint: '선택 객체의 종류·길이·크기를 표시한다',
|
|
run: listSelectedEntities,
|
|
},
|
|
{
|
|
id: 'QSELECT',
|
|
label: '빠른 선택',
|
|
glyph: '⋔',
|
|
hint: '객체 유형으로 선택 집합을 만든다',
|
|
tool: Tool.QSELECT,
|
|
machine: qSelectToolStateMachine,
|
|
},
|
|
{
|
|
id: 'QUICKCALC',
|
|
label: '계산기',
|
|
aliases: ['QC'],
|
|
glyph: '🖩',
|
|
hint: '수식을 계산한다',
|
|
tool: Tool.QUICKCALC,
|
|
machine: quickCalcToolStateMachine,
|
|
},
|
|
{
|
|
id: 'SELECTSIMILAR',
|
|
label: '유사 선택',
|
|
glyph: '⁝⁝',
|
|
hint: '같은 종류·색·도면층 객체를 모두 선택한다',
|
|
tool: Tool.SELECTSIMILAR,
|
|
machine: selectSimilarToolStateMachine,
|
|
},
|
|
{
|
|
id: 'ISOLATEOBJECTS',
|
|
label: '객체 분리',
|
|
glyph: '◧',
|
|
hint: '선택 객체만 남기고 나머지를 숨긴다',
|
|
tool: Tool.ISOLATEOBJECTS,
|
|
machine: isolateObjectsToolStateMachine,
|
|
},
|
|
{
|
|
id: 'HIDEOBJECTS',
|
|
label: '객체 숨기기',
|
|
glyph: '◌',
|
|
hint: '선택 객체를 일시적으로 숨긴다',
|
|
tool: Tool.HIDEOBJECTS,
|
|
machine: hideObjectsToolStateMachine,
|
|
},
|
|
{
|
|
id: 'UNISOLATEOBJECTS',
|
|
label: '객체 분리 종료',
|
|
aliases: ['UNHIDE', 'UNISOLATE'],
|
|
glyph: '◉',
|
|
hint: '숨긴 객체를 다시 표시한다',
|
|
run: unhideAllObjects,
|
|
},
|
|
];
|
|
|
|
export const CLIPBOARD_COMMANDS: CadCommand[] = [
|
|
{
|
|
id: 'COPYCLIP',
|
|
label: '복사',
|
|
glyph: '⎘',
|
|
hint: '선택 객체를 클립보드로 복사한다',
|
|
run: copySelectionToClipboard,
|
|
},
|
|
{
|
|
id: 'CUTCLIP',
|
|
label: '잘라내기',
|
|
glyph: '✂',
|
|
hint: '선택 객체를 클립보드로 옮긴다',
|
|
run: cutSelectionToClipboard,
|
|
},
|
|
{
|
|
id: 'PASTECLIP',
|
|
label: '붙여넣기',
|
|
glyph: '📋',
|
|
hint: '클립보드 객체를 지정 위치에 붙여넣는다',
|
|
tool: Tool.PASTECLIP,
|
|
machine: pasteToolStateMachine,
|
|
},
|
|
{
|
|
id: 'COPYBASE',
|
|
label: '기준점 복사',
|
|
glyph: '⌖',
|
|
hint: '기준점을 지정해 복사한다',
|
|
tool: Tool.COPYBASE,
|
|
machine: copyBaseToolStateMachine,
|
|
},
|
|
{
|
|
id: 'PASTEORIG',
|
|
label: '원래 좌표로 붙여넣기',
|
|
glyph: '⇱',
|
|
hint: '복사한 좌표 그대로 붙여넣는다',
|
|
run: pasteAtOriginalCoordinates,
|
|
},
|
|
{
|
|
id: 'PASTEBLOCK',
|
|
label: '그룹으로 붙여넣기',
|
|
glyph: '❐',
|
|
hint: '붙여넣으면서 하나의 그룹으로 묶는다',
|
|
run: pasteAsGroup,
|
|
},
|
|
];
|