@realsee/dnalogel 3.81.26 → 3.81.27

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.
@@ -50,6 +50,8 @@ export default class BaseController {
50
50
  protected get currentMeasureType(): MeasureType;
51
51
  private getMeasureType;
52
52
  constructor(params: ControllerParams);
53
+ /** 同步当前模式使用的放大镜用户开关。 */
54
+ setMagnifierEnabled(enabled: boolean): void;
53
55
  updateDistanceUI: () => void;
54
56
  updateAreaUI: () => void;
55
57
  protected removeLine(line: Line): void;
@@ -65,6 +65,10 @@ class V {
65
65
  get currentMeasureType() {
66
66
  return this.getMeasureType();
67
67
  }
68
+ /** 同步当前模式使用的放大镜用户开关。 */
69
+ setMagnifierEnabled(e) {
70
+ this.magnifier.setUserEnabled(e);
71
+ }
68
72
  removeLine(e) {
69
73
  this.group.remove(e.mesh, e.lightMesh), e.distanceItem.remove(), this.five.needsRender = !0;
70
74
  }
@@ -18,6 +18,7 @@ export default class EditController extends BaseController {
18
18
  private onIntersectionUpdate;
19
19
  constructor(params: ControllerParams);
20
20
  protected createPointSelector(_params: ControllerParams): PointSelector;
21
+ setMagnifierEnabled(enabled: boolean): void;
21
22
  protected disposeMagnifier(): void;
22
23
  dispose(): void;
23
24
  getEditingLines(): Line[];
@@ -12,17 +12,17 @@ var w = (d, a, e) => a in d ? x(d, a, { enumerable: !0, configurable: !0, writab
12
12
  }, M = (d, a) => j(d, G(a));
13
13
  var o = (d, a, e) => (w(d, typeof a != "symbol" ? a + "" : a, e), e);
14
14
  import $ from "../Model/line.js";
15
- import I from "../Model/point.js";
15
+ import E from "../Model/point.js";
16
16
  import { throttle as q } from "../../shared-utils/throttle.js";
17
17
  import z from "./BaseController.js";
18
- import { Polyline as E } from "../Model/polyline.js";
19
- import R from "../Model/area.js";
18
+ import { Polyline as I } from "../Model/polyline.js";
19
+ import b from "../Model/area.js";
20
20
  import { isIntersecting as H } from "../utils/isIntersecting.js";
21
21
  import { PointSelector as F } from "../../shared-utils/three/PointSelector/index.js";
22
22
  import N from "../Modules/DeleteDom/index.js";
23
23
  import * as f from "three";
24
24
  import { Vector2 as T } from "three";
25
- import b from "../utils/isNDCPointInScreen.js";
25
+ import R from "../utils/isNDCPointInScreen.js";
26
26
  import { closestPointOnLine as _ } from "../utils/math.js";
27
27
  import { getFiveModel as Q } from "../../shared-utils/five/getFiveModel.js";
28
28
  import "../../shared-utils/tag.js";
@@ -136,7 +136,7 @@ class Wt extends z {
136
136
  this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.remove(), this.five.needsRender = !0, this.hook.emit("revoke", { isEmpty: !0 });
137
137
  return;
138
138
  } else
139
- this.lastPoint = new I(this.area.points[this.area.points.length - 1]), this.updateDashed();
139
+ this.lastPoint = new E(this.area.points[this.area.points.length - 1]), this.updateDashed();
140
140
  this.five.needsRender = !0;
141
141
  }
142
142
  });
@@ -189,7 +189,7 @@ class Wt extends z {
189
189
  })();
190
190
  if (!e)
191
191
  return;
192
- const t = new I(e), i = this.lastPoint;
192
+ const t = new E(e), i = this.lastPoint;
193
193
  if (i != null && i.position && t.position.equals(i == null ? void 0 : i.position))
194
194
  return;
195
195
  this.lastPoint = t;
