@realsee/dnalogel 3.72.5-alpha.4 → 3.72.5-alpha.5

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.
@@ -1,22 +1,22 @@
1
1
  var Q = Object.defineProperty, Y = Object.defineProperties;
2
2
  var ee = Object.getOwnPropertyDescriptors;
3
3
  var w = Object.getOwnPropertySymbols;
4
- var E = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
4
+ var R = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
5
  var T = Math.pow, V = (m, i, e) => i in m ? Q(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, y = (m, i) => {
6
6
  for (var e in i || (i = {}))
7
- E.call(i, e) && V(m, e, i[e]);
7
+ R.call(i, e) && V(m, e, i[e]);
8
8
  if (w)
9
9
  for (var e of w(i))
10
- O.call(i, e) && V(m, e, i[e]);
10
+ E.call(i, e) && V(m, e, i[e]);
11
11
  return m;
12
12
  }, S = (m, i) => Y(m, ee(i));
13
- var R = (m, i) => {
13
+ var O = (m, i) => {
14
14
  var e = {};
15
15
  for (var t in m)
16
- E.call(m, t) && i.indexOf(t) < 0 && (e[t] = m[t]);
16
+ R.call(m, t) && i.indexOf(t) < 0 && (e[t] = m[t]);
17
17
  if (m != null && w)
18
18
  for (var t of w(m))
19
- i.indexOf(t) < 0 && O.call(m, t) && (e[t] = m[t]);
19
+ i.indexOf(t) < 0 && E.call(m, t) && (e[t] = m[t]);
20
20
  return e;
21
21
  };
22
22
  var a = (m, i, e) => (V(m, typeof i != "symbol" ? i + "" : i, e), e);
@@ -406,7 +406,7 @@ class Wi {
406
406
  this.cache.clear();
407
407
  }
408
408
  updateVisible() {
409
- this.enabled ? (this.state.visible = this.getVisible(), this.applyVisible()) : this.applyVisible(), this._updating = !1;
409
+ this.enabled ? (this.state.visible = this.getVisible(), this.applyVisible()) : this.applyVisible(), this.five.needsRender = !0, this._updating = !1;
410
410
  }
411
411
  updateZIndex() {
412
412
  const i = this.getSquaredDistance();
@@ -512,7 +512,7 @@ class Wi {
512
512
  if ((u == null ? void 0 : u.value) === !1)
513
513
  return u;
514
514
  if (n.followModelVisibility === !0 && ["poincare", "aerophoto", "sand"].includes(this.workUtil.fromType) && (o === "Floorplan" || o === "Mapview")) {
515
- const p = this.computeVisibleByFloorIndex(), { value: v } = p, b = R(p, ["value"]);
515
+ const p = this.computeVisibleByFloorIndex(), { value: v } = p, b = O(p, ["value"]);
516
516
  if (v === !1)
517
517
  return y({ value: !1, checkedList: s, reason: "followModelVisibility check failed" }, b);
518
518
  }
@@ -1,11 +1,11 @@
1
- var w = Object.defineProperty;
2
- var E = (m, l, t) => l in m ? w(m, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[l] = t;
3
- var c = (m, l, t) => (E(m, typeof l != "symbol" ? l + "" : l, t), t);
4
- import { BaseTag as k } from "./BaseTag.js";
5
- import * as n from "three";
6
- import { Line as I } from "@realsee/five/line";
7
- import { anyPositionToVector3 as M } from "../../../shared-utils/positionToVector3.js";
8
- import { transformPosition as R } from "../../../shared-utils/five/transformPosition.js";
1
+ var I = Object.defineProperty;
2
+ var M = (p, h, t) => h in p ? I(p, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[h] = t;
3
+ var c = (p, h, t) => (M(p, typeof h != "symbol" ? h + "" : h, t), t);
4
+ import { BaseTag as U } from "./BaseTag.js";
5
+ import * as r from "three";
6
+ import { Line as R } from "@realsee/five/line";
7
+ import { anyPositionToVector3 as g } from "../../../shared-utils/positionToVector3.js";
8
+ import { transformPosition as P } from "../../../shared-utils/five/transformPosition.js";
9
9
  import "../../../shared-utils/Subscribe.js";
10
10
  import "../../utils/tag/calculateTagConfig.js";
11
11
  import "../../../vendor/object-assign-deep/objectAssignDeep.js";
@@ -87,10 +87,10 @@ import "../../../shared-utils/five/getFloorIndex.js";
87
87
  import "../../../shared-utils/safeObj.js";
88
88
  import "../../utils/Cache.js";
89
89
  import "../../../shared-utils/promise/withResolvers.js";
90
- const g = new n.Vector2();
91
- class gi extends k {
90
+ const _ = new r.Vector2();
91
+ class Pi extends U {
92
92
  constructor(t, e) {
93
- var o, i, r, s, h;
93
+ var o, i, n, s, a;
94
94
  super(t, e);
95
95
  c(this, "__Object__");
96
96
  c(this, "requestIdleCallbackId");
@@ -98,19 +98,19 @@ class gi extends k {
98
98
  c(this, "iconPixelGap", 10);
99
99
  // 优化:重用临时对象,避免频繁创建
100
100
  c(this, "_temp", {
101
- lineStart: new n.Vector3(),
101
+ lineStart: new r.Vector3(),
102
102
  // 线条起点(project后会变成NDC)
103
- iconPos: new n.Vector3(),
103
+ iconPos: new r.Vector3(),
104
104
  // icon位置(project后会变成NDC)
105
- screenDirPixel: new n.Vector2(),
105
+ screenDirPixel: new r.Vector2(),
106
106
  // 屏幕方向(normalize后会变成单位向量)
107
- targetNDC: new n.Vector2(),
107
+ targetNDC: new r.Vector2(),
108
108
  // 目标NDC坐标
109
- lineDir: new n.Vector3(),
109
+ lineDir: new r.Vector3(),
110
110
  // 线条方向(计算w0时重用)
111
- lineEnd: new n.Vector3(),
111
+ lineEnd: new r.Vector3(),
112
112
  // 线条终点
113
- raycaster: new n.Raycaster()
113
+ raycaster: new r.Raycaster()
114
114
  // 射线投射器
115
115
  });
116
116
  // 用于变化检测的缓存值
@@ -122,20 +122,20 @@ class gi extends k {
122
122
  visible: !1
123
123
  });
124
124
  if ((i = (o = e.style) == null ? void 0 : o.point) != null && i.width) {
125
- const p = (h = (s = (r = e.style) == null ? void 0 : r.point) == null ? void 0 : s.scale) != null ? h : 1;
126
- this.iconPixelGap = e.style.point.width * p * 1.4 / 2 + 2;
125
+ const d = (a = (s = (n = e.style) == null ? void 0 : n.point) == null ? void 0 : s.scale) != null ? a : 1;
126
+ this.iconPixelGap = e.style.point.width * d * 1.4 / 2 + 2;
127
127
  }
128
128
  e.contentType === "Audio" && (this.iconPixelGap = 34 / 2 + 2), this.initialTagLine();
129
129
  }
130
130
  initialTagLine() {
131
- var i, r, s;
131
+ var n, s, a;
132
132
  const t = this.config;
133
- if (!((i = t == null ? void 0 : t.tagNormalLineConfig) != null && i.enabled) || !this.normalLineLength)
133
+ if (!this.five.renderer || !((n = t == null ? void 0 : t.tagNormalLineConfig) != null && n.enabled) || !this.normalLineLength)
134
134
  return;
135
- const e = this.five.renderer.getSize(g), o = this.five.renderer.getPixelRatio();
136
- this.tagNormalLine = new I(new n.Vector3().fromArray(this.position), new n.Vector3().fromArray(this.originPosition)), this.tagNormalLine.points.visible = !1, this.tagNormalLine.setMaterial({
137
- color: new n.Vector3(1, 1, 1),
138
- linewidth: (s = (r = t == null ? void 0 : t.tagNormalLineConfig) == null ? void 0 : r.lineWidth) != null ? s : 1.2,
135
+ const e = this.five.renderer.getSize(_), o = this.five.renderer.getPixelRatio(), i = P(g(this.originPosition), this.plugin.workUtil.transform);
136
+ this.tagNormalLine = new R(new r.Vector3().fromArray(this.position), i), this.tagNormalLine.points.visible = !1, this.tagNormalLine.setMaterial({
137
+ color: new r.Vector3(1, 1, 1),
138
+ linewidth: (a = (s = t == null ? void 0 : t.tagNormalLineConfig) == null ? void 0 : s.lineWidth) != null ? a : 1.2,
139
139
  dashed: !1
140
140
  }), this.tagNormalLine.line.material.transparent = !0, this.tagNormalLine.line.material.depthWrite = !1, this.tagNormalLine.line.material.depthTest = !0, this.tagNormalLine.line.material.dashed = !1, this.tagNormalLine.line.renderOrder = 2, this.tagNormalLine.setResolution(e.width * o, e.height * o), this.tagNormalLine.visible = !1, this.tagNormalLine.name = `tagNormalLine-${this.id}`, this.plugin.group.add(this.tagNormalLine);
141
141
  }
@@ -179,10 +179,10 @@ class gi extends k {
179
179
  setPosition(t) {
180
180
  this.originPosition = t, this.position = (() => {
181
181
  const e = this.plugin.workUtil.transform;
182
- let o = R(M(t), e).toArray();
182
+ let o = P(g(t), e).toArray();
183
183
  if (this.normal && this.normalLineLength) {
184
184
  const i = this.computeNormal();
185
- o = new n.Vector3().fromArray(o).clone().add(i.clone().setLength(this.normalLineLength)).toArray();
185
+ o = new r.Vector3().fromArray(o).clone().add(i.clone().setLength(this.normalLineLength)).toArray();
186
186
  }
187
187
  return o;
188
188
  })(), this.cache.clear(), this._lastUpdateCache.position = [0, 0, 0], this.updateVisible(), this.updateScreenPosition(), this.updateZIndex(), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
@@ -192,7 +192,7 @@ class gi extends k {
192
192
  * 使用屏幕空间反投影方法,确保任意视角下都保持固定像素距离
193
193
  */
194
194
  updateTagNormalLinePosition(t) {
195
- var v, b, L, x, C, N, S;
195
+ var L, x, C, N, S, T, D;
196
196
  if (!this.screenPosition || !this.tagNormalLine)
197
197
  return;
198
198
  const { force: e = !1 } = t != null ? t : {};
@@ -202,31 +202,32 @@ class gi extends k {
202
202
  }
203
203
  const i = this._lastUpdateCache;
204
204
  if (!(this.visible !== i.visible)) {
205
- const u = Math.abs(this.position[0] - i.position[0]) > 1e-3 || Math.abs(this.position[1] - i.position[1]) > 1e-3 || Math.abs(this.position[2] - i.position[2]) > 1e-3, V = Math.abs(((v = this.screenPosition.leftPx) != null ? v : 0) - i.screenLeft) > 0.5 || Math.abs(((b = this.screenPosition.topPx) != null ? b : 0) - i.screenTop) > 0.5 || Math.abs(((L = this.screenPosition.scale) != null ? L : 1) - i.scale) > 2e-3;
206
- if (!u && !V)
205
+ const u = Math.abs(this.position[0] - i.position[0]) > 1e-3 || Math.abs(this.position[1] - i.position[1]) > 1e-3 || Math.abs(this.position[2] - i.position[2]) > 1e-3, E = Math.abs(((L = this.screenPosition.leftPx) != null ? L : 0) - i.screenLeft) > 0.5 || Math.abs(((x = this.screenPosition.topPx) != null ? x : 0) - i.screenTop) > 0.5 || Math.abs(((C = this.screenPosition.scale) != null ? C : 1) - i.scale) > 2e-3;
206
+ if (!u && !E)
207
207
  return;
208
208
  }
209
- i.position = new n.Vector3().fromArray(this.position).toArray(), i.screenLeft = (x = this.screenPosition.leftPx) != null ? x : 0, i.screenTop = (C = this.screenPosition.topPx) != null ? C : 0, i.scale = (N = this.screenPosition.scale) != null ? N : 1, i.visible = this.visible;
210
- const s = this.five.renderer.getSize(g);
211
- this._temp.lineStart.fromArray(this.originPosition), this._temp.iconPos.fromArray(this.position), this._temp.lineStart.project(this.five.camera), this._temp.iconPos.project(this.five.camera), this._temp.screenDirPixel.set(
209
+ if (i.position = new r.Vector3().fromArray(this.position).toArray(), i.screenLeft = (N = this.screenPosition.leftPx) != null ? N : 0, i.screenTop = (S = this.screenPosition.topPx) != null ? S : 0, i.scale = (T = this.screenPosition.scale) != null ? T : 1, i.visible = this.visible, !this.five.renderer)
210
+ return;
211
+ const s = this.five.renderer.getSize(_), a = P(g(this.originPosition), this.plugin.workUtil.transform).toArray();
212
+ this._temp.lineStart.fromArray(a), this._temp.iconPos.fromArray(this.position), this._temp.lineStart.project(this.five.camera), this._temp.iconPos.project(this.five.camera), this._temp.screenDirPixel.set(
212
213
  (this._temp.iconPos.x - this._temp.lineStart.x) * s.x / 2,
213
214
  (this._temp.iconPos.y - this._temp.lineStart.y) * s.y / 2
214
215
  );
215
- const h = this._temp.screenDirPixel.length();
216
+ const d = this._temp.screenDirPixel.length();
216
217
  this._temp.screenDirPixel.normalize();
217
- const p = this.iconPixelGap * ((S = this.screenPosition.scale) != null ? S : 1);
218
+ const m = this.iconPixelGap * ((D = this.screenPosition.scale) != null ? D : 1);
218
219
  this._temp.targetNDC.set(
219
- (this._temp.iconPos.x * s.x / 2 - this._temp.screenDirPixel.x * p) / (s.x / 2),
220
- (this._temp.iconPos.y * s.y / 2 - this._temp.screenDirPixel.y * p) / (s.y / 2)
220
+ (this._temp.iconPos.x * s.x / 2 - this._temp.screenDirPixel.x * m) / (s.x / 2),
221
+ (this._temp.iconPos.y * s.y / 2 - this._temp.screenDirPixel.y * m) / (s.y / 2)
221
222
  ), this._temp.raycaster.setFromCamera(this._temp.targetNDC, this.five.camera);
222
- const a = this._temp.raycaster.ray;
223
- this._temp.lineStart.fromArray(this.originPosition), this._temp.iconPos.fromArray(this.position), this._temp.lineDir.copy(this._temp.iconPos).sub(this._temp.lineStart).normalize(), this._temp.lineEnd.copy(a.origin).sub(this._temp.lineStart);
224
- const d = a.direction.dot(a.direction), f = a.direction.dot(this._temp.lineDir), P = this._temp.lineDir.dot(this._temp.lineDir), T = a.direction.dot(this._temp.lineEnd), D = this._temp.lineDir.dot(this._temp.lineEnd), _ = d * P - f * f;
225
- let y = 0;
226
- Math.abs(_) > 1e-4 && (y = (f * D - P * T) / _), this._temp.lineEnd.copy(a.origin).add(a.direction.multiplyScalar(Math.max(0, y)));
227
- const A = this._temp.lineStart.distanceTo(this._temp.iconPos);
228
- if (this._temp.lineStart.distanceTo(this._temp.lineEnd) > A) {
229
- const u = Math.max(0, 1 - p / h);
223
+ const l = this._temp.raycaster.ray;
224
+ this._temp.lineStart.fromArray(a), this._temp.iconPos.fromArray(this.position), this._temp.lineDir.copy(this._temp.iconPos).sub(this._temp.lineStart).normalize(), this._temp.lineEnd.copy(l.origin).sub(this._temp.lineStart);
225
+ const A = l.direction.dot(l.direction), f = l.direction.dot(this._temp.lineDir), y = this._temp.lineDir.dot(this._temp.lineDir), w = l.direction.dot(this._temp.lineEnd), V = this._temp.lineDir.dot(this._temp.lineEnd), v = A * y - f * f;
226
+ let b = 0;
227
+ Math.abs(v) > 1e-4 && (b = (f * V - y * w) / v), this._temp.lineEnd.copy(l.origin).add(l.direction.multiplyScalar(Math.max(0, b)));
228
+ const k = this._temp.lineStart.distanceTo(this._temp.iconPos);
229
+ if (this._temp.lineStart.distanceTo(this._temp.lineEnd) > k) {
230
+ const u = Math.max(0, 1 - m / d);
230
231
  this._temp.lineEnd.copy(this._temp.lineStart).lerp(this._temp.iconPos, u);
231
232
  }
232
233
  this.tagNormalLine.setPoints(this._temp.lineStart, this._temp.lineEnd), this.tagNormalLine.visible = !0;
@@ -245,26 +246,26 @@ class gi extends k {
245
246
  });
246
247
  }, 1e3)) : i.timeoutId && (clearTimeout(i.timeoutId), i.inAnimation = !1, i.timeoutId = void 0), !o && !i.inAnimation)
247
248
  return;
248
- const r = this.computeTagProject();
249
- if (r && this.five.renderer) {
250
- const h = this.getDistance(void 0, 1), p = (() => {
249
+ const n = this.computeTagProject();
250
+ if (n && this.five.renderer) {
251
+ const a = this.getDistance(void 0, 1), d = (() => {
251
252
  if (!this.currentConfig.simulate3D)
252
253
  return 1;
253
- const d = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI);
254
- return Math.max(Math.min(1 - d * h / 40, 1), 0.7);
255
- })(), a = this.five.renderer.getSize(g);
254
+ const l = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI);
255
+ return Math.max(Math.min(1 - l * a / 40, 1), 0.7);
256
+ })(), m = this.five.renderer.getSize(_);
256
257
  this.screenPosition = {
257
- leftPx: (r.x + 1) / 2 * a.x,
258
- topPx: (-r.y + 1) / 2 * a.y,
259
- scale: p
258
+ leftPx: (n.x + 1) / 2 * m.x,
259
+ topPx: (-n.y + 1) / 2 * m.y,
260
+ scale: d
260
261
  }, this.updateTagNormalLinePosition({ force: t == null ? void 0 : t.force });
261
262
  } else
262
263
  this.screenPosition = null;
263
264
  this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
264
265
  }
265
266
  set(t, e = !0) {
266
- var o, i, r;
267
- super.set(t, e), this.normalLineLength = (r = (i = (o = t.style) == null ? void 0 : o.point) == null ? void 0 : i.normalLen) != null ? r : 0, this._lastUpdateCache.position = [0, 0, 0], this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), t.position && this.setPosition(this.position);
267
+ var o, i, n;
268
+ super.set(t, e), this.normalLineLength = (n = (i = (o = t.style) == null ? void 0 : o.point) == null ? void 0 : i.normalLen) != null ? n : 0, this._lastUpdateCache.position = [0, 0, 0], this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), t.position && this.setPosition(this.position);
268
269
  }
269
270
  setData(...t) {
270
271
  super.setData(...t), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
@@ -279,7 +280,7 @@ class gi extends k {
279
280
  }
280
281
  }
281
282
  computeNormal() {
282
- return new n.Vector3().fromArray(this.normal);
283
+ return new r.Vector3().fromArray(this.normal);
283
284
  }
284
285
  removeTagNormalLine() {
285
286
  this.tagNormalLine && (this.plugin.group.remove(this.tagNormalLine), this.tagNormalLine = null);
@@ -293,5 +294,5 @@ class gi extends k {
293
294
  }
294
295
  }
295
296
  export {
296
- gi as PointTag
297
+ Pi as PointTag
297
298
  };
@@ -22,7 +22,7 @@ let A = class {
22
22
  /**
23
23
  * @realsee/dnalogel 版本号
24
24
  */
25
- r(this, "VERSION", "3.72.5-alpha.4");
25
+ r(this, "VERSION", "3.72.5-alpha.5");
26
26
  r(this, "NAME");
27
27
  r(this, "five");
28
28
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.72.5-alpha.4",
3
+ "%c %c@realsee/dnalogel %cv3.72.5-alpha.5",
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.72.5-alpha.4",
3
+ "version": "3.72.5-alpha.5",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",