@mlightcad/cad-simple-viewer 1.0.0
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 -0
- package/README.md +26 -0
- package/dist/index.js +2422 -0
- package/dist/index.umd.cjs +9 -0
- package/lib/app/AcApContext.d.ts +15 -0
- package/lib/app/AcApContext.d.ts.map +1 -0
- package/lib/app/AcApContext.js +56 -0
- package/lib/app/AcApContext.js.map +1 -0
- package/lib/app/AcApDocCreator.d.ts +17 -0
- package/lib/app/AcApDocCreator.d.ts.map +1 -0
- package/lib/app/AcApDocCreator.js +140 -0
- package/lib/app/AcApDocCreator.js.map +1 -0
- package/lib/app/AcApDocManager.d.ts +60 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -0
- package/lib/app/AcApDocManager.js +275 -0
- package/lib/app/AcApDocManager.js.map +1 -0
- package/lib/app/AcApDocument.d.ts +27 -0
- package/lib/app/AcApDocument.d.ts.map +1 -0
- package/lib/app/AcApDocument.js +165 -0
- package/lib/app/AcApDocument.js.map +1 -0
- package/lib/app/AcApFontLoader.d.ts +20 -0
- package/lib/app/AcApFontLoader.d.ts.map +1 -0
- package/lib/app/AcApFontLoader.js +135 -0
- package/lib/app/AcApFontLoader.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +44 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -0
- package/lib/app/AcApSettingManager.js +122 -0
- package/lib/app/AcApSettingManager.js.map +1 -0
- package/lib/app/index.d.ts +5 -0
- package/lib/app/index.d.ts.map +1 -0
- package/lib/app/index.js +5 -0
- package/lib/app/index.js.map +1 -0
- package/lib/command/AcApConvertToSvgCmd.d.ts +6 -0
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -0
- package/lib/command/AcApConvertToSvgCmd.js +30 -0
- package/lib/command/AcApConvertToSvgCmd.js.map +1 -0
- package/lib/command/AcApOpenCmd.d.ts +6 -0
- package/lib/command/AcApOpenCmd.d.ts.map +1 -0
- package/lib/command/AcApOpenCmd.js +29 -0
- package/lib/command/AcApOpenCmd.js.map +1 -0
- package/lib/command/AcApPanCmd.d.ts +6 -0
- package/lib/command/AcApPanCmd.d.ts.map +1 -0
- package/lib/command/AcApPanCmd.js +30 -0
- package/lib/command/AcApPanCmd.js.map +1 -0
- package/lib/command/AcApQNewCmd.d.ts +6 -0
- package/lib/command/AcApQNewCmd.d.ts.map +1 -0
- package/lib/command/AcApQNewCmd.js +30 -0
- package/lib/command/AcApQNewCmd.js.map +1 -0
- package/lib/command/AcApSelectCmd.d.ts +6 -0
- package/lib/command/AcApSelectCmd.d.ts.map +1 -0
- package/lib/command/AcApSelectCmd.js +30 -0
- package/lib/command/AcApSelectCmd.js.map +1 -0
- package/lib/command/AcApSvgConvertor.d.ts +5 -0
- package/lib/command/AcApSvgConvertor.d.ts.map +1 -0
- package/lib/command/AcApSvgConvertor.js +55 -0
- package/lib/command/AcApSvgConvertor.js.map +1 -0
- package/lib/command/AcApZoomCmd.d.ts +6 -0
- package/lib/command/AcApZoomCmd.d.ts.map +1 -0
- package/lib/command/AcApZoomCmd.js +28 -0
- package/lib/command/AcApZoomCmd.js.map +1 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts +11 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -0
- package/lib/command/AcApZoomToBoxCmd.js +101 -0
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -0
- package/lib/command/index.d.ts +10 -0
- package/lib/command/index.d.ts.map +1 -0
- package/lib/command/index.js +10 -0
- package/lib/command/index.js.map +1 -0
- package/lib/editor/command/AcEdCommand.d.ts +42 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -0
- package/lib/editor/command/AcEdCommand.js +60 -0
- package/lib/editor/command/AcEdCommand.js.map +1 -0
- package/lib/editor/command/AcEdCommandIterator.d.ts +36 -0
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -0
- package/lib/editor/command/AcEdCommandIterator.js +65 -0
- package/lib/editor/command/AcEdCommandIterator.js.map +1 -0
- package/lib/editor/command/AcEdCommandStack.d.ts +66 -0
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -0
- package/lib/editor/command/AcEdCommandStack.js +192 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -0
- package/lib/editor/command/index.d.ts +3 -0
- package/lib/editor/command/index.d.ts.map +1 -0
- package/lib/editor/command/index.js +3 -0
- package/lib/editor/command/index.js.map +1 -0
- package/lib/editor/global/AcEdGlobalFunc.d.ts +8 -0
- package/lib/editor/global/AcEdGlobalFunc.d.ts.map +1 -0
- package/lib/editor/global/AcEdGlobalFunc.js +14 -0
- package/lib/editor/global/AcEdGlobalFunc.js.map +1 -0
- package/lib/editor/global/AcEdMessage.d.ts +5 -0
- package/lib/editor/global/AcEdMessage.d.ts.map +1 -0
- package/lib/editor/global/AcEdMessage.js +6 -0
- package/lib/editor/global/AcEdMessage.js.map +1 -0
- package/lib/editor/global/eventBus.d.ts +34 -0
- package/lib/editor/global/eventBus.d.ts.map +1 -0
- package/lib/editor/global/eventBus.js +3 -0
- package/lib/editor/global/eventBus.js.map +1 -0
- package/lib/editor/global/index.d.ts +3 -0
- package/lib/editor/global/index.d.ts.map +1 -0
- package/lib/editor/global/index.js +3 -0
- package/lib/editor/global/index.js.map +1 -0
- package/lib/editor/index.d.ts +5 -0
- package/lib/editor/index.d.ts.map +1 -0
- package/lib/editor/index.js +5 -0
- package/lib/editor/index.js.map +1 -0
- package/lib/editor/input/AcEdBaseInput.d.ts +25 -0
- package/lib/editor/input/AcEdBaseInput.d.ts.map +1 -0
- package/lib/editor/input/AcEdBaseInput.js +105 -0
- package/lib/editor/input/AcEdBaseInput.js.map +1 -0
- package/lib/editor/input/AcEdBoxSelector.d.ts +27 -0
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +1 -0
- package/lib/editor/input/AcEdBoxSelector.js +140 -0
- package/lib/editor/input/AcEdBoxSelector.js.map +1 -0
- package/lib/editor/input/AcEdCursorManager.d.ts +43 -0
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -0
- package/lib/editor/input/AcEdCursorManager.js +71 -0
- package/lib/editor/input/AcEdCursorManager.js.map +1 -0
- package/lib/editor/input/AcEdInputPoint.d.ts +14 -0
- package/lib/editor/input/AcEdInputPoint.d.ts.map +1 -0
- package/lib/editor/input/AcEdInputPoint.js +41 -0
- package/lib/editor/input/AcEdInputPoint.js.map +1 -0
- package/lib/editor/input/AcEdJig.d.ts +14 -0
- package/lib/editor/input/AcEdJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdJig.js +92 -0
- package/lib/editor/input/AcEdJig.js.map +1 -0
- package/lib/editor/input/AcEdJigLoop.d.ts +14 -0
- package/lib/editor/input/AcEdJigLoop.d.ts.map +1 -0
- package/lib/editor/input/AcEdJigLoop.js +43 -0
- package/lib/editor/input/AcEdJigLoop.js.map +1 -0
- package/lib/editor/input/AcEdSelectionSet.d.ts +26 -0
- package/lib/editor/input/AcEdSelectionSet.d.ts.map +1 -0
- package/lib/editor/input/AcEdSelectionSet.js +63 -0
- package/lib/editor/input/AcEdSelectionSet.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +27 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -0
- package/lib/editor/input/AcEditor.js +103 -0
- package/lib/editor/input/AcEditor.js.map +1 -0
- package/lib/editor/input/index.d.ts +5 -0
- package/lib/editor/input/index.d.ts.map +1 -0
- package/lib/editor/input/index.js +5 -0
- package/lib/editor/input/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +261 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -0
- package/lib/editor/view/AcEdBaseView.js +260 -0
- package/lib/editor/view/AcEdBaseView.js.map +1 -0
- package/lib/editor/view/index.d.ts +2 -0
- package/lib/editor/view/index.d.ts.map +1 -0
- package/lib/editor/view/index.js +2 -0
- package/lib/editor/view/index.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/util/AcTrGeometryUtil.d.ts +18 -0
- package/lib/util/AcTrGeometryUtil.d.ts.map +1 -0
- package/lib/util/AcTrGeometryUtil.js +33 -0
- package/lib/util/AcTrGeometryUtil.js.map +1 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -0
- package/lib/view/AcTrLayer.d.ts +97 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -0
- package/lib/view/AcTrLayer.js +170 -0
- package/lib/view/AcTrLayer.js.map +1 -0
- package/lib/view/AcTrLayout.d.ts +114 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -0
- package/lib/view/AcTrLayout.js +344 -0
- package/lib/view/AcTrLayout.js.map +1 -0
- package/lib/view/AcTrLayoutView.d.ts +57 -0
- package/lib/view/AcTrLayoutView.d.ts.map +1 -0
- package/lib/view/AcTrLayoutView.js +151 -0
- package/lib/view/AcTrLayoutView.js.map +1 -0
- package/lib/view/AcTrLayoutViewManager.d.ts +43 -0
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -0
- package/lib/view/AcTrLayoutViewManager.js +74 -0
- package/lib/view/AcTrLayoutViewManager.js.map +1 -0
- package/lib/view/AcTrScene.d.ts +115 -0
- package/lib/view/AcTrScene.d.ts.map +1 -0
- package/lib/view/AcTrScene.js +319 -0
- package/lib/view/AcTrScene.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts +160 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -0
- package/lib/view/AcTrView2d.js +473 -0
- package/lib/view/AcTrView2d.js.map +1 -0
- package/lib/view/index.d.ts +2 -0
- package/lib/view/index.d.ts.map +1 -0
- package/lib/view/index.js +2 -0
- package/lib/view/index.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcEdBaseInput } from './AcEdBaseInput';
|
|
17
|
+
/**
|
|
18
|
+
* Class used to input one point
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
var AcEdInputPoint = /** @class */ (function (_super) {
|
|
22
|
+
__extends(AcEdInputPoint, _super);
|
|
23
|
+
function AcEdInputPoint(view) {
|
|
24
|
+
var _this = _super.call(this, view) || this;
|
|
25
|
+
_this.onClick = function (event) {
|
|
26
|
+
_this.resolve(_this.view.cwcs2Wcs({ x: event.clientX, y: event.clientY }));
|
|
27
|
+
};
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
AcEdInputPoint.prototype.activate = function () {
|
|
31
|
+
_super.prototype.activate.call(this);
|
|
32
|
+
this.view.canvas.addEventListener('click', this.onClick);
|
|
33
|
+
};
|
|
34
|
+
AcEdInputPoint.prototype.deactivate = function () {
|
|
35
|
+
_super.prototype.deactivate.call(this);
|
|
36
|
+
this.view.canvas.removeEventListener('click', this.onClick);
|
|
37
|
+
};
|
|
38
|
+
return AcEdInputPoint;
|
|
39
|
+
}(AcEdBaseInput));
|
|
40
|
+
export { AcEdInputPoint };
|
|
41
|
+
//# sourceMappingURL=AcEdInputPoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdInputPoint.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdInputPoint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;GAGG;AACH;IAAoC,kCAA0B;IAC5D,wBAAY,IAAkB;QAC5B,YAAA,MAAK,YAAC,IAAI,CAAC,SAAA;QAaL,aAAO,GAAG,UAAC,KAAiB;YAClC,KAAI,CAAC,OAAO,CAAC,KAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QAC1E,CAAC,CAAA;;IAdD,CAAC;IAED,iCAAQ,GAAR;QACE,gBAAK,CAAC,QAAQ,WAAE,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1D,CAAC;IAED,mCAAU,GAAV;QACE,gBAAK,CAAC,UAAU,WAAE,CAAA;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC7D,CAAC;IAKH,qBAAC;AAAD,CAAC,AAlBD,CAAoC,aAAa,GAkBhD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AcEdBaseView } from '../view';
|
|
2
|
+
export declare class AcEdJig<TResult> {
|
|
3
|
+
private _jigLoop;
|
|
4
|
+
private _view;
|
|
5
|
+
constructor(view: AcEdBaseView);
|
|
6
|
+
get view(): AcEdBaseView;
|
|
7
|
+
resolve(result: TResult): void;
|
|
8
|
+
reject(reason: string): void;
|
|
9
|
+
drag(): Promise<void>;
|
|
10
|
+
sampler(): Promise<void>;
|
|
11
|
+
update(): void;
|
|
12
|
+
private onUpdate;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AcEdJig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdJig.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdJig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGtC,qBAAa,OAAO,CAAC,OAAO;IAC1B,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,KAAK,CAAc;gBAEf,IAAI,EAAE,YAAY;IAM9B,IAAI,IAAI,iBAEP;IAED,OAAO,CAAC,MAAM,EAAE,OAAO;IAKvB,MAAM,CAAC,MAAM,EAAE,MAAM;IAKf,IAAI;IAMJ,OAAO;IAIb,MAAM;IAIN,OAAO,CAAC,QAAQ,CAEf;CACF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { AcEdJigLoop } from './AcEdJigLoop';
|
|
38
|
+
var AcEdJig = /** @class */ (function () {
|
|
39
|
+
function AcEdJig(view) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
this.onUpdate = function () {
|
|
42
|
+
_this.update();
|
|
43
|
+
};
|
|
44
|
+
this._view = view;
|
|
45
|
+
this._jigLoop = new AcEdJigLoop(view);
|
|
46
|
+
this._jigLoop.events.update.addEventListener(this.onUpdate);
|
|
47
|
+
}
|
|
48
|
+
Object.defineProperty(AcEdJig.prototype, "view", {
|
|
49
|
+
get: function () {
|
|
50
|
+
return this._view;
|
|
51
|
+
},
|
|
52
|
+
enumerable: false,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
AcEdJig.prototype.resolve = function (result) {
|
|
56
|
+
this._jigLoop.events.update.removeEventListener(this.onUpdate);
|
|
57
|
+
this._jigLoop.resolve(result);
|
|
58
|
+
};
|
|
59
|
+
AcEdJig.prototype.reject = function (reason) {
|
|
60
|
+
this._jigLoop.events.update.removeEventListener(this.onUpdate);
|
|
61
|
+
this._jigLoop.reject(reason);
|
|
62
|
+
};
|
|
63
|
+
AcEdJig.prototype.drag = function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var promise1, promise2;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
promise1 = this._jigLoop.start();
|
|
70
|
+
promise2 = this.sampler();
|
|
71
|
+
return [4 /*yield*/, Promise.allSettled([promise1, promise2])];
|
|
72
|
+
case 1:
|
|
73
|
+
_a.sent();
|
|
74
|
+
return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
AcEdJig.prototype.sampler = function () {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/];
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
AcEdJig.prototype.update = function () {
|
|
87
|
+
// Do nothing for now
|
|
88
|
+
};
|
|
89
|
+
return AcEdJig;
|
|
90
|
+
}());
|
|
91
|
+
export { AcEdJig };
|
|
92
|
+
//# sourceMappingURL=AcEdJig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdJig.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;IAIE,iBAAY,IAAkB;QAA9B,iBAIC;QA8BO,aAAQ,GAAG;YACjB,KAAI,CAAC,MAAM,EAAE,CAAA;QACf,CAAC,CAAA;QAnCC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC7D,CAAC;IAED,sBAAI,yBAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;;;OAAA;IAED,yBAAO,GAAP,UAAQ,MAAe;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAED,wBAAM,GAAN,UAAO,MAAc;QACnB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9B,CAAC;IAEK,sBAAI,GAAV;;;;;;wBACQ,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;wBAChC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;wBAC/B,qBAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAA;;wBAA9C,SAA8C,CAAA;;;;;KAC/C;IAEK,yBAAO,GAAb;;;;;;KAEC;IAED,wBAAM,GAAN;QACE,qBAAqB;IACvB,CAAC;IAKH,cAAC;AAAD,CAAC,AAzCD,IAyCC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AcCmEventManager, AcGePoint2d } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
3
|
+
import { AcEdBaseInput } from './AcEdBaseInput';
|
|
4
|
+
export declare class AcEdJigLoop<TResult> extends AcEdBaseInput<TResult> {
|
|
5
|
+
readonly events: {
|
|
6
|
+
update: AcCmEventManager<void>;
|
|
7
|
+
};
|
|
8
|
+
curPos: AcGePoint2d;
|
|
9
|
+
constructor(view: AcEdBaseView);
|
|
10
|
+
activate(): void;
|
|
11
|
+
deactivate(): void;
|
|
12
|
+
private onMouseMove;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AcEdJigLoop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdJigLoop.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,qBAAa,WAAW,CAAC,OAAO,CAAE,SAAQ,aAAa,CAAC,OAAO,CAAC;IAC9D,SAAgB,MAAM;;MAErB;IACM,MAAM,EAAE,WAAW,CAAA;gBAEd,IAAI,EAAE,YAAY;IAK9B,QAAQ;IAKR,UAAU;IAKV,OAAO,CAAC,WAAW,CAGlB;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcCmEventManager, AcGePoint2d } from '@mlightcad/data-model';
|
|
17
|
+
import { AcEdBaseInput } from './AcEdBaseInput';
|
|
18
|
+
var AcEdJigLoop = /** @class */ (function (_super) {
|
|
19
|
+
__extends(AcEdJigLoop, _super);
|
|
20
|
+
function AcEdJigLoop(view) {
|
|
21
|
+
var _this = _super.call(this, view) || this;
|
|
22
|
+
_this.events = {
|
|
23
|
+
update: new AcCmEventManager()
|
|
24
|
+
};
|
|
25
|
+
_this.onMouseMove = function (event) {
|
|
26
|
+
_this.curPos.set(event.clientX, event.clientY);
|
|
27
|
+
_this.events.update.dispatch();
|
|
28
|
+
};
|
|
29
|
+
_this.curPos = new AcGePoint2d();
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
AcEdJigLoop.prototype.activate = function () {
|
|
33
|
+
_super.prototype.activate.call(this);
|
|
34
|
+
this.view.canvas.addEventListener('mousemove', this.onMouseMove);
|
|
35
|
+
};
|
|
36
|
+
AcEdJigLoop.prototype.deactivate = function () {
|
|
37
|
+
_super.prototype.deactivate.call(this);
|
|
38
|
+
this.view.canvas.removeEventListener('mousemove', this.onMouseMove);
|
|
39
|
+
};
|
|
40
|
+
return AcEdJigLoop;
|
|
41
|
+
}(AcEdBaseInput));
|
|
42
|
+
export { AcEdJigLoop };
|
|
43
|
+
//# sourceMappingURL=AcEdJigLoop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdJigLoop.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdJigLoop.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;IAA0C,+BAAsB;IAM9D,qBAAY,IAAkB;QAC5B,YAAA,MAAK,YAAC,IAAI,CAAC,SAAA;QANG,YAAM,GAAG;YACvB,MAAM,EAAE,IAAI,gBAAgB,EAAQ;SACrC,CAAA;QAkBO,iBAAW,GAAG,UAAC,KAAiB;YACtC,KAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC7C,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAA;QAC/B,CAAC,CAAA;QAhBC,KAAI,CAAC,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;;IACjC,CAAC;IAED,8BAAQ,GAAR;QACE,gBAAK,CAAC,QAAQ,WAAE,CAAA;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IAClE,CAAC;IAED,gCAAU,GAAV;QACE,gBAAK,CAAC,UAAU,WAAE,CAAA;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;IACrE,CAAC;IAMH,kBAAC;AAAD,CAAC,AAzBD,CAA0C,aAAa,GAyBtD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
|
+
import { AcDbObjectId } from '@mlightcad/data-model';
|
|
3
|
+
/**
|
|
4
|
+
* Interface to define arguments of selection events.
|
|
5
|
+
*/
|
|
6
|
+
export interface AcEdSelectionEventArgs {
|
|
7
|
+
ids: AcDbObjectId[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The class represents the selection set in current view.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AcEdSelectionSet {
|
|
13
|
+
private _ids;
|
|
14
|
+
readonly events: {
|
|
15
|
+
selectionAdded: AcCmEventManager<AcEdSelectionEventArgs>;
|
|
16
|
+
selectionRemoved: AcCmEventManager<AcEdSelectionEventArgs>;
|
|
17
|
+
};
|
|
18
|
+
constructor(ids?: AcDbObjectId[]);
|
|
19
|
+
get ids(): string[];
|
|
20
|
+
get count(): number;
|
|
21
|
+
add(value: AcDbObjectId | AcDbObjectId[]): void;
|
|
22
|
+
delete(value: AcDbObjectId | AcDbObjectId[]): void;
|
|
23
|
+
has(id: AcDbObjectId): boolean;
|
|
24
|
+
clear(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=AcEdSelectionSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdSelectionSet.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdSelectionSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,YAAY,EAAE,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAmB;IAE/B,SAAgB,MAAM;;;MAGrB;gBAEW,GAAG,GAAE,YAAY,EAAO;IAIpC,IAAI,GAAG,aAEN;IAED,IAAI,KAAK,WAER;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAUxC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;IAU3C,GAAG,CAAC,EAAE,EAAE,YAAY;IAIpB,KAAK;CAON"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
|
+
/**
|
|
3
|
+
* The class represents the selection set in current view.
|
|
4
|
+
*/
|
|
5
|
+
var AcEdSelectionSet = /** @class */ (function () {
|
|
6
|
+
function AcEdSelectionSet(ids) {
|
|
7
|
+
if (ids === void 0) { ids = []; }
|
|
8
|
+
this.events = {
|
|
9
|
+
selectionAdded: new AcCmEventManager(),
|
|
10
|
+
selectionRemoved: new AcCmEventManager()
|
|
11
|
+
};
|
|
12
|
+
this._ids = new Set(ids);
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(AcEdSelectionSet.prototype, "ids", {
|
|
15
|
+
get: function () {
|
|
16
|
+
return Array.from(this._ids);
|
|
17
|
+
},
|
|
18
|
+
enumerable: false,
|
|
19
|
+
configurable: true
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(AcEdSelectionSet.prototype, "count", {
|
|
22
|
+
get: function () {
|
|
23
|
+
return this._ids.size;
|
|
24
|
+
},
|
|
25
|
+
enumerable: false,
|
|
26
|
+
configurable: true
|
|
27
|
+
});
|
|
28
|
+
AcEdSelectionSet.prototype.add = function (value) {
|
|
29
|
+
var _this = this;
|
|
30
|
+
if (Array.isArray(value)) {
|
|
31
|
+
value.forEach(function (item) { return _this._ids.add(item); });
|
|
32
|
+
this.events.selectionAdded.dispatch({ ids: value });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this._ids.add(value);
|
|
36
|
+
this.events.selectionAdded.dispatch({ ids: [value] });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
AcEdSelectionSet.prototype.delete = function (value) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
if (Array.isArray(value)) {
|
|
42
|
+
value.forEach(function (item) { return _this._ids.delete(item); });
|
|
43
|
+
this.events.selectionRemoved.dispatch({ ids: value });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this._ids.delete(value);
|
|
47
|
+
this.events.selectionRemoved.dispatch({ ids: [value] });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
AcEdSelectionSet.prototype.has = function (id) {
|
|
51
|
+
return this._ids.has(id);
|
|
52
|
+
};
|
|
53
|
+
AcEdSelectionSet.prototype.clear = function () {
|
|
54
|
+
if (this._ids.size > 0) {
|
|
55
|
+
var ids = Array.from(this._ids);
|
|
56
|
+
this._ids.clear();
|
|
57
|
+
this.events.selectionRemoved.dispatch({ ids: ids });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return AcEdSelectionSet;
|
|
61
|
+
}());
|
|
62
|
+
export { AcEdSelectionSet };
|
|
63
|
+
//# sourceMappingURL=AcEdSelectionSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdSelectionSet.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdSelectionSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAUxD;;GAEG;AACH;IAQE,0BAAY,GAAwB;QAAxB,oBAAA,EAAA,QAAwB;QALpB,WAAM,GAAG;YACvB,cAAc,EAAE,IAAI,gBAAgB,EAA0B;YAC9D,gBAAgB,EAAE,IAAI,gBAAgB,EAA0B;SACjE,CAAA;QAGC,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAe,GAAG,CAAC,CAAA;IACxC,CAAC;IAED,sBAAI,iCAAG;aAAP;YACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;;;OAAA;IAED,sBAAI,mCAAK;aAAT;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;QACvB,CAAC;;;OAAA;IAED,8BAAG,GAAH,UAAI,KAAoC;QAAxC,iBAQC;QAPC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI,IAAI,OAAA,KAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAnB,CAAmB,CAAC,CAAA;YAC1C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAA;QACrD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACpB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IAED,iCAAM,GAAN,UAAO,KAAoC;QAA3C,iBAQC;QAPC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI,IAAI,OAAA,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAtB,CAAsB,CAAC,CAAA;YAC7C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAA;QACvD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACvB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACzD,CAAC;IACH,CAAC;IAED,8BAAG,GAAH,UAAI,EAAgB;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1B,CAAC;IAED,gCAAK,GAAL;QACE,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACvB,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACjC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;YACjB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AAnDD,IAmDC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
2
|
+
import { AcEdCorsorType } from './AcEdCursorManager';
|
|
3
|
+
/**
|
|
4
|
+
* This class is one advanced wrapper for all kinds of inputs such as inputting string, number, angle,
|
|
5
|
+
* distance, point, selection and so on. The mouse events and keyborad events are hidden for API users.
|
|
6
|
+
* It means API users should never listen mouse events and keyborad events. They should always use methods
|
|
7
|
+
* provided by this classes to get user inputs.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AcEditor {
|
|
10
|
+
private _previousCursor?;
|
|
11
|
+
private _currentCursor?;
|
|
12
|
+
private _cursorManager;
|
|
13
|
+
protected _view: AcEdBaseView;
|
|
14
|
+
constructor(view: AcEdBaseView);
|
|
15
|
+
get currentCursor(): AcEdCorsorType | undefined;
|
|
16
|
+
restoreCursor(): void;
|
|
17
|
+
setCursor(cursorType: AcEdCorsorType): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get user input for a point.
|
|
20
|
+
*/
|
|
21
|
+
getPoint(): Promise<import("@mlightcad/geometry-engine").AcGePoint2d>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the selection set obtained.
|
|
24
|
+
*/
|
|
25
|
+
getSelection(): Promise<import("@mlightcad/geometry-engine").AcGeBox2d>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=AcEditor.d.ts.map
|
|
@@ -0,0 +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;AAEnD,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAA;AAGvE;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,eAAe,CAAC,CAAgB;IACxC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,cAAc,CAAmB;IACzC,SAAS,CAAC,KAAK,EAAE,YAAY,CAAA;gBAEjB,IAAI,EAAE,YAAY;IAK9B,IAAI,aAAa,+BAEhB;IAED,aAAa;IAMb,SAAS,CAAC,UAAU,EAAE,cAAc;IAMpC;;OAEG;IACG,QAAQ;IAKd;;OAEG;IACG,YAAY;CAInB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { AcEdBoxSelector } from './AcEdBoxSelector';
|
|
38
|
+
import { AcEdCursorManager } from './AcEdCursorManager';
|
|
39
|
+
import { AcEdInputPoint } from './AcEdInputPoint';
|
|
40
|
+
/**
|
|
41
|
+
* This class is one advanced wrapper for all kinds of inputs such as inputting string, number, angle,
|
|
42
|
+
* distance, point, selection and so on. The mouse events and keyborad events are hidden for API users.
|
|
43
|
+
* It means API users should never listen mouse events and keyborad events. They should always use methods
|
|
44
|
+
* provided by this classes to get user inputs.
|
|
45
|
+
*/
|
|
46
|
+
var AcEditor = /** @class */ (function () {
|
|
47
|
+
function AcEditor(view) {
|
|
48
|
+
this._view = view;
|
|
49
|
+
this._cursorManager = new AcEdCursorManager();
|
|
50
|
+
}
|
|
51
|
+
Object.defineProperty(AcEditor.prototype, "currentCursor", {
|
|
52
|
+
get: function () {
|
|
53
|
+
return this._currentCursor;
|
|
54
|
+
},
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
58
|
+
AcEditor.prototype.restoreCursor = function () {
|
|
59
|
+
if (this._previousCursor != null) {
|
|
60
|
+
this.setCursor(this._previousCursor);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
AcEditor.prototype.setCursor = function (cursorType) {
|
|
64
|
+
this._cursorManager.setCursor(cursorType, this._view.canvas);
|
|
65
|
+
this._previousCursor = this._currentCursor;
|
|
66
|
+
this._currentCursor = cursorType;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Get user input for a point.
|
|
70
|
+
*/
|
|
71
|
+
AcEditor.prototype.getPoint = function () {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var inputter;
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
switch (_a.label) {
|
|
76
|
+
case 0:
|
|
77
|
+
inputter = new AcEdInputPoint(this._view);
|
|
78
|
+
return [4 /*yield*/, inputter.start()];
|
|
79
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Get the selection set obtained.
|
|
86
|
+
*/
|
|
87
|
+
AcEditor.prototype.getSelection = function () {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
+
var selector;
|
|
90
|
+
return __generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0:
|
|
93
|
+
selector = new AcEdBoxSelector(this._view);
|
|
94
|
+
return [4 /*yield*/, selector.start()];
|
|
95
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
return AcEditor;
|
|
101
|
+
}());
|
|
102
|
+
export { AcEditor };
|
|
103
|
+
//# sourceMappingURL=AcEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;;GAKG;AACH;IAME,kBAAY,IAAkB;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,EAAE,CAAA;IAC/C,CAAC;IAED,sBAAI,mCAAa;aAAjB;YACE,OAAO,IAAI,CAAC,cAAc,CAAA;QAC5B,CAAC;;;OAAA;IAED,gCAAa,GAAb;QACE,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;IAED,4BAAS,GAAT,UAAU,UAA0B;QAClC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAC5D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAA;QAC1C,IAAI,CAAC,cAAc,GAAG,UAAU,CAAA;IAClC,CAAC;IAED;;OAEG;IACG,2BAAQ,GAAd;;;;;;wBACQ,QAAQ,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;wBACxC,qBAAM,QAAQ,CAAC,KAAK,EAAE,EAAA;4BAA7B,sBAAO,SAAsB,EAAA;;;;KAC9B;IAED;;OAEG;IACG,+BAAY,GAAlB;;;;;;wBACQ,QAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;wBACzC,qBAAM,QAAQ,CAAC,KAAK,EAAE,EAAA;4BAA7B,sBAAO,SAAsB,EAAA;;;;KAC9B;IACH,eAAC;AAAD,CAAC,AA1CD,IA0CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/input/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/editor/input/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
|