@@ -291,7 +291,7 @@ class Wt extends z {
291
291
  return;
292
292
  const l = this.five.camera, c = n.point.clone().project(l), u = this.container.clientWidth, y = this.container.clientHeight, s = new T(c.x * u, c.y * y), h = this.model.getAllLines().map((r) => {
293
293
  const [p, A] = r.points, v = p.position.clone().project(l), C = A.position.clone().project(l);
294
- if (!b(v) && !b(C))
294
+ if (!R(v) && !R(C))
295
295
  return null;
296
296
  const V = new T(v.x * u, v.y * y), W = new T(C.x * u, C.y * y);
297
297
  return { id: r.id, points: [V, W] };
@@ -335,7 +335,7 @@ class Wt extends z {
335
335
  const i = t.type === "area", n = Array.isArray(t) && ((l = t[0]) == null ? void 0 : l.type) === "line";
336
336
  i && this.unHighlightArea(t), n && this.unHighlightLines(t);
337
337
  }
338
- }).appendTo(this.container), this.pointSelector = this.createPointSelector(e), this.pointSelector.enable(), this.polyline = new E({ model: this.model }), this.area = new R(void 0, {
338
+ }).appendTo(this.container), this.pointSelector = this.createPointSelector(e), this.pointSelector.enable(), this.polyline = new I({ model: this.model }), this.area = new b(void 0, {
339
339
  five: this.five,
340
340
  model: this.model,
341
341
  meshContainer: this.group,
@@ -354,6 +354,9 @@ class Wt extends z {
354
354
  helper: k({ magnifierParams: this.magnifierParams, container: this.container }, this.pointSelectorConfig.helper)
355
355
  }));
356
356
  }
357
+ setMagnifierEnabled(e) {
358
+ super.setMagnifierEnabled(e), this.pointSelector.pointSelectorHelper.setMagnifierEnabled(e);
359
+ }
357
360
  disposeMagnifier() {
358
361
  this.magnifier.dispose();
359
362
  }
@@ -369,9 +372,9 @@ class Wt extends z {
369
372
  this.onSelect();
370
373
  }
371
374
  complete() {
372
- this.hook.emit("complete"), this.currentMeasureType === "area" ? (this.area.points.length < 3 ? this.deleteArea(this.area) : (this.area.showArea(), this.area.complete(), this.area.hook.on("selected", this.chooseArea)), this.area = new R(void 0, { five: this.five, model: this.model, meshContainer: this.group, domContainer: this.container }), this.model.addArea(this.area)) : this.currentMeasureType === "line" && (this.polyline.lines.forEach((e) => {
375
+ this.hook.emit("complete"), this.currentMeasureType === "area" ? (this.area.points.length < 3 ? this.deleteArea(this.area) : (this.area.showArea(), this.area.complete(), this.area.hook.on("selected", this.chooseArea)), this.area = new b(void 0, { five: this.five, model: this.model, meshContainer: this.group, domContainer: this.container }), this.model.addArea(this.area)) : this.currentMeasureType === "line" && (this.polyline.lines.forEach((e) => {
373
376
  e.hook.on("selected", this.chooseLine), e.distanceItem.setCanSelect(!0);
374
- }), this.polyline = new E({ model: this.model }), this.model.addPolyline(this.polyline)), this.pointSelector.setAdherePoints(null), this.dashed.hide(), this.perpendicularDashed.hide(), this.lastPoint = void 0;
377
+ }), this.polyline = new I({ model: this.model }), this.model.addPolyline(this.polyline)), this.pointSelector.setAdherePoints(null), this.dashed.hide(), this.perpendicularDashed.hide(), this.lastPoint = void 0;
375
378
  }
