@mlightcad/cad-simple-viewer 1.4.12 → 1.4.13

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.
Files changed (160) hide show
  1. package/dist/index.js +15901 -10590
  2. package/dist/index.umd.cjs +55 -48
  3. package/dist/libredwg-parser-worker.js +4724 -4762
  4. package/lib/app/AcApDocManager.d.ts +60 -4
  5. package/lib/app/AcApDocManager.d.ts.map +1 -1
  6. package/lib/app/AcApDocManager.js +160 -33
  7. package/lib/app/AcApDocManager.js.map +1 -1
  8. package/lib/command/AcApArcCmd.d.ts.map +1 -1
  9. package/lib/command/AcApArcCmd.js +1 -1
  10. package/lib/command/AcApArcCmd.js.map +1 -1
  11. package/lib/command/AcApCircleCmd.d.ts +59 -0
  12. package/lib/command/AcApCircleCmd.d.ts.map +1 -1
  13. package/lib/command/AcApCircleCmd.js +489 -18
  14. package/lib/command/AcApCircleCmd.js.map +1 -1
  15. package/lib/command/AcApConvertToPngCmd.d.ts +35 -0
  16. package/lib/command/AcApConvertToPngCmd.d.ts.map +1 -0
  17. package/lib/command/{AcApZoomToBoxCmd.js → AcApConvertToPngCmd.js} +50 -26
  18. package/lib/command/AcApConvertToPngCmd.js.map +1 -0
  19. package/lib/command/AcApEllipseCmd.d.ts +87 -0
  20. package/lib/command/AcApEllipseCmd.d.ts.map +1 -0
  21. package/lib/command/AcApEllipseCmd.js +583 -0
  22. package/lib/command/AcApEllipseCmd.js.map +1 -0
  23. package/lib/command/AcApHatchCmd.d.ts +210 -0
  24. package/lib/command/AcApHatchCmd.d.ts.map +1 -0
  25. package/lib/command/AcApHatchCmd.js +808 -0
  26. package/lib/command/AcApHatchCmd.js.map +1 -0
  27. package/lib/command/AcApLayerCmd.d.ts +217 -0
  28. package/lib/command/AcApLayerCmd.d.ts.map +1 -0
  29. package/lib/command/AcApLayerCmd.js +768 -0
  30. package/lib/command/AcApLayerCmd.js.map +1 -0
  31. package/lib/command/AcApLineCmd.d.ts +36 -1
  32. package/lib/command/AcApLineCmd.d.ts.map +1 -1
  33. package/lib/command/AcApLineCmd.js +157 -20
  34. package/lib/command/AcApLineCmd.js.map +1 -1
  35. package/lib/command/AcApMeasureAreaCmd.d.ts.map +1 -1
  36. package/lib/command/AcApMeasureAreaCmd.js +3 -0
  37. package/lib/command/AcApMeasureAreaCmd.js.map +1 -1
  38. package/lib/command/AcApMoveCmd.d.ts +16 -0
  39. package/lib/command/AcApMoveCmd.d.ts.map +1 -0
  40. package/lib/command/AcApMoveCmd.js +278 -0
  41. package/lib/command/AcApMoveCmd.js.map +1 -0
  42. package/lib/command/AcApPngConvertor.d.ts +95 -0
  43. package/lib/command/AcApPngConvertor.d.ts.map +1 -0
  44. package/lib/command/AcApPngConvertor.js +205 -0
  45. package/lib/command/AcApPngConvertor.js.map +1 -0
  46. package/lib/command/AcApPolygonCmd.d.ts +69 -0
  47. package/lib/command/AcApPolygonCmd.d.ts.map +1 -0
  48. package/lib/command/AcApPolygonCmd.js +422 -0
  49. package/lib/command/AcApPolygonCmd.js.map +1 -0
  50. package/lib/command/AcApRectCmd.d.ts +149 -4
  51. package/lib/command/AcApRectCmd.d.ts.map +1 -1
  52. package/lib/command/AcApRectCmd.js +716 -34
  53. package/lib/command/AcApRectCmd.js.map +1 -1
  54. package/lib/command/AcApRevCircleCmd.d.ts +8 -0
  55. package/lib/command/AcApRevCircleCmd.d.ts.map +1 -1
  56. package/lib/command/AcApRevCircleCmd.js +30 -6
  57. package/lib/command/AcApRevCircleCmd.js.map +1 -1
  58. package/lib/command/AcApRevRectCmd.d.ts +8 -0
  59. package/lib/command/AcApRevRectCmd.d.ts.map +1 -1
  60. package/lib/command/AcApRevRectCmd.js +78 -6
  61. package/lib/command/AcApRevRectCmd.js.map +1 -1
  62. package/lib/command/AcApSplineCmd.d.ts +66 -1
  63. package/lib/command/AcApSplineCmd.d.ts.map +1 -1
  64. package/lib/command/AcApSplineCmd.js +466 -59
  65. package/lib/command/AcApSplineCmd.js.map +1 -1
  66. package/lib/command/AcApZoomCmd.d.ts +91 -20
  67. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  68. package/lib/command/AcApZoomCmd.js +288 -23
  69. package/lib/command/AcApZoomCmd.js.map +1 -1
  70. package/lib/command/index.d.ts +7 -1
  71. package/lib/command/index.d.ts.map +1 -1
  72. package/lib/command/index.js +7 -1
  73. package/lib/command/index.js.map +1 -1
  74. package/lib/editor/command/AcEdCommandStack.d.ts +54 -1
  75. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  76. package/lib/editor/command/AcEdCommandStack.js +207 -25
  77. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  78. package/lib/editor/input/AcEdSelectionFilter.d.ts +79 -0
  79. package/lib/editor/input/AcEdSelectionFilter.d.ts.map +1 -0
  80. package/lib/editor/input/AcEdSelectionFilter.js +231 -0
  81. package/lib/editor/input/AcEdSelectionFilter.js.map +1 -0
  82. package/lib/editor/input/AcEditor.d.ts +20 -2
  83. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  84. package/lib/editor/input/AcEditor.js +66 -0
  85. package/lib/editor/input/AcEditor.js.map +1 -1
  86. package/lib/editor/input/index.d.ts +1 -0
  87. package/lib/editor/input/index.d.ts.map +1 -1
  88. package/lib/editor/input/index.js +1 -0
  89. package/lib/editor/input/index.js.map +1 -1
  90. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +47 -0
  91. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -1
  92. package/lib/editor/input/prompt/AcEdKeywordCollection.js +19 -0
  93. package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -1
  94. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
  95. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  96. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
  97. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  98. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts +17 -0
  99. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts.map +1 -1
  100. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js +30 -3
  101. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js.map +1 -1
  102. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +6 -1
  103. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -1
  104. package/lib/editor/input/prompt/AcEdPromptOptions.js +7 -0
  105. package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -1
  106. package/lib/editor/input/session/AcEdKeywordSession.d.ts +65 -0
  107. package/lib/editor/input/session/AcEdKeywordSession.d.ts.map +1 -1
  108. package/lib/editor/input/session/AcEdKeywordSession.js +71 -0
  109. package/lib/editor/input/session/AcEdKeywordSession.js.map +1 -1
  110. package/lib/editor/input/ui/AcEdCommandLine.d.ts +23 -0
  111. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  112. package/lib/editor/input/ui/AcEdCommandLine.js +42 -6
  113. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  114. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +1 -0
  115. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  116. package/lib/editor/input/ui/AcEdFloatingInput.js +8 -2
  117. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  118. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +23 -1
  119. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  120. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +32 -9
  121. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  122. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +28 -0
  123. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
  124. package/lib/editor/input/ui/AcEdInputManager.d.ts +356 -16
  125. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  126. package/lib/editor/input/ui/AcEdInputManager.js +964 -529
  127. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  128. package/lib/editor/input/ui/AcEdRubberBand.d.ts +15 -1
  129. package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
  130. package/lib/editor/input/ui/AcEdRubberBand.js +42 -10
  131. package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
  132. package/lib/i18n/en/command.d.ts +21 -3
  133. package/lib/i18n/en/command.d.ts.map +1 -1
  134. package/lib/i18n/en/command.js +21 -3
  135. package/lib/i18n/en/command.js.map +1 -1
  136. package/lib/i18n/en/jig.d.ts +443 -0
  137. package/lib/i18n/en/jig.d.ts.map +1 -1
  138. package/lib/i18n/en/jig.js +452 -9
  139. package/lib/i18n/en/jig.js.map +1 -1
  140. package/lib/i18n/zh/command.d.ts +21 -3
  141. package/lib/i18n/zh/command.d.ts.map +1 -1
  142. package/lib/i18n/zh/command.js +21 -3
  143. package/lib/i18n/zh/command.js.map +1 -1
  144. package/lib/i18n/zh/jig.d.ts +443 -0
  145. package/lib/i18n/zh/jig.d.ts.map +1 -1
  146. package/lib/i18n/zh/jig.js +452 -9
  147. package/lib/i18n/zh/jig.js.map +1 -1
  148. package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
  149. package/lib/plugin/AcApPluginManager.js.map +1 -1
  150. package/lib/view/AcTrLayer.d.ts.map +1 -1
  151. package/lib/view/AcTrLayer.js +5 -3
  152. package/lib/view/AcTrLayer.js.map +1 -1
  153. package/lib/view/AcTrView2d.d.ts +0 -1
  154. package/lib/view/AcTrView2d.d.ts.map +1 -1
  155. package/lib/view/AcTrView2d.js +17 -4
  156. package/lib/view/AcTrView2d.js.map +1 -1
  157. package/package.json +11 -9
  158. package/lib/command/AcApZoomToBoxCmd.d.ts +0 -29
  159. package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
  160. package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
