@mlightcad/cad-simple-viewer 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +88 -88
- package/dist/index.js +6014 -5042
- package/dist/index.umd.cjs +22 -22
- package/lib/app/AcApAnnotation.d.ts +46 -0
- package/lib/app/AcApAnnotation.d.ts.map +1 -0
- package/lib/app/AcApAnnotation.js +134 -0
- package/lib/app/AcApAnnotation.js.map +1 -0
- package/lib/app/AcApDocManager.d.ts +118 -6
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +162 -6
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +16 -14
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +48 -31
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcDbOpenDatabaseOptions.d.ts +28 -0
- package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -0
- package/lib/app/AcDbOpenDatabaseOptions.js +2 -0
- package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -0
- package/lib/app/index.d.ts +2 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +2 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApBaseRevCmd.d.ts +36 -0
- package/lib/command/AcApBaseRevCmd.d.ts.map +1 -0
- package/lib/command/AcApBaseRevCmd.js +68 -0
- package/lib/command/AcApBaseRevCmd.js.map +1 -0
- package/lib/command/AcApCircleCmd.d.ts +1 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -1
- package/lib/command/AcApCircleCmd.js +4 -2
- package/lib/command/AcApCircleCmd.js.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.js +44 -2
- package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
- package/lib/command/AcApDimLinearCmd.d.ts +1 -0
- package/lib/command/AcApDimLinearCmd.d.ts.map +1 -1
- package/lib/command/AcApDimLinearCmd.js +4 -2
- package/lib/command/AcApDimLinearCmd.js.map +1 -1
- package/lib/command/AcApEraseCmd.d.ts +1 -0
- package/lib/command/AcApEraseCmd.d.ts.map +1 -1
- package/lib/command/AcApEraseCmd.js +14 -4
- package/lib/command/AcApEraseCmd.js.map +1 -1
- package/lib/command/AcApLineCmd.d.ts +1 -0
- package/lib/command/AcApLineCmd.d.ts.map +1 -1
- package/lib/command/AcApLineCmd.js +4 -2
- package/lib/command/AcApLineCmd.js.map +1 -1
- package/lib/command/AcApLogCmd.d.ts +1 -1
- package/lib/command/AcApLogCmd.d.ts.map +1 -1
- package/lib/command/AcApLogCmd.js +44 -3
- package/lib/command/AcApLogCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +1 -1
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +42 -1
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +1 -1
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +43 -2
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +1 -1
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +44 -2
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApRectCmd.d.ts +23 -0
- package/lib/command/AcApRectCmd.d.ts.map +1 -0
- package/lib/command/AcApRectCmd.js +134 -0
- package/lib/command/AcApRectCmd.js.map +1 -0
- package/lib/command/AcApRegenCmd.d.ts +1 -1
- package/lib/command/AcApRegenCmd.d.ts.map +1 -1
- package/lib/command/AcApRegenCmd.js +42 -1
- package/lib/command/AcApRegenCmd.js.map +1 -1
- package/lib/command/AcApRevCircleCmd.d.ts +10 -0
- package/lib/command/AcApRevCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApRevCircleCmd.js +83 -0
- package/lib/command/AcApRevCircleCmd.js.map +1 -0
- package/lib/command/AcApRevCloudCmd.d.ts +26 -0
- package/lib/command/AcApRevCloudCmd.d.ts.map +1 -0
- package/lib/command/AcApRevCloudCmd.js +234 -0
- package/lib/command/AcApRevCloudCmd.js.map +1 -0
- package/lib/command/AcApRevRectCmd.d.ts +10 -0
- package/lib/command/AcApRevRectCmd.d.ts.map +1 -0
- package/lib/command/AcApRevRectCmd.js +83 -0
- package/lib/command/AcApRevRectCmd.js.map +1 -0
- package/lib/command/AcApRevVisibilityCmd.d.ts +15 -0
- package/lib/command/AcApRevVisibilityCmd.d.ts.map +1 -0
- package/lib/command/AcApRevVisibilityCmd.js +90 -0
- package/lib/command/AcApRevVisibilityCmd.js.map +1 -0
- package/lib/command/AcApSelectCmd.d.ts +1 -1
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +43 -2
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/AcApSketchCmd.d.ts +32 -0
- package/lib/command/AcApSketchCmd.d.ts.map +1 -0
- package/lib/command/AcApSketchCmd.js +171 -0
- package/lib/command/AcApSketchCmd.js.map +1 -0
- package/lib/command/AcApSwitchBgCmd.d.ts +15 -0
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -0
- package/lib/command/AcApSwitchBgCmd.js +88 -0
- package/lib/command/AcApSwitchBgCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +2 -1
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +6 -5
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/AcApZoomCmd.d.ts +1 -1
- package/lib/command/AcApZoomCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomCmd.js +42 -1
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/index.d.ts +8 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +8 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +81 -22
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +157 -15
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts +1 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +31 -6
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +55 -11
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +14 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +5 -1
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +2 -2
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/view/AcEdOpenMode.d.ts +26 -0
- package/lib/editor/view/AcEdOpenMode.d.ts.map +1 -0
- package/lib/editor/view/AcEdOpenMode.js +27 -0
- package/lib/editor/view/AcEdOpenMode.js.map +1 -0
- package/lib/editor/view/index.d.ts +2 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +2 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +19 -1
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +8 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +8 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +18 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +8 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +8 -0
- package/lib/i18n/zh/jig.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/plugin/AcApPlugin.d.ts +83 -0
- package/lib/plugin/AcApPlugin.d.ts.map +1 -0
- package/lib/plugin/AcApPlugin.js +2 -0
- package/lib/plugin/AcApPlugin.js.map +1 -0
- package/lib/plugin/AcApPluginExample.d.ts +23 -0
- package/lib/plugin/AcApPluginExample.d.ts.map +1 -0
- package/lib/plugin/AcApPluginExample.js +160 -0
- package/lib/plugin/AcApPluginExample.js.map +1 -0
- package/lib/plugin/AcApPluginManager.d.ts +206 -0
- package/lib/plugin/AcApPluginManager.d.ts.map +1 -0
- package/lib/plugin/AcApPluginManager.js +499 -0
- package/lib/plugin/AcApPluginManager.js.map +1 -0
- package/lib/plugin/index.d.ts +4 -0
- package/lib/plugin/index.d.ts.map +1 -0
- package/lib/plugin/index.js +4 -0
- package/lib/plugin/index.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +8 -1
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcEdOpenMode } from '../editor';
|
|
53
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
54
|
+
import { AcApRectCmd } from './AcApRectCmd';
|
|
55
|
+
/**
|
|
56
|
+
* Command to create one revision rectangle.
|
|
57
|
+
*/
|
|
58
|
+
var AcApRevRectCmd = /** @class */ (function (_super) {
|
|
59
|
+
__extends(AcApRevRectCmd, _super);
|
|
60
|
+
function AcApRevRectCmd() {
|
|
61
|
+
var _this = _super.call(this) || this;
|
|
62
|
+
_this.mode = AcEdOpenMode.Review;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
AcApRevRectCmd.prototype.execute = function (context) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
var cmd;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
cmd = new AcApRectCmd();
|
|
72
|
+
return [4 /*yield*/, cmd.execute(context)];
|
|
73
|
+
case 1:
|
|
74
|
+
_a.sent();
|
|
75
|
+
return [2 /*return*/];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return AcApRevRectCmd;
|
|
81
|
+
}(AcApBaseRevCmd));
|
|
82
|
+
export { AcApRevRectCmd };
|
|
83
|
+
//# sourceMappingURL=AcApRevRectCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApRevRectCmd.js","sourceRoot":"","sources":["../../src/command/AcApRevRectCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH;IAAoC,kCAAc;IAChD;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAA;;IACjC,CAAC;IAEK,gCAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,GAAG,GAAG,IAAI,WAAW,EAAE,CAAA;wBAC7B,qBAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAA;;wBAA1B,SAA0B,CAAA;;;;;KAC3B;IACH,qBAAC;AAAD,CAAC,AAVD,CAAoC,cAAc,GAUjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
3
|
+
/**
|
|
4
|
+
* Command for switching the visibility of the current layer.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcApRevVisibilityCmd extends AcApBaseRevCmd {
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Executes the command to switch the visibility of the current layer.
|
|
10
|
+
*
|
|
11
|
+
* @param context - The application context containing the view
|
|
12
|
+
*/
|
|
13
|
+
execute(context: AcApContext): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=AcApRevVisibilityCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApRevVisibilityCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApRevVisibilityCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,cAAc;;IAOtD;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CASnC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcApAnnotation } from '../app';
|
|
53
|
+
import { AcEdOpenMode } from '../editor';
|
|
54
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
55
|
+
/**
|
|
56
|
+
* Command for switching the visibility of the current layer.
|
|
57
|
+
*/
|
|
58
|
+
var AcApRevVisibilityCmd = /** @class */ (function (_super) {
|
|
59
|
+
__extends(AcApRevVisibilityCmd, _super);
|
|
60
|
+
function AcApRevVisibilityCmd() {
|
|
61
|
+
var _this = _super.call(this) || this;
|
|
62
|
+
_this.mode = AcEdOpenMode.Review;
|
|
63
|
+
_this.isShowEntityDrawStyleToolbar = false;
|
|
64
|
+
return _this;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Executes the command to switch the visibility of the current layer.
|
|
68
|
+
*
|
|
69
|
+
* @param context - The application context containing the view
|
|
70
|
+
*/
|
|
71
|
+
AcApRevVisibilityCmd.prototype.execute = function (context) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var db, annotation, annotationLayer, layer;
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
db = context.doc.database;
|
|
76
|
+
annotation = new AcApAnnotation(db);
|
|
77
|
+
annotationLayer = annotation.getAnnotationLayer();
|
|
78
|
+
if (annotationLayer) {
|
|
79
|
+
layer = db.tables.layerTable.getAt(annotationLayer);
|
|
80
|
+
if (layer)
|
|
81
|
+
layer.isOff = !layer.isOff;
|
|
82
|
+
}
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return AcApRevVisibilityCmd;
|
|
88
|
+
}(AcApBaseRevCmd));
|
|
89
|
+
export { AcApRevVisibilityCmd };
|
|
90
|
+
//# sourceMappingURL=AcApRevVisibilityCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApRevVisibilityCmd.js","sourceRoot":"","sources":["../../src/command/AcApRevVisibilityCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH;IAA0C,wCAAc;IACtD;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAA;QAC/B,KAAI,CAAC,4BAA4B,GAAG,KAAK,CAAA;;IAC3C,CAAC;IAED;;;;OAIG;IACG,sCAAO,GAAb,UAAc,OAAoB;;;;gBAC1B,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;gBACzB,UAAU,GAAG,IAAI,cAAc,CAAC,EAAE,CAAC,CAAA;gBACnC,eAAe,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAA;gBACvD,IAAI,eAAe,EAAE,CAAC;oBACd,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;oBACzD,IAAI,KAAK;wBAAE,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,CAAA;gBACvC,CAAC;;;;KACF;IACH,2BAAC;AAAD,CAAC,AArBD,CAA0C,cAAc,GAqBvD"}
|
|
@@ -27,6 +27,6 @@ export declare class AcApSelectCmd extends AcEdCommand {
|
|
|
27
27
|
*
|
|
28
28
|
* @param context - The application context containing the view
|
|
29
29
|
*/
|
|
30
|
-
execute(context: AcApContext): void
|
|
30
|
+
execute(context: AcApContext): Promise<void>;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=AcApSelectCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSelectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;OAOG;
|
|
1
|
+
{"version":3,"file":"AcApSelectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;OAOG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAInC"}
|
|
@@ -13,6 +13,42 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
16
52
|
import { AcEdCommand } from '../command';
|
|
17
53
|
import { AcEdCorsorType, AcEdViewMode } from '../editor';
|
|
18
54
|
/**
|
|
@@ -47,8 +83,13 @@ var AcApSelectCmd = /** @class */ (function (_super) {
|
|
|
47
83
|
* @param context - The application context containing the view
|
|
48
84
|
*/
|
|
49
85
|
AcApSelectCmd.prototype.execute = function (context) {
|
|
50
|
-
|
|
51
|
-
|
|
86
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
context.view.mode = AcEdViewMode.SELECTION;
|
|
89
|
+
context.view.setCursor(AcEdCorsorType.Crosshair);
|
|
90
|
+
return [2 /*return*/];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
52
93
|
};
|
|
53
94
|
return AcApSelectCmd;
|
|
54
95
|
}(AcEdCommand));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSelectCmd.js","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApSelectCmd.js","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAmC,iCAAW;IAA9C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACG,+BAAO,GAAb,UAAc,OAAoB;;;gBAChC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,SAAS,CAAA;gBAC1C,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;;;;KACjD;IACH,oBAAC;AAAD,CAAC,AAbD,CAAmC,WAAW,GAa7C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AcDbPolyline, AcGePoint2d, AcGePoint2dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcApContext } from '../app';
|
|
3
|
+
import { AcEdBaseView, AcEdPreviewJig } from '../editor';
|
|
4
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
5
|
+
export declare class AcApSketchJig extends AcEdPreviewJig<AcGePoint2dLike> {
|
|
6
|
+
private _polyline;
|
|
7
|
+
private _points;
|
|
8
|
+
private _lastPoint;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a sketch jig.
|
|
11
|
+
*
|
|
12
|
+
* @param view - The associated view
|
|
13
|
+
* @param start - The first point
|
|
14
|
+
*/
|
|
15
|
+
constructor(view: AcEdBaseView, start: AcGePoint2dLike);
|
|
16
|
+
get entity(): AcDbPolyline;
|
|
17
|
+
/**
|
|
18
|
+
* Gets all accumulated points
|
|
19
|
+
*/
|
|
20
|
+
get points(): AcGePoint2d[];
|
|
21
|
+
update(currentPoint: AcGePoint2dLike): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Command to create a sketch line using polyline.
|
|
25
|
+
* After specifying the first point, continuously tracks mouse movement
|
|
26
|
+
* and adds points to the polyline until the user specifies the second point.
|
|
27
|
+
*/
|
|
28
|
+
export declare class AcApSketchCmd extends AcApBaseRevCmd {
|
|
29
|
+
constructor();
|
|
30
|
+
execute(context: AcApContext): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=AcApSketchCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSketchCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSketchCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EACL,YAAY,EAEZ,cAAc,EAEf,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAcjD,qBAAa,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IAChE,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,UAAU,CAA2B;IAE7C;;;;;OAKG;gBACS,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;IAUtD,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,WAAW,EAAE,CAE1B;IAED,MAAM,CAAC,YAAY,EAAE,eAAe;CAerC;AAED;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,cAAc;;IAMzC,OAAO,CAAC,OAAO,EAAE,WAAW;CAoCnC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDbPolyline, AcGePoint2d } from '@mlightcad/data-model';
|
|
53
|
+
import { AcApDocManager } from '../app';
|
|
54
|
+
import { AcEdOpenMode, AcEdPreviewJig, AcEdPromptPointOptions } from '../editor';
|
|
55
|
+
import { AcApI18n } from '../i18n';
|
|
56
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
57
|
+
// Minimum distance between points to add a new vertex (in world units)
|
|
58
|
+
var MIN_DISTANCE = 0.1;
|
|
59
|
+
/**
|
|
60
|
+
* Calculates the distance between two points
|
|
61
|
+
*/
|
|
62
|
+
function distance(p1, p2) {
|
|
63
|
+
var dx = p2.x - p1.x;
|
|
64
|
+
var dy = p2.y - p1.y;
|
|
65
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
66
|
+
}
|
|
67
|
+
var AcApSketchJig = /** @class */ (function (_super) {
|
|
68
|
+
__extends(AcApSketchJig, _super);
|
|
69
|
+
/**
|
|
70
|
+
* Creates a sketch jig.
|
|
71
|
+
*
|
|
72
|
+
* @param view - The associated view
|
|
73
|
+
* @param start - The first point
|
|
74
|
+
*/
|
|
75
|
+
function AcApSketchJig(view, start) {
|
|
76
|
+
var _this = _super.call(this, view) || this;
|
|
77
|
+
_this._lastPoint = null;
|
|
78
|
+
_this._polyline = new AcDbPolyline();
|
|
79
|
+
_this._points = [new AcGePoint2d(start)];
|
|
80
|
+
_this._lastPoint = new AcGePoint2d(start);
|
|
81
|
+
// Add the first point to the polyline
|
|
82
|
+
_this._polyline.addVertexAt(0, _this._points[0]);
|
|
83
|
+
return _this;
|
|
84
|
+
}
|
|
85
|
+
Object.defineProperty(AcApSketchJig.prototype, "entity", {
|
|
86
|
+
get: function () {
|
|
87
|
+
return this._polyline;
|
|
88
|
+
},
|
|
89
|
+
enumerable: false,
|
|
90
|
+
configurable: true
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(AcApSketchJig.prototype, "points", {
|
|
93
|
+
/**
|
|
94
|
+
* Gets all accumulated points
|
|
95
|
+
*/
|
|
96
|
+
get: function () {
|
|
97
|
+
return this._points;
|
|
98
|
+
},
|
|
99
|
+
enumerable: false,
|
|
100
|
+
configurable: true
|
|
101
|
+
});
|
|
102
|
+
AcApSketchJig.prototype.update = function (currentPoint) {
|
|
103
|
+
if (this._lastPoint === null) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
var current = new AcGePoint2d(currentPoint);
|
|
107
|
+
var dist = distance(this._lastPoint, current);
|
|
108
|
+
// Only add a new point if the distance is significant enough
|
|
109
|
+
if (dist >= MIN_DISTANCE) {
|
|
110
|
+
this._points.push(current);
|
|
111
|
+
this._lastPoint = current;
|
|
112
|
+
this._polyline.addVertexAt(this._points.length, current);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return AcApSketchJig;
|
|
116
|
+
}(AcEdPreviewJig));
|
|
117
|
+
export { AcApSketchJig };
|
|
118
|
+
/**
|
|
119
|
+
* Command to create a sketch line using polyline.
|
|
120
|
+
* After specifying the first point, continuously tracks mouse movement
|
|
121
|
+
* and adds points to the polyline until the user specifies the second point.
|
|
122
|
+
*/
|
|
123
|
+
var AcApSketchCmd = /** @class */ (function (_super) {
|
|
124
|
+
__extends(AcApSketchCmd, _super);
|
|
125
|
+
function AcApSketchCmd() {
|
|
126
|
+
var _this = _super.call(this) || this;
|
|
127
|
+
_this.mode = AcEdOpenMode.Review;
|
|
128
|
+
return _this;
|
|
129
|
+
}
|
|
130
|
+
AcApSketchCmd.prototype.execute = function (context) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
var firstPointPrompt, firstPoint, jig, secondPointPrompt, secondPoint, points, lastPoint, finalPoint, db, polyline, i;
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
switch (_a.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
firstPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.sketch.firstPoint'));
|
|
137
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(firstPointPrompt)];
|
|
138
|
+
case 1:
|
|
139
|
+
firstPoint = _a.sent();
|
|
140
|
+
jig = new AcApSketchJig(context.view, firstPoint);
|
|
141
|
+
secondPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.sketch.nextPoint'));
|
|
142
|
+
secondPointPrompt.jig = jig;
|
|
143
|
+
secondPointPrompt.useDashedLine = false;
|
|
144
|
+
secondPointPrompt.useBasePoint = true;
|
|
145
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(secondPointPrompt)
|
|
146
|
+
// Always add the final point
|
|
147
|
+
];
|
|
148
|
+
case 2:
|
|
149
|
+
secondPoint = _a.sent();
|
|
150
|
+
points = jig.points;
|
|
151
|
+
lastPoint = points[points.length - 1];
|
|
152
|
+
finalPoint = new AcGePoint2d(secondPoint);
|
|
153
|
+
// Only add if it's different from the last point
|
|
154
|
+
if (distance(lastPoint, finalPoint) > 0.01) {
|
|
155
|
+
points.push(finalPoint);
|
|
156
|
+
}
|
|
157
|
+
db = context.doc.database;
|
|
158
|
+
polyline = new AcDbPolyline();
|
|
159
|
+
for (i = 0; i < points.length; i++) {
|
|
160
|
+
polyline.addVertexAt(i, points[i]);
|
|
161
|
+
}
|
|
162
|
+
db.tables.blockTable.modelSpace.appendEntity(polyline);
|
|
163
|
+
return [2 /*return*/];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
return AcApSketchCmd;
|
|
169
|
+
}(AcApBaseRevCmd));
|
|
170
|
+
export { AcApSketchCmd };
|
|
171
|
+
//# sourceMappingURL=AcApSketchCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSketchCmd.js","sourceRoot":"","sources":["../../src/command/AcApSketchCmd.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Command for switching the drawing background between white and black.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcApSwitchBgCmd extends AcEdCommand {
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Executes the command to switch the drawing background between white and black.
|
|
10
|
+
*
|
|
11
|
+
* @param context - The application context containing the view
|
|
12
|
+
*/
|
|
13
|
+
execute(context: AcApContext): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=AcApSwitchBgCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSwitchBgCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSwitchBgCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAgB,MAAM,WAAW,CAAA;AAErD;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;;IAM9C;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAanC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDbSysVarManager } from '@mlightcad/data-model';
|
|
53
|
+
import { AcEdCommand, AcEdOpenMode } from '../editor';
|
|
54
|
+
/**
|
|
55
|
+
* Command for switching the drawing background between white and black.
|
|
56
|
+
*/
|
|
57
|
+
var AcApSwitchBgCmd = /** @class */ (function (_super) {
|
|
58
|
+
__extends(AcApSwitchBgCmd, _super);
|
|
59
|
+
function AcApSwitchBgCmd() {
|
|
60
|
+
var _this = _super.call(this) || this;
|
|
61
|
+
_this.mode = AcEdOpenMode.Review;
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Executes the command to switch the drawing background between white and black.
|
|
66
|
+
*
|
|
67
|
+
* @param context - The application context containing the view
|
|
68
|
+
*/
|
|
69
|
+
AcApSwitchBgCmd.prototype.execute = function (context) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var variableName, sysVarManager, sysVar, db, useWhiteBackgroundColor;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
variableName = 'WHITEBKCOLOR';
|
|
74
|
+
sysVarManager = AcDbSysVarManager.instance();
|
|
75
|
+
sysVar = sysVarManager.getDescriptor(variableName);
|
|
76
|
+
if (sysVar) {
|
|
77
|
+
db = context.doc.database;
|
|
78
|
+
useWhiteBackgroundColor = sysVarManager.getVar(variableName, db);
|
|
79
|
+
sysVarManager.setVar(variableName, !useWhiteBackgroundColor, db);
|
|
80
|
+
}
|
|
81
|
+
return [2 /*return*/];
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
return AcApSwitchBgCmd;
|
|
86
|
+
}(AcEdCommand));
|
|
87
|
+
export { AcApSwitchBgCmd };
|
|
88
|
+
//# sourceMappingURL=AcApSwitchBgCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSwitchBgCmd.js","sourceRoot":"","sources":["../../src/command/AcApSwitchBgCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAGzD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD;;GAEG;AACH;IAAqC,mCAAW;IAC9C;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAA;;IACjC,CAAC;IAED;;;;OAIG;IACG,iCAAO,GAAb,UAAc,OAAoB;;;;gBAC1B,YAAY,GAAG,cAAc,CAAA;gBAC7B,aAAa,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAA;gBAC5C,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;gBACxD,IAAI,MAAM,EAAE,CAAC;oBACL,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;oBACzB,uBAAuB,GAAG,aAAa,CAAC,MAAM,CAClD,YAAY,EACZ,EAAE,CACQ,CAAA;oBACZ,aAAa,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAA;gBAClE,CAAC;;;;KACF;IACH,sBAAC;AAAD,CAAC,AAxBD,CAAqC,WAAW,GAwB/C"}
|
|
@@ -5,11 +5,12 @@ import { AcEdCommand } from '../editor';
|
|
|
5
5
|
* this command.
|
|
6
6
|
*/
|
|
7
7
|
export declare class AcApSysVarCmd extends AcEdCommand {
|
|
8
|
+
constructor();
|
|
8
9
|
/**
|
|
9
10
|
* Executes the command to modify the value of one system variable.
|
|
10
11
|
*
|
|
11
12
|
* @param context - The application context containing the view
|
|
12
13
|
*/
|
|
13
|
-
execute(
|
|
14
|
+
execute(context: AcApContext): Promise<void>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=AcApSysVarCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSysVarCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"AcApSysVarCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAyC,MAAM,WAAW,CAAA;AAG9E;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;;IAM5C;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CASnC"}
|