376
379
  highlightArea(e) {
377
380
  this.highlightLines(e.polyline.lines), this.five.needsRender = !0;
@@ -145,7 +145,7 @@ import "../Components/Tip.js";
145
145
  import "../../shared-utils/url/defaultUrls.js";
146
146
  class fi extends F {
147
147
  constructor(t, e) {
148
- var l, a, m, h, g, y, C, M, w, P, b, v;
148
+ var l, a, h, m, g, y, C, M, w, b, P, v;
149
149
  super(t);
150
150
  o(this, "state", { enabled: !0 });
151
151
  o(this, "hasOpen", !1);
@@ -173,18 +173,18 @@ class fi extends F {
173
173
  * @description 还原点位展示和默认鼠标 UI
174
174
  */
175
175
  o(this, "disable", () => {
176
- var t, e, r, i;
177
- this.hasOpen = !1, this.state.enabled = !1, this.container.style.visibility = "hidden", this.container.style.opacity = "0", (t = this.controller) == null || t.dispose(), (e = this.useUIController) == null || e.hide(), (r = this.useGuideController) == null || r.hide(), (i = this.shortcutKeyController) == null || i.dispose(), this.controller = null, this.five.helperVisible = !0, this.five.scene.remove(this.group), this.five.needsRender = !0, this.hook.emit("disable", !0);
176
+ var t, e, i, r;
177
+ this.hasOpen = !1, this.state.enabled = !1, this.container.style.visibility = "hidden", this.container.style.opacity = "0", (t = this.controller) == null || t.dispose(), (e = this.useUIController) == null || e.hide(), (i = this.useGuideController) == null || i.hide(), (r = this.shortcutKeyController) == null || r.dispose(), this.controller = null, this.five.helperVisible = !0, this.five.scene.remove(this.group), this.five.needsRender = !0, this.hook.emit("disable", !0);
178
178
  });
179
179
  o(this, "getCurrentMode", () => this.controller instanceof c ? "Edit" : this.controller instanceof k ? "Watch" : this.controller instanceof u ? "Mixed" : this.controller instanceof U ? "View" : null);
180
180
  /** 变更场景
181
181
  * @description 如果从编辑场景改变到观看场景,不会自动保存,默认丢弃所有改动
182
182
  */
183
183
  o(this, "changeMode", (t) => {
184
- var i, l, a, m, h;
184
+ var r, l, a, h, m;
185
185
  if (!this.hasOpen || this.getCurrentMode() === t)
186
186
  return;
187
- (i = this.controller) == null || i.dispose();
187
+ (r = this.controller) == null || r.dispose();
188
188
  const e = {
189
189
  View: U,
190
190
  Watch: k,
@@ -193,8 +193,8 @@ class fi extends F {
193
193
  };
194
194
  if (!e[t])
195
195
  throw new Error("不存在的 Mode");
196
- const r = this.createControllerParams();
197
- this.controller = this.createModeController(r, e[t]), t === "View" ? ((l = this.useUIController) == null || l.hide(), (a = this.useGuideController) == null || a.hide()) : ((m = this.useUIController) == null || m.show(), (h = this.useGuideController) == null || h.show()), this.hook.emit("modeChange", t);
196
+ const i = this.createControllerParams();
197
+ this.controller = this.createModeController(i, e[t]), this.controller.setMagnifierEnabled(this.magnifierEnabled), t === "View" ? ((l = this.useUIController) == null || l.hide(), (a = this.useGuideController) == null || a.hide()) : ((h = this.useUIController) == null || h.show(), (m = this.useGuideController) == null || m.show()), this.hook.emit("modeChange", t);
198
198
  });
199
199
  /**
200
200
  * @description: 切换测量的类型
@@ -204,15 +204,15 @@ class fi extends F {
204
204
  });
205
205
  this.five = t, this.hook = this.hooks, this.params = e, this.config = O(e, ["openParams", "magnifierParams"]), this.model = new W(this.config), this.isMobile = (a = (l = e == null ? void 0 : e.openParams) == null ? void 0 : l.isMobile) != null ? a : !1, this.magnifier = this.createMagnifier(
206
206
  t,
207
- (y = (g = e.magnifierParams) != null ? g : (h = (m = e.pointSelectorConfig) == null ? void 0 : m.helper) == null ? void 0 : h.magnifierParams) != null ? y : { width: 190, height: 190, scale: 2 }
207
+ (y = (g = e.magnifierParams) != null ? g : (m = (h = e.pointSelectorConfig) == null ? void 0 : h.helper) == null ? void 0 : m.magnifierParams) != null ? y : { width: 190, height: 190, scale: 2 }
208
208
  ), this.allowMeasureType = Array.from(new Set((M = (C = e.editParams) == null ? void 0 : C.allowMeasureType) != null ? M : ["line"])), this.currentMeasureType = (w = this.allowMeasureType[0]) != null ? w : "line", this.group = new V(), this.group.name = "plugin-measure-group", this.container.classList.add("five-plugin-measure-container"), this.container.style.position = "absolute", this.container.style.left = "0", this.container.style.top = "0", this.container.style.visibility = "hidden", this.container.style.pointerEvents = "none", this.container.style.width = "100%", this.container.style.height = "100%", this.container.style.opacity = "0", this.container.style.zIndex = "1";
209
- const r = (b = (P = e.editParams) == null ? void 0 : P.pointSelectorMode) != null ? b : j ? "fixed" : "cursor", i = (v = this.params.openParams) != null ? v : {};
209
+ const i = (P = (b = e.editParams) == null ? void 0 : b.pointSelectorMode) != null ? P : j ? "fixed" : "cursor", r = (v = this.params.openParams) != null ? v : {};
210
210
  if (this.params.useUIController !== !1) {
211
211
  const d = p({
212
212
  container: this.container,
213
- openParams: i,
213
+ openParams: r,
214
214
  i18n: e.i18n,
215
- pointSelectorMode: r,
215
+ pointSelectorMode: i,
216
216
  useNewUI: this.allowMeasureType.length > 1
217
217
  }, T(this.params.useUIController));
218
218
  this.useUIController = new B(this, d);
@@ -220,7 +220,7 @@ class fi extends F {
220
220
  if (this.params.useGuideController !== !1) {
221
221
  const d = p({
222
222
  container: this.container,
223
- pointSelectorMode: r,
223
+ pointSelectorMode: i,
224
224
  i18n: e.i18n
225
225
  }, T(this.params.useGuideController));
226
226
  this.useGuideController = new K(this, d);
@@ -234,8 +234,8 @@ class fi extends F {
234
234
  * 运行时生效,不影响选点与测量流程。
235
235
  */
236
236
  setMagnifierEnabled(t) {
237
- var e;
238
- this._magnifierEnabled = t, (e = this.magnifier) == null || e.setUserEnabled(t);
237
+ var e, i;
238
+ this._magnifierEnabled = t, (e = this.magnifier) == null || e.setUserEnabled(t), (i = this.controller) == null || i.setMagnifierEnabled(t);
239
239
  }
240
240
  createMagnifier(t, e) {
241
241
  return new _(t, e);
@@ -264,10 +264,10 @@ class fi extends F {
264
264
  load(t) {
265
265
  let e = t;
266
266
  t.list && (e = {
267
- polylines: t.list.map((i) => i.polyline).map((i) => {
267
+ polylines: t.list.map((r) => r.polyline).map((r) => {
268
268
  var l;
269
- return E(p({}, i), {
270
- visibleFiveMode: (l = i.visibleFiveMode) != null ? l : ["Panorama"]
269
+ return E(p({}, r), {
270
+ visibleFiveMode: (l = r.visibleFiveMode) != null ? l : ["Panorama"]
271
271
  });
272
272
  })
273
273
  }), this.model.parse(e), this.save();
@@ -277,8 +277,8 @@ class fi extends F {
277
277
  * @description 会隐藏当前 VR 内的点位展示
278
278
  */
279
279
  enable(t) {
280
- var e, r, i;
281
- this.hasOpen || (!this.container.parentElement && ((e = this.five.getElement()) != null && e.parentElement) && this.appendTo(this.five.getElement().parentElement), this.state.enabled = !0, this.hasOpen = !0, this.group.matrix.copy(this.workUtil.transform), this.group.matrix.decompose(this.group.position, this.group.quaternion, this.group.scale), this.group.updateMatrixWorld(), this.five.scene.add(this.group), this.container.style.visibility = "visible", this.container.style.opacity = "1", t != null && t.mode ? this.changeMode(t.mode) : this.isMobile ? this.changeMode("Mixed") : this.changeMode("Watch"), (t == null ? void 0 : t.mode) !== "View" && ((r = this.useUIController) == null || r.show(), (i = this.useGuideController) == null || i.show()), this.shortcutKeyController = new H(this, this.five), this.hook.emit("enable", !0));
280
+ var e, i, r;
281
+ this.hasOpen || (!this.container.parentElement && ((e = this.five.getElement()) != null && e.parentElement) && this.appendTo(this.five.getElement().parentElement), this.state.enabled = !0, this.hasOpen = !0, this.group.matrix.copy(this.workUtil.transform), this.group.matrix.decompose(this.group.position, this.group.quaternion, this.group.scale), this.group.updateMatrixWorld(), this.five.scene.add(this.group), this.container.style.visibility = "visible", this.container.style.opacity = "1", t != null && t.mode ? this.changeMode(t.mode) : this.isMobile ? this.changeMode("Mixed") : this.changeMode("Watch"), (t == null ? void 0 : t.mode) !== "View" && ((i = this.useUIController) == null || i.show(), (r = this.useGuideController) == null || r.show()), this.shortcutKeyController = new H(this, this.five), this.hook.emit("enable", !0));
282
282
  }
283
283
  /** 进入编辑模式 */
284
284
  edit(t) {
@@ -321,11 +321,11 @@ class fi extends F {
321
321
  * @description 以下情况可能报错
322
322
  */
323
323
  save(t) {
324
- var i;
324
+ var r;
325
325
  if (!(this.controller instanceof c) && !(this.controller instanceof u))
326
326
  return this;
327
- const e = (i = t == null ? void 0 : t.mode) != null ? i : "View", r = this.controller.model.areas;
328
- return this.controller instanceof c ? this.controller.complete() : r.forEach((l) => {
327
+ const e = (r = t == null ? void 0 : t.mode) != null ? r : "View", i = this.controller.model.areas;
328
+ return this.controller instanceof c ? this.controller.complete() : i.forEach((l) => {
329
329
  l.showArea(), this.model.addArea(l);
330
330
  }), this.changeMode(e), this;
331
331
  }
@@ -349,20 +349,20 @@ class fi extends F {
349
349
  changeIsMobile(t) {
350
350
  }
351
351
  changeConfigs(t) {
352
- var e, r;
353
- Object.assign(this.config, t), (e = this.controller) == null || e.updateDistanceUI(), (r = this.controller) == null || r.updateAreaUI();
352
+ var e, i;
353
+ Object.assign(this.config, t), (e = this.controller) == null || e.updateDistanceUI(), (i = this.controller) == null || i.updateAreaUI();
354
354
  }
355
355
  /** 设置线段的文本 */
356
356
  setCustomText(t, e) {
357
- var i;
358
- const r = this.model.getLineByID(t);
359
- if (!r)
357
+ var r;
358
+ const i = this.model.getLineByID(t);
359
+ if (!i)
360
360
  throw new Error("不存在的线段");
361
- r.setText(e), (i = this.controller) == null || i.updateDistanceUI();
361
+ i.setText(e), (r = this.controller) == null || r.updateDistanceUI();
362
362
  }
363
363
  createControllerParams() {
364
- var r, i;
365
- const t = (r = this.params.openParams) != null ? r : {}, e = (i = this.params.editParams) != null ? i : {};
364
+ var i, r;
365
+ const t = (i = this.params.openParams) != null ? i : {}, e = (r = this.params.editParams) != null ? r : {};
366
366
  return t.isMobile = this.isMobile, {
367
367
  five: this.five,
368
368
  hook: this.hook,
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.81.26");
26
+ r(this, "VERSION", "3.81.27");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.81.26",
3
+ "%c %c@realsee/dnalogel %cv3.81.27",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.81.26",
3
+ "version": "3.81.27",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",