@@ -0,0 +1,69 @@
1
+ import { AcApContext } from '../app';
2
+ import { AcEdCommand } from '../editor';
3
+ /**
4
+ * Command to create one regular polygon.
5
+ *
6
+ * AutoCAD-like flow:
7
+ * - Enter number of sides (3-1024)
8
+ * - Specify center point or [Edge]
9
+ * - Center branch: specify radius point, with [Inscribed/Circumscribed] switch
10
+ * - Edge branch: specify first and second endpoints of one edge
11
+ */
12
+ export declare class AcApPolygonCmd extends AcEdCommand {
13
+ /**
14
+ * Last accepted side count used as default for next command run.
15
+ */
16
+ private static _lastSides;
17
+ /**
18
+ * Creates POLYGON command instance.
19
+ */
20
+ constructor();
21
+ /**
22
+ * Command entry point.
23
+ *
24
+ * @param context - Current application/document context.
25
+ */
26
+ execute(context: AcApContext): Promise<void>;
27
+ /**
28
+ * Adds one localized keyword to a point prompt.
29
+ *
30
+ * @param prompt - Target prompt object.
31
+ * @param key - Keyword translation key suffix.
32
+ */
33
+ private addKeyword;
34
+ /**
35
+ * Appends final polygon entity to model space.
36
+ *
37
+ * @param context - Current application/document context.
38
+ * @param vertices - Polygon vertex list in world coordinates.
39
+ */
40
+ private appendPolygon;
41
+ /**
42
+ * Emits warning message for invalid polygon input.
43
+ *
44
+ * @param key - Invalid-input category.
45
+ */
46
+ private warnInvalidInput;
47
+ /**
48
+ * Prompts and validates polygon side count.
49
+ *
50
+ * @returns Valid side count, or `undefined` on cancel.
51
+ */
52
+ private promptSides;
53
+ /**
54
+ * Runs center-based polygon flow.
55
+ *
56
+ * @param context - Current application/document context.
57
+ * @param sides - Number of polygon sides.
58
+ * @param center - Picked polygon center point.
59
+ */
60
+ private runCenterFlow;
61
+ /**
62
+ * Runs edge-based polygon flow.
63
+ *
64
+ * @param context - Current application/document context.
65
+ * @param sides - Number of polygon sides.
66
+ */
67
+ private runEdgeFlow;
68
+ }
69
+ //# sourceMappingURL=AcApPolygonCmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPolygonCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApPolygonCmd.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EAEL,WAAW,EAOZ,MAAM,WAAW,CAAA;AAmNlB;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU,CAAI;IAE7B;;OAEG;;IAMH;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAsBlC;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAMrB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;;;OAIG;YACW,WAAW;IA2BzB;;;;;;OAMG;YACW,aAAa;IAuD3B;;;;;OAKG;YACW,WAAW;CAoC1B"}
@@ -0,0 +1,422 @@
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, AcGePoint3d } from '@mlightcad/data-model';
53
+ import { AcApDocManager } from '../app';
54
+ import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptPointOptions, AcEdPromptStatus, AcEdPromptStringOptions, eventBus } from '../editor';
55
+ import { AcApI18n } from '../i18n';
56
+ var MIN_SIDES = 3;
57
+ var MAX_SIDES = 1024;
58
+ var EPSILON = 1e-9;
59
+ function distance2d(p1, p2) {
60
+ return Math.hypot(p2.x - p1.x, p2.y - p1.y);
61
+ }
62
+ function updatePolylineVertices(polyline, vertices) {
63
+ polyline.reset(false);
64
+ vertices.forEach(function (point, index) { return polyline.addVertexAt(index, point); });
65
+ polyline.closed = true;
66
+ }
67
+ function buildPolygonFromCenter(center, sides, point, mode) {
68
+ var inputRadius = distance2d(center, point);
69
+ if (inputRadius <= EPSILON)
70
+ return undefined;
71
+ var step = (Math.PI * 2) / sides;
72
+ var baseAngle = Math.atan2(point.y - center.y, point.x - center.x);
73
+ var circumRadius = mode === 'Inscribed' ? inputRadius : inputRadius / Math.cos(Math.PI / sides);
74
+ if (!Number.isFinite(circumRadius) || circumRadius <= EPSILON)
75
+ return undefined;
76
+ var firstVertexAngle = mode === 'Inscribed' ? baseAngle : baseAngle + step / 2;
77
+ var vertices = [];
78
+ for (var i = 0; i < sides; i++) {
79
+ var angle = firstVertexAngle + i * step;
80
+ vertices.push(new AcGePoint2d(center.x + circumRadius * Math.cos(angle), center.y + circumRadius * Math.sin(angle)));
81
+ }
82
+ return vertices;
83
+ }
84
+ function buildPolygonFromEdge(firstPoint, secondPoint, sides) {
85
+ var dx = secondPoint.x - firstPoint.x;
86
+ var dy = secondPoint.y - firstPoint.y;
87
+ var edgeLength = Math.hypot(dx, dy);
88
+ if (edgeLength <= EPSILON)
89
+ return undefined;
90
+ var step = (Math.PI * 2) / sides;
91
+ var vertices = [
92
+ new AcGePoint2d(firstPoint),
93
+ new AcGePoint2d(secondPoint)
94
+ ];
95
+ var currentX = secondPoint.x;
96
+ var currentY = secondPoint.y;
97
+ var edgeX = dx;
98
+ var edgeY = dy;
99
+ for (var i = 2; i < sides; i++) {
100
+ var rotatedX = edgeX * Math.cos(step) - edgeY * Math.sin(step);
101
+ var rotatedY = edgeX * Math.sin(step) + edgeY * Math.cos(step);
102
+ currentX += rotatedX;
103
+ currentY += rotatedY;
104
+ vertices.push(new AcGePoint2d(currentX, currentY));
105
+ edgeX = rotatedX;
106
+ edgeY = rotatedY;
107
+ }
108
+ return vertices;
109
+ }
110
+ /**
111
+ * Dynamic preview jig for center-based polygon creation.
112
+ */
113
+ var AcApPolygonCenterJig = /** @class */ (function (_super) {
114
+ __extends(AcApPolygonCenterJig, _super);
115
+ /**
116
+ * Creates center-mode polygon preview jig.
117
+ *
118
+ * @param view - Active editor view.
119
+ * @param center - Polygon center point.
120
+ * @param sides - Number of polygon sides.
121
+ * @param modeProvider - Callback for current inscribed/circumscribed mode.
122
+ */
123
+ function AcApPolygonCenterJig(view, center, sides, modeProvider) {
124
+ var _this = _super.call(this, view) || this;
125
+ _this._polyline = new AcDbPolyline();
126
+ _this._center = center;
127
+ _this._sides = sides;
128
+ _this._modeProvider = modeProvider;
129
+ return _this;
130
+ }
131
+ Object.defineProperty(AcApPolygonCenterJig.prototype, "entity", {
132
+ /**
133
+ * Gets transient polygon entity used by this jig.
134
+ */
135
+ get: function () {
136
+ return this._polyline;
137
+ },
138
+ enumerable: false,
139
+ configurable: true
140
+ });
141
+ /**
142
+ * Rebuilds preview polygon from cursor radius point.
143
+ *
144
+ * @param point - Current cursor point.
145
+ */
146
+ AcApPolygonCenterJig.prototype.update = function (point) {
147
+ var vertices = buildPolygonFromCenter(this._center, this._sides, point, this._modeProvider());
148
+ if (!vertices)
149
+ return;
150
+ updatePolylineVertices(this._polyline, vertices);
151
+ };
152
+ return AcApPolygonCenterJig;
153
+ }(AcEdPreviewJig));
154
+ /**
155
+ * Dynamic preview jig for edge-based polygon creation.
156
+ */
157
+ var AcApPolygonEdgeJig = /** @class */ (function (_super) {
158
+ __extends(AcApPolygonEdgeJig, _super);
159
+ /**
160
+ * Creates edge-mode polygon preview jig.
161
+ *
162
+ * @param view - Active editor view.
163
+ * @param firstPoint - First endpoint of the seed edge.
164
+ * @param sides - Number of polygon sides.
165
+ */
166
+ function AcApPolygonEdgeJig(view, firstPoint, sides) {
167
+ var _this = _super.call(this, view) || this;
168
+ _this._polyline = new AcDbPolyline();
169
+ _this._firstPoint = firstPoint;
170
+ _this._sides = sides;
171
+ return _this;
172
+ }
173
+ Object.defineProperty(AcApPolygonEdgeJig.prototype, "entity", {
174
+ /**
175
+ * Gets transient polygon entity used by this jig.
176
+ */
177
+ get: function () {
178
+ return this._polyline;
179
+ },
180
+ enumerable: false,
181
+ configurable: true
182
+ });
183
+ /**
184
+ * Rebuilds preview polygon from current second edge point.
185
+ *
186
+ * @param secondPoint - Current cursor point for edge endpoint.
187
+ */
188
+ AcApPolygonEdgeJig.prototype.update = function (secondPoint) {
189
+ var vertices = buildPolygonFromEdge(this._firstPoint, secondPoint, this._sides);
190
+ if (!vertices)
191
+ return;
192
+ updatePolylineVertices(this._polyline, vertices);
193
+ };
194
+ return AcApPolygonEdgeJig;
195
+ }(AcEdPreviewJig));
196
+ /**
197
+ * Command to create one regular polygon.
198
+ *
199
+ * AutoCAD-like flow:
200
+ * - Enter number of sides (3-1024)
201
+ * - Specify center point or [Edge]
202
+ * - Center branch: specify radius point, with [Inscribed/Circumscribed] switch
203
+ * - Edge branch: specify first and second endpoints of one edge
204
+ */
205
+ var AcApPolygonCmd = /** @class */ (function (_super) {
206
+ __extends(AcApPolygonCmd, _super);
207
+ /**
208
+ * Creates POLYGON command instance.
209
+ */
210
+ function AcApPolygonCmd() {
211
+ var _this = _super.call(this) || this;
212
+ _this.mode = AcEdOpenMode.Write;
213
+ return _this;
214
+ }
215
+ /**
216
+ * Command entry point.
217
+ *
218
+ * @param context - Current application/document context.
219
+ */
220
+ AcApPolygonCmd.prototype.execute = function (context) {
221
+ return __awaiter(this, void 0, void 0, function () {
222
+ var sides, centerOrEdgePrompt, centerOrEdgeResult;
223
+ return __generator(this, function (_a) {
224
+ switch (_a.label) {
225
+ case 0: return [4 /*yield*/, this.promptSides()];
226
+ case 1:
227
+ sides = _a.sent();
228
+ if (sides == null)
229
+ return [2 /*return*/];
230
+ centerOrEdgePrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.polygon.centerOrEdge'));
231
+ this.addKeyword(centerOrEdgePrompt, 'edge');
232
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(centerOrEdgePrompt)];
233
+ case 2:
234
+ centerOrEdgeResult = _a.sent();
235
+ if (!(centerOrEdgeResult.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 5];
236
+ if (!(centerOrEdgeResult.stringResult === 'Edge')) return [3 /*break*/, 4];
237
+ return [4 /*yield*/, this.runEdgeFlow(context, sides)];
238
+ case 3:
239
+ _a.sent();
240
+ _a.label = 4;
241
+ case 4: return [2 /*return*/];
242
+ case 5:
243
+ if (centerOrEdgeResult.status !== AcEdPromptStatus.OK)
244
+ return [2 /*return*/];
245
+ return [4 /*yield*/, this.runCenterFlow(context, sides, centerOrEdgeResult.value)];
246
+ case 6:
247
+ _a.sent();
248
+ return [2 /*return*/];
249
+ }
250
+ });
251
+ });
252
+ };
253
+ /**
254
+ * Adds one localized keyword to a point prompt.
255
+ *
256
+ * @param prompt - Target prompt object.
257
+ * @param key - Keyword translation key suffix.
258
+ */
259
+ AcApPolygonCmd.prototype.addKeyword = function (prompt, key) {
260
+ prompt.keywords.add(AcApI18n.t("jig.polygon.keywords.".concat(key, ".display")), AcApI18n.t("jig.polygon.keywords.".concat(key, ".global")), AcApI18n.t("jig.polygon.keywords.".concat(key, ".local")));
261
+ };
262
+ /**
263
+ * Appends final polygon entity to model space.
264
+ *
265
+ * @param context - Current application/document context.
266
+ * @param vertices - Polygon vertex list in world coordinates.
267
+ */
268
+ AcApPolygonCmd.prototype.appendPolygon = function (context, vertices) {
269
+ var polygon = new AcDbPolyline();
270
+ updatePolylineVertices(polygon, vertices);
271
+ context.doc.database.tables.blockTable.modelSpace.appendEntity(polygon);
272
+ };
273
+ /**
274
+ * Emits warning message for invalid polygon input.
275
+ *
276
+ * @param key - Invalid-input category.
277
+ */
278
+ AcApPolygonCmd.prototype.warnInvalidInput = function (key) {
279
+ eventBus.emit('message', {
280
+ message: AcApI18n.t("jig.polygon.invalid.".concat(key)),
281
+ type: 'warning'
282
+ });
283
+ };
284
+ /**
285
+ * Prompts and validates polygon side count.
286
+ *
287
+ * @returns Valid side count, or `undefined` on cancel.
288
+ */
289
+ AcApPolygonCmd.prototype.promptSides = function () {
290
+ return __awaiter(this, void 0, void 0, function () {
291
+ var defaultSides, sidesPrompt, sidesResult, rawInput, rawValue;
292
+ var _a;
293
+ return __generator(this, function (_b) {
294
+ switch (_b.label) {
295
+ case 0:
296
+ if (!true) return [3 /*break*/, 2];
297
+ defaultSides = AcApPolygonCmd._lastSides;
298
+ sidesPrompt = new AcEdPromptStringOptions("".concat(AcApI18n.t('jig.polygon.numberOfSides'), " <").concat(defaultSides, ">"));
299
+ sidesPrompt.allowEmpty = true;
300
+ sidesPrompt.allowSpaces = false;
301
+ return [4 /*yield*/, AcApDocManager.instance.editor.getString(sidesPrompt)];
302
+ case 1:
303
+ sidesResult = _b.sent();
304
+ if (sidesResult.status !== AcEdPromptStatus.OK)
305
+ return [2 /*return*/, undefined];
306
+ rawInput = ((_a = sidesResult.stringResult) !== null && _a !== void 0 ? _a : '').trim();
307
+ rawValue = rawInput === '' ? defaultSides : Number(rawInput);
308
+ if (Number.isInteger(rawValue) &&
309
+ rawValue >= MIN_SIDES &&
310
+ rawValue <= MAX_SIDES) {
311
+ AcApPolygonCmd._lastSides = rawValue;
312
+ return [2 /*return*/, rawValue];
313
+ }
314
+ this.warnInvalidInput('sides');
315
+ return [3 /*break*/, 0];
316
+ case 2: return [2 /*return*/];
317
+ }
318
+ });
319
+ });
320
+ };
321
+ /**
322
+ * Runs center-based polygon flow.
323
+ *
324
+ * @param context - Current application/document context.
325
+ * @param sides - Number of polygon sides.
326
+ * @param center - Picked polygon center point.
327
+ */
328
+ AcApPolygonCmd.prototype.runCenterFlow = function (context, sides, center) {
329
+ return __awaiter(this, void 0, void 0, function () {
330
+ var mode, radiusPrompt, radiusResult, keyword, vertices;
331
+ var _a;
332
+ return __generator(this, function (_b) {
333
+ switch (_b.label) {
334
+ case 0:
335
+ mode = 'Inscribed';
336
+ _b.label = 1;
337
+ case 1:
338
+ if (!true) return [3 /*break*/, 3];
339
+ radiusPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.polygon.radiusOrType'));
340
+ this.addKeyword(radiusPrompt, 'inscribed');
341
+ this.addKeyword(radiusPrompt, 'circumscribed');
342
+ radiusPrompt.useDashedLine = true;
343
+ radiusPrompt.useBasePoint = true;
344
+ radiusPrompt.basePoint = new AcGePoint3d(center);
345
+ radiusPrompt.jig = new AcApPolygonCenterJig(context.view, center, sides, function () { return mode; });
346
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(radiusPrompt)];
347
+ case 2:
348
+ radiusResult = _b.sent();
349
+ if (radiusResult.status === AcEdPromptStatus.Keyword) {
350
+ keyword = (_a = radiusResult.stringResult) !== null && _a !== void 0 ? _a : '';
351
+ if (keyword === 'Inscribed') {
352
+ mode = 'Inscribed';
353
+ return [3 /*break*/, 1];
354
+ }
355
+ if (keyword === 'Circumscribed') {
356
+ mode = 'Circumscribed';
357
+ return [3 /*break*/, 1];
358
+ }
359
+ return [2 /*return*/];
360
+ }
361
+ if (radiusResult.status !== AcEdPromptStatus.OK)
362
+ return [2 /*return*/];
363
+ vertices = buildPolygonFromCenter(center, sides, radiusResult.value, mode);
364
+ if (!vertices) {
365
+ this.warnInvalidInput('radius');
366
+ return [3 /*break*/, 1];
367
+ }
368
+ this.appendPolygon(context, vertices);
369
+ return [2 /*return*/];
370
+ case 3: return [2 /*return*/];
371
+ }
372
+ });
373
+ });
374
+ };
375
+ /**
376
+ * Runs edge-based polygon flow.
377
+ *
378
+ * @param context - Current application/document context.
379
+ * @param sides - Number of polygon sides.
380
+ */
381
+ AcApPolygonCmd.prototype.runEdgeFlow = function (context, sides) {
382
+ return __awaiter(this, void 0, void 0, function () {
383
+ var firstEdgePrompt, firstEdgeResult, firstPoint, secondEdgePrompt, secondEdgeResult, vertices;
384
+ return __generator(this, function (_a) {
385
+ switch (_a.label) {
386
+ case 0:
387
+ firstEdgePrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.polygon.edgeStart'));
388
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(firstEdgePrompt)];
389
+ case 1:
390
+ firstEdgeResult = _a.sent();
391
+ if (firstEdgeResult.status !== AcEdPromptStatus.OK)
392
+ return [2 /*return*/];
393
+ firstPoint = firstEdgeResult.value;
394
+ secondEdgePrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.polygon.edgeEnd'));
395
+ secondEdgePrompt.useDashedLine = true;
396
+ secondEdgePrompt.useBasePoint = true;
397
+ secondEdgePrompt.basePoint = new AcGePoint3d(firstPoint);
398
+ secondEdgePrompt.jig = new AcApPolygonEdgeJig(context.view, firstPoint, sides);
399
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(secondEdgePrompt)];
400
+ case 2:
401
+ secondEdgeResult = _a.sent();
402
+ if (secondEdgeResult.status !== AcEdPromptStatus.OK)
403
+ return [2 /*return*/];
404
+ vertices = buildPolygonFromEdge(firstPoint, secondEdgeResult.value, sides);
405
+ if (!vertices) {
406
+ this.warnInvalidInput('edge');
407
+ return [2 /*return*/];
408
+ }
409
+ this.appendPolygon(context, vertices);
410
+ return [2 /*return*/];
411
+ }
412
+ });
413
+ });
414
+ };
415
+ /**
416
+ * Last accepted side count used as default for next command run.
417
+ */
418
+ AcApPolygonCmd._lastSides = 4;
419
+ return AcApPolygonCmd;
420
+ }(AcEdCommand));
421
+ export { AcApPolygonCmd };
422
+ //# sourceMappingURL=AcApPolygonCmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPolygonCmd.js","sourceRoot":"","sources":["../../src/command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