@mlightcad/cad-simple-viewer 1.3.1 → 1.3.2
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 +2964 -2949
- package/dist/index.umd.cjs +19 -19
- package/dist/libredwg-parser-worker.js +13 -5
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +3 -2
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +3 -3
- package/lib/command/AcApCircleCmd.js +3 -3
- package/lib/command/AcApDimLinearCmd.d.ts +26 -0
- package/lib/command/AcApDimLinearCmd.d.ts.map +1 -0
- package/lib/command/AcApDimLinearCmd.js +182 -0
- package/lib/command/AcApDimLinearCmd.js.map +1 -0
- package/lib/command/AcApLineCmd.d.ts +21 -0
- package/lib/command/AcApLineCmd.d.ts.map +1 -0
- package/lib/command/AcApLineCmd.js +118 -0
- package/lib/command/AcApLineCmd.js.map +1 -0
- package/lib/command/AcApSvgConvertor.js +1 -1
- package/lib/command/AcApSvgConvertor.js.map +1 -1
- package/lib/command/index.d.ts +2 -1
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +2 -1
- package/lib/command/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +61 -6
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +120 -8
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +7 -2
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +0 -43
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +29 -124
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +3 -3
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
- package/lib/i18n/en/command.d.ts +2 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +2 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +9 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +10 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +2 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +2 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +9 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +10 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +2 -13
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +5 -5
- package/lib/command/AcApDimCmd.d.ts +0 -57
- package/lib/command/AcApDimCmd.d.ts.map +0 -1
- package/lib/command/AcApDimCmd.js +0 -228
- package/lib/command/AcApDimCmd.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AcGePoint2dLike } from '@mlightcad/data-model';
|
|
1
|
+
import { AcGePoint2d, AcGePoint2dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdBaseView } from '../../view';
|
|
2
3
|
import { AcEdFloatingInputOptions } from './AcEdFloatingInputTypes';
|
|
3
4
|
/**
|
|
4
5
|
* A UI component providing a small floating input box used inside CAD editing
|
|
@@ -17,10 +18,10 @@ import { AcEdFloatingInputOptions } from './AcEdFloatingInputTypes';
|
|
|
17
18
|
* remain clean and free from DOM-handling logic.
|
|
18
19
|
*/
|
|
19
20
|
export declare class AcEdFloatingInput<T> {
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/** Stores last confirmed point */
|
|
22
|
+
lastPoint: AcGePoint2d | null;
|
|
23
|
+
/** The view associated with this input operation */
|
|
24
|
+
protected view: AcEdBaseView;
|
|
24
25
|
/** Inject styles only once */
|
|
25
26
|
private static stylesInjected;
|
|
26
27
|
/**
|
|
@@ -35,6 +36,12 @@ export declare class AcEdFloatingInput<T> {
|
|
|
35
36
|
* X and Y Input elements.
|
|
36
37
|
*/
|
|
37
38
|
private inputs;
|
|
39
|
+
/**
|
|
40
|
+
* OSNAP marker manager to display and hide OSNAP marker
|
|
41
|
+
*/
|
|
42
|
+
private osnapMarkerManager?;
|
|
43
|
+
/** Stores last confirmed osnap point */
|
|
44
|
+
private lastOSnapPoint?;
|
|
38
45
|
/**
|
|
39
46
|
* Callback functions
|
|
40
47
|
*/
|
|
@@ -67,10 +74,11 @@ export declare class AcEdFloatingInput<T> {
|
|
|
67
74
|
/**
|
|
68
75
|
* Constructs a new floating input widget with the given options.
|
|
69
76
|
*
|
|
77
|
+
* @param view - The view associated with the floating input
|
|
70
78
|
* @param options Configuration object controlling behavior, callbacks,
|
|
71
79
|
* validation, and display mode.
|
|
72
80
|
*/
|
|
73
|
-
constructor(options: AcEdFloatingInputOptions<T>);
|
|
81
|
+
constructor(view: AcEdBaseView, options: AcEdFloatingInputOptions<T>);
|
|
74
82
|
/**
|
|
75
83
|
* Injects minimal CSS required for the floating input and preview rectangle.
|
|
76
84
|
* Useful when you do not have a separate CSS file.
|
|
@@ -147,5 +155,52 @@ export declare class AcEdFloatingInput<T> {
|
|
|
147
155
|
* @param e The click event containing the current cursor position.
|
|
148
156
|
*/
|
|
149
157
|
private handleClick;
|
|
158
|
+
/**
|
|
159
|
+
* Gets the position after considering window size and osnap
|
|
160
|
+
* @param e - Mouse event
|
|
161
|
+
* @returns The position after considering window size and osnap
|
|
162
|
+
*/
|
|
163
|
+
private getPosition;
|
|
164
|
+
/**
|
|
165
|
+
* Picks entities that intersect a hit-region centered at the specified point
|
|
166
|
+
* in world coordinates.
|
|
167
|
+
*
|
|
168
|
+
* The hit-region is defined as a square (or bounding box) centered at the
|
|
169
|
+
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
170
|
+
* Only entities whose geometry intersects this region are returned.
|
|
171
|
+
*
|
|
172
|
+
* @param point The center point of the hit-region in world coordinates.
|
|
173
|
+
* If omitted, the current cursor position is used.
|
|
174
|
+
*
|
|
175
|
+
* @param hitRadius The half-width (in world coordinate system) of the
|
|
176
|
+
* hit-region around the point. This creates a square bounding box:
|
|
177
|
+
* [point.x ± hitRadius, point.y ± hitRadius].
|
|
178
|
+
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
179
|
+
* default is used.
|
|
180
|
+
* @returns - Returns The OSNAP point in the specified position in world coordinate system
|
|
181
|
+
* if found. Return undefined if no OSNAP point found.
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* Gets OSNAP point of entities that intersect a hit-region centered at the
|
|
185
|
+
* specified point in world coordinates.
|
|
186
|
+
*
|
|
187
|
+
* The hit-region is defined as a square (or bounding box) centered at the
|
|
188
|
+
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
189
|
+
* Only entities whose geometry intersects this region are returned.
|
|
190
|
+
*
|
|
191
|
+
* @param point The center point of the hit-region in world coordinates.
|
|
192
|
+
* If omitted, the current cursor position is used.
|
|
193
|
+
*
|
|
194
|
+
* @param hitRadius The half-width (in pixel size) of the hit-region around
|
|
195
|
+
* the point. It will be converted on one value in the world
|
|
196
|
+
* coordinate 'wcsHitRadius' and creates a square bounding box:
|
|
197
|
+
* [point.x ± wcsHitRadius, point.y ± wcsHitRadius].
|
|
198
|
+
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
199
|
+
* default is used.
|
|
200
|
+
*
|
|
201
|
+
* @returns An array of object IDs representing the entities that intersect
|
|
202
|
+
* the hit-region.
|
|
203
|
+
*/
|
|
204
|
+
private getOSnapPoint;
|
|
150
205
|
}
|
|
151
206
|
//# sourceMappingURL=AcEdFloatingInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdFloatingInput.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInput.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AcEdFloatingInput.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,eAAe,EAGhB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAGzC,OAAO,EAML,wBAAwB,EAEzB,MAAM,0BAA0B,CAAA;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,iBAAiB,CAAC,CAAC;IAC9B,kCAAkC;IAClC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAO;IAEpC,oDAAoD;IACpD,SAAS,CAAC,IAAI,EAAE,YAAY,CAAA;IAE5B,8BAA8B;IAC9B,OAAO,CAAC,MAAM,CAAC,cAAc,CAAQ;IAErC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAa;IAE3B;;OAEG;IACH,OAAO,CAAC,SAAS,CAAgB;IAEjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAA2B;IAEzC;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAAC,CAAmB;IAE9C,wCAAwC;IACxC,OAAO,CAAC,cAAc,CAAC,CAAiB;IAExC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,CAAoC;IACrD,OAAO,CAAC,QAAQ,CAAC,CAAoC;IACrD,OAAO,CAAC,QAAQ,CAAC,CAAiC;IAClD,OAAO,CAAC,UAAU,CAAwC;IAC1D,OAAO,CAAC,eAAe,CAA0C;IACjE,OAAO,CAAC,WAAW,CAAC,CAAsC;IAE1D,+CAA+C;IAC/C,OAAO,CAAC,OAAO,CAAQ;IAEvB,+CAA+C;IAC/C,OAAO,CAAC,QAAQ,CAAQ;IAExB;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAyB;IAElD;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAyB;IAElD;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAyB;IAEjD;;OAEG;IACH,OAAO,CAAC,YAAY,CAAyB;IAM7C;;;;;;OAMG;gBACS,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAmDpE;;;OAGG;IACH,OAAO,CAAC,SAAS;IAyCjB;;;OAGG;IACH,IAAI,SAAS,YAEZ;IAED;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAYlC;;;;;;;;OAQG;IACH,IAAI;IAOJ;;;;;;;;OAQG;IACH,OAAO;IAUP;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,eAAe;;;;IAyBhC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAUtB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAevB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAiBnB;;;;;;;;;;;;;;;;;;OAkBG;IACH;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,aAAa;CAoCtB"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { acdbHostApplicationServices, AcDbOsnapMode } from '@mlightcad/data-model';
|
|
13
|
+
import { AcEdMarkerManager } from '../marker';
|
|
1
14
|
import { AcEdFloatingInputBoxes } from './AcEdFloatingInputBoxes';
|
|
2
15
|
/**
|
|
3
16
|
* A UI component providing a small floating input box used inside CAD editing
|
|
@@ -22,16 +35,23 @@ var AcEdFloatingInput = /** @class */ (function () {
|
|
|
22
35
|
/**
|
|
23
36
|
* Constructs a new floating input widget with the given options.
|
|
24
37
|
*
|
|
38
|
+
* @param view - The view associated with the floating input
|
|
25
39
|
* @param options Configuration object controlling behavior, callbacks,
|
|
26
40
|
* validation, and display mode.
|
|
27
41
|
*/
|
|
28
|
-
function AcEdFloatingInput(options) {
|
|
42
|
+
function AcEdFloatingInput(view, options) {
|
|
29
43
|
var _this = this;
|
|
30
44
|
var _a, _b;
|
|
45
|
+
/** Stores last confirmed point */
|
|
46
|
+
this.lastPoint = null;
|
|
31
47
|
/** Whether the widget is currently visible. */
|
|
32
48
|
this.visible = false;
|
|
33
49
|
/** Whether this instance has been disposed. */
|
|
34
50
|
this.disposed = false;
|
|
51
|
+
this.view = view;
|
|
52
|
+
if (!options.disableOSnap) {
|
|
53
|
+
this.osnapMarkerManager = new AcEdMarkerManager(view);
|
|
54
|
+
}
|
|
35
55
|
this.parent = (_a = options.parent) !== null && _a !== void 0 ? _a : document.body;
|
|
36
56
|
this.validateFn = options.validate;
|
|
37
57
|
this.getDynamicValue = options.getDynamicValue;
|
|
@@ -132,9 +152,11 @@ var AcEdFloatingInput = /** @class */ (function () {
|
|
|
132
152
|
* Safe to call multiple times; subsequent calls have no effect.
|
|
133
153
|
*/
|
|
134
154
|
AcEdFloatingInput.prototype.dispose = function () {
|
|
155
|
+
var _a;
|
|
135
156
|
if (this.disposed)
|
|
136
157
|
return;
|
|
137
158
|
this.disposed = true;
|
|
159
|
+
(_a = this.osnapMarkerManager) === null || _a === void 0 ? void 0 : _a.clear();
|
|
138
160
|
this.inputs.dispose();
|
|
139
161
|
this.removeListener(true);
|
|
140
162
|
this.container.remove();
|
|
@@ -151,7 +173,6 @@ var AcEdFloatingInput = /** @class */ (function () {
|
|
|
151
173
|
x: pos.x - parentRect.left,
|
|
152
174
|
y: pos.y - parentRect.top
|
|
153
175
|
};
|
|
154
|
-
this.mousePos = mousePos;
|
|
155
176
|
// Compute position within parent bounds
|
|
156
177
|
var left = mousePos.x + 10;
|
|
157
178
|
var top = mousePos.y + 10;
|
|
@@ -208,15 +229,14 @@ var AcEdFloatingInput = /** @class */ (function () {
|
|
|
208
229
|
var _a;
|
|
209
230
|
if (!this.visible)
|
|
210
231
|
return;
|
|
211
|
-
var
|
|
212
|
-
|
|
213
|
-
var defaults = this.getDynamicValue(mousePos.x, mousePos.y);
|
|
232
|
+
var wcsMousePos = this.getPosition(e);
|
|
233
|
+
var defaults = this.getDynamicValue(wcsMousePos);
|
|
214
234
|
this.inputs.setValue(defaults.raw);
|
|
215
235
|
// If inputs lost focus due to some reason, let's try to focus them again.
|
|
216
236
|
if (!this.inputs.focused) {
|
|
217
237
|
this.inputs.focus();
|
|
218
238
|
}
|
|
219
|
-
(_a = this.drawPreview) === null || _a === void 0 ? void 0 : _a.call(this,
|
|
239
|
+
(_a = this.drawPreview) === null || _a === void 0 ? void 0 : _a.call(this, wcsMousePos);
|
|
220
240
|
};
|
|
221
241
|
/**
|
|
222
242
|
* Handles click events to commit inputs.
|
|
@@ -227,10 +247,102 @@ var AcEdFloatingInput = /** @class */ (function () {
|
|
|
227
247
|
var _a;
|
|
228
248
|
if (!this.visible)
|
|
229
249
|
return;
|
|
230
|
-
var
|
|
231
|
-
var defaults = this.getDynamicValue(
|
|
250
|
+
var wcsMousePos = this.getPosition(e);
|
|
251
|
+
var defaults = this.getDynamicValue(wcsMousePos);
|
|
252
|
+
this.lastPoint = wcsMousePos;
|
|
232
253
|
(_a = this.onCommit) === null || _a === void 0 ? void 0 : _a.call(this, defaults.value);
|
|
233
254
|
};
|
|
255
|
+
/**
|
|
256
|
+
* Gets the position after considering window size and osnap
|
|
257
|
+
* @param e - Mouse event
|
|
258
|
+
* @returns The position after considering window size and osnap
|
|
259
|
+
*/
|
|
260
|
+
AcEdFloatingInput.prototype.getPosition = function (e) {
|
|
261
|
+
var mousePos = this.setPosition(e);
|
|
262
|
+
var wcsMousePos = this.view.cwcs2Wcs(mousePos);
|
|
263
|
+
// Show OSNAP Point
|
|
264
|
+
if (this.osnapMarkerManager) {
|
|
265
|
+
this.osnapMarkerManager.hideMarker();
|
|
266
|
+
this.lastOSnapPoint = this.getOSnapPoint();
|
|
267
|
+
if (this.lastOSnapPoint) {
|
|
268
|
+
wcsMousePos.x = this.lastOSnapPoint.x;
|
|
269
|
+
wcsMousePos.y = this.lastOSnapPoint.y;
|
|
270
|
+
this.osnapMarkerManager.showMarker(this.lastOSnapPoint);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return wcsMousePos;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Picks entities that intersect a hit-region centered at the specified point
|
|
277
|
+
* in world coordinates.
|
|
278
|
+
*
|
|
279
|
+
* The hit-region is defined as a square (or bounding box) centered at the
|
|
280
|
+
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
281
|
+
* Only entities whose geometry intersects this region are returned.
|
|
282
|
+
*
|
|
283
|
+
* @param point The center point of the hit-region in world coordinates.
|
|
284
|
+
* If omitted, the current cursor position is used.
|
|
285
|
+
*
|
|
286
|
+
* @param hitRadius The half-width (in world coordinate system) of the
|
|
287
|
+
* hit-region around the point. This creates a square bounding box:
|
|
288
|
+
* [point.x ± hitRadius, point.y ± hitRadius].
|
|
289
|
+
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
290
|
+
* default is used.
|
|
291
|
+
* @returns - Returns The OSNAP point in the specified position in world coordinate system
|
|
292
|
+
* if found. Return undefined if no OSNAP point found.
|
|
293
|
+
*/
|
|
294
|
+
/**
|
|
295
|
+
* Gets OSNAP point of entities that intersect a hit-region centered at the
|
|
296
|
+
* specified point in world coordinates.
|
|
297
|
+
*
|
|
298
|
+
* The hit-region is defined as a square (or bounding box) centered at the
|
|
299
|
+
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
300
|
+
* Only entities whose geometry intersects this region are returned.
|
|
301
|
+
*
|
|
302
|
+
* @param point The center point of the hit-region in world coordinates.
|
|
303
|
+
* If omitted, the current cursor position is used.
|
|
304
|
+
*
|
|
305
|
+
* @param hitRadius The half-width (in pixel size) of the hit-region around
|
|
306
|
+
* the point. It will be converted on one value in the world
|
|
307
|
+
* coordinate 'wcsHitRadius' and creates a square bounding box:
|
|
308
|
+
* [point.x ± wcsHitRadius, point.y ± wcsHitRadius].
|
|
309
|
+
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
310
|
+
* default is used.
|
|
311
|
+
*
|
|
312
|
+
* @returns An array of object IDs representing the entities that intersect
|
|
313
|
+
* the hit-region.
|
|
314
|
+
*/
|
|
315
|
+
AcEdFloatingInput.prototype.getOSnapPoint = function (point, hitRadius) {
|
|
316
|
+
if (hitRadius === void 0) { hitRadius = 20; }
|
|
317
|
+
var results = this.view.pick(point, hitRadius);
|
|
318
|
+
if (results.length > 0) {
|
|
319
|
+
// TODO: Is there one better way to get current working database
|
|
320
|
+
var db = acdbHostApplicationServices().workingDatabase;
|
|
321
|
+
var entity = db.tables.blockTable.modelSpace.getIdAt(results[0]);
|
|
322
|
+
if (entity) {
|
|
323
|
+
var snapPoints = [];
|
|
324
|
+
entity.subGetOsnapPoints(AcDbOsnapMode.EndPoint, __assign(__assign({}, this.view.curPos), { z: 0 }), this.lastPoint, snapPoints);
|
|
325
|
+
// Find the nearest osnap point
|
|
326
|
+
var minDist = Number.MAX_VALUE;
|
|
327
|
+
var minDistIndex = -1;
|
|
328
|
+
for (var i = 0; i < snapPoints.length; ++i) {
|
|
329
|
+
var distance = this.view.curPos.distanceTo(snapPoints[i]);
|
|
330
|
+
if (distance < minDist) {
|
|
331
|
+
minDist = distance;
|
|
332
|
+
minDistIndex = i;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (minDistIndex != -1) {
|
|
336
|
+
var p1 = this.view.cwcs2Wcs({ x: 0, y: 0 });
|
|
337
|
+
var p2 = this.view.cwcs2Wcs({ x: hitRadius, y: 0 });
|
|
338
|
+
if (minDist < p2.x - p1.x) {
|
|
339
|
+
return snapPoints[minDistIndex];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return undefined;
|
|
345
|
+
};
|
|
234
346
|
/** Inject styles only once */
|
|
235
347
|
AcEdFloatingInput.stylesInjected = false;
|
|
236
348
|
return AcEdFloatingInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdFloatingInput.js","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcEdFloatingInput.js","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInput.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAKd,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAWjE;;;;;;;;;;;;;;;GAeG;AACH;IAqEE,8EAA8E;IAC9E,cAAc;IACd,8EAA8E;IAE9E;;;;;;OAMG;IACH,2BAAY,IAAkB,EAAE,OAAoC;QAApE,iBAiDC;;QAhID,kCAAkC;QAClC,cAAS,GAAuB,IAAI,CAAA;QAyCpC,+CAA+C;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CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAzaD,8BAA8B;IACf,gCAAc,GAAG,KAAK,AAAR,CAAQ;IAyavC,wBAAC;CAAA,AAjbD,IAibC;SAjbY,iBAAiB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcGePoint2dLike } from '@mlightcad/data-model';
|
|
1
2
|
/**
|
|
2
3
|
* Describes the raw text values from the X and Y fields in {@link AcEdFloatingInput}.
|
|
3
4
|
*/
|
|
@@ -57,11 +58,11 @@ export type AcEdFloatingInputCancelCallback = () => void;
|
|
|
57
58
|
/**
|
|
58
59
|
* Callback invoked on mousemove to update the preview geometry.
|
|
59
60
|
*/
|
|
60
|
-
export type AcEdFloatingInputDrawPreviewCallback = (
|
|
61
|
+
export type AcEdFloatingInputDrawPreviewCallback = (pos: AcGePoint2dLike) => void;
|
|
61
62
|
/**
|
|
62
63
|
* Callback used to dynamically compute input values for the floating input fields.
|
|
63
64
|
*/
|
|
64
|
-
export type AcEdFloatingInputDynamicValueCallback<T> = (
|
|
65
|
+
export type AcEdFloatingInputDynamicValueCallback<T> = (pos: AcGePoint2dLike) => AcEdFloatingInputDynamicValue<T>;
|
|
65
66
|
/**
|
|
66
67
|
* Construction options for {@link AcEdFloatingInput}.
|
|
67
68
|
*/
|
|
@@ -83,6 +84,10 @@ export interface AcEdFloatingInputOptions<T> {
|
|
|
83
84
|
* Useful for describing expected input (e.g., "Specify next point").
|
|
84
85
|
*/
|
|
85
86
|
message?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The flag to indicate whether to disable osnap.
|
|
89
|
+
*/
|
|
90
|
+
disableOSnap?: boolean;
|
|
86
91
|
/**
|
|
87
92
|
* Custom validation function.
|
|
88
93
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdFloatingInputTypes.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInputTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wCAAwC;IACxC,CAAC,EAAE,MAAM,CAAA;IACT,wCAAwC;IACxC,CAAC,CAAC,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,wBAAwB;IACxB,KAAK,EAAE,CAAC,CAAA;IACR,8EAA8E;IAC9E,GAAG,EAAE,wBAAwB,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC,CAAC,CAAC;IAClD,wBAAwB;IACxB,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mCAAmC,CAAC,CAAC,IAAI,CACnD,GAAG,EAAE,wBAAwB,KAC1B,iCAAiC,CAAC,CAAC,CAAC,CAAA;AAEzC;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,CAAC,CAAC,IAAI,CAC/C,KAAK,EAAE,iCAAiC,CAAC,CAAC,CAAC,KACxC,IAAI,CAAA;AAET;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,CACjD,
|
|
1
|
+
{"version":3,"file":"AcEdFloatingInputTypes.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdFloatingInputTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wCAAwC;IACxC,CAAC,EAAE,MAAM,CAAA;IACT,wCAAwC;IACxC,CAAC,CAAC,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,wBAAw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AC,CAAC,CAAA;IAEzD;;OAEG;IACH,WAAW,CAAC,EAAE,oCAAoC,CAAA;IAElD;;OAEG;IACH,QAAQ,CAAC,EAAE,+BAA+B,CAAC,CAAC,CAAC,CAAA;IAE7C;;OAEG;IACH,QAAQ,CAAC,EAAE,+BAA+B,CAAC,CAAC,CAAC,CAAA;IAE7C;;OAEG;IACH,QAAQ,CAAC,EAAE,+BAA+B,CAAA;CAC3C"}
|
|
@@ -15,8 +15,6 @@ export declare class AcEdInputManager {
|
|
|
15
15
|
protected view: AcEdBaseView;
|
|
16
16
|
/** Stores last confirmed point from getPoint() or getBox() */
|
|
17
17
|
private lastPoint;
|
|
18
|
-
/** Stores last confirmed osnap point */
|
|
19
|
-
private lastOSnapPoint?;
|
|
20
18
|
/**
|
|
21
19
|
* The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point
|
|
22
20
|
* selection, distance/angle prompt, string prompt, etc.),
|
|
@@ -87,46 +85,5 @@ export declare class AcEdInputManager {
|
|
|
87
85
|
* values, and guaranteeing cleanup of UI elements and event handlers.
|
|
88
86
|
*/
|
|
89
87
|
private makePromise;
|
|
90
|
-
/**
|
|
91
|
-
* Picks entities that intersect a hit-region centered at the specified point
|
|
92
|
-
* in world coordinates.
|
|
93
|
-
*
|
|
94
|
-
* The hit-region is defined as a square (or bounding box) centered at the
|
|
95
|
-
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
96
|
-
* Only entities whose geometry intersects this region are returned.
|
|
97
|
-
*
|
|
98
|
-
* @param point The center point of the hit-region in world coordinates.
|
|
99
|
-
* If omitted, the current cursor position is used.
|
|
100
|
-
*
|
|
101
|
-
* @param hitRadius The half-width (in world coordinate system) of the
|
|
102
|
-
* hit-region around the point. This creates a square bounding box:
|
|
103
|
-
* [point.x ± hitRadius, point.y ± hitRadius].
|
|
104
|
-
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
105
|
-
* default is used.
|
|
106
|
-
* @returns - Returns The OSNAP point in the specified position in world coordinate system
|
|
107
|
-
* if found. Return undefined if no OSNAP point found.
|
|
108
|
-
*/
|
|
109
|
-
/**
|
|
110
|
-
* Gets OSNAP point of entities that intersect a hit-region centered at the
|
|
111
|
-
* specified point in world coordinates.
|
|
112
|
-
*
|
|
113
|
-
* The hit-region is defined as a square (or bounding box) centered at the
|
|
114
|
-
* input point, whose half-size is determined by the `hitRadius` parameter.
|
|
115
|
-
* Only entities whose geometry intersects this region are returned.
|
|
116
|
-
*
|
|
117
|
-
* @param point The center point of the hit-region in world coordinates.
|
|
118
|
-
* If omitted, the current cursor position is used.
|
|
119
|
-
*
|
|
120
|
-
* @param hitRadius The half-width (in pixel size) of the hit-region around
|
|
121
|
-
* the point. It will be converted on one value in the world
|
|
122
|
-
* coordinate 'wcsHitRadius' and creates a square bounding box:
|
|
123
|
-
* [point.x ± wcsHitRadius, point.y ± wcsHitRadius].
|
|
124
|
-
* A larger value increases the pick sensitivity. If omitted, a reasonable
|
|
125
|
-
* default is used.
|
|
126
|
-
*
|
|
127
|
-
* @returns An array of object IDs representing the entities that intersect
|
|
128
|
-
* the hit-region.
|
|
129
|
-
*/
|
|
130
|
-
private getOSnapPoint;
|
|
131
88
|
}
|
|
132
89
|
//# sourceMappingURL=AcEdInputManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdInputManager.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdInputManager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AcEdInputManager.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdInputManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAYzC,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EAExB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,WAAW,CAA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