@mlightcad/cad-simple-viewer 1.7.0 → 1.7.1
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 +185 -180
- package/dist/cad-simple-viewer.js +17061 -12706
- package/dist/cad-simple-viewer.umd.cjs +981 -114
- package/dist/mtext-renderer-worker.js +1908 -1765
- package/icons.ts +7 -7
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +4 -3
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +38 -18
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +59 -45
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApOpenDatabaseOptions.d.ts +17 -1
- package/lib/app/AcApOpenDatabaseOptions.d.ts.map +1 -1
- package/lib/app/AcApOpenDatabaseOptions.js +1 -1
- package/lib/app/AcApOpenDatabaseOptions.js.map +1 -1
- package/lib/app/AcApOpenFileProgressController.d.ts +4 -2
- package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
- package/lib/app/AcApOpenFileProgressController.js +4 -2
- package/lib/app/AcApOpenFileProgressController.js.map +1 -1
- package/lib/app/index.d.ts +1 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +1 -0
- package/lib/app/index.js.map +1 -1
- package/lib/app/notification/AcApNotificationEventBridge.d.ts +130 -0
- package/lib/app/notification/AcApNotificationEventBridge.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationEventBridge.js +309 -0
- package/lib/app/notification/AcApNotificationEventBridge.js.map +1 -0
- package/lib/app/notification/AcApNotificationService.d.ts +185 -0
- package/lib/app/notification/AcApNotificationService.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationService.js +271 -0
- package/lib/app/notification/AcApNotificationService.js.map +1 -0
- package/lib/app/notification/AcApNotificationStore.d.ts +147 -0
- package/lib/app/notification/AcApNotificationStore.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationStore.js +345 -0
- package/lib/app/notification/AcApNotificationStore.js.map +1 -0
- package/lib/app/notification/AcApNotificationTypes.d.ts +195 -0
- package/lib/app/notification/AcApNotificationTypes.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationTypes.js +78 -0
- package/lib/app/notification/AcApNotificationTypes.js.map +1 -0
- package/lib/app/notification/index.d.ts +13 -0
- package/lib/app/notification/index.d.ts.map +1 -0
- package/lib/app/notification/index.js +13 -0
- package/lib/app/notification/index.js.map +1 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js +11 -7
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js.map +1 -1
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -1
- package/lib/command/AcApSwitchBgCmd.js +7 -2
- package/lib/command/AcApSwitchBgCmd.js.map +1 -1
- package/lib/command/AcApToolbarDocBind.d.ts +19 -0
- package/lib/command/AcApToolbarDocBind.d.ts.map +1 -0
- package/lib/command/AcApToolbarDocBind.js +62 -0
- package/lib/command/AcApToolbarDocBind.js.map +1 -0
- package/lib/command/convert/AcApConvertToBmpCmd.d.ts +14 -0
- package/lib/command/convert/AcApConvertToBmpCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToBmpCmd.js +34 -0
- package/lib/command/convert/AcApConvertToBmpCmd.js.map +1 -0
- package/lib/command/convert/AcApConvertToJpgCmd.d.ts +14 -0
- package/lib/command/convert/AcApConvertToJpgCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToJpgCmd.js +34 -0
- package/lib/command/convert/AcApConvertToJpgCmd.js.map +1 -0
- package/lib/command/convert/AcApConvertToPngCmd.d.ts +4 -36
- package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -1
- package/lib/command/convert/AcApConvertToPngCmd.js +4 -138
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
- package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts +40 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.js +161 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.js.map +1 -0
- package/lib/command/convert/{AcApPngConvertor.d.ts → AcApRasterImageConvertor.d.ts} +36 -12
- package/lib/command/convert/AcApRasterImageConvertor.d.ts.map +1 -0
- package/lib/command/convert/{AcApPngConvertor.js → AcApRasterImageConvertor.js} +163 -32
- package/lib/command/convert/AcApRasterImageConvertor.js.map +1 -0
- package/lib/command/convert/index.d.ts +4 -1
- package/lib/command/convert/index.d.ts.map +1 -1
- package/lib/command/convert/index.js +4 -1
- package/lib/command/convert/index.js.map +1 -1
- package/lib/command/index.d.ts +2 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +2 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.js +51 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts +5 -0
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.js +27 -9
- package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.js +49 -1
- package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -1
- package/lib/editor/global/AcEdUiLayout.d.ts +6 -0
- package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiLayout.js +6 -0
- package/lib/editor/global/AcEdUiLayout.js.map +1 -1
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts +31 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js +67 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +2 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +13 -2
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +6 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +47 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js +2 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js.map +1 -1
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts +18 -4
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js +14 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js.map +1 -1
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts +10 -2
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js +15 -4
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js.map +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.js +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.js.map +1 -1
- package/lib/editor/input/ui/index.d.ts +1 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +1 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +12 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +19 -9
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +36 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.js +113 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -0
- package/lib/editor/view/index.d.ts +1 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +1 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +2 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +4 -1
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/ar/command.d.ts +9 -0
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +1 -1
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +47 -0
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +17 -1
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/ar/main.d.ts +30 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +34 -4
- package/lib/i18n/ar/main.js.map +1 -1
- package/lib/i18n/cs/command.d.ts +9 -0
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +9 -0
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +47 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +47 -0
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +30 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +34 -4
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/en/command.d.ts +9 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +9 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +47 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +47 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +30 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +34 -4
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/index.d.ts +2 -2
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +9 -0
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +9 -0
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +47 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +47 -0
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +30 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +34 -4
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +9 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +9 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +47 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +47 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +30 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +34 -4
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +6 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +10 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +4 -0
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -0
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +4 -0
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js +9 -0
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
- package/lib/ui/AcUiDefaultNotificationUi.d.ts +167 -0
- package/lib/ui/AcUiDefaultNotificationUi.d.ts.map +1 -0
- package/lib/ui/AcUiDefaultNotificationUi.js +603 -0
- package/lib/ui/AcUiDefaultNotificationUi.js.map +1 -0
- package/lib/ui/AcUiDrawStyle.d.ts +2 -1
- package/lib/ui/AcUiDrawStyle.d.ts.map +1 -1
- package/lib/ui/AcUiDrawStyle.js +2 -1
- package/lib/ui/AcUiDrawStyle.js.map +1 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts.map +1 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.js +5 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.js.map +1 -1
- package/lib/ui/AcUiMobileSessionPanel.d.ts +73 -8
- package/lib/ui/AcUiMobileSessionPanel.d.ts.map +1 -1
- package/lib/ui/AcUiMobileSessionPanel.js +314 -49
- package/lib/ui/AcUiMobileSessionPanel.js.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.d.ts +24 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.js +73 -5
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -1
- package/lib/ui/index.d.ts +2 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +2 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/toolbar/AcUiDropdownMenu.d.ts +48 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.js +116 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.js.map +1 -0
- package/lib/ui/toolbar/AcUiSubToolbar.d.ts +125 -0
- package/lib/ui/toolbar/AcUiSubToolbar.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiSubToolbar.js +625 -0
- package/lib/ui/toolbar/AcUiSubToolbar.js.map +1 -0
- package/lib/ui/toolbar/AcUiToolbar.d.ts +446 -0
- package/lib/ui/toolbar/AcUiToolbar.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiToolbar.js +1550 -0
- package/lib/ui/toolbar/AcUiToolbar.js.map +1 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.d.ts +20 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.js +34 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.js.map +1 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.d.ts +19 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.d.ts.map +1 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.js +36 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.js.map +1 -0
- package/lib/ui/toolbar/index.d.ts +19 -0
- package/lib/ui/toolbar/index.d.ts.map +1 -0
- package/lib/ui/toolbar/index.js +15 -0
- package/lib/ui/toolbar/index.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarChrome.d.ts +14 -0
- package/lib/ui/toolbar/resolveToolbarChrome.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarChrome.js +35 -0
- package/lib/ui/toolbar/resolveToolbarChrome.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItemState.d.ts +63 -0
- package/lib/ui/toolbar/resolveToolbarItemState.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItemState.js +171 -0
- package/lib/ui/toolbar/resolveToolbarItemState.js.map +1 -0
- package/lib/ui/toolbar/toolbarItemUtils.d.ts +62 -0
- package/lib/ui/toolbar/toolbarItemUtils.d.ts.map +1 -0
- package/lib/ui/toolbar/toolbarItemUtils.js +184 -0
- package/lib/ui/toolbar/toolbarItemUtils.js.map +1 -0
- package/lib/ui/toolbar/types.d.ts +268 -0
- package/lib/ui/toolbar/types.d.ts.map +1 -0
- package/lib/ui/toolbar/types.js +8 -0
- package/lib/ui/toolbar/types.js.map +1 -0
- package/lib/ui-html-entry.d.ts +8 -1
- package/lib/ui-html-entry.d.ts.map +1 -1
- package/lib/ui-html-entry.js +6 -1
- package/lib/ui-html-entry.js.map +1 -1
- package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts +53 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts.map +1 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.js +164 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.js.map +1 -0
- package/lib/util/AcApFormatFontMissedMessage.d.ts +32 -0
- package/lib/util/AcApFormatFontMissedMessage.d.ts.map +1 -0
- package/lib/util/AcApFormatFontMissedMessage.js +46 -0
- package/lib/util/AcApFormatFontMissedMessage.js.map +1 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts +44 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts.map +1 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.js +105 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.js.map +1 -0
- package/lib/util/index.d.ts +3 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +3 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +13 -1
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +28 -11
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +17 -2
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +44 -3
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +4 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +6 -0
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +93 -14
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +382 -102
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +8 -8
- package/src/ui/icons.ts +387 -387
- package/lib/command/convert/AcApPngConvertor.d.ts.map +0 -1
- package/lib/command/convert/AcApPngConvertor.js.map +0 -1
package/lib/view/AcTrView2d.js
CHANGED
|
@@ -96,8 +96,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
96
96
|
}
|
|
97
97
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
98
98
|
};
|
|
99
|
-
import { AcCmUiYieldGate, AcDbAttribute, AcDbBlockReference, acdbHostApplicationServices, AcDbMText, AcDbRasterImage, AcDbRay, AcDbSysVarManager, AcDbViewport, AcDbXline, AcGeBox2d, AcGePoint2d, log } from '@mlightcad/data-model';
|
|
99
|
+
import { AcCmUiYieldGate, AcDbAttribute, AcDbBlockReference, acdbHostApplicationServices, AcDbMText, AcDbRasterImage, AcDbRay, AcDbSysVarManager, AcDbViewport, AcDbXline, AcGeBox2d, AcGePoint2d, acgiForegroundColorForBackground, log } from '@mlightcad/data-model';
|
|
100
100
|
import { AcDbSystemVariables } from '@mlightcad/data-model';
|
|
101
|
+
import { FontManager } from '@mlightcad/mtext-renderer';
|
|
101
102
|
import { AcTrEntity, AcTrGlyphEntity, AcTrGroup, AcTrRenderer, AcTrViewportView } from '@mlightcad/three-renderer';
|
|
102
103
|
import { AcTrMatrixUtil } from '@mlightcad/three-renderer';
|
|
103
104
|
import * as THREE from 'three';
|
|
@@ -107,9 +108,10 @@ import { AcApDocManager, AcApSettingManager } from '../app';
|
|
|
107
108
|
import { AcApZoomCmd } from '../command/AcApZoomCmd';
|
|
108
109
|
import { isMarkupHtmlTextEditing } from '../command/markup/AcApMarkupTextEdit';
|
|
109
110
|
import { notifyMeasurementLayoutChanged } from '../command/measure/AcApMeasurementStore';
|
|
110
|
-
import { acedAttachMobileBoxGesture, AcEdBaseView, AcEdConditionWaiter, AcEdCorsorType, AcEdGripManager, acedInteractionStrategy, acedIsTouchDerivedMouseEvent, AcEdMTextEditor, AcEdOpenMode, acedShouldIgnoreCompatMouse, AcEdViewMode, eventBus, resolvePointerSelectionAction } from '../editor';
|
|
111
|
+
import { acedAttachMobileBoxGesture, AcEdBaseView, AcEdConditionWaiter, AcEdCorsorType, AcEdGripManager, acedGuardCanvasTouchCallout, acedInteractionStrategy, acedIsTouchDerivedMouseEvent, AcEdMTextEditor, AcEdOpenMode, acedShouldIgnoreCompatMouse, AcEdViewMode, eventBus, resolvePointerSelectionAction } from '../editor';
|
|
111
112
|
import { ACGI_MODEL_SPACE_BACKGROUND, isModelSpaceDatabase, readLayoutBackgroundColor } from '../editor/global/AcEdUiColor';
|
|
112
113
|
import { ML_UI_Z_CANVAS_HTML_OVERLAY } from '../editor/global/AcEdUiLayout';
|
|
114
|
+
import { acedEntityIntersectsSelectionBox, acedNeedsCrossingGeometryRefine } from '../editor/view/AcEdSelectionBoxIntersect';
|
|
113
115
|
import { isEffectiveSpatialQueryHit } from '../editor/view/AcEdSpatialQueryResult';
|
|
114
116
|
import { AcTrGeometryUtil } from '../util';
|
|
115
117
|
import { acapRunDatabaseEdit } from '../util/AcApDatabaseEdit';
|
|
@@ -182,11 +184,8 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
182
184
|
renderer.domElement.style.maxWidth = '100%';
|
|
183
185
|
renderer.domElement.style.maxHeight = '100%';
|
|
184
186
|
// Keep one-finger picks (measure snap loupe) from being stolen by the
|
|
185
|
-
// browser scroll / long-press
|
|
186
|
-
renderer.domElement
|
|
187
|
-
renderer.domElement.style.userSelect = 'none';
|
|
188
|
-
renderer.domElement.style.setProperty('-webkit-user-select', 'none');
|
|
189
|
-
renderer.domElement.style.setProperty('-webkit-touch-callout', 'none');
|
|
187
|
+
// browser scroll / long-press copy-selection callout (especially iOS).
|
|
188
|
+
var disposeCanvasTouchCallout = acedGuardCanvasTouchCallout(renderer.domElement, container);
|
|
190
189
|
_this = _super.call(this, renderer.domElement, container) || this;
|
|
191
190
|
/**
|
|
192
191
|
* ID of the currently scheduled requestAnimationFrame callback.
|
|
@@ -275,10 +274,24 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
275
274
|
/** Cooperative yields taken inside progressive {@link batchConvert}. */
|
|
276
275
|
_this._progressiveYieldCount = 0;
|
|
277
276
|
/**
|
|
278
|
-
* In-flight glyph/group geometry jobs that await fonts via asyncDraw.
|
|
277
|
+
* In-flight + queued glyph/group geometry jobs that await fonts via asyncDraw.
|
|
279
278
|
* Counted separately so linework convert can continue while text waits.
|
|
280
279
|
*/
|
|
281
280
|
_this._pendingGeometryJobs = 0;
|
|
281
|
+
/**
|
|
282
|
+
* Waiting deferred geometry runners. Capped concurrency avoids scheduling
|
|
283
|
+
* thousands of INSERT/text `asyncDraw` jobs at once (large multi-sheet DWGs
|
|
284
|
+
* otherwise flood the main thread and freeze on "Rendering drawing ...").
|
|
285
|
+
*/
|
|
286
|
+
_this._deferredGeometryQueue = [];
|
|
287
|
+
/** Currently executing deferred geometry runners. */
|
|
288
|
+
_this._deferredGeometryActive = 0;
|
|
289
|
+
/**
|
|
290
|
+
* Debounced glyph rebuild after {@link FontManager.events.fontLoaded} so a
|
|
291
|
+
* burst of lazy face loads (simsun + malgun, etc.) triggers one redraw pass.
|
|
292
|
+
*/
|
|
293
|
+
_this._fontLoadedRedrawTimer = null;
|
|
294
|
+
_this._fontLoadedRedrawEpoch = 0;
|
|
282
295
|
/** Transient reading mode forces black linework on a white canvas. */
|
|
283
296
|
_this._readingMode = new AcApReadingModeState({
|
|
284
297
|
getCurrentBackgroundColor: function () { return _this._renderer.currentBackgroundColor; },
|
|
@@ -323,6 +336,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
323
336
|
_this._isDirty = needsRedraw;
|
|
324
337
|
_this._htmlDirty = false;
|
|
325
338
|
};
|
|
339
|
+
_this._disposeCanvasTouchCallout = disposeCanvasTouchCallout;
|
|
326
340
|
_this._gripManager = new AcEdGripManager(_this);
|
|
327
341
|
_this._keyHandler = new AcEdViewKeyHandler(_this);
|
|
328
342
|
if (options.calculateSizeCallback) {
|
|
@@ -340,9 +354,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
340
354
|
count: (_a = args.count) !== null && _a !== void 0 ? _a : 0
|
|
341
355
|
});
|
|
342
356
|
});
|
|
343
|
-
_this._renderer.events.fontLoaded.addEventListener(function () {
|
|
357
|
+
_this._renderer.events.fontLoaded.addEventListener(function (args) {
|
|
344
358
|
// Lazy load success clears FontManager.missedFonts; refresh status-bar state.
|
|
345
359
|
eventBus.emit('missed-data-changed', {});
|
|
360
|
+
// On-demand faces (e.g. style `malgun`) may finish after the first glyph
|
|
361
|
+
// bake. Rebuild text so Hangul is not left as permanent '?'.
|
|
362
|
+
_this.scheduleGlyphRedrawAfterFontLoad(args === null || args === void 0 ? void 0 : args.fontName);
|
|
346
363
|
});
|
|
347
364
|
_this._scene = _this.createScene();
|
|
348
365
|
_this._layerAppearance = new AcTrLayerAppearanceController(_this._scene, _this._renderer);
|
|
@@ -631,7 +648,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
631
648
|
_this._htmlDirty = false;
|
|
632
649
|
_this.startAnimationLoop();
|
|
633
650
|
_this._numOfEntitiesToProcess = 0;
|
|
634
|
-
_this.
|
|
651
|
+
_this.resetDeferredGeometryQueue();
|
|
635
652
|
return _this;
|
|
636
653
|
}
|
|
637
654
|
AcTrView2d.prototype.getPointerSelectionAction = function (e) {
|
|
@@ -763,9 +780,14 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
763
780
|
* True while batch conversion or deferred glyph/group geometry is still
|
|
764
781
|
* running.
|
|
765
782
|
*
|
|
766
|
-
* Parsing can report 100% before this reaches zero; callers
|
|
767
|
-
* should wait on this (as
|
|
768
|
-
*
|
|
783
|
+
* Parsing can report 100% before this reaches zero; callers that need a
|
|
784
|
+
* fully drawable scene (export, scripted zoom) should wait on this (as
|
|
785
|
+
* {@link waitUntilIdle} / {@link zoomToFitDrawing} do).
|
|
786
|
+
*
|
|
787
|
+
* The open-file progress overlay intentionally uses
|
|
788
|
+
* {@link isConvertingEntities} instead so "Rendering drawing ..." can hide
|
|
789
|
+
* once linework convert finishes while text geometry continues in the
|
|
790
|
+
* deferred pool.
|
|
769
791
|
*/
|
|
770
792
|
get: function () {
|
|
771
793
|
return this._numOfEntitiesToProcess > 0 || this._pendingGeometryJobs > 0;
|
|
@@ -773,6 +795,17 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
773
795
|
enumerable: false,
|
|
774
796
|
configurable: true
|
|
775
797
|
});
|
|
798
|
+
Object.defineProperty(AcTrView2d.prototype, "isConvertingEntities", {
|
|
799
|
+
/**
|
|
800
|
+
* True while the entity convert queue / {@link batchConvert} is still
|
|
801
|
+
* draining. Does **not** include deferred glyph/INSERT geometry jobs.
|
|
802
|
+
*/
|
|
803
|
+
get: function () {
|
|
804
|
+
return this._numOfEntitiesToProcess > 0;
|
|
805
|
+
},
|
|
806
|
+
enumerable: false,
|
|
807
|
+
configurable: true
|
|
808
|
+
});
|
|
776
809
|
/**
|
|
777
810
|
* Waits until batch conversion and deferred glyph/font geometry finish.
|
|
778
811
|
*
|
|
@@ -832,8 +865,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
832
865
|
});
|
|
833
866
|
Object.defineProperty(AcTrView2d.prototype, "progressiveOpenStats", {
|
|
834
867
|
/**
|
|
835
|
-
*
|
|
836
|
-
*
|
|
868
|
+
* Open-convert counters for OPENPROF / palette (cooperative yields during
|
|
869
|
+
* convert, and mid-open paints when progressive rendering is enabled).
|
|
870
|
+
* Reset when progressive mode is enabled for an open.
|
|
837
871
|
*/
|
|
838
872
|
get: function () {
|
|
839
873
|
return {
|
|
@@ -962,6 +996,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
962
996
|
AcTrView2d.prototype.applyCanvasBackground = function (value) {
|
|
963
997
|
this._renderer.currentBackgroundColor = value;
|
|
964
998
|
this._layerAppearance.refreshTextMaterialsInObjectTree(this._scene.internalScene);
|
|
999
|
+
// Style-manager changeForeground only updates cache entries; batch
|
|
1000
|
+
// containers own private material clones and must be repainted too.
|
|
1001
|
+
this._scene.repaintForegroundMaterials(acgiForegroundColorForBackground(value));
|
|
965
1002
|
this.resyncForegroundLayersForBackground();
|
|
966
1003
|
if (this._readingMode.isEnabled) {
|
|
967
1004
|
this._readingMode.noteLayoutBackground(value);
|
|
@@ -1421,11 +1458,13 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1421
1458
|
/**
|
|
1422
1459
|
* Re-render points with latest point style settings
|
|
1423
1460
|
* @param displayMode Input display mode of points
|
|
1461
|
+
* @param displaySize Input display size of points (`PDSIZE`)
|
|
1424
1462
|
*/
|
|
1425
|
-
AcTrView2d.prototype.rerenderPoints = function (displayMode) {
|
|
1463
|
+
AcTrView2d.prototype.rerenderPoints = function (displayMode, displaySize) {
|
|
1464
|
+
if (displaySize === void 0) { displaySize = 0; }
|
|
1426
1465
|
var activeLayout = this._scene.activeLayout;
|
|
1427
1466
|
if (activeLayout) {
|
|
1428
|
-
activeLayout.rerenderPoints(displayMode);
|
|
1467
|
+
activeLayout.rerenderPoints(displayMode, displaySize);
|
|
1429
1468
|
this._isDirty = true;
|
|
1430
1469
|
}
|
|
1431
1470
|
};
|
|
@@ -1796,6 +1835,48 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1796
1835
|
AcTrView2d.prototype.selectByBox = function (box) {
|
|
1797
1836
|
this.selectByBoxWithMode(box, 'crossing', 'add');
|
|
1798
1837
|
};
|
|
1838
|
+
/**
|
|
1839
|
+
* Drops crossing spatial hits whose curve geometry misses the pick box.
|
|
1840
|
+
*
|
|
1841
|
+
* Large closed polylines (site boundaries, frames) have AABBs that cover
|
|
1842
|
+
* huge empty interiors. Without this refine, crossing a small INSERT inside
|
|
1843
|
+
* that interior also selects those polylines and can stall highlight work.
|
|
1844
|
+
*/
|
|
1845
|
+
AcTrView2d.prototype.refineCrossingSelectionHits = function (box, results) {
|
|
1846
|
+
var e_8, _a;
|
|
1847
|
+
var _b;
|
|
1848
|
+
var database = (_b = AcApDocManager.instance.curDocument) === null || _b === void 0 ? void 0 : _b.database;
|
|
1849
|
+
if (!database) {
|
|
1850
|
+
return results.map(function (item) { return item.id; });
|
|
1851
|
+
}
|
|
1852
|
+
var ids = [];
|
|
1853
|
+
try {
|
|
1854
|
+
for (var results_1 = __values(results), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
|
|
1855
|
+
var item = results_1_1.value;
|
|
1856
|
+
if (!acedNeedsCrossingGeometryRefine(item)) {
|
|
1857
|
+
ids.push(item.id);
|
|
1858
|
+
continue;
|
|
1859
|
+
}
|
|
1860
|
+
var entityBox = new AcGeBox2d({ x: item.minX, y: item.minY }, { x: item.maxX, y: item.maxY });
|
|
1861
|
+
if (box.containsBox(entityBox)) {
|
|
1862
|
+
ids.push(item.id);
|
|
1863
|
+
continue;
|
|
1864
|
+
}
|
|
1865
|
+
var entity = database.tables.blockTable.getEntityById(item.id);
|
|
1866
|
+
if (!entity || acedEntityIntersectsSelectionBox(entity, box)) {
|
|
1867
|
+
ids.push(item.id);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1872
|
+
finally {
|
|
1873
|
+
try {
|
|
1874
|
+
if (results_1_1 && !results_1_1.done && (_a = results_1.return)) _a.call(results_1);
|
|
1875
|
+
}
|
|
1876
|
+
finally { if (e_8) throw e_8.error; }
|
|
1877
|
+
}
|
|
1878
|
+
return ids;
|
|
1879
|
+
};
|
|
1799
1880
|
/**
|
|
1800
1881
|
* @inheritdoc
|
|
1801
1882
|
*/
|
|
@@ -1808,7 +1889,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1808
1889
|
* @inheritdoc
|
|
1809
1890
|
*/
|
|
1810
1891
|
AcTrView2d.prototype.updateLayer = function (layer, changes) {
|
|
1811
|
-
var
|
|
1892
|
+
var e_9, _a;
|
|
1812
1893
|
var touchedObjectIds = this._scene.updateLayer(this.toLayerInfo(layer)).touchedObjectIds;
|
|
1813
1894
|
if (this._layerAppearance.layerStyleMayHaveChanged(changes)) {
|
|
1814
1895
|
this._layerAppearance.syncFromLiveRecord(layer);
|
|
@@ -1830,12 +1911,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1830
1911
|
this.applySessionHiddenObjectState(objectId);
|
|
1831
1912
|
}
|
|
1832
1913
|
}
|
|
1833
|
-
catch (
|
|
1914
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1834
1915
|
finally {
|
|
1835
1916
|
try {
|
|
1836
1917
|
if (touchedObjectIds_1_1 && !touchedObjectIds_1_1.done && (_a = touchedObjectIds_1.return)) _a.call(touchedObjectIds_1);
|
|
1837
1918
|
}
|
|
1838
|
-
finally { if (
|
|
1919
|
+
finally { if (e_9) throw e_9.error; }
|
|
1839
1920
|
}
|
|
1840
1921
|
this._isDirty = true;
|
|
1841
1922
|
};
|
|
@@ -1952,13 +2033,13 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1952
2033
|
var _a;
|
|
1953
2034
|
var entities = Array.isArray(entity) ? entity : [entity];
|
|
1954
2035
|
this._numOfEntitiesToProcess += entities.length;
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
2036
|
+
// Always serialize convert through one drain loop. Non-progressive opens
|
|
2037
|
+
// used to `void batchConvert(chunk)` per ENTITY flush chunk, which ran
|
|
2038
|
+
// many converts in parallel and OOM'd dense drawings (e.g. cathedral.dwg)
|
|
2039
|
+
// during "Rendering drawing ...". Progressive mid-open paints stay gated
|
|
2040
|
+
// by `_progressiveRendering` inside batchConvert / markProgressiveDirty.
|
|
2041
|
+
(_a = this._convertQueue).push.apply(_a, __spreadArray([], __read(entities), false));
|
|
2042
|
+
void this.drainConvertQueue();
|
|
1962
2043
|
};
|
|
1963
2044
|
/**
|
|
1964
2045
|
* @inheritdoc
|
|
@@ -2064,7 +2145,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2064
2145
|
* drawable entity that must be rebuilt (for example ATTRIB → INSERT).
|
|
2065
2146
|
*/
|
|
2066
2147
|
AcTrView2d.prototype.resolveSceneUpdateEntities = function (entities) {
|
|
2067
|
-
var
|
|
2148
|
+
var e_10, _a;
|
|
2068
2149
|
var _b;
|
|
2069
2150
|
var db = (_b = AcApDocManager.instance.curDocument) === null || _b === void 0 ? void 0 : _b.database;
|
|
2070
2151
|
var resolved = [];
|
|
@@ -2086,12 +2167,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2086
2167
|
resolved.push(target);
|
|
2087
2168
|
}
|
|
2088
2169
|
}
|
|
2089
|
-
catch (
|
|
2170
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
2090
2171
|
finally {
|
|
2091
2172
|
try {
|
|
2092
2173
|
if (entities_1_1 && !entities_1_1.done && (_a = entities_1.return)) _a.call(entities_1);
|
|
2093
2174
|
}
|
|
2094
|
-
finally { if (
|
|
2175
|
+
finally { if (e_10) throw e_10.error; }
|
|
2095
2176
|
}
|
|
2096
2177
|
return resolved;
|
|
2097
2178
|
};
|
|
@@ -2215,9 +2296,10 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2215
2296
|
// Invalidate any in-flight progressive convert so it neither paints into
|
|
2216
2297
|
// the cleared scene nor double-decrements the processing counter.
|
|
2217
2298
|
this._convertEpoch++;
|
|
2299
|
+
this.clearFontLoadedRedrawTimer();
|
|
2218
2300
|
this._convertQueue.length = 0;
|
|
2219
2301
|
this._numOfEntitiesToProcess = 0;
|
|
2220
|
-
this.
|
|
2302
|
+
this.resetDeferredGeometryQueue();
|
|
2221
2303
|
this._scene.clear();
|
|
2222
2304
|
this._isDirty = true;
|
|
2223
2305
|
this._missedImages.clear();
|
|
@@ -2252,9 +2334,10 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2252
2334
|
AcTrView2d.prototype.restoreSessionState = function (state) {
|
|
2253
2335
|
var _a;
|
|
2254
2336
|
this._convertEpoch++;
|
|
2337
|
+
this.clearFontLoadedRedrawTimer();
|
|
2255
2338
|
this._convertQueue.length = 0;
|
|
2256
2339
|
this._numOfEntitiesToProcess = 0;
|
|
2257
|
-
this.
|
|
2340
|
+
this.resetDeferredGeometryQueue();
|
|
2258
2341
|
this._scene = state.scene;
|
|
2259
2342
|
this._layoutViewManager = state.layoutViewManager;
|
|
2260
2343
|
this._initializedLayouts = state.initializedLayouts;
|
|
@@ -2279,9 +2362,10 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2279
2362
|
AcTrView2d.prototype.beginNewSession = function () {
|
|
2280
2363
|
var parked = this.captureSessionState();
|
|
2281
2364
|
this._convertEpoch++;
|
|
2365
|
+
this.clearFontLoadedRedrawTimer();
|
|
2282
2366
|
this._convertQueue.length = 0;
|
|
2283
2367
|
this._numOfEntitiesToProcess = 0;
|
|
2284
|
-
this.
|
|
2368
|
+
this.resetDeferredGeometryQueue();
|
|
2285
2369
|
this._scene = this.createScene();
|
|
2286
2370
|
this._layoutViewManager = new AcTrLayoutViewManager();
|
|
2287
2371
|
this._initializedLayouts = new Set();
|
|
@@ -2327,8 +2411,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2327
2411
|
return current == null || current === this;
|
|
2328
2412
|
};
|
|
2329
2413
|
/**
|
|
2330
|
-
* Drains the
|
|
2331
|
-
*
|
|
2414
|
+
* Drains the convert queue on a single serial worker so ENTITY flush chunks
|
|
2415
|
+
* can enqueue without overlapping multiple {@link batchConvert} runs (which
|
|
2416
|
+
* spikes heap on large drawings).
|
|
2332
2417
|
*
|
|
2333
2418
|
* Concurrent callers share the same promise; if more entities are queued
|
|
2334
2419
|
* after a drain finishes, a follow-up drain is started.
|
|
@@ -2437,6 +2522,19 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2437
2522
|
this._rafId = null;
|
|
2438
2523
|
}
|
|
2439
2524
|
};
|
|
2525
|
+
/**
|
|
2526
|
+
* Releases canvas DOM listeners and stops the animation loop.
|
|
2527
|
+
*
|
|
2528
|
+
* Call when this view will no longer be used (manager destroy / split
|
|
2529
|
+
* view teardown). Safe to call more than once.
|
|
2530
|
+
*/
|
|
2531
|
+
AcTrView2d.prototype.dispose = function () {
|
|
2532
|
+
var _a;
|
|
2533
|
+
(_a = this._disposeCanvasTouchCallout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2534
|
+
this._disposeCanvasTouchCallout = undefined;
|
|
2535
|
+
this.clearFontLoadedRedrawTimer();
|
|
2536
|
+
this.stopAnimationLoop();
|
|
2537
|
+
};
|
|
2440
2538
|
/**
|
|
2441
2539
|
* @inheritdoc
|
|
2442
2540
|
*/
|
|
@@ -2529,7 +2627,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2529
2627
|
* @param layoutBtrId Input the block table record id of the layout
|
|
2530
2628
|
*/
|
|
2531
2629
|
AcTrView2d.prototype.loadLayoutEntitiesIfNeeded = function (layoutBtrId) {
|
|
2532
|
-
var
|
|
2630
|
+
var e_11, _a;
|
|
2533
2631
|
var _this = this;
|
|
2534
2632
|
try {
|
|
2535
2633
|
var db = AcApDocManager.instance.curDocument.database;
|
|
@@ -2600,12 +2698,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2600
2698
|
entities_2.push(entity);
|
|
2601
2699
|
}
|
|
2602
2700
|
}
|
|
2603
|
-
catch (
|
|
2701
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
2604
2702
|
finally {
|
|
2605
2703
|
try {
|
|
2606
2704
|
if (iterator_1_1 && !iterator_1_1.done && (_a = iterator_1.return)) _a.call(iterator_1);
|
|
2607
2705
|
}
|
|
2608
|
-
finally { if (
|
|
2706
|
+
finally { if (e_11) throw e_11.error; }
|
|
2609
2707
|
}
|
|
2610
2708
|
if (entities_2.length === 0) {
|
|
2611
2709
|
// Empty layout (e.g. a freshly-created paper space tab). Mark as
|
|
@@ -2736,11 +2834,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2736
2834
|
switch (_a.label) {
|
|
2737
2835
|
case 0:
|
|
2738
2836
|
if (!(threeEntity instanceof AcTrGroup)) return [3 /*break*/, 2];
|
|
2739
|
-
//
|
|
2740
|
-
//
|
|
2741
|
-
|
|
2742
|
-
if (threeEntity.getSourceEntities().length === 0 &&
|
|
2743
|
-
!this.groupHasPendingGlyphGeometry(threeEntity)) {
|
|
2837
|
+
// Linework-only INSERTs (no empty glyph shells) skip asyncDraw; spatial
|
|
2838
|
+
// boxes are refreshed by syncGroupSpatialBoundsForIndexing after commit.
|
|
2839
|
+
if (!this.groupHasPendingGlyphGeometry(threeEntity)) {
|
|
2744
2840
|
return [2 /*return*/];
|
|
2745
2841
|
}
|
|
2746
2842
|
return [4 /*yield*/, threeEntity.asyncDraw()];
|
|
@@ -2760,7 +2856,139 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2760
2856
|
});
|
|
2761
2857
|
};
|
|
2762
2858
|
AcTrView2d.prototype.needsDeferredFontGeometry = function (threeEntity) {
|
|
2763
|
-
|
|
2859
|
+
if (threeEntity instanceof AcTrGlyphEntity) {
|
|
2860
|
+
return !threeEntity.hasDrawableGeometry();
|
|
2861
|
+
}
|
|
2862
|
+
// Only defer INSERTs that still have empty glyph shells. Linework-only
|
|
2863
|
+
// blocks should commit on the convert path and not occupy the geometry pool.
|
|
2864
|
+
if (threeEntity instanceof AcTrGroup) {
|
|
2865
|
+
return this.groupHasPendingGlyphGeometry(threeEntity);
|
|
2866
|
+
}
|
|
2867
|
+
return false;
|
|
2868
|
+
};
|
|
2869
|
+
AcTrView2d.prototype.clearFontLoadedRedrawTimer = function () {
|
|
2870
|
+
if (this._fontLoadedRedrawTimer != null) {
|
|
2871
|
+
clearTimeout(this._fontLoadedRedrawTimer);
|
|
2872
|
+
this._fontLoadedRedrawTimer = null;
|
|
2873
|
+
}
|
|
2874
|
+
};
|
|
2875
|
+
/**
|
|
2876
|
+
* Coalesces late font-load notifications into one glyph rebuild pass.
|
|
2877
|
+
*/
|
|
2878
|
+
AcTrView2d.prototype.scheduleGlyphRedrawAfterFontLoad = function (fontName) {
|
|
2879
|
+
var _this = this;
|
|
2880
|
+
this.clearFontLoadedRedrawTimer();
|
|
2881
|
+
var epoch = this._convertEpoch;
|
|
2882
|
+
this._fontLoadedRedrawTimer = setTimeout(function () {
|
|
2883
|
+
_this._fontLoadedRedrawTimer = null;
|
|
2884
|
+
if (epoch !== _this._convertEpoch) {
|
|
2885
|
+
return;
|
|
2886
|
+
}
|
|
2887
|
+
void _this.redrawGlyphEntitiesAfterFontLoad(epoch, fontName);
|
|
2888
|
+
}, 50);
|
|
2889
|
+
};
|
|
2890
|
+
/**
|
|
2891
|
+
* Rebuilds text after a late {@link FontManager.events.fontLoaded}.
|
|
2892
|
+
*
|
|
2893
|
+
* Live {@link AcTrGlyphEntity} shells (rare: mid-convert / not yet batched)
|
|
2894
|
+
* are re-drawn in place. Committed text is already flattened into batches and
|
|
2895
|
+
* disposed, so on-demand faces (style `malgun` → Noto Sans KR) need a database
|
|
2896
|
+
* regen once conversion is idle — otherwise Hangul stays baked as '?'.
|
|
2897
|
+
*/
|
|
2898
|
+
AcTrView2d.prototype.redrawGlyphEntitiesAfterFontLoad = function (epoch, fontName) {
|
|
2899
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2900
|
+
var redrawEpoch, glyphs, _a, _b, layout, glyphs_1, glyphs_1_1, glyph, e_12_1, defaults, normalized_1, db;
|
|
2901
|
+
var e_13, _c, e_12, _d;
|
|
2902
|
+
var _e, _f;
|
|
2903
|
+
return __generator(this, function (_g) {
|
|
2904
|
+
switch (_g.label) {
|
|
2905
|
+
case 0:
|
|
2906
|
+
if (epoch !== this._convertEpoch) {
|
|
2907
|
+
return [2 /*return*/];
|
|
2908
|
+
}
|
|
2909
|
+
redrawEpoch = ++this._fontLoadedRedrawEpoch;
|
|
2910
|
+
glyphs = [];
|
|
2911
|
+
try {
|
|
2912
|
+
for (_a = __values(this._scene.layouts.values()), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
2913
|
+
layout = _b.value;
|
|
2914
|
+
layout.layers.forEach(function (layer) {
|
|
2915
|
+
layer.internalObject.traverse(function (obj) {
|
|
2916
|
+
if (obj instanceof AcTrGlyphEntity) {
|
|
2917
|
+
glyphs.push(obj);
|
|
2918
|
+
}
|
|
2919
|
+
});
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
2924
|
+
finally {
|
|
2925
|
+
try {
|
|
2926
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2927
|
+
}
|
|
2928
|
+
finally { if (e_13) throw e_13.error; }
|
|
2929
|
+
}
|
|
2930
|
+
_g.label = 1;
|
|
2931
|
+
case 1:
|
|
2932
|
+
_g.trys.push([1, 6, 7, 8]);
|
|
2933
|
+
glyphs_1 = __values(glyphs), glyphs_1_1 = glyphs_1.next();
|
|
2934
|
+
_g.label = 2;
|
|
2935
|
+
case 2:
|
|
2936
|
+
if (!!glyphs_1_1.done) return [3 /*break*/, 5];
|
|
2937
|
+
glyph = glyphs_1_1.value;
|
|
2938
|
+
if (epoch !== this._convertEpoch ||
|
|
2939
|
+
redrawEpoch !== this._fontLoadedRedrawEpoch) {
|
|
2940
|
+
return [2 /*return*/];
|
|
2941
|
+
}
|
|
2942
|
+
return [4 /*yield*/, glyph.asyncDraw()];
|
|
2943
|
+
case 3:
|
|
2944
|
+
_g.sent();
|
|
2945
|
+
_g.label = 4;
|
|
2946
|
+
case 4:
|
|
2947
|
+
glyphs_1_1 = glyphs_1.next();
|
|
2948
|
+
return [3 /*break*/, 2];
|
|
2949
|
+
case 5: return [3 /*break*/, 8];
|
|
2950
|
+
case 6:
|
|
2951
|
+
e_12_1 = _g.sent();
|
|
2952
|
+
e_12 = { error: e_12_1 };
|
|
2953
|
+
return [3 /*break*/, 8];
|
|
2954
|
+
case 7:
|
|
2955
|
+
try {
|
|
2956
|
+
if (glyphs_1_1 && !glyphs_1_1.done && (_d = glyphs_1.return)) _d.call(glyphs_1);
|
|
2957
|
+
}
|
|
2958
|
+
finally { if (e_12) throw e_12.error; }
|
|
2959
|
+
return [7 /*endfinally*/];
|
|
2960
|
+
case 8:
|
|
2961
|
+
if (glyphs.length > 0) {
|
|
2962
|
+
if (epoch === this._convertEpoch) {
|
|
2963
|
+
this._isDirty = true;
|
|
2964
|
+
}
|
|
2965
|
+
return [2 /*return*/];
|
|
2966
|
+
}
|
|
2967
|
+
// Default preset loads during open are covered by awaitFontsBeforeDraw;
|
|
2968
|
+
// regenerating for those would thrash after every open.
|
|
2969
|
+
if (fontName) {
|
|
2970
|
+
defaults = FontManager.instance.defaultFonts;
|
|
2971
|
+
normalized_1 = fontName.toLowerCase();
|
|
2972
|
+
if (defaults.has(fontName) ||
|
|
2973
|
+
defaults.has(normalized_1) ||
|
|
2974
|
+
__spreadArray([], __read(defaults), false).some(function (name) { return name.toLowerCase() === normalized_1; })) {
|
|
2975
|
+
return [2 /*return*/];
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
if (epoch !== this._convertEpoch ||
|
|
2979
|
+
redrawEpoch !== this._fontLoadedRedrawEpoch ||
|
|
2980
|
+
this.isProcessingEntities) {
|
|
2981
|
+
return [2 /*return*/];
|
|
2982
|
+
}
|
|
2983
|
+
db = (_f = (_e = AcApDocManager.instance) === null || _e === void 0 ? void 0 : _e.curDocument) === null || _f === void 0 ? void 0 : _f.database;
|
|
2984
|
+
if (!db) {
|
|
2985
|
+
return [2 /*return*/];
|
|
2986
|
+
}
|
|
2987
|
+
db.regen();
|
|
2988
|
+
return [2 /*return*/];
|
|
2989
|
+
}
|
|
2990
|
+
});
|
|
2991
|
+
});
|
|
2764
2992
|
};
|
|
2765
2993
|
AcTrView2d.prototype.groupHasPendingGlyphGeometry = function (group) {
|
|
2766
2994
|
var pending = false;
|
|
@@ -2774,32 +3002,69 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2774
3002
|
/**
|
|
2775
3003
|
* Runs glyph/group geometry finalize off the main convert loop so other
|
|
2776
3004
|
* entities keep converting while fonts download.
|
|
3005
|
+
*
|
|
3006
|
+
* Jobs are queued with bounded concurrency — unbounded parallel
|
|
3007
|
+
* `asyncDraw` on large INSERT/text drawings can freeze the main thread
|
|
3008
|
+
* during the "Rendering drawing ..." stage.
|
|
2777
3009
|
*/
|
|
2778
3010
|
AcTrView2d.prototype.enqueueDeferredGeometry = function (run, epoch) {
|
|
2779
|
-
var _this = this;
|
|
2780
3011
|
if (epoch !== this._convertEpoch) {
|
|
2781
3012
|
return;
|
|
2782
3013
|
}
|
|
2783
3014
|
this._pendingGeometryJobs++;
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
3015
|
+
this._deferredGeometryQueue.push({ run: run, epoch: epoch });
|
|
3016
|
+
this.pumpDeferredGeometryQueue();
|
|
3017
|
+
};
|
|
3018
|
+
/**
|
|
3019
|
+
* Starts queued deferred geometry jobs up to
|
|
3020
|
+
* {@link DEFERRED_GEOMETRY_CONCURRENCY}.
|
|
3021
|
+
*/
|
|
3022
|
+
AcTrView2d.prototype.pumpDeferredGeometryQueue = function () {
|
|
3023
|
+
var _this = this;
|
|
3024
|
+
var _loop_3 = function () {
|
|
3025
|
+
var job = this_2._deferredGeometryQueue.shift();
|
|
3026
|
+
if (job.epoch !== this_2._convertEpoch) {
|
|
3027
|
+
this_2._pendingGeometryJobs = Math.max(0, this_2._pendingGeometryJobs - 1);
|
|
3028
|
+
return "continue";
|
|
2790
3029
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
if (_this._pendingGeometryJobs === 0) {
|
|
3030
|
+
this_2._deferredGeometryActive++;
|
|
3031
|
+
void job
|
|
3032
|
+
.run()
|
|
3033
|
+
.then(function () {
|
|
3034
|
+
// Convert counter often hits 0 before fonts finish; without this,
|
|
3035
|
+
// text added later never paints until the user pans/zooms.
|
|
3036
|
+
if (job.epoch === _this._convertEpoch) {
|
|
2799
3037
|
_this._isDirty = true;
|
|
2800
3038
|
}
|
|
2801
|
-
}
|
|
2802
|
-
|
|
3039
|
+
})
|
|
3040
|
+
.catch(function (error) {
|
|
3041
|
+
log.error('[AcTrView2d] Deferred entity geometry failed:', error);
|
|
3042
|
+
})
|
|
3043
|
+
.finally(function () {
|
|
3044
|
+
_this._deferredGeometryActive = Math.max(0, _this._deferredGeometryActive - 1);
|
|
3045
|
+
if (job.epoch === _this._convertEpoch) {
|
|
3046
|
+
_this._pendingGeometryJobs = Math.max(0, _this._pendingGeometryJobs - 1);
|
|
3047
|
+
if (_this._pendingGeometryJobs === 0) {
|
|
3048
|
+
_this._isDirty = true;
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
_this.pumpDeferredGeometryQueue();
|
|
3052
|
+
});
|
|
3053
|
+
};
|
|
3054
|
+
var this_2 = this;
|
|
3055
|
+
while (this._deferredGeometryActive <
|
|
3056
|
+
AcTrView2d.DEFERRED_GEOMETRY_CONCURRENCY &&
|
|
3057
|
+
this._deferredGeometryQueue.length > 0) {
|
|
3058
|
+
_loop_3();
|
|
3059
|
+
}
|
|
3060
|
+
};
|
|
3061
|
+
/** Drops queued deferred geometry and resets counters for a new epoch. */
|
|
3062
|
+
AcTrView2d.prototype.resetDeferredGeometryQueue = function () {
|
|
3063
|
+
this._deferredGeometryQueue.length = 0;
|
|
3064
|
+
// Keep `_deferredGeometryActive`: in-flight runners still own concurrency
|
|
3065
|
+
// slots until their `finally` runs. Zeroing here lets pump over-schedule
|
|
3066
|
+
// when those completions decrement the counter afterward.
|
|
3067
|
+
this._pendingGeometryJobs = 0;
|
|
2803
3068
|
};
|
|
2804
3069
|
/**
|
|
2805
3070
|
* Waits until side-pool glyph/group jobs for the current convert epoch finish.
|
|
@@ -2843,7 +3108,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2843
3108
|
* paper layouts.
|
|
2844
3109
|
*/
|
|
2845
3110
|
AcTrView2d.prototype.ensureViewportViews = function (blockTableRecord, layoutView) {
|
|
2846
|
-
var
|
|
3111
|
+
var e_14, _a;
|
|
2847
3112
|
var iterator = blockTableRecord.newIterator();
|
|
2848
3113
|
try {
|
|
2849
3114
|
for (var iterator_2 = __values(iterator), iterator_2_1 = iterator_2.next(); !iterator_2_1.done; iterator_2_1 = iterator_2.next()) {
|
|
@@ -2856,12 +3121,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2856
3121
|
layoutView.addViewport(viewportView);
|
|
2857
3122
|
}
|
|
2858
3123
|
}
|
|
2859
|
-
catch (
|
|
3124
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
2860
3125
|
finally {
|
|
2861
3126
|
try {
|
|
2862
3127
|
if (iterator_2_1 && !iterator_2_1.done && (_a = iterator_2.return)) _a.call(iterator_2);
|
|
2863
3128
|
}
|
|
2864
|
-
finally { if (
|
|
3129
|
+
finally { if (e_14) throw e_14.error; }
|
|
2865
3130
|
}
|
|
2866
3131
|
};
|
|
2867
3132
|
/**
|
|
@@ -2871,7 +3136,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2871
3136
|
*/
|
|
2872
3137
|
AcTrView2d.prototype.batchConvert = function (entities_3) {
|
|
2873
3138
|
return __awaiter(this, arguments, void 0, function (entities, options) {
|
|
2874
|
-
var epoch, progressive, yieldGate, yieldToEventLoop,
|
|
3139
|
+
var epoch, progressive, yieldGate, yieldToEventLoop, _loop_4, this_3, i;
|
|
2875
3140
|
var _this = this;
|
|
2876
3141
|
if (options === void 0) { options = {}; }
|
|
2877
3142
|
return __generator(this, function (_a) {
|
|
@@ -2879,13 +3144,13 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2879
3144
|
case 0:
|
|
2880
3145
|
epoch = this._convertEpoch;
|
|
2881
3146
|
progressive = this._progressiveRendering && !options.forExport;
|
|
2882
|
-
yieldGate =
|
|
2883
|
-
?
|
|
2884
|
-
:
|
|
3147
|
+
yieldGate = options.forExport
|
|
3148
|
+
? undefined
|
|
3149
|
+
: new AcCmUiYieldGate(AcTrView2d.OPEN_CONVERT_YIELD_BUDGET_MS);
|
|
2885
3150
|
yieldToEventLoop = function () {
|
|
2886
3151
|
return new Promise(function (resolve) { return setTimeout(resolve, 0); });
|
|
2887
3152
|
};
|
|
2888
|
-
|
|
3153
|
+
_loop_4 = function (i) {
|
|
2889
3154
|
var entity, shouldConvert, directMeta, added, threeEntity_1, isMultiLayerGroup, deferGeometry, isExtendBbox_1, commitEntity, layoutView, viewportView, fileName, error_2, didYield;
|
|
2890
3155
|
return __generator(this, function (_b) {
|
|
2891
3156
|
switch (_b.label) {
|
|
@@ -2895,7 +3160,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2895
3160
|
case 1:
|
|
2896
3161
|
_b.trys.push([1, 9, 10, 11]);
|
|
2897
3162
|
// Document was cleared / replaced while this batch was draining.
|
|
2898
|
-
if (epoch !==
|
|
3163
|
+
if (epoch !== this_3._convertEpoch) {
|
|
2899
3164
|
return [2 /*return*/, "continue"];
|
|
2900
3165
|
}
|
|
2901
3166
|
// Skip the default paper-space viewport (`*Paper_Space`) entirely:
|
|
@@ -2914,21 +3179,21 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2914
3179
|
return [2 /*return*/, "continue"];
|
|
2915
3180
|
}
|
|
2916
3181
|
shouldConvert = options.forExport
|
|
2917
|
-
?
|
|
2918
|
-
:
|
|
3182
|
+
? this_3._entityDisplay.shouldConvertForExport(entity)
|
|
3183
|
+
: this_3._entityDisplay.shouldConvert(entity);
|
|
2919
3184
|
if (!shouldConvert) {
|
|
2920
3185
|
return [2 /*return*/, "continue"];
|
|
2921
3186
|
}
|
|
2922
|
-
directMeta = tryBuildDirectEntityMeta(entity,
|
|
3187
|
+
directMeta = tryBuildDirectEntityMeta(entity, this_3._renderer);
|
|
2923
3188
|
if (directMeta) {
|
|
2924
3189
|
added = false;
|
|
2925
3190
|
try {
|
|
2926
|
-
added =
|
|
3191
|
+
added = this_3._scene.addDirectEntity(directMeta, shouldExtendBboxForDirectEntity(entity));
|
|
2927
3192
|
if (added) {
|
|
2928
|
-
|
|
3193
|
+
this_3.applySessionHiddenObjectState(entity.objectId);
|
|
2929
3194
|
if (progressive) {
|
|
2930
|
-
|
|
2931
|
-
|
|
3195
|
+
this_3.markProgressiveDirty();
|
|
3196
|
+
this_3._progressiveOpenFit.afterGeometryBatch(function () { return _this.resolveLayoutFitBox(); }, i);
|
|
2932
3197
|
}
|
|
2933
3198
|
}
|
|
2934
3199
|
}
|
|
@@ -2940,7 +3205,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2940
3205
|
}
|
|
2941
3206
|
// Append refused (e.g. invisible) — fall through to the legacy path.
|
|
2942
3207
|
}
|
|
2943
|
-
threeEntity_1 =
|
|
3208
|
+
threeEntity_1 = this_3.drawEntity(entity, false);
|
|
2944
3209
|
// Viewports may produce no border geometry (e.g. on a no-plot layer) while
|
|
2945
3210
|
// still needing an AcTrViewportView for model content below.
|
|
2946
3211
|
if (!threeEntity_1 && !(entity instanceof AcDbViewport))
|
|
@@ -2954,19 +3219,19 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
2954
3219
|
threeEntity_1.isOnTheSameLayer) {
|
|
2955
3220
|
// Even when a block expands to a single layer bucket, children authored on
|
|
2956
3221
|
// layer "0" still inherit the INSERT layer for ByLayer traits (color, etc.).
|
|
2957
|
-
|
|
3222
|
+
this_3._inheritedLayerMaterialMapper.remap(threeEntity_1.children, '0', threeEntity_1.layerName);
|
|
2958
3223
|
threeEntity_1.userData.insertLayerName = threeEntity_1.layerName;
|
|
2959
3224
|
}
|
|
2960
3225
|
isMultiLayerGroup = threeEntity_1 instanceof AcTrGroup &&
|
|
2961
3226
|
!threeEntity_1.isOnTheSameLayer;
|
|
2962
|
-
deferGeometry = !options.forExport &&
|
|
3227
|
+
deferGeometry = !options.forExport && this_3.needsDeferredFontGeometry(threeEntity_1);
|
|
2963
3228
|
if (!isMultiLayerGroup) return [3 /*break*/, 5];
|
|
2964
3229
|
if (!deferGeometry) return [3 /*break*/, 2];
|
|
2965
|
-
|
|
3230
|
+
this_3.enqueueDeferredGeometry(function () {
|
|
2966
3231
|
return _this.handleGroup(threeEntity_1, progressive, epoch);
|
|
2967
3232
|
}, epoch);
|
|
2968
3233
|
return [3 /*break*/, 4];
|
|
2969
|
-
case 2: return [4 /*yield*/,
|
|
3234
|
+
case 2: return [4 /*yield*/, this_3.handleGroup(threeEntity_1, progressive, epoch)];
|
|
2970
3235
|
case 3:
|
|
2971
3236
|
_b.sent();
|
|
2972
3237
|
_b.label = 4;
|
|
@@ -3000,14 +3265,14 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3000
3265
|
});
|
|
3001
3266
|
}); };
|
|
3002
3267
|
if (!deferGeometry) return [3 /*break*/, 6];
|
|
3003
|
-
|
|
3268
|
+
this_3.enqueueDeferredGeometry(commitEntity, epoch);
|
|
3004
3269
|
return [3 /*break*/, 8];
|
|
3005
3270
|
case 6: return [4 /*yield*/, commitEntity()];
|
|
3006
3271
|
case 7:
|
|
3007
3272
|
_b.sent();
|
|
3008
3273
|
_b.label = 8;
|
|
3009
3274
|
case 8:
|
|
3010
|
-
if (epoch !==
|
|
3275
|
+
if (epoch !== this_3._convertEpoch) {
|
|
3011
3276
|
return [2 /*return*/, "continue"];
|
|
3012
3277
|
}
|
|
3013
3278
|
if (entity instanceof AcDbViewport) {
|
|
@@ -3017,9 +3282,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3017
3282
|
// a defensive guard in case a future refactor reorders the
|
|
3018
3283
|
// early-skip — it costs ~nothing and prevents a regression.
|
|
3019
3284
|
if (!AcTrViewportView.isDefaultPaperSpaceViewport(entity)) {
|
|
3020
|
-
layoutView =
|
|
3285
|
+
layoutView = this_3._layoutViewManager.getAt(entity.ownerId);
|
|
3021
3286
|
if (layoutView) {
|
|
3022
|
-
viewportView = new AcTrViewportView(layoutView, entity.toGiViewport(),
|
|
3287
|
+
viewportView = new AcTrViewportView(layoutView, entity.toGiViewport(), this_3._renderer);
|
|
3023
3288
|
layoutView.addViewport(viewportView);
|
|
3024
3289
|
}
|
|
3025
3290
|
}
|
|
@@ -3027,7 +3292,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3027
3292
|
else if (entity instanceof AcDbRasterImage) {
|
|
3028
3293
|
fileName = entity.imageFileName;
|
|
3029
3294
|
if (fileName && !entity.image) {
|
|
3030
|
-
|
|
3295
|
+
this_3._missedImages.set(entity.objectId, fileName);
|
|
3031
3296
|
}
|
|
3032
3297
|
}
|
|
3033
3298
|
return [3 /*break*/, 11];
|
|
@@ -3038,12 +3303,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3038
3303
|
case 10:
|
|
3039
3304
|
// Counter was reset in clear() when the epoch advanced; do not
|
|
3040
3305
|
// decrease again or isProcessingEntities can go negative/warn.
|
|
3041
|
-
if (epoch ===
|
|
3042
|
-
|
|
3306
|
+
if (epoch === this_3._convertEpoch) {
|
|
3307
|
+
this_3.decreaseNumOfEntitiesToProcess();
|
|
3043
3308
|
}
|
|
3044
3309
|
return [7 /*endfinally*/];
|
|
3045
3310
|
case 11:
|
|
3046
|
-
if (epoch !==
|
|
3311
|
+
if (epoch !== this_3._convertEpoch) {
|
|
3047
3312
|
return [2 /*return*/, "continue"];
|
|
3048
3313
|
}
|
|
3049
3314
|
if (!yieldGate) return [3 /*break*/, 13];
|
|
@@ -3051,19 +3316,19 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3051
3316
|
case 12:
|
|
3052
3317
|
didYield = _b.sent();
|
|
3053
3318
|
if (didYield) {
|
|
3054
|
-
|
|
3319
|
+
this_3._progressiveYieldCount++;
|
|
3055
3320
|
}
|
|
3056
3321
|
_b.label = 13;
|
|
3057
3322
|
case 13: return [2 /*return*/];
|
|
3058
3323
|
}
|
|
3059
3324
|
});
|
|
3060
3325
|
};
|
|
3061
|
-
|
|
3326
|
+
this_3 = this;
|
|
3062
3327
|
i = 0;
|
|
3063
3328
|
_a.label = 1;
|
|
3064
3329
|
case 1:
|
|
3065
3330
|
if (!(i < entities.length)) return [3 /*break*/, 4];
|
|
3066
|
-
return [5 /*yield**/,
|
|
3331
|
+
return [5 /*yield**/, _loop_4(i)];
|
|
3067
3332
|
case 2:
|
|
3068
3333
|
_a.sent();
|
|
3069
3334
|
_a.label = 3;
|
|
@@ -3098,7 +3363,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3098
3363
|
AcTrView2d.prototype.handleGroup = function (group_1, progressive_1) {
|
|
3099
3364
|
return __awaiter(this, arguments, void 0, function (group, progressive, epoch) {
|
|
3100
3365
|
var children, objectsGroupByLayer, children_1, children_1_1, child, renderContext, groupObjectId, groupLayerName, groupChildBoxes, aggregateSpatialBbox;
|
|
3101
|
-
var
|
|
3366
|
+
var e_15, _a;
|
|
3102
3367
|
var _this = this;
|
|
3103
3368
|
if (epoch === void 0) { epoch = this._convertEpoch; }
|
|
3104
3369
|
return __generator(this, function (_b) {
|
|
@@ -3140,12 +3405,12 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3140
3405
|
child.parent = null;
|
|
3141
3406
|
}
|
|
3142
3407
|
}
|
|
3143
|
-
catch (
|
|
3408
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
3144
3409
|
finally {
|
|
3145
3410
|
try {
|
|
3146
3411
|
if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1);
|
|
3147
3412
|
}
|
|
3148
|
-
finally { if (
|
|
3413
|
+
finally { if (e_15) throw e_15.error; }
|
|
3149
3414
|
}
|
|
3150
3415
|
renderContext = group.renderContext;
|
|
3151
3416
|
groupObjectId = group.objectId;
|
|
@@ -3191,7 +3456,11 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3191
3456
|
// buckets, so selection/highlight still maps back to the same database object.
|
|
3192
3457
|
// Within each layer bucket, the object id remains unique in scene indexing.
|
|
3193
3458
|
var entity = new AcTrEntity(renderContext);
|
|
3194
|
-
|
|
3459
|
+
// Copy the INSERT matrix exactly — applyMatrix4 decomposes and drops
|
|
3460
|
+
// reflections from mirrored block scales.
|
|
3461
|
+
entity.matrix.copy(group.matrix);
|
|
3462
|
+
entity.matrixAutoUpdate = false;
|
|
3463
|
+
entity.matrixWorldNeedsUpdate = true;
|
|
3195
3464
|
entity.objectId = groupObjectId;
|
|
3196
3465
|
entity.ownerId = group.ownerId;
|
|
3197
3466
|
// If block-definition entities are on layer "0", this bucket now uses the layer
|
|
@@ -3207,6 +3476,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3207
3476
|
for (var i = 0; i < objects.length; i++) {
|
|
3208
3477
|
entity.add(objects[i]);
|
|
3209
3478
|
}
|
|
3479
|
+
entity.updateMatrixWorld(true);
|
|
3210
3480
|
_this._layerAppearance.refreshTextMaterialsInObjectTree(entity);
|
|
3211
3481
|
_this._scene.addEntity(entity, true);
|
|
3212
3482
|
_this.applySessionHiddenObjectState(groupObjectId);
|
|
@@ -3239,17 +3509,27 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
3239
3509
|
}
|
|
3240
3510
|
};
|
|
3241
3511
|
/**
|
|
3242
|
-
* Wall-time between cooperative yields during
|
|
3243
|
-
*
|
|
3244
|
-
*
|
|
3512
|
+
* Wall-time between cooperative yields during scene convert (ms).
|
|
3513
|
+
* Used for both progressive and non-progressive opens so large drawings
|
|
3514
|
+
* (e.g. multi-sheet architectural DWGs) cannot freeze the main thread long
|
|
3515
|
+
* enough for Chromium to show "Page Unresponsive" while the overlay still
|
|
3516
|
+
* reads "Rendering drawing ...". Kept relatively large so convert
|
|
3517
|
+
* throughput stays high; smaller budgets made open 2–3× slower.
|
|
3245
3518
|
*/
|
|
3246
|
-
AcTrView2d.
|
|
3519
|
+
AcTrView2d.OPEN_CONVERT_YIELD_BUDGET_MS = 300;
|
|
3247
3520
|
/**
|
|
3248
3521
|
* Minimum interval between progressive mid-open paints (ms).
|
|
3249
3522
|
* Full-scene WebGL paints dominate open wall time on large drawings;
|
|
3250
|
-
* paint much less often than we yield.
|
|
3523
|
+
* paint much less often than we yield. Independent of convert yields —
|
|
3524
|
+
* non-progressive opens still yield without mid-open WebGL paints.
|
|
3251
3525
|
*/
|
|
3252
3526
|
AcTrView2d.PROGRESSIVE_OPEN_PAINT_INTERVAL_MS = 1000;
|
|
3527
|
+
/**
|
|
3528
|
+
* Max concurrent deferred glyph/INSERT geometry finalizers. Large drawings
|
|
3529
|
+
* enqueue thousands of jobs; keep this modest to limit peak JS heap during
|
|
3530
|
+
* open while retaining reasonable text throughput after convert finishes.
|
|
3531
|
+
*/
|
|
3532
|
+
AcTrView2d.DEFERRED_GEOMETRY_CONCURRENCY = 8;
|
|
3253
3533
|
return AcTrView2d;
|
|
3254
3534
|
}(AcEdBaseView));
|
|
3255
3535
|
export { AcTrView2d };
|