Files
Aislo/B07_DesignDetail/openwebcad/src/commands/commands.annotate.ts
T
eomsangdonandClaude Opus 5.5 c426fa2ad6 feat(B07 CAD): 표 놓기 도구 · 표 메시지 place-table · update-table (41-2)
- 새 tools/annotate/place-table-tool.ts — PLACETABLE: 부모가 보낸 표를 커서에 붙여 미리보기 · 누르면 그 자리(왼쪽 위) · Esc 그만 · 놓기 = 되돌리기 한 걸음
- 새 integration/aislo-table-bridge.ts — place-table{entity, link} = style.연결 단 표로 놓기 시작 · update-table{link, cells} = 연결 같은 표 칸만 갈기(자리 · 크기 그대로) → table-updated{link, count} · 확정 · 보기 전용이면 안 함
- TableEntity style.연결 · replaceCells · bridge 갈래 한 줄 · 명령 PLACETABLE
- 시험 aislo-table-bridge.test.ts(놓기 · 연결 남음 · 칸 갈기 · 넘침 · 없는 연결)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoSr2sqvYtBf1dtQdus88s
2026-10-04 22:43:40 +09:00

356 lines
8.4 KiB
TypeScript

/** 주석 탭 명령 (조사표 5절 전 항목) */
import { toast } from 'react-toastify';
import { setActiveRibbonTab } from '../components/ui-state';
import { Tool } from '../tools';
import {
centerLineToolStateMachine,
centerMarkToolStateMachine,
dimAngularToolStateMachine,
dimArcToolStateMachine,
dimDiameterToolStateMachine,
dimOrdinateToolStateMachine,
dimRadiusToolStateMachine,
dimSpaceToolStateMachine,
} from '../tools/annotate/dimension-radial-tools';
import {
dimAlignedToolStateMachine,
dimAutoToolStateMachine,
dimBaselineToolStateMachine,
dimContinueToolStateMachine,
dimLinearToolStateMachine,
qDimToolStateMachine,
} from '../tools/annotate/dimension-tools';
import {
annotationScaleToolStateMachine,
dimStyleToolStateMachine,
mleaderAlignToolStateMachine,
mleaderStyleToolStateMachine,
mleaderToolStateMachine,
revCloudToolStateMachine,
updateDimensions,
} from '../tools/annotate/leader-table-tools';
import { placeTableToolStateMachine } from '../tools/annotate/place-table-tool';
import {
tableColumnToolStateMachine,
tableEditToolStateMachine,
tableMergeToolStateMachine,
tableRowToolStateMachine,
tableStyleToolStateMachine,
tableToolStateMachine,
tableUnmergeToolStateMachine,
} from '../tools/annotate/table-tools';
import {
findToolStateMachine,
mtextToolStateMachine,
textEditToolStateMachine,
textToolStateMachine,
} from '../tools/annotate/text-tools';
import type { CadCommand } from './command.types';
export const TEXT_COMMANDS: CadCommand[] = [
{
id: 'MTEXT',
label: '여러 줄 문자',
aliases: ['T', 'MT'],
glyph: '¶',
hint: '여러 줄 문자를 작성한다 (줄바꿈은 \\P)',
tool: Tool.MTEXT,
machine: mtextToolStateMachine,
},
{
id: 'TEXT',
label: '단일 행 문자',
aliases: ['DT'],
glyph: 'A',
hint: '한 줄짜리 문자를 작성한다',
tool: Tool.TEXT,
machine: textToolStateMachine,
},
{
id: 'STYLE',
label: '문자 스타일',
aliases: ['ST'],
glyph: '🅰',
hint: '리본 문자 패널에서 글꼴·크기·색을 지정한다',
run: () => {
setActiveRibbonTab('annotate');
toast.info('주석 탭 문자 패널에서 글꼴과 크기를 지정하십시오.');
return '문자 스타일';
},
},
{
id: 'TEXTEDIT',
label: '문자 편집',
aliases: ['TEDIT'],
glyph: '✎',
hint: '기존 문자의 내용을 고친다',
tool: Tool.TEXTEDIT,
machine: textEditToolStateMachine,
},
{
id: 'FIND',
label: '찾기·대치',
glyph: '🔍',
hint: '도면 문자를 찾고 바꾼다',
tool: Tool.FIND,
machine: findToolStateMachine,
},
];
export const DIMENSION_COMMANDS: CadCommand[] = [
{
id: 'DIM',
label: '치수',
glyph: '⟺',
hint: '선택 객체에 맞는 치수를 자동으로 넣는다',
tool: Tool.DIM,
machine: dimAutoToolStateMachine,
},
{
id: 'DIMLINEAR',
label: '선형 치수',
aliases: ['DLI'],
glyph: '↔',
hint: '수평 또는 수직 거리를 기입한다',
tool: Tool.DIMLINEAR,
machine: dimLinearToolStateMachine,
},
{
id: 'DIMALIGNED',
label: '정렬 치수',
aliases: ['DAL'],
glyph: '⤢',
hint: '두 점과 평행한 실제 길이를 기입한다',
tool: Tool.DIMALIGNED,
machine: dimAlignedToolStateMachine,
},
{
id: 'DIMANGULAR',
label: '각도 치수',
aliases: ['DAN'],
glyph: '∠',
hint: '세 점이 이루는 각도를 기입한다',
tool: Tool.DIMANGULAR,
machine: dimAngularToolStateMachine,
},
{
id: 'DIMARC',
label: '호 길이 치수',
aliases: ['DAR'],
glyph: '⌒',
hint: '호의 곡선 길이를 기입한다',
tool: Tool.DIMARC,
machine: dimArcToolStateMachine,
},
{
id: 'DIMRADIUS',
label: '반지름 치수',
aliases: ['DRA'],
glyph: 'R',
hint: '원·호의 반지름을 기입한다',
tool: Tool.DIMRADIUS,
machine: dimRadiusToolStateMachine,
},
{
id: 'DIMDIAMETER',
label: '지름 치수',
aliases: ['DDI'],
glyph: 'Ø',
hint: '원·호의 지름을 기입한다',
tool: Tool.DIMDIAMETER,
machine: dimDiameterToolStateMachine,
},
{
id: 'DIMORDINATE',
label: '세로좌표 치수',
aliases: ['DOR'],
glyph: '⌐',
hint: '기준 원점에 대한 X 또는 Y 좌표를 기입한다',
tool: Tool.DIMORDINATE,
machine: dimOrdinateToolStateMachine,
},
{
id: 'DIMBASELINE',
label: '기준선 치수',
aliases: ['DBA'],
glyph: '⊞',
hint: '직전 치수의 시작점을 기준으로 이어 기입한다',
tool: Tool.DIMBASELINE,
machine: dimBaselineToolStateMachine,
},
{
id: 'DIMCONTINUE',
label: '연속 치수',
aliases: ['DCO'],
glyph: '⋯',
hint: '직전 치수의 끝점에서 이어 기입한다',
tool: Tool.DIMCONTINUE,
machine: dimContinueToolStateMachine,
},
{
id: 'QDIM',
label: '빠른 치수',
glyph: '⚡',
hint: '선택 객체에 치수를 한 번에 넣는다',
tool: Tool.QDIM,
machine: qDimToolStateMachine,
},
{
id: 'CENTERMARK',
label: '중심 표식',
glyph: '✛',
hint: '원·호 중심에 표식을 넣는다',
tool: Tool.CENTERMARK,
machine: centerMarkToolStateMachine,
},
{
id: 'CENTERLINE',
label: '중심선',
glyph: '┈',
hint: '두 선 사이에 중심선을 넣는다',
tool: Tool.CENTERLINE,
machine: centerLineToolStateMachine,
},
{
id: 'DIMSTYLE',
label: '치수 스타일',
aliases: ['D'],
glyph: '⚙',
hint: '치수 문자 높이·화살표 크기·소수 자릿수를 정한다',
tool: Tool.DIMSTYLE,
machine: dimStyleToolStateMachine,
},
{
id: 'DIMUPDATE',
label: '치수 업데이트',
glyph: '⟳',
hint: '바꾼 치수 스타일을 기존 치수에 반영한다',
run: updateDimensions,
},
{
id: 'DIMSPACE',
label: '치수 간격',
glyph: '⇕',
hint: '평행한 치수선의 간격을 고르게 맞춘다',
tool: Tool.DIMSPACE,
machine: dimSpaceToolStateMachine,
},
];
export const LEADER_COMMANDS: CadCommand[] = [
{
id: 'MLEADER',
label: '다중 지시선',
aliases: ['MLD'],
glyph: '➤',
hint: '화살표와 문자를 잇는 지시선을 작성한다',
tool: Tool.MLEADER,
machine: mleaderToolStateMachine,
},
{
id: 'MLEADERSTYLE',
label: '지시선 스타일',
aliases: ['MLS'],
glyph: '⚙',
hint: '지시선 문자 높이와 화살표 크기를 정한다',
tool: Tool.MLEADERSTYLE,
machine: mleaderStyleToolStateMachine,
},
{
id: 'MLEADERALIGN',
label: '지시선 정렬',
glyph: '≡',
hint: '선택한 지시선 문자의 위치를 맞춘다',
tool: Tool.MLEADERALIGN,
machine: mleaderAlignToolStateMachine,
},
];
export const TABLE_COMMANDS: CadCommand[] = [
{
id: 'TABLE',
label: '테이블',
aliases: ['TB'],
glyph: '▦',
hint: '행·열 격자를 도면에 배치한다',
tool: Tool.TABLE,
machine: tableToolStateMachine,
},
{
id: 'TABLESTYLE',
label: '테이블 스타일',
aliases: ['TS'],
glyph: '⚙',
hint: '새 표의 기본 열 너비와 행 높이를 정한다',
tool: Tool.TABLESTYLE,
machine: tableStyleToolStateMachine,
},
{
id: 'TABLEEDIT',
label: '칸 편집',
glyph: '✎',
hint: '표의 칸에 문자를 넣는다',
tool: Tool.TABLEEDIT,
machine: tableEditToolStateMachine,
},
{
id: 'TABLEROW',
label: '행 넣기·지우기',
glyph: '⬒',
hint: '표의 행을 넣거나 지운다',
tool: Tool.TABLEROW,
machine: tableRowToolStateMachine,
},
{
id: 'TABLECOL',
label: '열 넣기·지우기',
glyph: '◫',
hint: '표의 열을 넣거나 지운다',
tool: Tool.TABLECOL,
machine: tableColumnToolStateMachine,
},
{
id: 'TABLEMERGE',
label: '칸 병합',
glyph: '⧉',
hint: '표의 여러 칸을 하나로 합친다',
tool: Tool.TABLEMERGE,
machine: tableMergeToolStateMachine,
},
{
id: 'TABLEUNMERGE',
label: '병합 해제',
glyph: '⧅',
hint: '합친 칸을 원래대로 되돌린다',
tool: Tool.TABLEUNMERGE,
machine: tableUnmergeToolStateMachine,
},
{
id: 'PLACETABLE',
label: '표 놓기',
glyph: '▦',
hint: '부모 화면이 보낸 표(면적산출 범위)를 누른 자리에 놓는다',
tool: Tool.PLACETABLE,
machine: placeTableToolStateMachine,
},
];
export const MARKUP_COMMANDS: CadCommand[] = [
{
id: 'REVCLOUD',
label: '구름형 리비전',
glyph: '☁',
hint: '검토 범위를 구름형 선으로 표시한다',
tool: Tool.REVCLOUD,
machine: revCloudToolStateMachine,
},
{
id: 'ANNOSCALE',
label: '주석 축척',
glyph: '⚖',
hint: '치수·문자·화살표 크기에 곱할 축척을 정한다',
tool: Tool.ANNOSCALE,
machine: annotationScaleToolStateMachine,
},
];