@mlightcad/cad-simple-viewer 1.4.7 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7749 -6724
- package/dist/index.umd.cjs +23 -23
- 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 +163 -7
- 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/AcApProgress.d.ts +8 -2
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +13 -7
- package/lib/app/AcApProgress.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 +14 -0
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -0
- package/lib/command/AcApSwitchBgCmd.js +86 -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/marker/AcEdMarker.d.ts +4 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.js +11 -3
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +6 -3
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +2 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +22 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +2 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts +6 -4
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.js +19 -13
- package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +14 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +30 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +42 -6
- package/lib/editor/view/AcEdBaseView.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,234 @@
|
|
|
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
|
+
// Cloud line diameter in pixels
|
|
58
|
+
var CLOUD_DIAMETER_PIXELS = 8;
|
|
59
|
+
/**
|
|
60
|
+
* Converts pixel distance to world distance using view transformation
|
|
61
|
+
*/
|
|
62
|
+
function pixelToWorldDistance(view, pixelDistance, referencePoint) {
|
|
63
|
+
var screenPoint1 = view.worldToScreen(referencePoint);
|
|
64
|
+
var screenPoint2 = new AcGePoint2d(screenPoint1.x + pixelDistance, screenPoint1.y);
|
|
65
|
+
var worldPoint2 = view.screenToWorld(screenPoint2);
|
|
66
|
+
return Math.abs(worldPoint2.x - referencePoint.x);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a cloud line (revision cloud) along a rectangular path
|
|
70
|
+
*/
|
|
71
|
+
function updateCloud(cloud, firstPoint, secondPoint, view) {
|
|
72
|
+
// Reset the polyline (using type assertion as reset may not be in type definitions)
|
|
73
|
+
cloud.reset(false);
|
|
74
|
+
// Calculate rectangle dimensions
|
|
75
|
+
var minX = Math.min(firstPoint.x, secondPoint.x);
|
|
76
|
+
var maxX = Math.max(firstPoint.x, secondPoint.x);
|
|
77
|
+
var minY = Math.min(firstPoint.y, secondPoint.y);
|
|
78
|
+
var maxY = Math.max(firstPoint.y, secondPoint.y);
|
|
79
|
+
var width = maxX - minX;
|
|
80
|
+
var height = maxY - minY;
|
|
81
|
+
// Convert cloud diameter from pixels to world coordinates
|
|
82
|
+
var centerPoint = new AcGePoint2d((minX + maxX) / 2, (minY + maxY) / 2);
|
|
83
|
+
var cloudDiameter = pixelToWorldDistance(view, CLOUD_DIAMETER_PIXELS, centerPoint);
|
|
84
|
+
// Calculate chord length for each arc segment
|
|
85
|
+
// Each arc segment should span approximately the cloud diameter
|
|
86
|
+
var chordLength = cloudDiameter;
|
|
87
|
+
// Calculate the number of segments needed along each edge
|
|
88
|
+
var numSegmentsX = Math.max(4, Math.ceil(width / chordLength) * 2);
|
|
89
|
+
var numSegmentsY = Math.max(4, Math.ceil(height / chordLength) * 2);
|
|
90
|
+
// Generate points along the rectangle path with arcs
|
|
91
|
+
var points = [];
|
|
92
|
+
var bulges = [];
|
|
93
|
+
var segmentIndex = 0;
|
|
94
|
+
// Helper function to calculate bulge for a small arc
|
|
95
|
+
// For cloud effect, use a small bulge value to create gentle arcs
|
|
96
|
+
// A bulge of 0.3-0.5 creates nice cloud-like arcs
|
|
97
|
+
var calculateBulge = function (outward) {
|
|
98
|
+
return outward ? 0.4 : -0.4;
|
|
99
|
+
};
|
|
100
|
+
// Bottom edge (left to right)
|
|
101
|
+
for (var i = 0; i <= numSegmentsX; i++) {
|
|
102
|
+
var t = i / numSegmentsX;
|
|
103
|
+
var x = minX + width * t;
|
|
104
|
+
var y = minY;
|
|
105
|
+
points.push(new AcGePoint2d(x, y));
|
|
106
|
+
if (i < numSegmentsX) {
|
|
107
|
+
var outward = segmentIndex % 2 === 0;
|
|
108
|
+
bulges.push(calculateBulge(outward));
|
|
109
|
+
segmentIndex++;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
bulges.push(undefined);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Right edge (bottom to top)
|
|
116
|
+
for (var i = 1; i <= numSegmentsY; i++) {
|
|
117
|
+
var t = i / numSegmentsY;
|
|
118
|
+
var x = maxX;
|
|
119
|
+
var y = minY + height * t;
|
|
120
|
+
points.push(new AcGePoint2d(x, y));
|
|
121
|
+
if (i < numSegmentsY) {
|
|
122
|
+
var outward = segmentIndex % 2 === 0;
|
|
123
|
+
bulges.push(calculateBulge(outward));
|
|
124
|
+
segmentIndex++;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
bulges.push(undefined);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Top edge (right to left)
|
|
131
|
+
for (var i = 1; i <= numSegmentsX; i++) {
|
|
132
|
+
var t = 1 - i / numSegmentsX;
|
|
133
|
+
var x = minX + width * t;
|
|
134
|
+
var y = maxY;
|
|
135
|
+
points.push(new AcGePoint2d(x, y));
|
|
136
|
+
if (i < numSegmentsX) {
|
|
137
|
+
var outward = segmentIndex % 2 === 0;
|
|
138
|
+
bulges.push(calculateBulge(outward));
|
|
139
|
+
segmentIndex++;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
bulges.push(undefined);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Left edge (top to bottom)
|
|
146
|
+
for (var i = 1; i < numSegmentsY; i++) {
|
|
147
|
+
var t = 1 - i / numSegmentsY;
|
|
148
|
+
var x = minX;
|
|
149
|
+
var y = minY + height * t;
|
|
150
|
+
points.push(new AcGePoint2d(x, y));
|
|
151
|
+
if (i < numSegmentsY - 1) {
|
|
152
|
+
var outward = segmentIndex % 2 === 0;
|
|
153
|
+
bulges.push(calculateBulge(outward));
|
|
154
|
+
segmentIndex++;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
bulges.push(undefined);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Add vertices to polyline with bulge values
|
|
161
|
+
for (var i = 0; i < points.length; i++) {
|
|
162
|
+
var bulge = bulges[i];
|
|
163
|
+
cloud.addVertexAt(i, points[i], bulge);
|
|
164
|
+
}
|
|
165
|
+
cloud.closed = true;
|
|
166
|
+
}
|
|
167
|
+
var AcApRevCloudJig = /** @class */ (function (_super) {
|
|
168
|
+
__extends(AcApRevCloudJig, _super);
|
|
169
|
+
/**
|
|
170
|
+
* Creates a cloud line jig.
|
|
171
|
+
*
|
|
172
|
+
* @param view - The associated view
|
|
173
|
+
* @param start - The first corner point
|
|
174
|
+
*/
|
|
175
|
+
function AcApRevCloudJig(view, start) {
|
|
176
|
+
var _this = _super.call(this, view) || this;
|
|
177
|
+
_this._cloud = new AcDbPolyline();
|
|
178
|
+
_this._firstPoint = new AcGePoint2d(start);
|
|
179
|
+
_this._view = view;
|
|
180
|
+
return _this;
|
|
181
|
+
}
|
|
182
|
+
Object.defineProperty(AcApRevCloudJig.prototype, "entity", {
|
|
183
|
+
get: function () {
|
|
184
|
+
return this._cloud;
|
|
185
|
+
},
|
|
186
|
+
enumerable: false,
|
|
187
|
+
configurable: true
|
|
188
|
+
});
|
|
189
|
+
AcApRevCloudJig.prototype.update = function (secondPoint) {
|
|
190
|
+
updateCloud(this._cloud, this._firstPoint, secondPoint, this._view);
|
|
191
|
+
};
|
|
192
|
+
return AcApRevCloudJig;
|
|
193
|
+
}(AcEdPreviewJig));
|
|
194
|
+
export { AcApRevCloudJig };
|
|
195
|
+
/**
|
|
196
|
+
* Command to create a revision cloud (cloud line) in rectangular shape.
|
|
197
|
+
*/
|
|
198
|
+
var AcApRevCloudCmd = /** @class */ (function (_super) {
|
|
199
|
+
__extends(AcApRevCloudCmd, _super);
|
|
200
|
+
function AcApRevCloudCmd() {
|
|
201
|
+
var _this = _super.call(this) || this;
|
|
202
|
+
_this.mode = AcEdOpenMode.Review;
|
|
203
|
+
return _this;
|
|
204
|
+
}
|
|
205
|
+
AcApRevCloudCmd.prototype.execute = function (context) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
+
var firstPointPrompt, firstPoint, secondPointPrompt, secondPoint, db, cloud;
|
|
208
|
+
return __generator(this, function (_a) {
|
|
209
|
+
switch (_a.label) {
|
|
210
|
+
case 0:
|
|
211
|
+
firstPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.line.firstPoint'));
|
|
212
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(firstPointPrompt)];
|
|
213
|
+
case 1:
|
|
214
|
+
firstPoint = _a.sent();
|
|
215
|
+
secondPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.line.nextPoint'));
|
|
216
|
+
secondPointPrompt.jig = new AcApRevCloudJig(context.view, firstPoint);
|
|
217
|
+
secondPointPrompt.useDashedLine = false;
|
|
218
|
+
secondPointPrompt.useBasePoint = true;
|
|
219
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(secondPointPrompt)];
|
|
220
|
+
case 2:
|
|
221
|
+
secondPoint = _a.sent();
|
|
222
|
+
db = context.doc.database;
|
|
223
|
+
cloud = new AcDbPolyline();
|
|
224
|
+
updateCloud(cloud, firstPoint, secondPoint, context.view);
|
|
225
|
+
db.tables.blockTable.modelSpace.appendEntity(cloud);
|
|
226
|
+
return [2 /*return*/];
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
return AcApRevCloudCmd;
|
|
232
|
+
}(AcApBaseRevCmd));
|
|
233
|
+
export { AcApRevCloudCmd };
|
|
234
|
+
//# sourceMappingURL=AcApRevCloudCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApRevCloudCmd.js","sourceRoot":"","sources":["../../src/command/AcApRevCloudCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EAEZ,MAAM,uBAAuB,CAAA;A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iB,CAAC,GAAG,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;wBACrE,iBAAiB,CAAC,aAAa,GAAG,KAAK,CAAA;wBACvC,iBAAiB,CAAC,YAAY,GAAG,IAAI,CAAA;wBAEnC,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAA;;wBAD5D,WAAW,GACf,SAAgE;wBAE5D,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;wBACzB,KAAK,GAAG,IAAI,YAAY,EAAE,CAAA;wBAChC,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;wBACzD,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;;;;;KACpD;IACH,sBAAC;AAAD,CAAC,AA3BD,CAAqC,cAAc,GA2BlD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcApBaseRevCmd } from './AcApBaseRevCmd';
|
|
3
|
+
/**
|
|
4
|
+
* Command to create one revision rectangle.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcApRevRectCmd extends AcApBaseRevCmd {
|
|
7
|
+
constructor();
|
|
8
|
+
execute(context: AcApContext): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AcApRevRectCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApRevRectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApRevRectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;GAEG;AACH,qBAAa,cAAe,SAAQ,cAAc;;IAM1C,OAAO,CAAC,OAAO,EAAE,WAAW;CAInC"}
|
|
@@ -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"}
|