@mlightcad/cad-simple-viewer 1.2.4 → 1.2.5
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/dist/index.js +11406 -8892
- package/dist/index.umd.cjs +314 -24
- package/dist/libredwg-parser-worker.js +7267 -7238
- package/dist/mtext-renderer-worker.js +32 -9
- package/lib/app/AcApDocManager.d.ts +20 -3
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +66 -11
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +133 -0
- package/lib/app/AcApProgress.d.ts.map +1 -0
- package/lib/app/AcApProgress.js +148 -0
- package/lib/app/AcApProgress.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +42 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +63 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +21 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApCircleCmd.js +115 -0
- package/lib/command/AcApCircleCmd.js.map +1 -0
- package/lib/command/AcApDimCmd.d.ts +57 -0
- package/lib/command/AcApDimCmd.d.ts.map +1 -0
- package/lib/command/AcApDimCmd.js +228 -0
- package/lib/command/AcApDimCmd.js.map +1 -0
- package/lib/command/AcApLogCmd.d.ts +13 -0
- package/lib/command/AcApLogCmd.d.ts.map +1 -0
- package/lib/command/AcApLogCmd.js +97 -0
- package/lib/command/AcApLogCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +15 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -0
- package/lib/command/AcApSysVarCmd.js +94 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -36
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +4 -61
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +19 -1
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +40 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +14 -30
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +32 -31
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts +103 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.js +82 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -11
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -22
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js +25 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts +8 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js +29 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts +7 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js +28 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +14 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.js +2 -0
- package/lib/editor/input/handler/AcEdInputHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js +44 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js +24 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +16 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.js +19 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.js +24 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -0
- package/lib/editor/input/handler/index.d.ts +9 -0
- package/lib/editor/input/handler/index.d.ts.map +1 -0
- package/lib/editor/input/handler/index.js +9 -0
- package/lib/editor/input/handler/index.js.map +1 -0
- package/lib/editor/input/index.d.ts +4 -1
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +4 -1
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +72 -0
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdMarker.js +124 -0
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +52 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +91 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -0
- package/lib/editor/input/marker/index.d.ts +3 -0
- package/lib/editor/input/marker/index.d.ts.map +1 -0
- package/lib/editor/input/marker/index.js +3 -0
- package/lib/editor/input/marker/index.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts +63 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.js +120 -0
- package/lib/editor/input/prompt/AcEdKeyword.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +52 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +103 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +75 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +182 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +114 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts +39 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js +84 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +59 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +140 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts +19 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js +36 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +61 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js +179 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +113 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +25 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js +38 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts +27 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts +22 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js +23 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +54 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +124 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -0
- package/lib/editor/input/prompt/index.d.ts +11 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -0
- package/lib/editor/input/prompt/index.js +11 -0
- package/lib/editor/input/prompt/index.js.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +114 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.js +453 -0
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +151 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js +239 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +60 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +104 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +154 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts +132 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.js +477 -0
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +66 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +276 -0
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +3 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -0
- package/lib/editor/input/ui/index.js +3 -0
- package/lib/editor/input/ui/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +35 -11
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -11
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +135 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -0
- package/lib/i18n/AcApI18n.js +208 -0
- package/lib/i18n/AcApI18n.js.map +1 -0
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -0
- package/lib/i18n/en/command.js +17 -0
- package/lib/i18n/en/command.js.map +1 -0
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -0
- package/lib/i18n/en/jig.js +10 -0
- package/lib/i18n/en/jig.js.map +1 -0
- package/lib/i18n/en/main.d.ts +37 -0
- package/lib/i18n/en/main.d.ts.map +1 -0
- package/lib/i18n/en/main.js +36 -0
- package/lib/i18n/en/main.js.map +1 -0
- package/lib/i18n/index.d.ts +6 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +31 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -0
- package/lib/i18n/zh/command.js +17 -0
- package/lib/i18n/zh/command.js.map +1 -0
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -0
- package/lib/i18n/zh/jig.js +10 -0
- package/lib/i18n/zh/jig.js.map +1 -0
- package/lib/i18n/zh/main.d.ts +37 -0
- package/lib/i18n/zh/main.d.ts.map +1 -0
- package/lib/i18n/zh/main.js +36 -0
- package/lib/i18n/zh/main.js.map +1 -0
- 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/view/AcTrScene.d.ts +19 -6
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +25 -6
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +11 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +73 -35
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +7 -7
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcDbSysVarManager } from '@mlightcad/data-model';
|
|
1
2
|
/**
|
|
2
3
|
* Enumeration of cursor types available in the CAD editor.
|
|
3
4
|
*
|
|
@@ -59,48 +60,47 @@ export var AcEdCorsorType;
|
|
|
59
60
|
*
|
|
60
61
|
* The cursor manager maintains a cache of cursor definitions to avoid
|
|
61
62
|
* recreating them repeatedly, improving performance.
|
|
62
|
-
*
|
|
63
|
-
* @internal This class is for internal use by the editor system
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* const cursorManager = new AcEdCursorManager();
|
|
68
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
69
|
-
*
|
|
70
|
-
* // Set crosshair cursor
|
|
71
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
72
|
-
*
|
|
73
|
-
* // Set grab cursor for panning
|
|
74
|
-
* cursorManager.setCursor(AcEdCorsorType.Grab, canvas);
|
|
75
|
-
* ```
|
|
76
63
|
*/
|
|
77
64
|
var AcEdCursorManager = /** @class */ (function () {
|
|
78
65
|
/**
|
|
79
66
|
* Creates a new cursor manager instance.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
67
|
+
* Initializes the cursor and creates default cursor definitions.
|
|
68
|
+
* @param view - The view associated with the cursor manager
|
|
82
69
|
*/
|
|
83
|
-
function AcEdCursorManager() {
|
|
70
|
+
function AcEdCursorManager(view) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
this._view = view;
|
|
84
73
|
this._cursorMap = new Map();
|
|
85
|
-
|
|
74
|
+
var totalLength = 20;
|
|
75
|
+
var rectSize = 10;
|
|
76
|
+
this._cursorMap.set(AcEdCorsorType.Crosshair, this.createRectCrossIcon(rectSize, totalLength - rectSize));
|
|
77
|
+
AcDbSysVarManager.instance().events.sysVarChanged.addEventListener(function (args) {
|
|
78
|
+
if (args.name === 'PICKBOX') {
|
|
79
|
+
var size = args.newVal;
|
|
80
|
+
size = size >= 0 ? size : 0;
|
|
81
|
+
_this._cursorMap.set(AcEdCorsorType.Crosshair, _this.createRectCrossIcon(size, totalLength - size));
|
|
82
|
+
_this.setCursor(_this._currentCursor);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
this.setCursor(AcEdCorsorType.Crosshair);
|
|
86
86
|
}
|
|
87
|
+
Object.defineProperty(AcEdCursorManager.prototype, "currentCursor", {
|
|
88
|
+
/**
|
|
89
|
+
* The current cursor type for the associated view.
|
|
90
|
+
*/
|
|
91
|
+
get: function () {
|
|
92
|
+
return this._currentCursor;
|
|
93
|
+
},
|
|
94
|
+
enumerable: false,
|
|
95
|
+
configurable: true
|
|
96
|
+
});
|
|
87
97
|
/**
|
|
88
|
-
* Sets the cursor for the
|
|
89
|
-
*
|
|
90
|
-
* Applies the appropriate cursor style based on the cursor type.
|
|
91
|
-
* For built-in cursor types, uses CSS cursor values. For custom
|
|
92
|
-
* cursor types, uses cached SVG-based cursor definitions.
|
|
98
|
+
* Sets the current cursor for the associated view.
|
|
93
99
|
*
|
|
94
100
|
* @param cursorType - The type of cursor to set
|
|
95
|
-
* @param element - The HTML element to apply the cursor to
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
100
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
101
|
-
* ```
|
|
102
101
|
*/
|
|
103
|
-
AcEdCursorManager.prototype.setCursor = function (cursorType
|
|
102
|
+
AcEdCursorManager.prototype.setCursor = function (cursorType) {
|
|
103
|
+
var element = this._view.canvas;
|
|
104
104
|
if (cursorType <= AcEdCorsorType.NoSpecialCursor) {
|
|
105
105
|
element.style.cursor = 'default';
|
|
106
106
|
}
|
|
@@ -113,6 +113,7 @@ var AcEdCursorManager = /** @class */ (function () {
|
|
|
113
113
|
element.style.cursor = cursor;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
this._currentCursor = cursorType;
|
|
116
117
|
};
|
|
117
118
|
/**
|
|
118
119
|
* Encodes an SVG string into a CSS cursor URL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IACxB,+CAA+C;IAC/C,0EAAoB,CAAA;IACpB,mDAAmD;IACnD,6DAAa,CAAA;IACb,0CAA0C;IAC1C,+DAAU,CAAA;IACV,6CAA6C;IAC7C,+DAAU,CAAA;IACV,yBAAyB;IACzB,+DAAU,CAAA;IACV,4CAA4C;IAC5C,6DAAS,CAAA;IACT,+BAA+B;IAC/B,2EAAgB,CAAA;IAChB,8CAA8C;IAC9C,6EAAiB,CAAA;IACjB,yCAAyC;IACzC,6DAAS,CAAA;IACT,8BAA8B;IAC9B,mEAAY,CAAA;IACZ,iDAAiD;IACjD,qEAAa,CAAA;IACb,+CAA+C;IAC/C,kFAAmB,CAAA;IACnB,gDAAgD;IAChD,wEAAc,CAAA;IACd,8BAA8B;IAC9B,0EAAe,CAAA;IACf,mCAAmC;IACnC,oDAAI,CAAA;AACN,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB;AAED
|
|
1
|
+
{"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts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
|
5
|
+
* @template T
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A generic, TypeScript-based version of AutoCAD’s AcEdJig system for
|
|
9
|
+
* interactive previews during editor input.
|
|
10
|
+
*
|
|
11
|
+
* This class manages a *transient preview entity* that updates dynamically
|
|
12
|
+
* as the user moves the cursor or provides other incremental input.
|
|
13
|
+
*
|
|
14
|
+
* ## Why Generic?
|
|
15
|
+
* AutoCAD’s jig can sample different types of values:
|
|
16
|
+
* - a 3D point → during acquirePoint()
|
|
17
|
+
* - a distance → during acquireDistance()
|
|
18
|
+
* - an angle → during acquireAngle()
|
|
19
|
+
*
|
|
20
|
+
* Using a generic type parameter `T` allows the jig to update entities
|
|
21
|
+
* based on different input types while sharing the same structure.
|
|
22
|
+
*
|
|
23
|
+
* ## Method Mapping vs AutoCAD AcEdJig
|
|
24
|
+
* | AutoCAD AcEdJig Method | Purpose | This Class |
|
|
25
|
+
* |-------------------------|---------|------------|
|
|
26
|
+
* | `sampler()` | Sample new input | `update(value: T)` |
|
|
27
|
+
* | `worldDraw()` | Draw geometry | `render()` |
|
|
28
|
+
* | `startJig()` | Begin preview | `setEntity()` |
|
|
29
|
+
* | `drag()` | Main loop | Controlled externally via JS events |
|
|
30
|
+
*
|
|
31
|
+
* ## Entity Integration
|
|
32
|
+
* The preview entity may optionally implement:
|
|
33
|
+
* ```ts
|
|
34
|
+
* onJigUpdate(value: T): void
|
|
35
|
+
* ```
|
|
36
|
+
* When present, the jig will call it whenever the input changes.
|
|
37
|
+
*
|
|
38
|
+
* ## Example Use Cases
|
|
39
|
+
* - Point acquisition (`T = AcGePoint3d`)
|
|
40
|
+
* - Distance jig (`T = number`)
|
|
41
|
+
* - Angle jig (`T = number`)
|
|
42
|
+
*
|
|
43
|
+
* Example:
|
|
44
|
+
* ```ts
|
|
45
|
+
* const jig = new AcEdPreviewJig<AcGePoint3d>(view)
|
|
46
|
+
* jig.setEntity(circleEntity)
|
|
47
|
+
* await editor.getPoint("Specify center:", { jig })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare abstract class AcEdPreviewJig<T> {
|
|
51
|
+
private view;
|
|
52
|
+
/**
|
|
53
|
+
* Construct a new preview jig.
|
|
54
|
+
*
|
|
55
|
+
* @param view The CAD drawing view responsible for rendering transient graphics.
|
|
56
|
+
* Called via `view.draw(entity)` on each update.
|
|
57
|
+
*/
|
|
58
|
+
constructor(view: AcEdBaseView);
|
|
59
|
+
/**
|
|
60
|
+
* Assign the preview entity used by the jig.
|
|
61
|
+
*
|
|
62
|
+
* The entity should be transient (not yet added to the model database).
|
|
63
|
+
*
|
|
64
|
+
* @param ent The preview entity to display.
|
|
65
|
+
*/
|
|
66
|
+
abstract get entity(): AcDbEntity | null;
|
|
67
|
+
/**
|
|
68
|
+
* Update the preview entity based on incremental input.
|
|
69
|
+
*
|
|
70
|
+
* This method replaces the older `updatePoint()` and now accepts any type `T`,
|
|
71
|
+
* enabling use for point, distance, angle, or custom parameter updates.
|
|
72
|
+
*
|
|
73
|
+
* This function performs the conceptual role of AutoCAD’s `sampler()`:
|
|
74
|
+
* the editor triggers this method whenever the user’s input changes.
|
|
75
|
+
*
|
|
76
|
+
* If the preview entity implements:
|
|
77
|
+
* ```ts
|
|
78
|
+
* onJigUpdate(value: T)
|
|
79
|
+
* ```
|
|
80
|
+
* then it will be invoked here to recompute geometry.
|
|
81
|
+
*
|
|
82
|
+
* @param value Incremental value of type `T` describing new jig input.
|
|
83
|
+
* Examples:
|
|
84
|
+
* - world point
|
|
85
|
+
* - radius/distance
|
|
86
|
+
* - angle in radians
|
|
87
|
+
*/
|
|
88
|
+
abstract update(value: T): void;
|
|
89
|
+
/**
|
|
90
|
+
* Render the preview entity through the associated view.
|
|
91
|
+
*
|
|
92
|
+
* Equivalent to AutoCAD’s `worldDraw()` — called after each `update(value)`.
|
|
93
|
+
*/
|
|
94
|
+
render(): void;
|
|
95
|
+
/**
|
|
96
|
+
* End the jig and clear any transient preview state.
|
|
97
|
+
*
|
|
98
|
+
* Should be called when the user finalizes input (mouse click or Enter)
|
|
99
|
+
* to prevent further updates and allow garbage collection.
|
|
100
|
+
*/
|
|
101
|
+
end(): void;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=AcEdPreviewJig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPreviewJig.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdPreviewJig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,8BAAsB,cAAc,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAc;IAE1B;;;;;OAKG;gBACS,IAAI,EAAE,YAAY;IAI9B;;;;;;OAMG;IACH,QAAQ,KAAK,MAAM,IAAI,UAAU,GAAG,IAAI,CAAA;IAExC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAE/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAMd;;;;;OAKG;IACH,GAAG,IAAI,IAAI;CAKZ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class AcEdPreviewJig<T>
|
|
3
|
+
* @template T
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* A generic, TypeScript-based version of AutoCAD’s AcEdJig system for
|
|
7
|
+
* interactive previews during editor input.
|
|
8
|
+
*
|
|
9
|
+
* This class manages a *transient preview entity* that updates dynamically
|
|
10
|
+
* as the user moves the cursor or provides other incremental input.
|
|
11
|
+
*
|
|
12
|
+
* ## Why Generic?
|
|
13
|
+
* AutoCAD’s jig can sample different types of values:
|
|
14
|
+
* - a 3D point → during acquirePoint()
|
|
15
|
+
* - a distance → during acquireDistance()
|
|
16
|
+
* - an angle → during acquireAngle()
|
|
17
|
+
*
|
|
18
|
+
* Using a generic type parameter `T` allows the jig to update entities
|
|
19
|
+
* based on different input types while sharing the same structure.
|
|
20
|
+
*
|
|
21
|
+
* ## Method Mapping vs AutoCAD AcEdJig
|
|
22
|
+
* | AutoCAD AcEdJig Method | Purpose | This Class |
|
|
23
|
+
* |-------------------------|---------|------------|
|
|
24
|
+
* | `sampler()` | Sample new input | `update(value: T)` |
|
|
25
|
+
* | `worldDraw()` | Draw geometry | `render()` |
|
|
26
|
+
* | `startJig()` | Begin preview | `setEntity()` |
|
|
27
|
+
* | `drag()` | Main loop | Controlled externally via JS events |
|
|
28
|
+
*
|
|
29
|
+
* ## Entity Integration
|
|
30
|
+
* The preview entity may optionally implement:
|
|
31
|
+
* ```ts
|
|
32
|
+
* onJigUpdate(value: T): void
|
|
33
|
+
* ```
|
|
34
|
+
* When present, the jig will call it whenever the input changes.
|
|
35
|
+
*
|
|
36
|
+
* ## Example Use Cases
|
|
37
|
+
* - Point acquisition (`T = AcGePoint3d`)
|
|
38
|
+
* - Distance jig (`T = number`)
|
|
39
|
+
* - Angle jig (`T = number`)
|
|
40
|
+
*
|
|
41
|
+
* Example:
|
|
42
|
+
* ```ts
|
|
43
|
+
* const jig = new AcEdPreviewJig<AcGePoint3d>(view)
|
|
44
|
+
* jig.setEntity(circleEntity)
|
|
45
|
+
* await editor.getPoint("Specify center:", { jig })
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
var AcEdPreviewJig = /** @class */ (function () {
|
|
49
|
+
/**
|
|
50
|
+
* Construct a new preview jig.
|
|
51
|
+
*
|
|
52
|
+
* @param view The CAD drawing view responsible for rendering transient graphics.
|
|
53
|
+
* Called via `view.draw(entity)` on each update.
|
|
54
|
+
*/
|
|
55
|
+
function AcEdPreviewJig(view) {
|
|
56
|
+
this.view = view;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Render the preview entity through the associated view.
|
|
60
|
+
*
|
|
61
|
+
* Equivalent to AutoCAD’s `worldDraw()` — called after each `update(value)`.
|
|
62
|
+
*/
|
|
63
|
+
AcEdPreviewJig.prototype.render = function () {
|
|
64
|
+
if (this.entity) {
|
|
65
|
+
this.view.addTransientEntity(this.entity);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* End the jig and clear any transient preview state.
|
|
70
|
+
*
|
|
71
|
+
* Should be called when the user finalizes input (mouse click or Enter)
|
|
72
|
+
* to prevent further updates and allow garbage collection.
|
|
73
|
+
*/
|
|
74
|
+
AcEdPreviewJig.prototype.end = function () {
|
|
75
|
+
if (this.entity) {
|
|
76
|
+
this.view.removeTransientEntity(this.entity.objectId);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return AcEdPreviewJig;
|
|
80
|
+
}());
|
|
81
|
+
export { AcEdPreviewJig };
|
|
82
|
+
//# sourceMappingURL=AcEdPreviewJig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPreviewJig.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdPreviewJig.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAGE;;;;;OAKG;IACH,wBAAY,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAkCD;;;;OAIG;IACH,+BAAM,GAAN;QACE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,4BAAG,GAAH;QACE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAnED,IAmEC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
1
2
|
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
2
3
|
import { AcEdCorsorType } from './AcEdCursorManager';
|
|
4
|
+
import { AcEdPromptAngleOptions, AcEdPromptDistanceOptions, AcEdPromptPointOptions, AcEdPromptStringOptions } from './prompt';
|
|
5
|
+
/**
|
|
6
|
+
* Event arguments for system variable related events.
|
|
7
|
+
*/
|
|
8
|
+
export interface AcDbSysVarEventArgs {
|
|
9
|
+
/** The system variable name */
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Advanced input handler for CAD operations providing high-level user interaction methods.
|
|
5
14
|
*
|
|
@@ -34,14 +43,31 @@ export declare class AcEditor {
|
|
|
34
43
|
private _currentCursor?;
|
|
35
44
|
/** Manager for cursor appearance and behavior */
|
|
36
45
|
private _cursorManager;
|
|
46
|
+
/** Manager for mouse and keyboard input */
|
|
47
|
+
private _inputManager;
|
|
37
48
|
/** The view this editor is associated with */
|
|
38
49
|
protected _view: AcEdBaseView;
|
|
50
|
+
/**
|
|
51
|
+
* Editor events
|
|
52
|
+
*/
|
|
53
|
+
readonly events: {
|
|
54
|
+
/**
|
|
55
|
+
* Fired after a system variable is changed directly through the SETVAR command or
|
|
56
|
+
* by entering the variable name at the command line.
|
|
57
|
+
*/
|
|
58
|
+
sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs>;
|
|
59
|
+
};
|
|
39
60
|
/**
|
|
40
61
|
* Creates a new editor instance for the specified view.
|
|
41
62
|
*
|
|
42
63
|
* @param view - The view that this editor will handle input for
|
|
43
64
|
*/
|
|
44
65
|
constructor(view: AcEdBaseView);
|
|
66
|
+
/**
|
|
67
|
+
* The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point
|
|
68
|
+
* selection, distance/angle prompt, string prompt, etc.),
|
|
69
|
+
*/
|
|
70
|
+
get isActive(): boolean;
|
|
45
71
|
/**
|
|
46
72
|
* Gets the currently active cursor type.
|
|
47
73
|
*
|
|
@@ -70,21 +96,42 @@ export declare class AcEditor {
|
|
|
70
96
|
*/
|
|
71
97
|
setCursor(cursorType: AcEdCorsorType): void;
|
|
72
98
|
/**
|
|
73
|
-
* Prompts the user to input a point by clicking on the view
|
|
99
|
+
* Prompts the user to input a point by clicking on the view or inputting
|
|
100
|
+
* one coordinate value.
|
|
74
101
|
*
|
|
75
|
-
* This method returns a promise that resolves
|
|
76
|
-
* on the view
|
|
102
|
+
* This method returns a promise that resolves after the user clicks
|
|
103
|
+
* on the view or inputs one valid coordinate value, providing the
|
|
104
|
+
* world coordinates of the click point.
|
|
77
105
|
*
|
|
78
106
|
* @returns Promise that resolves to the input point coordinates
|
|
107
|
+
*/
|
|
108
|
+
getPoint(options: AcEdPromptPointOptions): Promise<import("@mlightcad/data-model").AcGeVector3dLike>;
|
|
109
|
+
/**
|
|
110
|
+
* Prompts the user to input an angle by clicking on the view or input
|
|
111
|
+
* one number.
|
|
79
112
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
113
|
+
* This method returns a promise that resolves after the user clicks
|
|
114
|
+
* on the view or inputs one valid angle value.
|
|
115
|
+
*
|
|
116
|
+
* @returns Promise that resolves to the input angle value.
|
|
117
|
+
*/
|
|
118
|
+
getAngle(options: AcEdPromptAngleOptions): Promise<number>;
|
|
119
|
+
/**
|
|
120
|
+
* Prompts the user to input a distance by clicking on the view or input
|
|
121
|
+
* one number.
|
|
122
|
+
*
|
|
123
|
+
* This method returns a promise that resolves after the user clicks
|
|
124
|
+
* on the view or inputs one valid distance value.
|
|
125
|
+
*
|
|
126
|
+
* @returns Promise that resolves to the input distance value.
|
|
127
|
+
*/
|
|
128
|
+
getDistance(options: AcEdPromptDistanceOptions): Promise<number>;
|
|
129
|
+
/**
|
|
130
|
+
* Prompts the user to input a string.
|
|
131
|
+
*
|
|
132
|
+
* @returns Promise that resolves to the input one string.
|
|
86
133
|
*/
|
|
87
|
-
|
|
134
|
+
getString(options: AcEdPromptStringOptions): Promise<string>;
|
|
88
135
|
/**
|
|
89
136
|
* Prompts the user to select entities using box selection.
|
|
90
137
|
*
|
|
@@ -106,6 +153,6 @@ export declare class AcEditor {
|
|
|
106
153
|
* }
|
|
107
154
|
* ```
|
|
108
155
|
*/
|
|
109
|
-
getSelection(): Promise<import("@mlightcad/
|
|
156
|
+
getSelection(): Promise<import("@mlightcad/data-model").AcGeBox2d>;
|
|
110
157
|
}
|
|
111
158
|
//# sourceMappingURL=AcEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,UAAU,CAAA;AAGjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,QAAQ;IACnB,iDAAiD;IACjD,OAAO,CAAC,eAAe,CAAC,CAAgB;IACxC,mCAAmC;IACnC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,iDAAiD;IACjD,OAAO,CAAC,cAAc,CAAmB;IACzC,2CAA2C;IAC3C,OAAO,CAAC,aAAa,CAAkB;IACvC,8CAA8C;IAC9C,SAAS,CAAC,KAAK,EAAE,YAAY,CAAA;IAE7B;;OAEG;IACH,SAAgB,MAAM;QACpB;;;WAGG;;MAEJ;IAED;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAM9B;;;OAGG;IACH,IAAI,QAAQ,YAEX;IAED;;;;OAIG;IACH,IAAI,aAAa,+BAEhB;IAED;;;;;OAKG;IACH,aAAa;IAMb;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,UAAU,EAAE,cAAc;IAMpC;;;;;;;;;OASG;IACG,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAI9C;;;;;;;;OAQG;IACG,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAI9C;;;;;;;;OAQG;IACG,WAAW,CAAC,OAAO,EAAE,yBAAyB;IAIpD;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,uBAAuB;IAIhD;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,YAAY;CAGnB"}
|
|
@@ -34,9 +34,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import {
|
|
37
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
38
38
|
import { AcEdCursorManager } from './AcEdCursorManager';
|
|
39
|
-
import {
|
|
39
|
+
import { AcEdInputManager } from './ui';
|
|
40
40
|
/**
|
|
41
41
|
* Advanced input handler for CAD operations providing high-level user interaction methods.
|
|
42
42
|
*
|
|
@@ -71,9 +71,31 @@ var AcEditor = /** @class */ (function () {
|
|
|
71
71
|
* @param view - The view that this editor will handle input for
|
|
72
72
|
*/
|
|
73
73
|
function AcEditor(view) {
|
|
74
|
+
/**
|
|
75
|
+
* Editor events
|
|
76
|
+
*/
|
|
77
|
+
this.events = {
|
|
78
|
+
/**
|
|
79
|
+
* Fired after a system variable is changed directly through the SETVAR command or
|
|
80
|
+
* by entering the variable name at the command line.
|
|
81
|
+
*/
|
|
82
|
+
sysVarChanged: new AcCmEventManager()
|
|
83
|
+
};
|
|
74
84
|
this._view = view;
|
|
75
|
-
this._cursorManager = new AcEdCursorManager();
|
|
85
|
+
this._cursorManager = new AcEdCursorManager(view);
|
|
86
|
+
this._inputManager = new AcEdInputManager(view);
|
|
76
87
|
}
|
|
88
|
+
Object.defineProperty(AcEditor.prototype, "isActive", {
|
|
89
|
+
/**
|
|
90
|
+
* The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point
|
|
91
|
+
* selection, distance/angle prompt, string prompt, etc.),
|
|
92
|
+
*/
|
|
93
|
+
get: function () {
|
|
94
|
+
return this._inputManager.isActive;
|
|
95
|
+
},
|
|
96
|
+
enumerable: false,
|
|
97
|
+
configurable: true
|
|
98
|
+
});
|
|
77
99
|
Object.defineProperty(AcEditor.prototype, "currentCursor", {
|
|
78
100
|
/**
|
|
79
101
|
* Gets the currently active cursor type.
|
|
@@ -111,33 +133,78 @@ var AcEditor = /** @class */ (function () {
|
|
|
111
133
|
* ```
|
|
112
134
|
*/
|
|
113
135
|
AcEditor.prototype.setCursor = function (cursorType) {
|
|
114
|
-
this._cursorManager.setCursor(cursorType
|
|
136
|
+
this._cursorManager.setCursor(cursorType);
|
|
115
137
|
this._previousCursor = this._currentCursor;
|
|
116
138
|
this._currentCursor = cursorType;
|
|
117
139
|
};
|
|
118
140
|
/**
|
|
119
|
-
* Prompts the user to input a point by clicking on the view
|
|
141
|
+
* Prompts the user to input a point by clicking on the view or inputting
|
|
142
|
+
* one coordinate value.
|
|
120
143
|
*
|
|
121
|
-
* This method returns a promise that resolves
|
|
122
|
-
* on the view
|
|
144
|
+
* This method returns a promise that resolves after the user clicks
|
|
145
|
+
* on the view or inputs one valid coordinate value, providing the
|
|
146
|
+
* world coordinates of the click point.
|
|
123
147
|
*
|
|
124
148
|
* @returns Promise that resolves to the input point coordinates
|
|
149
|
+
*/
|
|
150
|
+
AcEditor.prototype.getPoint = function (options) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
return __generator(this, function (_a) {
|
|
153
|
+
switch (_a.label) {
|
|
154
|
+
case 0: return [4 /*yield*/, this._inputManager.getPoint(options)];
|
|
155
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Prompts the user to input an angle by clicking on the view or input
|
|
162
|
+
* one number.
|
|
125
163
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
|
|
164
|
+
* This method returns a promise that resolves after the user clicks
|
|
165
|
+
* on the view or inputs one valid angle value.
|
|
166
|
+
*
|
|
167
|
+
* @returns Promise that resolves to the input angle value.
|
|
168
|
+
*/
|
|
169
|
+
AcEditor.prototype.getAngle = function (options) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
return __generator(this, function (_a) {
|
|
172
|
+
switch (_a.label) {
|
|
173
|
+
case 0: return [4 /*yield*/, this._inputManager.getAngle(options)];
|
|
174
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Prompts the user to input a distance by clicking on the view or input
|
|
181
|
+
* one number.
|
|
182
|
+
*
|
|
183
|
+
* This method returns a promise that resolves after the user clicks
|
|
184
|
+
* on the view or inputs one valid distance value.
|
|
185
|
+
*
|
|
186
|
+
* @returns Promise that resolves to the input distance value.
|
|
187
|
+
*/
|
|
188
|
+
AcEditor.prototype.getDistance = function (options) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0: return [4 /*yield*/, this._inputManager.getDistance(options)];
|
|
193
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Prompts the user to input a string.
|
|
200
|
+
*
|
|
201
|
+
* @returns Promise that resolves to the input one string.
|
|
132
202
|
*/
|
|
133
|
-
AcEditor.prototype.
|
|
203
|
+
AcEditor.prototype.getString = function (options) {
|
|
134
204
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var inputter;
|
|
136
205
|
return __generator(this, function (_a) {
|
|
137
206
|
switch (_a.label) {
|
|
138
|
-
case 0:
|
|
139
|
-
inputter = new AcEdInputPoint(this._view);
|
|
140
|
-
return [4 /*yield*/, inputter.start()];
|
|
207
|
+
case 0: return [4 /*yield*/, this._inputManager.getString(options)];
|
|
141
208
|
case 1: return [2 /*return*/, _a.sent()];
|
|
142
209
|
}
|
|
143
210
|
});
|
|
@@ -166,12 +233,9 @@ var AcEditor = /** @class */ (function () {
|
|
|
166
233
|
*/
|
|
167
234
|
AcEditor.prototype.getSelection = function () {
|
|
168
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
var selector;
|
|
170
236
|
return __generator(this, function (_a) {
|
|
171
237
|
switch (_a.label) {
|
|
172
|
-
case 0:
|
|
173
|
-
selector = new AcEdBoxSelector(this._view);
|
|
174
|
-
return [4 /*yield*/, selector.start()];
|
|
238
|
+
case 0: return [4 /*yield*/, this._inputManager.getBox()];
|
|
175
239
|
case 1: return [2 /*return*/, _a.sent()];
|
|
176
240
|
}
|
|
177
241
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":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IAClC,CAAC;IAED;;;;;;;;;OASG;IACG,2BAAQ,GAAd,UAAe,OAA+B;;;;4BACrC,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAA;;;;KAClD;IAED;;;;;;;;OAQG;IACG,2BAAQ,GAAd,UAAe,OAA+B;;;;4BACrC,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAA;;;;KAClD;IAED;;;;;;;;OAQG;IACG,8BAAW,GAAjB,UAAkB,OAAkC;;;;4BAC3C,qBAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;4BAApD,sBAAO,SAA6C,EAAA;;;;KACrD;IAED;;;;OAIG;IACG,4BAAS,GAAf,UAAgB,OAAgC;;;;4BACvC,qBAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,EAAA;4BAAlD,sBAAO,SAA2C,EAAA;;;;KACnD;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,+BAAY,GAAlB;;;;4BACS,qBAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAA;4BAAxC,sBAAO,SAAiC,EAAA;;;;KACzC;IACH,eAAC;AAAD,CAAC,AA3JD,IA2JC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AcEdPromptAngleOptions } from '../prompt/AcEdPromptAngleOptions';
|
|
2
|
+
import { AcEdInputHandler } from './AcEdInputHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Validates angular numeric input.
|
|
5
|
+
* Uses degrees. Fully compatible with PromptAngleOptions behavior in AutoCAD.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcEdAngleHandler implements AcEdInputHandler<number> {
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options: AcEdPromptAngleOptions);
|
|
10
|
+
parse(value: string): number | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AcEdAngleHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdAngleHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdAngleHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,MAAM,CAAC;IAC/D,OAAO,CAAC,OAAO,CAAwB;gBAE3B,OAAO,EAAE,sBAAsB;IAI3C,KAAK,CAAC,KAAK,EAAE,MAAM;CAiBpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates angular numeric input.
|
|
3
|
+
* Uses degrees. Fully compatible with PromptAngleOptions behavior in AutoCAD.
|
|
4
|
+
*/
|
|
5
|
+
var AcEdAngleHandler = /** @class */ (function () {
|
|
6
|
+
function AcEdAngleHandler(options) {
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
AcEdAngleHandler.prototype.parse = function (value) {
|
|
10
|
+
var n = Number(value);
|
|
11
|
+
if (isNaN(n)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (!this.options.allowNegative && n < 0) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (!this.options.allowZero && n === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
};
|
|
22
|
+
return AcEdAngleHandler;
|
|
23
|
+
}());
|
|
24
|
+
export { AcEdAngleHandler };
|
|
25
|
+
//# sourceMappingURL=AcEdAngleHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdAngleHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdAngleHandler.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IAGE,0BAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,gCAAK,GAAL,UAAM,KAAa;QACjB,IAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAA;IACV,CAAC;IACH,uBAAC;AAAD,CAAC,AAxBD,IAwBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
2
|
+
/**
|
|
3
|
+
* Validates distance input.
|
|
4
|
+
* Distances must be numeric and normally non-negative (AutoCAD behavior).
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcEdDistanceHandler extends AcEdNumericalHandler {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AcEdDistanceHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdDistanceHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdDistanceHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,oBAAoB;CAAG"}
|