@mlightcad/cad-simple-viewer 1.5.6 → 1.5.7
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/README.md +66 -1
- package/dist/cad-simple-viewer.js +30394 -28405
- package/dist/cad-simple-viewer.umd.cjs +150 -158
- package/dist/dxf-parser-worker.js +796 -707
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +15 -5
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +56 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +112 -14
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +81 -0
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +154 -0
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApLayerSessionState.d.ts +15 -0
- package/lib/app/AcApLayerSessionState.d.ts.map +1 -0
- package/lib/app/AcApLayerSessionState.js +2 -0
- package/lib/app/AcApLayerSessionState.js.map +1 -0
- package/lib/app/AcApOpenFileDialog.d.ts +35 -0
- package/lib/app/AcApOpenFileDialog.d.ts.map +1 -0
- package/lib/app/AcApOpenFileDialog.js +192 -0
- package/lib/app/AcApOpenFileDialog.js.map +1 -0
- package/lib/app/AcApWebworkerReadiness.d.ts +18 -0
- package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -0
- package/lib/app/AcApWebworkerReadiness.js +126 -0
- package/lib/app/AcApWebworkerReadiness.js.map +1 -0
- package/lib/app/index.d.ts +3 -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/AcApOpenCmd.d.ts +3 -22
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +3 -22
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApRedoCmd.d.ts +10 -0
- package/lib/command/AcApRedoCmd.d.ts.map +1 -0
- package/lib/command/AcApRedoCmd.js +85 -0
- package/lib/command/AcApRedoCmd.js.map +1 -0
- package/lib/command/AcApUndoCmd.d.ts +10 -0
- package/lib/command/AcApUndoCmd.d.ts.map +1 -0
- package/lib/command/AcApUndoCmd.js +85 -0
- package/lib/command/AcApUndoCmd.js.map +1 -0
- package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.js +12 -4
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
- package/lib/command/draw/AcApLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApLineCmd.js +8 -2
- package/lib/command/draw/AcApLineCmd.js.map +1 -1
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMLineCmd.js +2 -0
- package/lib/command/draw/AcApMLineCmd.js.map +1 -1
- package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolylineCmd.js +3 -0
- package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
- package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApSplineCmd.js +2 -0
- package/lib/command/draw/AcApSplineCmd.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/layer/AcApLayerCmd.d.ts +3 -187
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCmd.js +52 -376
- package/lib/command/layer/AcApLayerCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -27
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.js +18 -67
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -25
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.js +22 -155
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -9
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.js +27 -39
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -24
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.js +14 -183
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -33
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.js +18 -55
- package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerMutationCmd.d.ts +13 -0
- package/lib/command/layer/AcApLayerMutationCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerMutationCmd.js +42 -0
- package/lib/command/layer/AcApLayerMutationCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts +2 -2
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOffCmd.js +27 -28
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -15
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.js +6 -49
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.d.ts +2 -68
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.js +4 -152
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -22
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.js +6 -61
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -37
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.js +7 -108
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -33
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.js +18 -55
- package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
- package/lib/command/modify/AcApCopyCmd.d.ts +12 -0
- package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApCopyCmd.js +67 -177
- package/lib/command/modify/AcApCopyCmd.js.map +1 -1
- package/lib/command/modify/AcApCopyPreviewJig.d.ts +21 -0
- package/lib/command/modify/AcApCopyPreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApCopyPreviewJig.js +61 -0
- package/lib/command/modify/AcApCopyPreviewJig.js.map +1 -0
- package/lib/command/modify/AcApEraseCmd.d.ts +0 -6
- package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApEraseCmd.js +11 -38
- package/lib/command/modify/AcApEraseCmd.js.map +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.d.ts +0 -7
- package/lib/command/modify/AcApHideObjectsCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.js +0 -7
- package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
- package/lib/command/modify/AcApMoveCmd.d.ts +0 -6
- package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApMoveCmd.js +26 -105
- package/lib/command/modify/AcApMoveCmd.js.map +1 -1
- package/lib/command/modify/AcApMovePreviewJig.d.ts +18 -0
- package/lib/command/modify/AcApMovePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApMovePreviewJig.js +45 -0
- package/lib/command/modify/AcApMovePreviewJig.js.map +1 -0
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.js +5 -33
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
- package/lib/command/modify/AcApRotateCmd.d.ts +2 -2
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApRotateCmd.js +37 -200
- package/lib/command/modify/AcApRotateCmd.js.map +1 -1
- package/lib/command/modify/AcApRotatePreviewJig.d.ts +47 -0
- package/lib/command/modify/AcApRotatePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApRotatePreviewJig.js +97 -0
- package/lib/command/modify/AcApRotatePreviewJig.js.map +1 -0
- package/lib/editor/command/AcEdCommand.d.ts +8 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +48 -5
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +10 -2
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
- package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripAppearance.js +30 -0
- package/lib/editor/grip/AcEdGripAppearance.js.map +1 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +9 -2
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.d.ts +3 -2
- package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.js +9 -6
- package/lib/editor/grip/AcEdGripHandle.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +13 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +54 -14
- package/lib/editor/grip/AcEdGripManager.js.map +1 -1
- package/lib/editor/input/AcEdBatchPreview.d.ts +96 -0
- package/lib/editor/input/AcEdBatchPreview.d.ts.map +1 -0
- package/lib/editor/input/AcEdBatchPreview.js +125 -0
- package/lib/editor/input/AcEdBatchPreview.js.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.js +14 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -1
- package/lib/editor/input/AcEdSelectionPreviewJig.d.ts +109 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.js +185 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.js.map +1 -0
- package/lib/editor/input/index.d.ts +2 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +2 -0
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +10 -2
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +9 -4
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +37 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -12
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSpatialQueryResult.d.ts +28 -0
- package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
- package/lib/editor/view/AcEdSpatialQueryResult.js +65 -1
- package/lib/editor/view/AcEdSpatialQueryResult.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +42 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +56 -4
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/en/command.d.ts +23 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +23 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +23 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +23 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/service/AcApEntitySelection.d.ts +42 -0
- package/lib/service/AcApEntitySelection.d.ts.map +1 -0
- package/lib/service/AcApEntitySelection.js +156 -0
- package/lib/service/AcApEntitySelection.js.map +1 -0
- package/lib/service/AcApEntityService.d.ts +115 -0
- package/lib/service/AcApEntityService.d.ts.map +1 -0
- package/lib/service/AcApEntityService.js +194 -0
- package/lib/service/AcApEntityService.js.map +1 -0
- package/lib/{command/layer → service}/AcApLayerIsoState.d.ts +6 -24
- package/lib/service/AcApLayerIsoState.d.ts.map +1 -0
- package/lib/service/AcApLayerIsoState.js +28 -0
- package/lib/service/AcApLayerIsoState.js.map +1 -0
- package/lib/service/AcApLayerService.d.ts +400 -0
- package/lib/service/AcApLayerService.d.ts.map +1 -0
- package/lib/service/AcApLayerService.js +1240 -0
- package/lib/service/AcApLayerService.js.map +1 -0
- package/lib/service/AcApLayerStore.d.ts +198 -0
- package/lib/service/AcApLayerStore.d.ts.map +1 -0
- package/lib/service/AcApLayerStore.js +335 -0
- package/lib/service/AcApLayerStore.js.map +1 -0
- package/lib/service/AcApServiceEdit.d.ts +18 -0
- package/lib/service/AcApServiceEdit.d.ts.map +1 -0
- package/lib/service/AcApServiceEdit.js +34 -0
- package/lib/service/AcApServiceEdit.js.map +1 -0
- package/lib/service/index.d.ts +16 -0
- package/lib/service/index.d.ts.map +1 -0
- package/lib/service/index.js +16 -0
- package/lib/service/index.js.map +1 -0
- package/lib/service/types.d.ts +116 -0
- package/lib/service/types.d.ts.map +1 -0
- package/lib/service/types.js +5 -0
- package/lib/service/types.js.map +1 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +21 -6
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +56 -10
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +2 -2
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -3
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +2 -2
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js +19 -5
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrSpatialIndex.d.ts +10 -1
- package/lib/spatialIndex/AcTrSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrSpatialIndex.js +7 -1
- package/lib/spatialIndex/AcTrSpatialIndex.js.map +1 -1
- package/lib/util/AcApDatabaseEdit.d.ts +11 -0
- package/lib/util/AcApDatabaseEdit.d.ts.map +1 -0
- package/lib/util/AcApDatabaseEdit.js +20 -0
- package/lib/util/AcApDatabaseEdit.js.map +1 -0
- package/lib/util/AcApGeTransform.d.ts +10 -0
- package/lib/util/AcApGeTransform.d.ts.map +1 -0
- package/lib/util/AcApGeTransform.js +15 -0
- package/lib/util/AcApGeTransform.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/AcEdViewKeyHandler.d.ts +32 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -0
- package/lib/view/AcEdViewKeyHandler.js +101 -0
- package/lib/view/AcEdViewKeyHandler.js.map +1 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts +16 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -1
- package/lib/view/AcTrGroupWcsBboxAssert.js +19 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -1
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +49 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.js +138 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -0
- package/lib/view/AcTrLayer.d.ts +26 -2
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +64 -0
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayerAppearanceController.d.ts +55 -0
- package/lib/view/AcTrLayerAppearanceController.d.ts.map +1 -0
- package/lib/view/AcTrLayerAppearanceController.js +86 -0
- package/lib/view/AcTrLayerAppearanceController.js.map +1 -0
- package/lib/view/AcTrLayout.d.ts +36 -1
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +160 -14
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +47 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +78 -3
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +50 -53
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +195 -312
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/index.d.ts +3 -0
- package/lib/view/index.d.ts.map +1 -1
- package/lib/view/index.js +3 -0
- package/lib/view/index.js.map +1 -1
- package/package.json +7 -7
- package/lib/command/layer/AcApLayerIsoState.d.ts.map +0 -1
- package/lib/command/layer/AcApLayerIsoState.js +0 -53
- package/lib/command/layer/AcApLayerIsoState.js.map +0 -1
|
@@ -61,8 +61,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
import { AcApDocManager } from '../../app';
|
|
64
|
-
import {
|
|
64
|
+
import { AcEdOpenMode, AcEdPromptEntityOptions, AcEdPromptKeywordOptions, AcEdPromptStatus } from '../../editor';
|
|
65
65
|
import { AcApI18n } from '../../i18n';
|
|
66
|
+
import { AcApLayerService } from '../../service';
|
|
67
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
66
68
|
var DEFAULT_SETTINGS = {
|
|
67
69
|
viewportMode: 'Freeze',
|
|
68
70
|
blockSelectionMode: 'None'
|
|
@@ -306,17 +308,6 @@ var AcApLayerFreezeCmd = /** @class */ (function (_super) {
|
|
|
306
308
|
});
|
|
307
309
|
});
|
|
308
310
|
};
|
|
309
|
-
/**
|
|
310
|
-
* Toggles the frozen flag on a layer table record.
|
|
311
|
-
*
|
|
312
|
-
* @param layer - Layer record to update.
|
|
313
|
-
* @param frozen - Whether the layer should be marked frozen.
|
|
314
|
-
*/
|
|
315
|
-
AcApLayerFreezeCmd.prototype.setLayerFrozen = function (layer, frozen) {
|
|
316
|
-
var _a;
|
|
317
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
318
|
-
layer.standardFlags = frozen ? flags | 0x01 : flags & ~0x01;
|
|
319
|
-
};
|
|
320
311
|
/**
|
|
321
312
|
* Resolves the picked entity's layer and freezes it when allowed.
|
|
322
313
|
*
|
|
@@ -328,24 +319,23 @@ var AcApLayerFreezeCmd = /** @class */ (function (_super) {
|
|
|
328
319
|
*/
|
|
329
320
|
AcApLayerFreezeCmd.prototype.freezeEntityLayer = function (context, objectId) {
|
|
330
321
|
var _a;
|
|
331
|
-
var
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this.showMessage("".concat(AcApI18n.t('jig.layfrz.alreadyFrozen'), ": ").concat(layer.name), 'info');
|
|
322
|
+
var service = new AcApLayerService(context.doc.database);
|
|
323
|
+
var result = service.freezeLayerByEntity(objectId);
|
|
324
|
+
if (!result.ok) {
|
|
325
|
+
switch (result.reason) {
|
|
326
|
+
case 'invalid_selection':
|
|
327
|
+
this.showMessage(AcApI18n.t('jig.layfrz.invalidSelection'), 'warning');
|
|
328
|
+
return;
|
|
329
|
+
case 'layer_not_found':
|
|
330
|
+
this.showMessage("".concat(AcApI18n.t('jig.layfrz.layerNotFound'), ": ").concat(result.layerName), 'warning');
|
|
331
|
+
return;
|
|
332
|
+
case 'cannot_change_current':
|
|
333
|
+
this.showMessage(AcApI18n.t('jig.layfrz.cannotFreezeCurrent'), 'warning');
|
|
334
|
+
return;
|
|
335
|
+
case 'already_frozen':
|
|
336
|
+
this.showMessage("".concat(AcApI18n.t('jig.layfrz.alreadyFrozen'), ": ").concat(result.layerName), 'info');
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
349
339
|
return;
|
|
350
340
|
}
|
|
351
341
|
if (AcApLayerFreezeCmd._settings.viewportMode === 'Vpfreeze' &&
|
|
@@ -354,12 +344,11 @@ var AcApLayerFreezeCmd = /** @class */ (function (_super) {
|
|
|
354
344
|
this._vpfreezeHintShown = true;
|
|
355
345
|
}
|
|
356
346
|
this._history.push({
|
|
357
|
-
layerName:
|
|
358
|
-
wasFrozen:
|
|
347
|
+
layerName: result.layerName,
|
|
348
|
+
wasFrozen: (_a = result.previousFrozen) !== null && _a !== void 0 ? _a : false
|
|
359
349
|
});
|
|
360
|
-
this.setLayerFrozen(layer, true);
|
|
361
350
|
context.view.selectionSet.clear();
|
|
362
|
-
this.showMessage("".concat(AcApI18n.t('jig.layfrz.frozen'), ": ").concat(
|
|
351
|
+
this.showMessage("".concat(AcApI18n.t('jig.layfrz.frozen'), ": ").concat(result.layerName), 'success');
|
|
363
352
|
};
|
|
364
353
|
/**
|
|
365
354
|
* Restores the most recently frozen layer state captured during this run.
|
|
@@ -372,17 +361,16 @@ var AcApLayerFreezeCmd = /** @class */ (function (_super) {
|
|
|
372
361
|
this.showMessage(AcApI18n.t('jig.layfrz.nothingToUndo'), 'warning');
|
|
373
362
|
return;
|
|
374
363
|
}
|
|
375
|
-
var
|
|
376
|
-
if (!
|
|
364
|
+
var service = new AcApLayerService(context.doc.database);
|
|
365
|
+
if (!service.setLayerFrozenByName(history.layerName, history.wasFrozen)) {
|
|
377
366
|
this.showMessage("".concat(AcApI18n.t('jig.layfrz.layerNotFound'), ": ").concat(history.layerName), 'warning');
|
|
378
367
|
return;
|
|
379
368
|
}
|
|
380
|
-
this.setLayerFrozen(layer, history.wasFrozen);
|
|
381
369
|
context.view.selectionSet.clear();
|
|
382
|
-
this.showMessage("".concat(AcApI18n.t('jig.layfrz.restored'), ": ").concat(
|
|
370
|
+
this.showMessage("".concat(AcApI18n.t('jig.layfrz.restored'), ": ").concat(history.layerName), 'success');
|
|
383
371
|
};
|
|
384
372
|
AcApLayerFreezeCmd._settings = __assign({}, DEFAULT_SETTINGS);
|
|
385
373
|
return AcApLayerFreezeCmd;
|
|
386
|
-
}(
|
|
374
|
+
}(AcApLayerMutationCmd));
|
|
387
375
|
export { AcApLayerFreezeCmd };
|
|
388
376
|
//# sourceMappingURL=AcApLayerFreezeCmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerFreezeCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerFreezeCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"AcApLayerFreezeCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerFreezeCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAsE7D,IAAM,gBAAgB,GAAmB;IACvC,YAAY,EAAE,QAAQ;IACtB,kBAAkB,EAAE,MAAM;CAC3B,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH;IAAwC,sCAAoB;IAM1D;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QAPD,cAAQ,GAAyB,EAAE,CAAA;QACnC,wBAAkB,GAAG,KAAK,CAAA;QAOhC,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAED;;;;;;;;OAQG;IACG,oCAAO,GAAb,UAAc,OAAoB;;;;;;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CAAC,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACxE,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,eAAK,OAAO,CAAC,SAAS,CAAE,EACjE,SAAS,CACV,CAAA;YACD,OAAM;QACR,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,eAAK,OAAO,CAAC,SAAS,CAAE,EAC5D,SAAS,CACV,CAAA;IACH,CAAC;IAxTc,4BAAS,gBAAwB,gBAAgB,CAAxC,CAA0C;IAyTpE,yBAAC;CAAA,AA1TD,CAAwC,oBAAoB,GA0T3D;SA1TY,kBAAkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AcApContext } from '../../app';
|
|
2
|
-
import {
|
|
2
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
3
3
|
/**
|
|
4
4
|
* AutoCAD-like `LAYISO` command.
|
|
5
5
|
*
|
|
@@ -12,7 +12,7 @@ import { AcEdCommand } from '../../editor';
|
|
|
12
12
|
* - Locked-layer fading is not rendered, so `Lock and fade` falls back to
|
|
13
13
|
* locking non-isolated layers without changing their visibility.
|
|
14
14
|
*/
|
|
15
|
-
export declare class AcApLayerIsoCmd extends
|
|
15
|
+
export declare class AcApLayerIsoCmd extends AcApLayerMutationCmd {
|
|
16
16
|
private static _settings;
|
|
17
17
|
private _vpfreezeHintShown;
|
|
18
18
|
private _lockFadeHintShown;
|
|
@@ -59,20 +59,6 @@ export declare class AcApLayerIsoCmd extends AcEdCommand {
|
|
|
59
59
|
* @returns Resolves when the prompt is dismissed or the setting is updated.
|
|
60
60
|
*/
|
|
61
61
|
private promptOffMode;
|
|
62
|
-
/**
|
|
63
|
-
* Sets or clears the frozen bit while preserving other layer flags.
|
|
64
|
-
*
|
|
65
|
-
* @param layer - Target layer table record.
|
|
66
|
-
* @param frozen - Whether the layer should be marked frozen.
|
|
67
|
-
*/
|
|
68
|
-
private setLayerFrozen;
|
|
69
|
-
/**
|
|
70
|
-
* Sets or clears the locked bit while preserving other layer flags.
|
|
71
|
-
*
|
|
72
|
-
* @param layer - Target layer table record.
|
|
73
|
-
* @param locked - Whether the layer should be marked locked.
|
|
74
|
-
*/
|
|
75
|
-
private setLayerLocked;
|
|
76
62
|
/**
|
|
77
63
|
* Resolves selected entities to layer names and applies isolation.
|
|
78
64
|
*
|
|
@@ -80,13 +66,5 @@ export declare class AcApLayerIsoCmd extends AcEdCommand {
|
|
|
80
66
|
* @param objectIds - Entity ids selected by the user.
|
|
81
67
|
*/
|
|
82
68
|
private isolateSelectedObjectLayers;
|
|
83
|
-
/**
|
|
84
|
-
* Collects distinct layer names from selected entity ids.
|
|
85
|
-
*
|
|
86
|
-
* @param context - Active application context containing the drawing database.
|
|
87
|
-
* @param objectIds - Selected entity identifiers.
|
|
88
|
-
* @returns Layer names resolved from valid selected entities.
|
|
89
|
-
*/
|
|
90
|
-
private collectSelectedLayerNames;
|
|
91
69
|
}
|
|
92
70
|
//# sourceMappingURL=AcApLayerIsoCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerIsoCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerIsoCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApLayerIsoCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerIsoCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AASvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAoD7D;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,SAAQ,oBAAoB;IACvD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0C;IAElE,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,kBAAkB,CAAQ;IAElC;;OAEG;;IAMH;;;;;;;;;OASG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAyBlC;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAWlB;;;;OAIG;YACW,eAAe;IA4B7B;;;;OAIG;YACW,WAAW;IAsCzB;;;;;;;OAOG;YACW,aAAa;IAmC3B;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;CAqDpC"}
|
|
@@ -60,46 +60,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
60
60
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
var __values = (this && this.__values) || function(o) {
|
|
64
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
65
|
-
if (m) return m.call(o);
|
|
66
|
-
if (o && typeof o.length === "number") return {
|
|
67
|
-
next: function () {
|
|
68
|
-
if (o && i >= o.length) o = void 0;
|
|
69
|
-
return { value: o && o[i++], done: !o };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
73
|
-
};
|
|
74
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
75
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
76
|
-
if (!m) return o;
|
|
77
|
-
var i = m.call(o), r, ar = [], e;
|
|
78
|
-
try {
|
|
79
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
80
|
-
}
|
|
81
|
-
catch (error) { e = { error: error }; }
|
|
82
|
-
finally {
|
|
83
|
-
try {
|
|
84
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
85
|
-
}
|
|
86
|
-
finally { if (e) throw e.error; }
|
|
87
|
-
}
|
|
88
|
-
return ar;
|
|
89
|
-
};
|
|
90
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
91
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
92
|
-
if (ar || !(i in from)) {
|
|
93
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
94
|
-
ar[i] = from[i];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
98
|
-
};
|
|
99
63
|
import { AcApDocManager } from '../../app';
|
|
100
|
-
import {
|
|
64
|
+
import { AcEdOpenMode, AcEdPromptKeywordOptions, AcEdPromptSelectionOptions, AcEdPromptStatus } from '../../editor';
|
|
101
65
|
import { AcApI18n } from '../../i18n';
|
|
102
|
-
import {
|
|
66
|
+
import { AcApLayerService } from '../../service';
|
|
67
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
103
68
|
var DEFAULT_SETTINGS = {
|
|
104
69
|
isolationMode: 'Off',
|
|
105
70
|
offMode: 'Off'
|
|
@@ -299,28 +264,6 @@ var AcApLayerIsoCmd = /** @class */ (function (_super) {
|
|
|
299
264
|
});
|
|
300
265
|
});
|
|
301
266
|
};
|
|
302
|
-
/**
|
|
303
|
-
* Sets or clears the frozen bit while preserving other layer flags.
|
|
304
|
-
*
|
|
305
|
-
* @param layer - Target layer table record.
|
|
306
|
-
* @param frozen - Whether the layer should be marked frozen.
|
|
307
|
-
*/
|
|
308
|
-
AcApLayerIsoCmd.prototype.setLayerFrozen = function (layer, frozen) {
|
|
309
|
-
var _a;
|
|
310
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
311
|
-
layer.standardFlags = frozen ? flags | 0x01 : flags & ~0x01;
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* Sets or clears the locked bit while preserving other layer flags.
|
|
315
|
-
*
|
|
316
|
-
* @param layer - Target layer table record.
|
|
317
|
-
* @param locked - Whether the layer should be marked locked.
|
|
318
|
-
*/
|
|
319
|
-
AcApLayerIsoCmd.prototype.setLayerLocked = function (layer, locked) {
|
|
320
|
-
var _a;
|
|
321
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
322
|
-
layer.standardFlags = locked ? flags | 0x04 : flags & ~0x04;
|
|
323
|
-
};
|
|
324
267
|
/**
|
|
325
268
|
* Resolves selected entities to layer names and applies isolation.
|
|
326
269
|
*
|
|
@@ -328,102 +271,20 @@ var AcApLayerIsoCmd = /** @class */ (function (_super) {
|
|
|
328
271
|
* @param objectIds - Entity ids selected by the user.
|
|
329
272
|
*/
|
|
330
273
|
AcApLayerIsoCmd.prototype.isolateSelectedObjectLayers = function (context, objectIds) {
|
|
331
|
-
var
|
|
332
|
-
var
|
|
274
|
+
var service = new AcApLayerService(context.doc.database);
|
|
275
|
+
var _a = service.collectLayerNamesFromEntities(objectIds), layerNames = _a.layerNames, missingLayerNames = _a.missingLayerNames;
|
|
276
|
+
if (missingLayerNames.length > 0) {
|
|
277
|
+
this.showMessage("".concat(AcApI18n.t('jig.layiso.layerNotFound'), ": ").concat(missingLayerNames.join(', ')), 'warning');
|
|
278
|
+
}
|
|
333
279
|
if (layerNames.length === 0) {
|
|
334
280
|
this.showMessage(AcApI18n.t('jig.layiso.noLayers'), 'warning');
|
|
335
281
|
return;
|
|
336
282
|
}
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
var currentLayerBefore = db.clayer;
|
|
342
|
-
var beforeStates = new Map();
|
|
343
|
-
try {
|
|
344
|
-
for (var _d = __values(table.newIterator()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
345
|
-
var layer = _e.value;
|
|
346
|
-
beforeStates.set(layer.name, getLayerIsoState(layer));
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
350
|
-
finally {
|
|
351
|
-
try {
|
|
352
|
-
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
353
|
-
}
|
|
354
|
-
finally { if (e_1) throw e_1.error; }
|
|
355
|
-
}
|
|
356
|
-
if (targetLayer) {
|
|
357
|
-
db.clayer = targetLayer.name;
|
|
358
|
-
}
|
|
359
|
-
var affectedLayerNames = new Set();
|
|
360
|
-
try {
|
|
361
|
-
for (var _f = __values(table.newIterator()), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
362
|
-
var layer = _g.value;
|
|
363
|
-
if (targetNames.has(layer.name)) {
|
|
364
|
-
if (layer.isOff) {
|
|
365
|
-
layer.isOff = false;
|
|
366
|
-
affectedLayerNames.add(layer.name);
|
|
367
|
-
}
|
|
368
|
-
if (layer.isFrozen) {
|
|
369
|
-
this.setLayerFrozen(layer, false);
|
|
370
|
-
affectedLayerNames.add(layer.name);
|
|
371
|
-
}
|
|
372
|
-
if (layer.isLocked) {
|
|
373
|
-
this.setLayerLocked(layer, false);
|
|
374
|
-
affectedLayerNames.add(layer.name);
|
|
375
|
-
}
|
|
376
|
-
continue;
|
|
377
|
-
}
|
|
378
|
-
if (AcApLayerIsoCmd._settings.isolationMode === 'Off') {
|
|
379
|
-
if (!layer.isOff) {
|
|
380
|
-
layer.isOff = true;
|
|
381
|
-
affectedLayerNames.add(layer.name);
|
|
382
|
-
}
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
385
|
-
if (!layer.isLocked) {
|
|
386
|
-
this.setLayerLocked(layer, true);
|
|
387
|
-
affectedLayerNames.add(layer.name);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
392
|
-
finally {
|
|
393
|
-
try {
|
|
394
|
-
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
395
|
-
}
|
|
396
|
-
finally { if (e_2) throw e_2.error; }
|
|
397
|
-
}
|
|
398
|
-
var snapshots = [];
|
|
399
|
-
try {
|
|
400
|
-
for (var _h = __values(table.newIterator()), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
401
|
-
var layer = _j.value;
|
|
402
|
-
var before = beforeStates.get(layer.name);
|
|
403
|
-
if (!before)
|
|
404
|
-
continue;
|
|
405
|
-
var isolated = getLayerIsoState(layer);
|
|
406
|
-
if (!isSameLayerIsoState(before, isolated)) {
|
|
407
|
-
snapshots.push({
|
|
408
|
-
name: layer.name,
|
|
409
|
-
before: before,
|
|
410
|
-
isolated: isolated
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
416
|
-
finally {
|
|
417
|
-
try {
|
|
418
|
-
if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
|
|
419
|
-
}
|
|
420
|
-
finally { if (e_3) throw e_3.error; }
|
|
283
|
+
var result = context.doc.isolateLayers(layerNames, AcApLayerIsoCmd._settings.isolationMode);
|
|
284
|
+
if (!result) {
|
|
285
|
+
this.showMessage(AcApI18n.t('jig.layiso.noLayers'), 'warning');
|
|
286
|
+
return;
|
|
421
287
|
}
|
|
422
|
-
AcApLayerIsoState.set({
|
|
423
|
-
currentLayerBefore: currentLayerBefore,
|
|
424
|
-
currentLayerAfter: db.clayer,
|
|
425
|
-
layers: snapshots
|
|
426
|
-
});
|
|
427
288
|
if (AcApLayerIsoCmd._settings.isolationMode === 'Off' &&
|
|
428
289
|
AcApLayerIsoCmd._settings.offMode === 'Vpfreeze' &&
|
|
429
290
|
!this._vpfreezeHintShown) {
|
|
@@ -436,40 +297,10 @@ var AcApLayerIsoCmd = /** @class */ (function (_super) {
|
|
|
436
297
|
this._lockFadeHintShown = true;
|
|
437
298
|
}
|
|
438
299
|
context.view.selectionSet.clear();
|
|
439
|
-
this.showMessage("".concat(AcApI18n.t('jig.layiso.isolated'), ": ").concat(layerNames.join(', '), " (").concat(AcApI18n.t('jig.layiso.affectedLayers'), ": ").concat(
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* Collects distinct layer names from selected entity ids.
|
|
443
|
-
*
|
|
444
|
-
* @param context - Active application context containing the drawing database.
|
|
445
|
-
* @param objectIds - Selected entity identifiers.
|
|
446
|
-
* @returns Layer names resolved from valid selected entities.
|
|
447
|
-
*/
|
|
448
|
-
AcApLayerIsoCmd.prototype.collectSelectedLayerNames = function (context, objectIds) {
|
|
449
|
-
var db = context.doc.database;
|
|
450
|
-
var names = new Set();
|
|
451
|
-
var missing = new Set();
|
|
452
|
-
objectIds.forEach(function (objectId) {
|
|
453
|
-
var _a;
|
|
454
|
-
var entity = db.tables.blockTable.getEntityById(objectId);
|
|
455
|
-
var layerName = (_a = entity === null || entity === void 0 ? void 0 : entity.layer) === null || _a === void 0 ? void 0 : _a.trim();
|
|
456
|
-
if (!layerName)
|
|
457
|
-
return;
|
|
458
|
-
var layer = db.tables.layerTable.getAt(layerName);
|
|
459
|
-
if (layer) {
|
|
460
|
-
names.add(layer.name);
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
missing.add(layerName);
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
if (missing.size > 0) {
|
|
467
|
-
this.showMessage("".concat(AcApI18n.t('jig.layiso.layerNotFound'), ": ").concat(__spreadArray([], __read(missing), false).join(', ')), 'warning');
|
|
468
|
-
}
|
|
469
|
-
return __spreadArray([], __read(names), false);
|
|
300
|
+
this.showMessage("".concat(AcApI18n.t('jig.layiso.isolated'), ": ").concat(layerNames.join(', '), " (").concat(AcApI18n.t('jig.layiso.affectedLayers'), ": ").concat(result.affectedLayerCount, ")"), 'success');
|
|
470
301
|
};
|
|
471
302
|
AcApLayerIsoCmd._settings = __assign({}, DEFAULT_SETTINGS);
|
|
472
303
|
return AcApLayerIsoCmd;
|
|
473
|
-
}(
|
|
304
|
+
}(AcApLayerMutationCmd));
|
|
474
305
|
export { AcApLayerIsoCmd };
|
|
475
306
|
//# sourceMappingURL=AcApLayerIsoCmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerIsoCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerIsoCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApLayerIsoCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerIsoCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAA0B,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AA+C7D,IAAM,gBAAgB,GAAmB;IACvC,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;CACf,CAAA;AAED;;;;;;;;;;;GAWG;AACH;IAAqC,mCAAoB;IAMvD;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QAPD,wBAAkB,GAAG,KAAK,CAAA;QAC1B,wBAAkB,GAAG,KAAK,CAAA;QAOhC,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAED;;;;;;;;;OASG;IACG,iCAAO,GAAb,UAAc,OAAoB;;;;;;wBAChC,IAAI,CAAC,kBAAkB,GAAG,eAAe,CAAC,SAAS,CAAC,OAAO,KAAK,UAAU,CAAA;wBAC1E,IAAI,CAAC,kBAAkB;4BACrB,eAAe,CAAC,SAAS,CAAC,aAAa,KAAK,aAAa,CAAA;wBAErD,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,YAA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{ AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
3
3
|
/**
|
|
4
4
|
* AutoCAD-like `LAYLCK` command.
|
|
5
|
-
*
|
|
6
|
-
* The command repeatedly asks the user to pick an entity and locks the
|
|
7
|
-
* corresponding layer. It intentionally works by selection instead of layer
|
|
8
|
-
* name entry, matching AutoCAD's `LAYLCK` workflow.
|
|
9
5
|
*/
|
|
10
|
-
export declare class AcApLayerLockCmd extends
|
|
11
|
-
/**
|
|
12
|
-
* Creates a write-enabled `LAYLCK` command instance.
|
|
13
|
-
*/
|
|
6
|
+
export declare class AcApLayerLockCmd extends AcApLayerMutationCmd {
|
|
14
7
|
constructor();
|
|
15
|
-
/**
|
|
16
|
-
* Runs the interactive lock-layer workflow until the user cancels.
|
|
17
|
-
*
|
|
18
|
-
* @param context - Active application context used to read and update the current drawing.
|
|
19
|
-
* @returns Resolves when the command loop ends.
|
|
20
|
-
*/
|
|
21
8
|
execute(context: AcApContext): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Prompts for one entity whose layer should be locked.
|
|
24
|
-
*
|
|
25
|
-
* @returns Picked entity identifier, or `undefined` when the user cancels.
|
|
26
|
-
*/
|
|
27
9
|
private promptSelection;
|
|
28
|
-
/**
|
|
29
|
-
* Sets or clears the locked bit in `standardFlags`.
|
|
30
|
-
*
|
|
31
|
-
* @param layer - Target layer table record.
|
|
32
|
-
* @param locked - `true` to lock, `false` to unlock.
|
|
33
|
-
*/
|
|
34
|
-
private setLayerLocked;
|
|
35
|
-
/**
|
|
36
|
-
* Resolves the picked entity's layer and locks it when needed.
|
|
37
|
-
*
|
|
38
|
-
* @param context - Active application context containing the current database and view.
|
|
39
|
-
* @param objectId - Identifier of the entity selected by the user.
|
|
40
|
-
*/
|
|
41
10
|
private lockEntityLayer;
|
|
42
11
|
}
|
|
43
12
|
//# sourceMappingURL=AcApLayerLockCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerLockCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerLockCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApLayerLockCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerLockCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AAQvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;;IAMlD,OAAO,CAAC,OAAO,EAAE,WAAW;YASpB,eAAe;IAc7B,OAAO,CAAC,eAAe;CA+BxB"}
|
|
@@ -50,31 +50,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
import { AcApDocManager } from '../../app';
|
|
53
|
-
import {
|
|
53
|
+
import { AcEdOpenMode, AcEdPromptEntityOptions, AcEdPromptStatus } from '../../editor';
|
|
54
54
|
import { AcApI18n } from '../../i18n';
|
|
55
|
+
import { AcApLayerService } from '../../service';
|
|
56
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
55
57
|
/**
|
|
56
58
|
* AutoCAD-like `LAYLCK` command.
|
|
57
|
-
*
|
|
58
|
-
* The command repeatedly asks the user to pick an entity and locks the
|
|
59
|
-
* corresponding layer. It intentionally works by selection instead of layer
|
|
60
|
-
* name entry, matching AutoCAD's `LAYLCK` workflow.
|
|
61
59
|
*/
|
|
62
60
|
var AcApLayerLockCmd = /** @class */ (function (_super) {
|
|
63
61
|
__extends(AcApLayerLockCmd, _super);
|
|
64
|
-
/**
|
|
65
|
-
* Creates a write-enabled `LAYLCK` command instance.
|
|
66
|
-
*/
|
|
67
62
|
function AcApLayerLockCmd() {
|
|
68
63
|
var _this = _super.call(this) || this;
|
|
69
64
|
_this.mode = AcEdOpenMode.Write;
|
|
70
65
|
return _this;
|
|
71
66
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Runs the interactive lock-layer workflow until the user cancels.
|
|
74
|
-
*
|
|
75
|
-
* @param context - Active application context used to read and update the current drawing.
|
|
76
|
-
* @returns Resolves when the command loop ends.
|
|
77
|
-
*/
|
|
78
67
|
AcApLayerLockCmd.prototype.execute = function (context) {
|
|
79
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
69
|
var objectId;
|
|
@@ -94,11 +83,6 @@ var AcApLayerLockCmd = /** @class */ (function (_super) {
|
|
|
94
83
|
});
|
|
95
84
|
});
|
|
96
85
|
};
|
|
97
|
-
/**
|
|
98
|
-
* Prompts for one entity whose layer should be locked.
|
|
99
|
-
*
|
|
100
|
-
* @returns Picked entity identifier, or `undefined` when the user cancels.
|
|
101
|
-
*/
|
|
102
86
|
AcApLayerLockCmd.prototype.promptSelection = function () {
|
|
103
87
|
return __awaiter(this, void 0, void 0, function () {
|
|
104
88
|
var prompt, result;
|
|
@@ -120,46 +104,25 @@ var AcApLayerLockCmd = /** @class */ (function (_super) {
|
|
|
120
104
|
});
|
|
121
105
|
});
|
|
122
106
|
};
|
|
123
|
-
/**
|
|
124
|
-
* Sets or clears the locked bit in `standardFlags`.
|
|
125
|
-
*
|
|
126
|
-
* @param layer - Target layer table record.
|
|
127
|
-
* @param locked - `true` to lock, `false` to unlock.
|
|
128
|
-
*/
|
|
129
|
-
AcApLayerLockCmd.prototype.setLayerLocked = function (layer, locked) {
|
|
130
|
-
var _a;
|
|
131
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
132
|
-
layer.standardFlags = locked ? flags | 0x04 : flags & ~0x04;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Resolves the picked entity's layer and locks it when needed.
|
|
136
|
-
*
|
|
137
|
-
* @param context - Active application context containing the current database and view.
|
|
138
|
-
* @param objectId - Identifier of the entity selected by the user.
|
|
139
|
-
*/
|
|
140
107
|
AcApLayerLockCmd.prototype.lockEntityLayer = function (context, objectId) {
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (layer.isLocked) {
|
|
155
|
-
this.showMessage("".concat(AcApI18n.t('jig.laylck.alreadyLocked'), ": ").concat(layer.name), 'info');
|
|
156
|
-
return;
|
|
108
|
+
var result = new AcApLayerService(context.doc.database).lockLayerByEntity(objectId);
|
|
109
|
+
if (!result.ok) {
|
|
110
|
+
switch (result.reason) {
|
|
111
|
+
case 'invalid_selection':
|
|
112
|
+
this.showMessage(AcApI18n.t('jig.laylck.invalidSelection'), 'warning');
|
|
113
|
+
return;
|
|
114
|
+
case 'layer_not_found':
|
|
115
|
+
this.showMessage("".concat(AcApI18n.t('jig.laylck.layerNotFound'), ": ").concat(result.layerName), 'warning');
|
|
116
|
+
return;
|
|
117
|
+
case 'already_locked':
|
|
118
|
+
this.showMessage("".concat(AcApI18n.t('jig.laylck.alreadyLocked'), ": ").concat(result.layerName), 'info');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
157
121
|
}
|
|
158
|
-
this.setLayerLocked(layer, true);
|
|
159
122
|
context.view.selectionSet.clear();
|
|
160
|
-
this.showMessage("".concat(AcApI18n.t('jig.laylck.locked'), ": ").concat(
|
|
123
|
+
this.showMessage("".concat(AcApI18n.t('jig.laylck.locked'), ": ").concat(result.layerName), 'success');
|
|
161
124
|
};
|
|
162
125
|
return AcApLayerLockCmd;
|
|
163
|
-
}(
|
|
126
|
+
}(AcApLayerMutationCmd));
|
|
164
127
|
export { AcApLayerLockCmd };
|
|
165
128
|
//# sourceMappingURL=AcApLayerLockCmd.js.map
|