@mlightcad/cad-simple-viewer 1.8.0-preview.3 → 1.8.0-preview.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +206 -204
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-D_0b6okm.js +890 -0
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-DcZiBNvh.js +1 -0
- package/dist/cad-simple-viewer-AcUiFileOpenSession-AGSCe0Nv.js +324 -0
- package/dist/{cad-simple-viewer-AcUiFileOpenSession-BCcqBAH9.js → cad-simple-viewer-AcUiFileOpenSession-Bo3U3wCu.js} +707 -167
- package/dist/cad-simple-viewer-file-open-panel.js +26 -24
- package/dist/cad-simple-viewer-file-open-panel.umd.cjs +1 -1
- package/dist/cad-simple-viewer.js +64409 -41558
- package/dist/cad-simple-viewer.umd.cjs +1659 -497
- package/dist/mtext-renderer-worker.js +4 -5
- package/file-open-panel.ts +6 -6
- package/icons.ts +7 -7
- package/lib/app/AcApClipboard.d.ts +97 -0
- package/lib/app/AcApClipboard.d.ts.map +1 -0
- package/lib/app/AcApClipboard.js +270 -0
- package/lib/app/AcApClipboard.js.map +1 -0
- package/lib/app/AcApContext.d.ts +10 -0
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +24 -8
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +63 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +264 -35
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +11 -11
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApOpenFileDialog.d.ts +2 -2
- package/lib/app/AcApOpenFileDialog.js +2 -2
- package/lib/app/AcApPaletteService.d.ts +154 -0
- package/lib/app/AcApPaletteService.d.ts.map +1 -0
- package/lib/app/AcApPaletteService.js +327 -0
- package/lib/app/AcApPaletteService.js.map +1 -0
- package/lib/app/acapHealModelLayoutLink.d.ts +30 -0
- package/lib/app/acapHealModelLayoutLink.d.ts.map +1 -0
- package/lib/app/acapHealModelLayoutLink.js +192 -0
- package/lib/app/acapHealModelLayoutLink.js.map +1 -0
- package/lib/app/dataSource/AcApLocalDataSource.d.ts +1 -1
- package/lib/app/dataSource/AcApLocalDataSource.js +2 -2
- package/lib/app/dataSource/AcApLocalDataSource.js.map +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js.map +1 -1
- package/lib/app/index.d.ts +2 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +2 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApShortCutToolbarDocBind.d.ts.map +1 -1
- package/lib/command/AcApShortCutToolbarDocBind.js +30 -3
- package/lib/command/AcApShortCutToolbarDocBind.js.map +1 -1
- package/lib/command/AcApUcsCmd.d.ts +26 -0
- package/lib/command/AcApUcsCmd.d.ts.map +1 -0
- package/lib/command/AcApUcsCmd.js +545 -0
- package/lib/command/AcApUcsCmd.js.map +1 -0
- package/lib/command/AcApViewRestoreCmd.d.ts +13 -0
- package/lib/command/AcApViewRestoreCmd.d.ts.map +1 -0
- package/lib/command/AcApViewRestoreCmd.js +101 -0
- package/lib/command/AcApViewRestoreCmd.js.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts +57 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.js +618 -0
- package/lib/command/block/AcApDashBSearchCmd.js.map +1 -0
- package/lib/command/block/index.d.ts +2 -0
- package/lib/command/block/index.d.ts.map +1 -0
- package/lib/command/block/index.js +2 -0
- package/lib/command/block/index.js.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts +61 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.js +203 -0
- package/lib/command/clipboard/AcApClipboardUtils.js.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts +13 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js +95 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js +85 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts +11 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.js +91 -0
- package/lib/command/clipboard/AcApCutClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts +23 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js +127 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts +14 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js +100 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js +99 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts +37 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js +87 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js.map +1 -0
- package/lib/command/clipboard/index.d.ts +9 -0
- package/lib/command/clipboard/index.d.ts.map +1 -0
- package/lib/command/clipboard/index.js +9 -0
- package/lib/command/clipboard/index.js.map +1 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts +8 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApBlockPreviewConvertor.js +16 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.js.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts +32 -0
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.js +70 -14
- package/lib/command/convert/AcApEntityPreviewConvertor.js.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.d.ts +7 -0
- package/lib/command/draw/AcApDimBlockUtil.d.ts.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.js +16 -54
- package/lib/command/draw/AcApDimBlockUtil.js.map +1 -1
- package/lib/command/draw/AcApLeaderCmd.d.ts +49 -0
- package/lib/command/draw/AcApLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApLeaderCmd.js +611 -0
- package/lib/command/draw/AcApLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts +41 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.js +632 -0
- package/lib/command/draw/AcApMLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts +137 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js +411 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts +13 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js +245 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts +7 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.js +141 -0
- package/lib/command/draw/acedRenderDimStylePreview.js.map +1 -0
- package/lib/command/draw/dimStylePreview.d.ts +62 -0
- package/lib/command/draw/dimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/dimStylePreview.js +723 -0
- package/lib/command/draw/dimStylePreview.js.map +1 -0
- package/lib/command/draw/index.d.ts +6 -0
- package/lib/command/draw/index.d.ts.map +1 -1
- package/lib/command/draw/index.js +6 -0
- package/lib/command/draw/index.js.map +1 -1
- package/lib/command/group/AcApDashGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApDashGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApDashGroupCmd.js +457 -0
- package/lib/command/group/AcApDashGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupCmd.js +253 -0
- package/lib/command/group/AcApGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts +14 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.js +241 -0
- package/lib/command/group/AcApGroupEditCmd.js.map +1 -0
- package/lib/command/group/AcApUngroupCmd.d.ts +20 -0
- package/lib/command/group/AcApUngroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApUngroupCmd.js +249 -0
- package/lib/command/group/AcApUngroupCmd.js.map +1 -0
- package/lib/command/group/index.d.ts +5 -0
- package/lib/command/group/index.d.ts.map +1 -0
- package/lib/command/group/index.js +5 -0
- package/lib/command/group/index.js.map +1 -0
- package/lib/command/index.d.ts +5 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +5 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts +9 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.js +21 -7
- package/lib/command/markup/AcApMarkupSessionBootstrap.js.map +1 -1
- package/lib/command/markup/index.d.ts +1 -1
- package/lib/command/markup/index.d.ts.map +1 -1
- package/lib/command/markup/index.js +4 -2
- package/lib/command/markup/index.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts +7 -0
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +183 -73
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts +23 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.js +57 -1
- package/lib/command/measure/AcApMeasureArcLock.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +3 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js +44 -4
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -1
- package/lib/command/modify/AcApScaleCmd.d.ts +115 -0
- package/lib/command/modify/AcApScaleCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApScaleCmd.js +347 -0
- package/lib/command/modify/AcApScaleCmd.js.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts +56 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.js +115 -0
- package/lib/command/modify/AcApScalePreviewJig.js.map +1 -0
- package/lib/command/modify/index.d.ts +1 -0
- package/lib/command/modify/index.d.ts.map +1 -1
- package/lib/command/modify/index.js +1 -0
- package/lib/command/modify/index.js.map +1 -1
- package/lib/command/ui/AcApFindUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApFindUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApFindUiCmd.js +83 -0
- package/lib/command/ui/AcApFindUiCmd.js.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts +65 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.js +142 -0
- package/lib/command/ui/AcApLayerUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js.map +1 -0
- package/lib/command/ui/index.d.ts +5 -0
- package/lib/command/ui/index.d.ts.map +1 -0
- package/lib/command/ui/index.js +5 -0
- package/lib/command/ui/index.js.map +1 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts +13 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +44 -9
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +21 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +204 -22
- package/lib/editor/grip/AcEdGripManager.js.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts +7 -0
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js +18 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -1
- package/lib/editor/grip/AcEdGripViewport.d.ts +35 -0
- package/lib/editor/grip/AcEdGripViewport.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripViewport.js +68 -0
- package/lib/editor/grip/AcEdGripViewport.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts +24 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js +76 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts +46 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js +187 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js.map +1 -0
- package/lib/editor/grip/index.d.ts +3 -0
- package/lib/editor/grip/index.d.ts.map +1 -1
- package/lib/editor/grip/index.js +3 -0
- package/lib/editor/grip/index.js.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.d.ts +2 -2
- package/lib/editor/input/AcEdOrthoMode.d.ts.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.js +20 -7
- package/lib/editor/input/AcEdOrthoMode.js.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts +16 -0
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.js +24 -3
- package/lib/editor/input/AcEdOsnapCenterMarks.js.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts +0 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.js +3 -16
- package/lib/editor/input/AcEdOsnapResolver.js.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.d.ts.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.js +16 -10
- package/lib/editor/input/AcEdPolarTracking.js.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.js +36 -16
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts +12 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js +20 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +5 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +33 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +30 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +47 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +80 -0
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +40 -4
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.js +199 -3
- package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts +10 -0
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.js +15 -8
- package/lib/editor/view/AcEdViewportBoxSelection.js.map +1 -1
- package/lib/file-open-panel.d.ts.map +1 -1
- package/lib/file-open-panel.js +4 -0
- package/lib/file-open-panel.js.map +1 -1
- package/lib/find/AcApFindNavigator.d.ts +47 -0
- package/lib/find/AcApFindNavigator.d.ts.map +1 -1
- package/lib/find/AcApFindNavigator.js +13 -5
- package/lib/find/AcApFindNavigator.js.map +1 -1
- package/lib/find/findDrawing.d.ts +1 -1
- package/lib/find/findDrawing.d.ts.map +1 -1
- package/lib/find/findDrawing.js +4 -3
- package/lib/find/findDrawing.js.map +1 -1
- package/lib/find/findText.d.ts +40 -13
- package/lib/find/findText.d.ts.map +1 -1
- package/lib/find/findText.js +100 -44
- package/lib/find/findText.js.map +1 -1
- package/lib/find/index.d.ts +8 -0
- package/lib/find/index.d.ts.map +1 -1
- package/lib/find/index.js +8 -0
- package/lib/find/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +1 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +2 -0
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/AcUiI18n.d.ts +23 -0
- package/lib/i18n/AcUiI18n.d.ts.map +1 -0
- package/lib/i18n/AcUiI18n.js +126 -0
- package/lib/i18n/AcUiI18n.js.map +1 -0
- package/lib/i18n/ar/command.d.ts +103 -6
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +601 -11
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +1423 -579
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +2096 -322
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/ar/main.d.ts +22 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +22 -0
- package/lib/i18n/ar/main.js.map +1 -1
- package/lib/i18n/ar/simpleUi.d.ts +170 -0
- package/lib/i18n/ar/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ar/simpleUi.js +169 -0
- package/lib/i18n/ar/simpleUi.js.map +1 -0
- package/lib/i18n/cs/command.d.ts +111 -1
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +112 -2
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +867 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +988 -24
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +22 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +23 -1
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/cs/simpleUi.d.ts +170 -0
- package/lib/i18n/cs/simpleUi.d.ts.map +1 -0
- package/lib/i18n/cs/simpleUi.js +169 -0
- package/lib/i18n/cs/simpleUi.js.map +1 -0
- package/lib/i18n/en/command.d.ts +98 -1
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +99 -2
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +844 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +801 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +22 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +22 -0
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/en/simpleUi.d.ts +170 -0
- package/lib/i18n/en/simpleUi.d.ts.map +1 -0
- package/lib/i18n/en/simpleUi.js +169 -0
- package/lib/i18n/en/simpleUi.js.map +1 -0
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +37 -6
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/ja/command.d.ts +605 -0
- package/lib/i18n/ja/command.d.ts.map +1 -0
- package/lib/i18n/ja/command.js +604 -0
- package/lib/i18n/ja/command.js.map +1 -0
- package/lib/i18n/ja/jig.d.ts +2425 -0
- package/lib/i18n/ja/jig.d.ts.map +1 -0
- package/lib/i18n/ja/jig.js +2316 -0
- package/lib/i18n/ja/jig.js.map +1 -0
- package/lib/i18n/ja/main.d.ts +216 -0
- package/lib/i18n/ja/main.d.ts.map +1 -0
- package/lib/i18n/ja/main.js +215 -0
- package/lib/i18n/ja/main.js.map +1 -0
- package/lib/i18n/ja/simpleUi.d.ts +170 -0
- package/lib/i18n/ja/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ja/simpleUi.js +169 -0
- package/lib/i18n/ja/simpleUi.js.map +1 -0
- package/lib/i18n/ko/command.d.ts +605 -0
- package/lib/i18n/ko/command.d.ts.map +1 -0
- package/lib/i18n/ko/command.js +604 -0
- package/lib/i18n/ko/command.js.map +1 -0
- package/lib/i18n/ko/jig.d.ts +2425 -0
- package/lib/i18n/ko/jig.d.ts.map +1 -0
- package/lib/i18n/ko/jig.js +2316 -0
- package/lib/i18n/ko/jig.js.map +1 -0
- package/lib/i18n/ko/main.d.ts +216 -0
- package/lib/i18n/ko/main.d.ts.map +1 -0
- package/lib/i18n/ko/main.js +215 -0
- package/lib/i18n/ko/main.js.map +1 -0
- package/lib/i18n/ko/simpleUi.d.ts +170 -0
- package/lib/i18n/ko/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ko/simpleUi.js +169 -0
- package/lib/i18n/ko/simpleUi.js.map +1 -0
- package/lib/i18n/tr/command.d.ts +111 -1
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +112 -2
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +867 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +1096 -24
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +22 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +23 -1
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/tr/simpleUi.d.ts +170 -0
- package/lib/i18n/tr/simpleUi.d.ts.map +1 -0
- package/lib/i18n/tr/simpleUi.js +169 -0
- package/lib/i18n/tr/simpleUi.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +98 -1
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +99 -2
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +844 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +793 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +22 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +22 -0
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/i18n/zh/simpleUi.d.ts +170 -0
- package/lib/i18n/zh/simpleUi.d.ts.map +1 -0
- package/lib/i18n/zh/simpleUi.js +169 -0
- package/lib/i18n/zh/simpleUi.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/service/AcApEntityService.d.ts +36 -2
- package/lib/service/AcApEntityService.d.ts.map +1 -1
- package/lib/service/AcApEntityService.js +92 -23
- package/lib/service/AcApEntityService.js.map +1 -1
- package/lib/service/AcApGroup.d.ts +95 -0
- package/lib/service/AcApGroup.d.ts.map +1 -0
- package/lib/service/AcApGroup.js +421 -0
- package/lib/service/AcApGroup.js.map +1 -0
- package/lib/service/AcApLlmSettingsService.d.ts +74 -0
- package/lib/service/AcApLlmSettingsService.d.ts.map +1 -0
- package/lib/service/AcApLlmSettingsService.js +126 -0
- package/lib/service/AcApLlmSettingsService.js.map +1 -0
- package/lib/service/AcApNamedViewService.d.ts +139 -0
- package/lib/service/AcApNamedViewService.d.ts.map +1 -0
- package/lib/service/AcApNamedViewService.js +407 -0
- package/lib/service/AcApNamedViewService.js.map +1 -0
- package/lib/service/AcApTextRecognitionService.d.ts +107 -0
- package/lib/service/AcApTextRecognitionService.d.ts.map +1 -0
- package/lib/service/AcApTextRecognitionService.js +304 -0
- package/lib/service/AcApTextRecognitionService.js.map +1 -0
- package/lib/service/AcApUcsService.d.ts +101 -0
- package/lib/service/AcApUcsService.d.ts.map +1 -0
- package/lib/service/AcApUcsService.js +753 -0
- package/lib/service/AcApUcsService.js.map +1 -0
- package/lib/service/index.d.ts +5 -0
- package/lib/service/index.d.ts.map +1 -1
- package/lib/service/index.js +5 -0
- package/lib/service/index.js.map +1 -1
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts +98 -0
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js +300 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts +149 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js +1464 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts +161 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js +712 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts +85 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.js +233 -0
- package/lib/smartBlock/AcApSmartBlockSession.js.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts +33 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.js +571 -0
- package/lib/smartBlock/AcEdShapeFeatures.js.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts +146 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.js +749 -0
- package/lib/smartBlock/AcEdShapeMatcher.js.map +1 -0
- package/lib/smartBlock/index.d.ts +7 -0
- package/lib/smartBlock/index.d.ts.map +1 -0
- package/lib/smartBlock/index.js +7 -0
- package/lib/smartBlock/index.js.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts +374 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.js +1308 -0
- package/lib/ui/AcApSimpleUiChrome.js.map +1 -0
- package/lib/ui/AcUiColorPicker.d.ts +47 -0
- package/lib/ui/AcUiColorPicker.d.ts.map +1 -0
- package/lib/ui/AcUiColorPicker.js +133 -0
- package/lib/ui/AcUiColorPicker.js.map +1 -0
- package/lib/ui/AcUiFileOpenPanel.js +1 -1
- package/lib/ui/AcUiFileOpenPanel.js.map +1 -1
- package/lib/ui/AcUiFindPaletteView.d.ts +99 -0
- package/lib/ui/AcUiFindPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiFindPaletteView.js +426 -0
- package/lib/ui/AcUiFindPaletteView.js.map +1 -0
- package/lib/ui/AcUiLayerListView.d.ts +114 -0
- package/lib/ui/AcUiLayerListView.d.ts.map +1 -0
- package/lib/ui/AcUiLayerListView.js +443 -0
- package/lib/ui/AcUiLayerListView.js.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts +83 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.js +341 -0
- package/lib/ui/AcUiMeasurementPaletteView.js.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts +141 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.js +524 -0
- package/lib/ui/AcUiReviewPaletteView.js.map +1 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts +24 -2
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.js +48 -6
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -1
- package/lib/ui/AcUiSimpleUiOptions.d.ts +88 -0
- package/lib/ui/AcUiSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiOptions.js +2 -0
- package/lib/ui/AcUiSimpleUiOptions.js.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts +12 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.js +28 -0
- package/lib/ui/AcUiSimpleUiStyles.js.map +1 -0
- package/lib/ui/AcUiThemeSync.d.ts +58 -0
- package/lib/ui/AcUiThemeSync.d.ts.map +1 -0
- package/lib/ui/AcUiThemeSync.js +114 -0
- package/lib/ui/AcUiThemeSync.js.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts +20 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js +46 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts +204 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.js +926 -0
- package/lib/ui/dock/AcUiDockPanel.js.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts +9 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.js +27 -0
- package/lib/ui/dock/acuiDockPanelStyles.js.map +1 -0
- package/lib/ui/dock/index.d.ts +3 -0
- package/lib/ui/dock/index.d.ts.map +1 -0
- package/lib/ui/dock/index.js +3 -0
- package/lib/ui/dock/index.js.map +1 -0
- package/lib/ui/icons.d.ts +22 -14
- package/lib/ui/icons.d.ts.map +1 -1
- package/lib/ui/icons.js +42 -32
- package/lib/ui/icons.js.map +1 -1
- package/lib/ui/index.d.ts +12 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +11 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/toolbar/AcUiToolbar.d.ts +1 -1
- package/lib/ui/toolbar/AcUiToolbar.js +1 -1
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts +41 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts.map +1 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js +103 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts +40 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js +65 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts +44 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.js +614 -0
- package/lib/ui/toolbar/defaultToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/index.d.ts +3 -1
- package/lib/ui/toolbar/index.d.ts.map +1 -1
- package/lib/ui/toolbar/index.js +1 -0
- package/lib/ui/toolbar/index.js.map +1 -1
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts +25 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts.map +1 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js +164 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts +22 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js +47 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts +46 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.js +161 -0
- package/lib/ui/toolbar/resolveToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts +17 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js +39 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts +15 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.js +14 -0
- package/lib/ui/toolbar/simpleUiPresets.js.map +1 -0
- package/lib/ui/toolbar/types.d.ts +18 -0
- package/lib/ui/toolbar/types.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.d.ts +19 -0
- package/lib/util/AcApFontUtil.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.js +108 -13
- package/lib/util/AcApFontUtil.js.map +1 -1
- package/lib/util/AcApGeTransform.d.ts +8 -0
- package/lib/util/AcApGeTransform.d.ts.map +1 -1
- package/lib/util/AcApGeTransform.js +13 -0
- package/lib/util/AcApGeTransform.js.map +1 -1
- package/lib/util/AcApTextMeasure.d.ts +43 -0
- package/lib/util/AcApTextMeasure.d.ts.map +1 -0
- package/lib/util/AcApTextMeasure.js +82 -0
- package/lib/util/AcApTextMeasure.js.map +1 -0
- package/lib/util/acapResolveOpenFileType.d.ts +12 -0
- package/lib/util/acapResolveOpenFileType.d.ts.map +1 -0
- package/lib/util/acapResolveOpenFileType.js +22 -0
- package/lib/util/acapResolveOpenFileType.js.map +1 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcApUcsIconOverlay.d.ts +26 -0
- package/lib/view/AcApUcsIconOverlay.d.ts.map +1 -0
- package/lib/view/AcApUcsIconOverlay.js +143 -0
- package/lib/view/AcApUcsIconOverlay.js.map +1 -0
- package/lib/view/AcEdViewKeyHandler.d.ts +11 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +39 -3
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/lib/view/AcTrEntityDisplayController.d.ts +5 -0
- package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -1
- package/lib/view/AcTrEntityDisplayController.js +5 -0
- package/lib/view/AcTrEntityDisplayController.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +27 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +40 -0
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +55 -1
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +252 -51
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +0 -12
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +0 -20
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +6 -0
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
- package/lib/view/AcTrLayoutViewManager.js +8 -0
- package/lib/view/AcTrLayoutViewManager.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +12 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +65 -16
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +92 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +367 -92
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/AcTrViewSessionState.d.ts +5 -0
- package/lib/view/AcTrViewSessionState.d.ts.map +1 -1
- package/package.json +12 -16
- package/src/file-open-panel.ts +93 -89
- package/src/ui/icons.ts +428 -411
- package/dist/cad-simple-viewer-AcUiFileOpenSession-drptdOYc.js +0 -324
- package/find.ts +0 -7
- package/src/find/AcApFindNavigator.ts +0 -190
- package/src/find/findDrawing.ts +0 -211
- package/src/find/findText.ts +0 -624
- package/src/find/index.ts +0 -2
|
@@ -0,0 +1,749 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds repeated copies of a group of shapes ("block instances") under a
|
|
3
|
+
* similarity transform: translation, rotation, optional uniform scale and
|
|
4
|
+
* optional mirroring.
|
|
5
|
+
*
|
|
6
|
+
* Pure geometry: shapes are described by {@link AcEdShapeFeature}s so the
|
|
7
|
+
* algorithm is testable without the data model.
|
|
8
|
+
*/
|
|
9
|
+
var __values = (this && this.__values) || function(o) {
|
|
10
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
11
|
+
if (m) return m.call(o);
|
|
12
|
+
if (o && typeof o.length === "number") return {
|
|
13
|
+
next: function () {
|
|
14
|
+
if (o && i >= o.length) o = void 0;
|
|
15
|
+
return { value: o && o[i++], done: !o };
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
19
|
+
};
|
|
20
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
21
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
22
|
+
if (!m) return o;
|
|
23
|
+
var i = m.call(o), r, ar = [], e;
|
|
24
|
+
try {
|
|
25
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
26
|
+
}
|
|
27
|
+
catch (error) { e = { error: error }; }
|
|
28
|
+
finally {
|
|
29
|
+
try {
|
|
30
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
31
|
+
}
|
|
32
|
+
finally { if (e) throw e.error; }
|
|
33
|
+
}
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
37
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38
|
+
if (ar || !(i in from)) {
|
|
39
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
40
|
+
ar[i] = from[i];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
44
|
+
};
|
|
45
|
+
// Math.hypot is several times slower than sqrt in V8, and matching calls
|
|
46
|
+
// this in its innermost loops.
|
|
47
|
+
function dist(a, b) {
|
|
48
|
+
var dx = a.x - b.x;
|
|
49
|
+
var dy = a.y - b.y;
|
|
50
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Opaque store of spatial indexes for {@link AcEdShapeMatchOptions.gridCache}.
|
|
54
|
+
* Create one per unchanged candidate set, e.g. per detection run.
|
|
55
|
+
*/
|
|
56
|
+
var AcEdShapeGridCache = /** @class */ (function () {
|
|
57
|
+
function AcEdShapeGridCache() {
|
|
58
|
+
}
|
|
59
|
+
return AcEdShapeGridCache;
|
|
60
|
+
}());
|
|
61
|
+
export { AcEdShapeGridCache };
|
|
62
|
+
var gridStores = new WeakMap();
|
|
63
|
+
function gridStoreOf(cache) {
|
|
64
|
+
var store = gridStores.get(cache);
|
|
65
|
+
if (!store)
|
|
66
|
+
gridStores.set(cache, (store = new Map()));
|
|
67
|
+
return store;
|
|
68
|
+
}
|
|
69
|
+
function groupByKind(features) {
|
|
70
|
+
var e_1, _a;
|
|
71
|
+
var map = new Map();
|
|
72
|
+
try {
|
|
73
|
+
for (var features_1 = __values(features), features_1_1 = features_1.next(); !features_1_1.done; features_1_1 = features_1.next()) {
|
|
74
|
+
var f = features_1_1.value;
|
|
75
|
+
var list = map.get(f.kind);
|
|
76
|
+
if (list)
|
|
77
|
+
list.push(f);
|
|
78
|
+
else
|
|
79
|
+
map.set(f.kind, [f]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
if (features_1_1 && !features_1_1.done && (_a = features_1.return)) _a.call(features_1);
|
|
86
|
+
}
|
|
87
|
+
finally { if (e_1) throw e_1.error; }
|
|
88
|
+
}
|
|
89
|
+
return map;
|
|
90
|
+
}
|
|
91
|
+
/** Applies an affine map to a point. */
|
|
92
|
+
export function acedApplyAffine2d(t, p) {
|
|
93
|
+
return { x: t.a * p.x + t.c * p.y + t.e, y: t.b * p.x + t.d * p.y + t.f };
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Similarity mapping `p0 → q0` and `p1 → q1`. With `mirror`, the template is
|
|
97
|
+
* reflected across its local x axis first (`y → -y`).
|
|
98
|
+
*/
|
|
99
|
+
function similarityFrom(p0, p1, q0, q1, mirror) {
|
|
100
|
+
var sign = mirror ? -1 : 1;
|
|
101
|
+
var vx = p1.x - p0.x;
|
|
102
|
+
var vy = (p1.y - p0.y) * sign;
|
|
103
|
+
var wx = q1.x - q0.x;
|
|
104
|
+
var wy = q1.y - q0.y;
|
|
105
|
+
var len = Math.hypot(vx, vy);
|
|
106
|
+
if (len === 0)
|
|
107
|
+
return undefined;
|
|
108
|
+
var scale = Math.hypot(wx, wy) / len;
|
|
109
|
+
var rotation = Math.atan2(wy, wx) - Math.atan2(vy, vx);
|
|
110
|
+
var cos = Math.cos(rotation) * scale;
|
|
111
|
+
var sin = Math.sin(rotation) * scale;
|
|
112
|
+
// M = R(θ)·s·diag(1, sign)
|
|
113
|
+
var a = cos;
|
|
114
|
+
var b = sin;
|
|
115
|
+
var c = -sin * sign;
|
|
116
|
+
var d = cos * sign;
|
|
117
|
+
var t = {
|
|
118
|
+
a: a,
|
|
119
|
+
b: b,
|
|
120
|
+
c: c,
|
|
121
|
+
d: d,
|
|
122
|
+
e: q0.x - (a * p0.x + c * p0.y),
|
|
123
|
+
f: q0.y - (b * p0.x + d * p0.y)
|
|
124
|
+
};
|
|
125
|
+
return { t: t, rotation: rotation, scale: scale };
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Uniform grid over feature centers, one per shape kind so a lookup only
|
|
129
|
+
* touches shapes that can match. Cells are nested numeric maps: no string
|
|
130
|
+
* keys and no overflow for far-away coordinates.
|
|
131
|
+
*/
|
|
132
|
+
var KindGrid = /** @class */ (function () {
|
|
133
|
+
function KindGrid(features, cell) {
|
|
134
|
+
var e_2, _a;
|
|
135
|
+
this.cell = cell;
|
|
136
|
+
this.cells = new Map();
|
|
137
|
+
this.size = features.length;
|
|
138
|
+
this.sizes = Float64Array.from(features, function (f) { return f.size; }).sort();
|
|
139
|
+
try {
|
|
140
|
+
for (var features_2 = __values(features), features_2_1 = features_2.next(); !features_2_1.done; features_2_1 = features_2.next()) {
|
|
141
|
+
var feature = features_2_1.value;
|
|
142
|
+
var gx = Math.floor(feature.center.x / cell);
|
|
143
|
+
var gy = Math.floor(feature.center.y / cell);
|
|
144
|
+
var column = this.cells.get(gx);
|
|
145
|
+
if (!column)
|
|
146
|
+
this.cells.set(gx, (column = new Map()));
|
|
147
|
+
var bucket = column.get(gy);
|
|
148
|
+
if (bucket)
|
|
149
|
+
bucket.push(feature);
|
|
150
|
+
else
|
|
151
|
+
column.set(gy, [feature]);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
155
|
+
finally {
|
|
156
|
+
try {
|
|
157
|
+
if (features_2_1 && !features_2_1.done && (_a = features_2.return)) _a.call(features_2);
|
|
158
|
+
}
|
|
159
|
+
finally { if (e_2) throw e_2.error; }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Number of features whose size is within `tol` of `size`. */
|
|
163
|
+
KindGrid.prototype.countSizes = function (size, tol) {
|
|
164
|
+
return (lowerBound(this.sizes, size + tol, true) -
|
|
165
|
+
lowerBound(this.sizes, size - tol, false));
|
|
166
|
+
};
|
|
167
|
+
/** Calls `visit` for features whose center is within `radius` of `p`. */
|
|
168
|
+
KindGrid.prototype.forEachNear = function (p, radius, visit) {
|
|
169
|
+
var e_3, _a;
|
|
170
|
+
var x0 = Math.floor((p.x - radius) / this.cell);
|
|
171
|
+
var x1 = Math.floor((p.x + radius) / this.cell);
|
|
172
|
+
var y0 = Math.floor((p.y - radius) / this.cell);
|
|
173
|
+
var y1 = Math.floor((p.y + radius) / this.cell);
|
|
174
|
+
var r2 = radius * radius;
|
|
175
|
+
for (var gx = x0; gx <= x1; gx++) {
|
|
176
|
+
var column = this.cells.get(gx);
|
|
177
|
+
if (!column)
|
|
178
|
+
continue;
|
|
179
|
+
for (var gy = y0; gy <= y1; gy++) {
|
|
180
|
+
var bucket = column.get(gy);
|
|
181
|
+
if (!bucket)
|
|
182
|
+
continue;
|
|
183
|
+
try {
|
|
184
|
+
for (var bucket_1 = (e_3 = void 0, __values(bucket)), bucket_1_1 = bucket_1.next(); !bucket_1_1.done; bucket_1_1 = bucket_1.next()) {
|
|
185
|
+
var f = bucket_1_1.value;
|
|
186
|
+
var dx = f.center.x - p.x;
|
|
187
|
+
var dy = f.center.y - p.y;
|
|
188
|
+
// `visit` returns true to stop the search.
|
|
189
|
+
if (dx * dx + dy * dy <= r2 && visit(f))
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
194
|
+
finally {
|
|
195
|
+
try {
|
|
196
|
+
if (bucket_1_1 && !bucket_1_1.done && (_a = bucket_1.return)) _a.call(bucket_1);
|
|
197
|
+
}
|
|
198
|
+
finally { if (e_3) throw e_3.error; }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return false;
|
|
203
|
+
};
|
|
204
|
+
return KindGrid;
|
|
205
|
+
}());
|
|
206
|
+
/**
|
|
207
|
+
* First index whose value is `>= value` (or `> value` with `after`) in an
|
|
208
|
+
* ascending array.
|
|
209
|
+
*/
|
|
210
|
+
function lowerBound(values, value, after) {
|
|
211
|
+
var lo = 0;
|
|
212
|
+
var hi = values.length;
|
|
213
|
+
while (lo < hi) {
|
|
214
|
+
var mid = (lo + hi) >> 1;
|
|
215
|
+
if (values[mid] < value || (after && values[mid] === value))
|
|
216
|
+
lo = mid + 1;
|
|
217
|
+
else
|
|
218
|
+
hi = mid;
|
|
219
|
+
}
|
|
220
|
+
return lo;
|
|
221
|
+
}
|
|
222
|
+
function extentOf(features) {
|
|
223
|
+
var e_4, _a, e_5, _b;
|
|
224
|
+
var minX = Infinity;
|
|
225
|
+
var minY = Infinity;
|
|
226
|
+
var maxX = -Infinity;
|
|
227
|
+
var maxY = -Infinity;
|
|
228
|
+
try {
|
|
229
|
+
for (var features_3 = __values(features), features_3_1 = features_3.next(); !features_3_1.done; features_3_1 = features_3.next()) {
|
|
230
|
+
var f = features_3_1.value;
|
|
231
|
+
try {
|
|
232
|
+
for (var _c = (e_5 = void 0, __values(__spreadArray([f.center], __read(f.points), false))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
233
|
+
var p = _d.value;
|
|
234
|
+
minX = Math.min(minX, p.x);
|
|
235
|
+
minY = Math.min(minY, p.y);
|
|
236
|
+
maxX = Math.max(maxX, p.x);
|
|
237
|
+
maxY = Math.max(maxY, p.y);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
241
|
+
finally {
|
|
242
|
+
try {
|
|
243
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
244
|
+
}
|
|
245
|
+
finally { if (e_5) throw e_5.error; }
|
|
246
|
+
}
|
|
247
|
+
minX = Math.min(minX, f.center.x - f.size);
|
|
248
|
+
maxX = Math.max(maxX, f.center.x + f.size);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
252
|
+
finally {
|
|
253
|
+
try {
|
|
254
|
+
if (features_3_1 && !features_3_1.done && (_a = features_3.return)) _a.call(features_3);
|
|
255
|
+
}
|
|
256
|
+
finally { if (e_4) throw e_4.error; }
|
|
257
|
+
}
|
|
258
|
+
return Math.max(maxX - minX, maxY - minY, 0);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* True when `from`, mapped by `t`, lands on `to` within `tol`: their
|
|
262
|
+
* outlines lie on each other when both have one ({@link AcEdShapeFeature.path}),
|
|
263
|
+
* otherwise their characteristic points coincide as sets. Center, size,
|
|
264
|
+
* kind and label are not checked here.
|
|
265
|
+
*
|
|
266
|
+
* @param from - Shape to map.
|
|
267
|
+
* @param to - Shape it should land on.
|
|
268
|
+
* @param t - Map from `from`'s coordinates to `to`'s.
|
|
269
|
+
* @param tol - Absolute tolerance in `to`'s coordinates.
|
|
270
|
+
*/
|
|
271
|
+
export function acedShapeLandsOn(from, to, t, tol) {
|
|
272
|
+
if (from.path && to.path) {
|
|
273
|
+
var mapped = from.path.map(function (p) { return acedApplyAffine2d(t, p); });
|
|
274
|
+
return pathWithin(mapped, to.path, tol) && pathWithin(to.path, mapped, tol);
|
|
275
|
+
}
|
|
276
|
+
if (from.points.length !== to.points.length)
|
|
277
|
+
return false;
|
|
278
|
+
return pointSetsMatch(from.points.map(function (p) { return acedApplyAffine2d(t, p); }), to.points, tol);
|
|
279
|
+
}
|
|
280
|
+
/** True when every vertex of `path` lies within `tol` of `outline`. */
|
|
281
|
+
function pathWithin(path, outline, tol) {
|
|
282
|
+
var e_6, _a;
|
|
283
|
+
var _b;
|
|
284
|
+
var tol2 = tol * tol;
|
|
285
|
+
try {
|
|
286
|
+
for (var path_1 = __values(path), path_1_1 = path_1.next(); !path_1_1.done; path_1_1 = path_1.next()) {
|
|
287
|
+
var p = path_1_1.value;
|
|
288
|
+
var near = false;
|
|
289
|
+
for (var i = 0; i < outline.length && !near; i++) {
|
|
290
|
+
var a = outline[i];
|
|
291
|
+
var b = (_b = outline[i + 1]) !== null && _b !== void 0 ? _b : a;
|
|
292
|
+
near = segmentDistance2(p, a, b) <= tol2;
|
|
293
|
+
}
|
|
294
|
+
if (!near)
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
299
|
+
finally {
|
|
300
|
+
try {
|
|
301
|
+
if (path_1_1 && !path_1_1.done && (_a = path_1.return)) _a.call(path_1);
|
|
302
|
+
}
|
|
303
|
+
finally { if (e_6) throw e_6.error; }
|
|
304
|
+
}
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
/** Squared distance from `p` to the segment `ab`. */
|
|
308
|
+
function segmentDistance2(p, a, b) {
|
|
309
|
+
var vx = b.x - a.x;
|
|
310
|
+
var vy = b.y - a.y;
|
|
311
|
+
var len2 = vx * vx + vy * vy;
|
|
312
|
+
var t = len2 > 0 ? ((p.x - a.x) * vx + (p.y - a.y) * vy) / len2 : 0;
|
|
313
|
+
t = Math.max(0, Math.min(1, t));
|
|
314
|
+
var dx = a.x + vx * t - p.x;
|
|
315
|
+
var dy = a.y + vy * t - p.y;
|
|
316
|
+
return dx * dx + dy * dy;
|
|
317
|
+
}
|
|
318
|
+
/** True when `points` (already transformed) coincide with `target` as sets. */
|
|
319
|
+
function pointSetsMatch(points, target, tol) {
|
|
320
|
+
var e_7, _a;
|
|
321
|
+
if (points.length !== target.length)
|
|
322
|
+
return false;
|
|
323
|
+
var used = new Array(target.length).fill(false);
|
|
324
|
+
var tol2 = tol * tol;
|
|
325
|
+
try {
|
|
326
|
+
for (var points_1 = __values(points), points_1_1 = points_1.next(); !points_1_1.done; points_1_1 = points_1.next()) {
|
|
327
|
+
var p = points_1_1.value;
|
|
328
|
+
var best = -1;
|
|
329
|
+
var bestDist = tol2;
|
|
330
|
+
for (var i = 0; i < target.length; i++) {
|
|
331
|
+
if (used[i])
|
|
332
|
+
continue;
|
|
333
|
+
var dx = p.x - target[i].x;
|
|
334
|
+
var dy = p.y - target[i].y;
|
|
335
|
+
var d = dx * dx + dy * dy;
|
|
336
|
+
if (d <= bestDist) {
|
|
337
|
+
bestDist = d;
|
|
338
|
+
best = i;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (best < 0)
|
|
342
|
+
return false;
|
|
343
|
+
used[best] = true;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
347
|
+
finally {
|
|
348
|
+
try {
|
|
349
|
+
if (points_1_1 && !points_1_1.done && (_a = points_1.return)) _a.call(points_1);
|
|
350
|
+
}
|
|
351
|
+
finally { if (e_7) throw e_7.error; }
|
|
352
|
+
}
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Finds copies of `template` among `candidates`.
|
|
357
|
+
*
|
|
358
|
+
* Each copy is located through an anchor pair that fixes the similarity
|
|
359
|
+
* transform:
|
|
360
|
+
*
|
|
361
|
+
* - Anchor 0 is the template shape whose kind is rarest among the
|
|
362
|
+
* candidates (fewest seeds to try); among equals, the largest.
|
|
363
|
+
* - Anchor 1 is the shape whose center is farthest from anchor 0. When all
|
|
364
|
+
* shapes share one center (a single polyline, concentric shapes), the
|
|
365
|
+
* farthest characteristic point of anchor 0 fixes rotation and mirroring
|
|
366
|
+
* instead; shapes without any orientation (circles) match by translation
|
|
367
|
+
* (and scale) only.
|
|
368
|
+
*
|
|
369
|
+
* Every template shape must then land on a free candidate of the same kind,
|
|
370
|
+
* label, size and point set. Shapes are checked rarest kind first, so a
|
|
371
|
+
* wrong transform is rejected early. Matches never share shapes and never
|
|
372
|
+
* reuse template shapes.
|
|
373
|
+
*
|
|
374
|
+
* Cost is roughly `seeds × partners × template size` grid lookups, where
|
|
375
|
+
* seeds are the candidates of the first anchor kind; candidate grids are per
|
|
376
|
+
* kind so dense drawings do not slow down unrelated lookups.
|
|
377
|
+
*
|
|
378
|
+
* @param template - Shapes of one instance (at least one).
|
|
379
|
+
* @param candidates - Shapes to search, typically the rest of the drawing.
|
|
380
|
+
* @param options - Tolerance and allowed transform types.
|
|
381
|
+
*/
|
|
382
|
+
export function acedFindShapeMatches(template, candidates, options) {
|
|
383
|
+
var e_8, _a, e_9, _b, e_10, _c, e_11, _d, e_12, _e, e_13, _f, e_14, _g;
|
|
384
|
+
var _h, _j, _k, _l, _m;
|
|
385
|
+
if (options === void 0) { options = {}; }
|
|
386
|
+
if (template.length === 0)
|
|
387
|
+
return [];
|
|
388
|
+
var extent = extentOf(template);
|
|
389
|
+
var tol = (_h = options.tolerance) !== null && _h !== void 0 ? _h : Math.max(extent * 0.002, 1e-9);
|
|
390
|
+
var allowRotation = (_j = options.allowRotation) !== null && _j !== void 0 ? _j : true;
|
|
391
|
+
var allowMirror = (_k = options.allowMirror) !== null && _k !== void 0 ? _k : true;
|
|
392
|
+
var allowScale = (_l = options.allowScale) !== null && _l !== void 0 ? _l : false;
|
|
393
|
+
var ignoreLabels = (_m = options.ignoreLabels) !== null && _m !== void 0 ? _m : false;
|
|
394
|
+
var labelOk = function (a, b) { var _a, _b; return ignoreLabels || ((_a = a.label) !== null && _a !== void 0 ? _a : '') === ((_b = b.label) !== null && _b !== void 0 ? _b : ''); };
|
|
395
|
+
// Absolute tolerance grows with the copy so scaled copies are judged
|
|
396
|
+
// relative to their own size.
|
|
397
|
+
var tolAt = function (scale) { return tol * Math.max(1, scale); };
|
|
398
|
+
var sizeOk = function (expected, actual, scale) {
|
|
399
|
+
return Math.abs(expected - actual) <= tolAt(scale);
|
|
400
|
+
};
|
|
401
|
+
var templateKinds = new Set(template.map(function (f) { return f.kind; }));
|
|
402
|
+
var templateIds = new Set(template.map(function (f) { return f.id; }));
|
|
403
|
+
var byKind = new Map();
|
|
404
|
+
try {
|
|
405
|
+
for (var candidates_1 = __values(candidates), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
|
|
406
|
+
var f = candidates_1_1.value;
|
|
407
|
+
if (templateIds.has(f.id) || !templateKinds.has(f.kind))
|
|
408
|
+
continue;
|
|
409
|
+
var list = byKind.get(f.kind);
|
|
410
|
+
if (list)
|
|
411
|
+
list.push(f);
|
|
412
|
+
else
|
|
413
|
+
byKind.set(f.kind, [f]);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
417
|
+
finally {
|
|
418
|
+
try {
|
|
419
|
+
if (candidates_1_1 && !candidates_1_1.done && (_a = candidates_1.return)) _a.call(candidates_1);
|
|
420
|
+
}
|
|
421
|
+
finally { if (e_8) throw e_8.error; }
|
|
422
|
+
}
|
|
423
|
+
try {
|
|
424
|
+
// A kind without candidates cannot be matched at all.
|
|
425
|
+
for (var templateKinds_1 = __values(templateKinds), templateKinds_1_1 = templateKinds_1.next(); !templateKinds_1_1.done; templateKinds_1_1 = templateKinds_1.next()) {
|
|
426
|
+
var kind = templateKinds_1_1.value;
|
|
427
|
+
if (!byKind.has(kind))
|
|
428
|
+
return [];
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
432
|
+
finally {
|
|
433
|
+
try {
|
|
434
|
+
if (templateKinds_1_1 && !templateKinds_1_1.done && (_b = templateKinds_1.return)) _b.call(templateKinds_1);
|
|
435
|
+
}
|
|
436
|
+
finally { if (e_9) throw e_9.error; }
|
|
437
|
+
}
|
|
438
|
+
var cell = Math.max(extent, tol * 10, 1e-9);
|
|
439
|
+
var grids = new Map();
|
|
440
|
+
var store = options.gridCache && gridStoreOf(options.gridCache);
|
|
441
|
+
if (store) {
|
|
442
|
+
// Power-of-two cells let templates of similar size share grids. Cached
|
|
443
|
+
// grids hold every candidate, template shapes included; lookups skip
|
|
444
|
+
// those.
|
|
445
|
+
cell = Math.pow(2, Math.ceil(Math.log2(cell)));
|
|
446
|
+
var all = void 0;
|
|
447
|
+
try {
|
|
448
|
+
for (var _o = __values(byKind.keys()), _p = _o.next(); !_p.done; _p = _o.next()) {
|
|
449
|
+
var kind = _p.value;
|
|
450
|
+
var key = "".concat(cell, "|").concat(kind);
|
|
451
|
+
var grid = store.get(key);
|
|
452
|
+
if (!grid) {
|
|
453
|
+
all !== null && all !== void 0 ? all : (all = groupByKind(candidates));
|
|
454
|
+
grid = new KindGrid(all.get(kind), cell);
|
|
455
|
+
store.set(key, grid);
|
|
456
|
+
}
|
|
457
|
+
grids.set(kind, grid);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
461
|
+
finally {
|
|
462
|
+
try {
|
|
463
|
+
if (_p && !_p.done && (_c = _o.return)) _c.call(_o);
|
|
464
|
+
}
|
|
465
|
+
finally { if (e_10) throw e_10.error; }
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
try {
|
|
470
|
+
for (var byKind_1 = __values(byKind), byKind_1_1 = byKind_1.next(); !byKind_1_1.done; byKind_1_1 = byKind_1.next()) {
|
|
471
|
+
var _q = __read(byKind_1_1.value, 2), kind = _q[0], list = _q[1];
|
|
472
|
+
grids.set(kind, new KindGrid(list, cell));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
476
|
+
finally {
|
|
477
|
+
try {
|
|
478
|
+
if (byKind_1_1 && !byKind_1_1.done && (_d = byKind_1.return)) _d.call(byKind_1);
|
|
479
|
+
}
|
|
480
|
+
finally { if (e_11) throw e_11.error; }
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
// Without scaling only equally sized shapes can match, so rarity is
|
|
484
|
+
// counted by size too: one kind (lines of a layer) can hold thousands of
|
|
485
|
+
// shapes while few have the anchor's length.
|
|
486
|
+
var countOf = function (f) {
|
|
487
|
+
var grid = grids.get(f.kind);
|
|
488
|
+
return allowScale ? grid.size : grid.countSizes(f.size, tolAt(1));
|
|
489
|
+
};
|
|
490
|
+
// Anchor 0: rarest kind, then largest size (a zero-size anchor cannot
|
|
491
|
+
// give the scale).
|
|
492
|
+
var a0 = template.reduce(function (best, f) {
|
|
493
|
+
if (best.size <= 0 && f.size > 0)
|
|
494
|
+
return f;
|
|
495
|
+
if (f.size <= 0 && best.size > 0)
|
|
496
|
+
return best;
|
|
497
|
+
var cf = countOf(f);
|
|
498
|
+
var cb = countOf(best);
|
|
499
|
+
if (cf !== cb)
|
|
500
|
+
return cf < cb ? f : best;
|
|
501
|
+
return f.size > best.size ? f : best;
|
|
502
|
+
});
|
|
503
|
+
var a1 = a0;
|
|
504
|
+
try {
|
|
505
|
+
for (var template_1 = __values(template), template_1_1 = template_1.next(); !template_1_1.done; template_1_1 = template_1.next()) {
|
|
506
|
+
var f = template_1_1.value;
|
|
507
|
+
if (dist(f.center, a0.center) > dist(a1.center, a0.center))
|
|
508
|
+
a1 = f;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
512
|
+
finally {
|
|
513
|
+
try {
|
|
514
|
+
if (template_1_1 && !template_1_1.done && (_e = template_1.return)) _e.call(template_1);
|
|
515
|
+
}
|
|
516
|
+
finally { if (e_12) throw e_12.error; }
|
|
517
|
+
}
|
|
518
|
+
var span = dist(a0.center, a1.center);
|
|
519
|
+
// Orientation point of anchor 0 for templates without a second center.
|
|
520
|
+
var orient;
|
|
521
|
+
var orientRadius = 0;
|
|
522
|
+
try {
|
|
523
|
+
for (var _r = __values(a0.points), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
524
|
+
var p = _s.value;
|
|
525
|
+
var r = dist(p, a0.center);
|
|
526
|
+
if (r > orientRadius) {
|
|
527
|
+
orientRadius = r;
|
|
528
|
+
orient = p;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
533
|
+
finally {
|
|
534
|
+
try {
|
|
535
|
+
if (_s && !_s.done && (_f = _r.return)) _f.call(_r);
|
|
536
|
+
}
|
|
537
|
+
finally { if (e_13) throw e_13.error; }
|
|
538
|
+
}
|
|
539
|
+
var lever = Math.max(span, orientRadius, 1e-9);
|
|
540
|
+
var mirrors = allowMirror ? [false, true] : [false];
|
|
541
|
+
// Check order: anchors first, then rarest kinds, so wrong transforms fail
|
|
542
|
+
// fast. Results are still reported in template order.
|
|
543
|
+
var rank = function (f) {
|
|
544
|
+
return f === a0 ? -2 : f === a1 ? -1 : countOf(f);
|
|
545
|
+
};
|
|
546
|
+
var order = template
|
|
547
|
+
.map(function (f, index) { return ({ f: f, index: index }); })
|
|
548
|
+
.sort(function (x, y) { return rank(x.f) - rank(y.f); });
|
|
549
|
+
var claimed = new Set();
|
|
550
|
+
var tryTransform = function (t, scale) {
|
|
551
|
+
var e_15, _a;
|
|
552
|
+
var ids = new Array(template.length);
|
|
553
|
+
var taken = new Set();
|
|
554
|
+
var pointTol = tolAt(scale);
|
|
555
|
+
var _loop_2 = function (f, index) {
|
|
556
|
+
var c = acedApplyAffine2d(t, f.center);
|
|
557
|
+
var hit;
|
|
558
|
+
grids.get(f.kind).forEachNear(c, pointTol, function (g) {
|
|
559
|
+
if (claimed.has(g.id) || taken.has(g.id))
|
|
560
|
+
return false;
|
|
561
|
+
if (templateIds.has(g.id))
|
|
562
|
+
return false;
|
|
563
|
+
if (!labelOk(f, g) || !sizeOk(f.size * scale, g.size, scale)) {
|
|
564
|
+
return false;
|
|
565
|
+
}
|
|
566
|
+
if (!acedShapeLandsOn(f, g, t, pointTol))
|
|
567
|
+
return false;
|
|
568
|
+
hit = g;
|
|
569
|
+
return true;
|
|
570
|
+
});
|
|
571
|
+
if (!hit)
|
|
572
|
+
return { value: undefined };
|
|
573
|
+
ids[index] = hit.id;
|
|
574
|
+
taken.add(hit.id);
|
|
575
|
+
};
|
|
576
|
+
try {
|
|
577
|
+
for (var order_1 = __values(order), order_1_1 = order_1.next(); !order_1_1.done; order_1_1 = order_1.next()) {
|
|
578
|
+
var _b = order_1_1.value, f = _b.f, index = _b.index;
|
|
579
|
+
var state_1 = _loop_2(f, index);
|
|
580
|
+
if (typeof state_1 === "object")
|
|
581
|
+
return state_1.value;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
585
|
+
finally {
|
|
586
|
+
try {
|
|
587
|
+
if (order_1_1 && !order_1_1.done && (_a = order_1.return)) _a.call(order_1);
|
|
588
|
+
}
|
|
589
|
+
finally { if (e_15) throw e_15.error; }
|
|
590
|
+
}
|
|
591
|
+
return ids;
|
|
592
|
+
};
|
|
593
|
+
var accept = function (t, rotation, scale, mirrored) {
|
|
594
|
+
var r = Math.atan2(Math.sin(rotation), Math.cos(rotation));
|
|
595
|
+
if (!allowScale && Math.abs(scale - 1) * lever > tol * 2)
|
|
596
|
+
return undefined;
|
|
597
|
+
if (!allowRotation && Math.abs(r) * lever > tol)
|
|
598
|
+
return undefined;
|
|
599
|
+
var ids = tryTransform(t, scale);
|
|
600
|
+
if (!ids)
|
|
601
|
+
return undefined;
|
|
602
|
+
var match = { transform: t, rotation: r, scale: scale, mirrored: mirrored, ids: ids };
|
|
603
|
+
return !options.accept || options.accept(match) ? match : undefined;
|
|
604
|
+
};
|
|
605
|
+
var matches = [];
|
|
606
|
+
var seeds = byKind
|
|
607
|
+
.get(a0.kind)
|
|
608
|
+
.filter(function (f) {
|
|
609
|
+
return labelOk(a0, f) &&
|
|
610
|
+
(allowScale ? f.size > 0 || a0.size <= 0 : sizeOk(a0.size, f.size, 1));
|
|
611
|
+
});
|
|
612
|
+
var _loop_1 = function (c0) {
|
|
613
|
+
var e_16, _t, e_17, _u, e_18, _v, e_19, _w, e_20, _x;
|
|
614
|
+
if (claimed.has(c0.id))
|
|
615
|
+
return "continue";
|
|
616
|
+
var scale0 = allowScale && a0.size > 0 ? c0.size / a0.size : 1;
|
|
617
|
+
var found = void 0;
|
|
618
|
+
if (span > tol) {
|
|
619
|
+
// Second anchor: a free shape of the anchor 1 kind at the right
|
|
620
|
+
// distance from the seed.
|
|
621
|
+
var reach_1 = span * scale0;
|
|
622
|
+
var ringTol_1 = tolAt(scale0) * 2;
|
|
623
|
+
var partners_2 = [];
|
|
624
|
+
grids.get(a1.kind).forEachNear(c0.center, reach_1 + ringTol_1, function (g) {
|
|
625
|
+
if (g.id === c0.id || claimed.has(g.id) || !labelOk(a1, g))
|
|
626
|
+
return;
|
|
627
|
+
if (templateIds.has(g.id))
|
|
628
|
+
return;
|
|
629
|
+
if (!sizeOk(a1.size * scale0, g.size, scale0))
|
|
630
|
+
return;
|
|
631
|
+
if (Math.abs(dist(g.center, c0.center) - reach_1) <= ringTol_1) {
|
|
632
|
+
partners_2.push(g);
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
try {
|
|
636
|
+
outer: for (var partners_1 = (e_16 = void 0, __values(partners_2)), partners_1_1 = partners_1.next(); !partners_1_1.done; partners_1_1 = partners_1.next()) {
|
|
637
|
+
var c1 = partners_1_1.value;
|
|
638
|
+
try {
|
|
639
|
+
for (var mirrors_1 = (e_17 = void 0, __values(mirrors)), mirrors_1_1 = mirrors_1.next(); !mirrors_1_1.done; mirrors_1_1 = mirrors_1.next()) {
|
|
640
|
+
var mirror = mirrors_1_1.value;
|
|
641
|
+
var sim = similarityFrom(a0.center, a1.center, c0.center, c1.center, mirror);
|
|
642
|
+
if (!sim)
|
|
643
|
+
continue;
|
|
644
|
+
found = accept(sim.t, sim.rotation, sim.scale, mirror);
|
|
645
|
+
if (found)
|
|
646
|
+
break outer;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
650
|
+
finally {
|
|
651
|
+
try {
|
|
652
|
+
if (mirrors_1_1 && !mirrors_1_1.done && (_u = mirrors_1.return)) _u.call(mirrors_1);
|
|
653
|
+
}
|
|
654
|
+
finally { if (e_17) throw e_17.error; }
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
659
|
+
finally {
|
|
660
|
+
try {
|
|
661
|
+
if (partners_1_1 && !partners_1_1.done && (_t = partners_1.return)) _t.call(partners_1);
|
|
662
|
+
}
|
|
663
|
+
finally { if (e_16) throw e_16.error; }
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
else if (orient && orientRadius > tol) {
|
|
667
|
+
// One center only: the farthest point of anchor 0 fixes the
|
|
668
|
+
// orientation. Try each seed point at the right radius (symmetric
|
|
669
|
+
// shapes offer several; any that maps the whole template is valid).
|
|
670
|
+
var reach = orientRadius * scale0;
|
|
671
|
+
var ringTol = tolAt(scale0) * 2;
|
|
672
|
+
try {
|
|
673
|
+
outer: for (var _y = (e_18 = void 0, __values(c0.points)), _z = _y.next(); !_z.done; _z = _y.next()) {
|
|
674
|
+
var q = _z.value;
|
|
675
|
+
if (Math.abs(dist(q, c0.center) - reach) > ringTol)
|
|
676
|
+
continue;
|
|
677
|
+
try {
|
|
678
|
+
for (var mirrors_2 = (e_19 = void 0, __values(mirrors)), mirrors_2_1 = mirrors_2.next(); !mirrors_2_1.done; mirrors_2_1 = mirrors_2.next()) {
|
|
679
|
+
var mirror = mirrors_2_1.value;
|
|
680
|
+
var sim = similarityFrom(a0.center, orient, c0.center, q, mirror);
|
|
681
|
+
if (!sim)
|
|
682
|
+
continue;
|
|
683
|
+
found = accept(sim.t, sim.rotation, sim.scale, mirror);
|
|
684
|
+
if (found)
|
|
685
|
+
break outer;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
689
|
+
finally {
|
|
690
|
+
try {
|
|
691
|
+
if (mirrors_2_1 && !mirrors_2_1.done && (_w = mirrors_2.return)) _w.call(mirrors_2);
|
|
692
|
+
}
|
|
693
|
+
finally { if (e_19) throw e_19.error; }
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
698
|
+
finally {
|
|
699
|
+
try {
|
|
700
|
+
if (_z && !_z.done && (_v = _y.return)) _v.call(_y);
|
|
701
|
+
}
|
|
702
|
+
finally { if (e_18) throw e_18.error; }
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
// No orientation at all (circles, points): translation and scale only.
|
|
707
|
+
var t = {
|
|
708
|
+
a: scale0,
|
|
709
|
+
b: 0,
|
|
710
|
+
c: 0,
|
|
711
|
+
d: scale0,
|
|
712
|
+
e: c0.center.x - scale0 * a0.center.x,
|
|
713
|
+
f: c0.center.y - scale0 * a0.center.y
|
|
714
|
+
};
|
|
715
|
+
found = accept(t, 0, scale0, false);
|
|
716
|
+
}
|
|
717
|
+
if (found) {
|
|
718
|
+
try {
|
|
719
|
+
for (var _0 = (e_20 = void 0, __values(found.ids)), _1 = _0.next(); !_1.done; _1 = _0.next()) {
|
|
720
|
+
var id = _1.value;
|
|
721
|
+
claimed.add(id);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
725
|
+
finally {
|
|
726
|
+
try {
|
|
727
|
+
if (_1 && !_1.done && (_x = _0.return)) _x.call(_0);
|
|
728
|
+
}
|
|
729
|
+
finally { if (e_20) throw e_20.error; }
|
|
730
|
+
}
|
|
731
|
+
matches.push(found);
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
try {
|
|
735
|
+
for (var seeds_1 = __values(seeds), seeds_1_1 = seeds_1.next(); !seeds_1_1.done; seeds_1_1 = seeds_1.next()) {
|
|
736
|
+
var c0 = seeds_1_1.value;
|
|
737
|
+
_loop_1(c0);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
741
|
+
finally {
|
|
742
|
+
try {
|
|
743
|
+
if (seeds_1_1 && !seeds_1_1.done && (_g = seeds_1.return)) _g.call(seeds_1);
|
|
744
|
+
}
|
|
745
|
+
finally { if (e_14) throw e_14.error; }
|
|
746
|
+
}
|
|
747
|
+
return matches;
|
|
748
|
+
}
|
|
749
|
+
//# sourceMappingURL=AcEdShapeMatcher.js.map
|