@realsee/dnalogel 3.44.3 → 3.44.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.
- package/CHANGELOG.md +7 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/utils/DebugUtil.d.ts +5 -0
- package/dist/index.cjs.js +25 -25
- package/dist/index.js +2454 -2443
- package/dist/index.umd.js +25 -25
- package/libs/CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js +39 -58
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/Work.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/GuideLinePlugin/Controller.js +1 -1
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.js +68 -68
- package/libs/PanoTagPlugin/controller/index.js +38 -44
- package/libs/PanoTagPlugin/index.js +1 -1
- package/libs/PanoTagPlugin/utils/DebugUtil.d.ts +5 -0
- package/libs/PanoTagPlugin/utils/DebugUtil.js +47 -8
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +19 -19
- package/libs/shared-utils/three/PointSelector/utils/PointHelper.js +17 -17
- package/package.json +2 -2
|
@@ -1,83 +1,64 @@
|
|
|
1
|
-
import { Matrix4 as
|
|
1
|
+
import { Matrix4 as M } from "three";
|
|
2
2
|
let k = function() {
|
|
3
|
-
let
|
|
3
|
+
let x = this, f, m, S, y, n = new M(), p = {
|
|
4
4
|
camera: { fov: 0, style: "" },
|
|
5
5
|
objects: /* @__PURE__ */ new WeakMap()
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let u = /Trident/i.test(navigator.userAgent);
|
|
11
|
-
this.getSize = function() {
|
|
6
|
+
}, a = document.createElement("div");
|
|
7
|
+
a.style.overflow = "hidden", this.domElement = a;
|
|
8
|
+
let s = document.createElement("div");
|
|
9
|
+
s.style.WebkitTransformStyle = "preserve-3d", s.style.transformStyle = "preserve-3d", s.style.pointerEvents = "none", a.appendChild(s), this.getSize = function() {
|
|
12
10
|
return {
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
11
|
+
width: f,
|
|
12
|
+
height: m
|
|
15
13
|
};
|
|
16
14
|
}, this.setSize = function(t, e) {
|
|
17
|
-
|
|
15
|
+
f = t, m = e, S = f / 2, y = m / 2, a.style.width = t + "px", a.style.height = e + "px", s.style.width = t + "px", s.style.height = e + "px";
|
|
18
16
|
};
|
|
19
|
-
function
|
|
17
|
+
function l(t) {
|
|
20
18
|
return Math.abs(t) < 1e-10 ? 0 : t;
|
|
21
19
|
}
|
|
22
|
-
function
|
|
20
|
+
function u(t) {
|
|
23
21
|
let e = t.elements;
|
|
24
|
-
return "matrix3d(" +
|
|
22
|
+
return "matrix3d(" + l(e[0]) + "," + l(-e[1]) + "," + l(e[2]) + "," + l(e[3]) + "," + l(e[4]) + "," + l(-e[5]) + "," + l(e[6]) + "," + l(e[7]) + "," + l(e[8]) + "," + l(-e[9]) + "," + l(e[10]) + "," + l(e[11]) + "," + l(e[12]) + "," + l(-e[13]) + "," + l(e[14]) + "," + l(e[15]) + ")";
|
|
25
23
|
}
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
return
|
|
24
|
+
function v(t, e) {
|
|
25
|
+
let i = t.elements;
|
|
26
|
+
return "translate(-50%,-50%)" + ("matrix3d(" + l(i[0]) + "," + l(i[1]) + "," + l(i[2]) + "," + l(i[3]) + "," + l(-i[4]) + "," + l(-i[5]) + "," + l(-i[6]) + "," + l(-i[7]) + "," + l(i[8]) + "," + l(i[9]) + "," + l(i[10]) + "," + l(i[11]) + "," + l(i[12]) + "," + l(i[13]) + "," + l(i[14]) + "," + l(i[15]) + ")");
|
|
29
27
|
}
|
|
30
|
-
function
|
|
28
|
+
function c(t) {
|
|
31
29
|
t.isCSS3DObject && (t.element.style.display = "none");
|
|
32
|
-
for (let e = 0,
|
|
33
|
-
|
|
30
|
+
for (let e = 0, i = t.children.length; e < i; e++)
|
|
31
|
+
c(t.children[e]);
|
|
34
32
|
}
|
|
35
|
-
function C(t, e,
|
|
33
|
+
function C(t, e, i, h) {
|
|
36
34
|
if (t.visible === !1) {
|
|
37
|
-
|
|
35
|
+
c(t);
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
38
|
if (t.isCSS3DObject) {
|
|
41
|
-
t.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const o = t.layers.test(i.layers) === !0, d = t.element;
|
|
40
|
+
if (d.style.display = o === !0 ? "" : "none", o) {
|
|
41
|
+
t.onBeforeRender(x, e, i);
|
|
42
|
+
let r;
|
|
43
|
+
t.isCSS3DSprite ? (n.copy(i.matrixWorldInverse), n.transpose(), n.copyPosition(t.matrixWorld), n.scale(t.scale), n.elements[3] = 0, n.elements[7] = 0, n.elements[11] = 0, n.elements[15] = 1, r = v(n)) : r = v(t.matrixWorld);
|
|
44
|
+
let W = p.objects.get(t);
|
|
45
|
+
if (W === void 0 || W.style !== r) {
|
|
46
|
+
d.style.WebkitTransform = r, d.style.transform = r;
|
|
47
|
+
let g = { style: r };
|
|
48
|
+
p.objects.set(t, g);
|
|
49
|
+
}
|
|
50
|
+
d.style.display = t.visible ? "" : "none", d.parentNode !== s && s.appendChild(d), t.onAfterRender(x, e, i);
|
|
49
51
|
}
|
|
50
|
-
s.style.display = t.visible ? "" : "none", s.parentNode !== a && a.appendChild(s), t.onAfterRender(c, e, r);
|
|
51
52
|
}
|
|
52
|
-
for (let
|
|
53
|
-
C(t.children[
|
|
54
|
-
}
|
|
55
|
-
var O = function() {
|
|
56
|
-
let t = new M(), e = new M();
|
|
57
|
-
return function(r, l) {
|
|
58
|
-
return t.setFromMatrixPosition(r.matrixWorld), e.setFromMatrixPosition(l.matrixWorld), t.distanceToSquared(e);
|
|
59
|
-
};
|
|
60
|
-
}();
|
|
61
|
-
function T(t) {
|
|
62
|
-
let e = [];
|
|
63
|
-
return t.traverse(function(r) {
|
|
64
|
-
r.isCSS3DObject && e.push(r);
|
|
65
|
-
}), e;
|
|
66
|
-
}
|
|
67
|
-
function w(t) {
|
|
68
|
-
let e = T(t).sort(function(l, n) {
|
|
69
|
-
let s = p.objects.get(l).distanceToCameraSquared, f = p.objects.get(n).distanceToCameraSquared;
|
|
70
|
-
return s - f;
|
|
71
|
-
}), r = e.length;
|
|
72
|
-
for (let l = 0, n = e.length; l < n; l++)
|
|
73
|
-
e[l].element.style.zIndex = r - l;
|
|
53
|
+
for (let o = 0, d = t.children.length; o < d; o++)
|
|
54
|
+
C(t.children[o], e, i);
|
|
74
55
|
}
|
|
75
56
|
this.render = function(t, e) {
|
|
76
|
-
let
|
|
77
|
-
if (p.camera.fov !==
|
|
78
|
-
var
|
|
79
|
-
let
|
|
80
|
-
p.camera.style !==
|
|
57
|
+
let i = e.projectionMatrix.elements[5] * y;
|
|
58
|
+
if (p.camera.fov !== i && (e.isPerspectiveCamera ? (a.style.WebkitPerspective = i + "px", a.style.perspective = i + "px") : (a.style.WebkitPerspective = "", a.style.perspective = ""), p.camera.fov = i), t.autoUpdate === !0 && t.updateMatrixWorld(), e.parent === null && e.updateMatrixWorld(), e.isOrthographicCamera)
|
|
59
|
+
var h = -(e.right + e.left) / 2, o = (e.top + e.bottom) / 2;
|
|
60
|
+
let r = (e.isOrthographicCamera ? "scale(" + i + ")translate(" + l(h) + "px," + l(o) + "px)" + u(e.matrixWorldInverse) : "translateZ(" + i + "px)" + u(e.matrixWorldInverse)) + "translate(" + S + "px," + y + "px)";
|
|
61
|
+
p.camera.style !== r && (s.style.WebkitTransform = r, s.style.transform = r, p.camera.style = r), C(t, t, e);
|
|
81
62
|
};
|
|
82
63
|
};
|
|
83
64
|
export {
|
|
@@ -74,7 +74,6 @@ import "../shared-utils/animationFrame/BetterTween.js";
|
|
|
74
74
|
import "../shared-utils/animationFrame/index.js";
|
|
75
75
|
import "../shared-utils/three/loadTexture.js";
|
|
76
76
|
import "../PanoTagPlugin/controller/index.js";
|
|
77
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
78
77
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
79
78
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
80
79
|
import "../PanoTagPlugin/utils/throttle.js";
|
|
@@ -201,6 +200,7 @@ import "../shared-utils/five/FiveDomEvents.js";
|
|
|
201
200
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
202
201
|
import "../shared-utils/three/THREERaycaster.js";
|
|
203
202
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
203
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
204
204
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
205
205
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
206
206
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -75,7 +75,6 @@ import "../shared-utils/animationFrame/index.js";
|
|
|
75
75
|
import "../shared-utils/three/loadTexture.js";
|
|
76
76
|
import "../PanoTagPlugin/controller/index.js";
|
|
77
77
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
78
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
79
78
|
import "../shared-utils/positionToVector3.js";
|
|
80
79
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
81
80
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -202,6 +201,7 @@ import "../shared-utils/five/FiveDomEvents.js";
|
|
|
202
201
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
203
202
|
import "../shared-utils/three/THREERaycaster.js";
|
|
204
203
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
204
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
205
205
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
206
206
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
207
207
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -42,7 +42,6 @@ import "../shared-utils/animationFrame/index.js";
|
|
|
42
42
|
import "../shared-utils/three/loadTexture.js";
|
|
43
43
|
import "../PanoTagPlugin/controller/index.js";
|
|
44
44
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
45
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
46
45
|
import "../shared-utils/positionToVector3.js";
|
|
47
46
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
48
47
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -173,6 +172,7 @@ import "../shared-utils/five/FiveDomEvents.js";
|
|
|
173
172
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
174
173
|
import "../shared-utils/three/THREERaycaster.js";
|
|
175
174
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
175
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
176
176
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
177
177
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
178
178
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -68,7 +68,6 @@ import "../shared-utils/animationFrame/BetterTween.js";
|
|
|
68
68
|
import "../shared-utils/animationFrame/index.js";
|
|
69
69
|
import "../shared-utils/three/loadTexture.js";
|
|
70
70
|
import "../PanoTagPlugin/controller/index.js";
|
|
71
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
72
71
|
import "../shared-utils/positionToVector3.js";
|
|
73
72
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
74
73
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -197,6 +196,7 @@ import "../shared-utils/five/FiveDomEvents.js";
|
|
|
197
196
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
198
197
|
import "../shared-utils/three/THREERaycaster.js";
|
|
199
198
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
199
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
200
200
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
201
201
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
202
202
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -31,7 +31,6 @@ import "../shared-utils/animationFrame/index.js";
|
|
|
31
31
|
import "../shared-utils/three/loadTexture.js";
|
|
32
32
|
import "../PanoTagPlugin/controller/index.js";
|
|
33
33
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
34
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
35
34
|
import "../shared-utils/positionToVector3.js";
|
|
36
35
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
37
36
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -169,6 +168,7 @@ import "../shared-utils/five/calculateThreeMouse.js";
|
|
|
169
168
|
import "../shared-utils/three/THREERaycaster.js";
|
|
170
169
|
import "../base/BasePlugin.js";
|
|
171
170
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
171
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
172
172
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
173
173
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
174
174
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -27,7 +27,6 @@ import "animejs";
|
|
|
27
27
|
import "../shared-utils/util.js";
|
|
28
28
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
29
29
|
import "../shared-utils/animationFrame/index.js";
|
|
30
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
31
30
|
import "../shared-utils/positionToVector3.js";
|
|
32
31
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
33
32
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -166,6 +165,7 @@ import "../shared-utils/five/calculateThreeMouse.js";
|
|
|
166
165
|
import "../shared-utils/three/THREERaycaster.js";
|
|
167
166
|
import "../base/BasePlugin.js";
|
|
168
167
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
168
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
169
169
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
170
170
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
171
171
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -49,7 +49,6 @@ import "../shared-utils/animationFrame/BetterTween.js";
|
|
|
49
49
|
import "../shared-utils/animationFrame/index.js";
|
|
50
50
|
import "../shared-utils/three/loadTexture.js";
|
|
51
51
|
import "../PanoTagPlugin/controller/index.js";
|
|
52
|
-
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
53
52
|
import "../shared-utils/positionToVector3.js";
|
|
54
53
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
55
54
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
@@ -176,6 +175,7 @@ import "../shared-utils/five/FiveDomEvents.js";
|
|
|
176
175
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
177
176
|
import "../shared-utils/three/THREERaycaster.js";
|
|
178
177
|
import "../PanoTagPlugin/utils/DebugUtil.js";
|
|
178
|
+
import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
179
179
|
import "../PanoTagPlugin/controller/Tag/PointTag.js";
|
|
180
180
|
import "../PanoTagPlugin/utils/requestIdleCallback.js";
|
|
181
181
|
import "../PanoTagPlugin/controller/Tag/PlaneTag.js";
|
|
@@ -33,7 +33,7 @@ export declare abstract class TagRender extends TagUtil {
|
|
|
33
33
|
/**
|
|
34
34
|
* @description 渲染3D贴片
|
|
35
35
|
*/
|
|
36
|
-
updateRender3DDomTag
|
|
36
|
+
updateRender3DDomTag(tag?: TagInstance | TagInstance[]): void;
|
|
37
37
|
/** 更新标签中多媒体面片的位置
|
|
38
38
|
* @param tag 标签
|
|
39
39
|
* @param model 模型
|
|
@@ -186,74 +186,6 @@ class Se extends U {
|
|
|
186
186
|
c(this, "temporaryState", { visible: !0 });
|
|
187
187
|
/** 点标签 */
|
|
188
188
|
c(this, "TagContainerSvelte");
|
|
189
|
-
/**
|
|
190
|
-
* @description 渲染3D贴片
|
|
191
|
-
*/
|
|
192
|
-
c(this, "updateRender3DDomTag", (t) => {
|
|
193
|
-
(t ? N(t) : this.filterCSS3DTag).forEach((o) => {
|
|
194
|
-
var i, a, d, n, h, b;
|
|
195
|
-
if (o.tag3DContentSvelte) {
|
|
196
|
-
const { svelteApp: f, css3DInstance: l, initialNormal: u, currentNormal: s } = o.tag3DContentSvelte;
|
|
197
|
-
if ((a = l == null ? void 0 : l.css3DObject) == null || a.setVisible((this.state.visible && ((i = o.state) == null ? void 0 : i.visible)) !== !1), f.$set({ tag: o, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !u.equals(s)) {
|
|
198
|
-
const p = new G().setFromUnitVectors(u, s);
|
|
199
|
-
l.css3DObject.setRotationFromQuaternion(p);
|
|
200
|
-
}
|
|
201
|
-
return;
|
|
202
|
-
} else {
|
|
203
|
-
if (P(o) && !((d = o.model) != null && d.object) || ((n = o.state) == null ? void 0 : n.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
|
|
204
|
-
return;
|
|
205
|
-
if (o.stickType === "3DPoint" && !o.normal)
|
|
206
|
-
return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
|
|
207
|
-
const f = this.getPositions(o);
|
|
208
|
-
if (!f)
|
|
209
|
-
return;
|
|
210
|
-
const l = o.computeNormal();
|
|
211
|
-
if (!l)
|
|
212
|
-
return;
|
|
213
|
-
const u = o.getConfig(), s = w({
|
|
214
|
-
wrapperStyle: { zIndex: `${Math.round((1e4 - ((h = o.getDistance()) != null ? h : 0)) * 100)}` }
|
|
215
|
-
}, u.tag3DConfig);
|
|
216
|
-
if (o.computeRenderType() === "BehindDom" || s.mode === "behind") {
|
|
217
|
-
s.mode = "behind", s.container = document.createElement("div");
|
|
218
|
-
const D = "black";
|
|
219
|
-
s.container.style.backgroundColor = D, s.container.style.border = `3px solid ${D}`, this.css3DRenderPlugin.hooks.on("render", () => {
|
|
220
|
-
var S;
|
|
221
|
-
if (p.css3DObject.opacityMesh && u.clickable !== !1) {
|
|
222
|
-
const j = this.addObjectClickHandler(o, p.css3DObject.opacityMesh, (k) => {
|
|
223
|
-
this.hooks.emit("click", { event: k, target: "TagContent", tag: o });
|
|
224
|
-
});
|
|
225
|
-
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(j);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
const p = this.css3DRenderPlugin.create3DDomContainer(f, s);
|
|
230
|
-
if (!p)
|
|
231
|
-
return;
|
|
232
|
-
this.store.css3DRenderDisposer.set(o.id, [p.dispose]);
|
|
233
|
-
const g = new E({
|
|
234
|
-
target: p.container,
|
|
235
|
-
props: {
|
|
236
|
-
tag: o,
|
|
237
|
-
hooks: this.hooks,
|
|
238
|
-
/** 模型标签要等模型加载好之后再展示 */
|
|
239
|
-
state: this.state,
|
|
240
|
-
mediaStore: this.mediaStore,
|
|
241
|
-
temporaryState: this.temporaryState
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
o.tag3DContentSvelte = {
|
|
245
|
-
svelteApp: g,
|
|
246
|
-
domContainer: p,
|
|
247
|
-
css3DInstance: p,
|
|
248
|
-
initialNormal: l,
|
|
249
|
-
currentNormal: l,
|
|
250
|
-
dispose: () => {
|
|
251
|
-
g.$destroy(), p.dispose();
|
|
252
|
-
}
|
|
253
|
-
}, P(o) && ((b = o.model) != null && b.object) && this.updateTagCss3DObjectMatrix(o, o.model.object);
|
|
254
|
-
}
|
|
255
|
-
}), this.clearUnusedPanelTag();
|
|
256
|
-
});
|
|
257
189
|
this.group.name = "PanoTagPluginModelGroup", this.gltfObjectGroup.name = "PanoTagPluginGLTFObjectGroup", this.imagePlaneGroup.name = "ImagePlaneGroup", this.group.add(this.gltfObjectGroup), this.group.add(this.imagePlaneGroup);
|
|
258
190
|
}
|
|
259
191
|
/**
|
|
@@ -278,6 +210,74 @@ class Se extends U {
|
|
|
278
210
|
(i = (o = e.mediaPlane) == null ? void 0 : o.parent) == null || i.remove(e.mediaPlane);
|
|
279
211
|
}), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (t = this.TagContainerSvelte) == null || t.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
|
|
280
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* @description 渲染3D贴片
|
|
215
|
+
*/
|
|
216
|
+
updateRender3DDomTag(t) {
|
|
217
|
+
(t ? N(t) : this.filterCSS3DTag).forEach((o) => {
|
|
218
|
+
var i, a, d, n, h, b;
|
|
219
|
+
if (o.tag3DContentSvelte) {
|
|
220
|
+
const { svelteApp: f, css3DInstance: l, initialNormal: u, currentNormal: s } = o.tag3DContentSvelte;
|
|
221
|
+
if ((a = l == null ? void 0 : l.css3DObject) == null || a.setVisible((this.state.visible && ((i = o.state) == null ? void 0 : i.visible)) !== !1), f.$set({ tag: o, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !u.equals(s)) {
|
|
222
|
+
const p = new G().setFromUnitVectors(u, s);
|
|
223
|
+
l.css3DObject.setRotationFromQuaternion(p);
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
} else {
|
|
227
|
+
if (P(o) && !((d = o.model) != null && d.object) || ((n = o.state) == null ? void 0 : n.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
|
|
228
|
+
return;
|
|
229
|
+
if (o.stickType === "3DPoint" && !o.normal)
|
|
230
|
+
return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
|
|
231
|
+
const f = this.getPositions(o);
|
|
232
|
+
if (!f)
|
|
233
|
+
return;
|
|
234
|
+
const l = o.computeNormal();
|
|
235
|
+
if (!l)
|
|
236
|
+
return;
|
|
237
|
+
const u = o.getConfig(), s = w({
|
|
238
|
+
wrapperStyle: { zIndex: `${Math.round((1e4 - ((h = o.getDistance()) != null ? h : 0)) * 100)}` }
|
|
239
|
+
}, u.tag3DConfig);
|
|
240
|
+
if (o.computeRenderType() === "BehindDom" || s.mode === "behind") {
|
|
241
|
+
s.mode = "behind", s.container = document.createElement("div");
|
|
242
|
+
const D = "black";
|
|
243
|
+
s.container.style.backgroundColor = D, s.container.style.border = `3px solid ${D}`, this.css3DRenderPlugin.hooks.on("render", () => {
|
|
244
|
+
var S;
|
|
245
|
+
if (p.css3DObject.opacityMesh && u.clickable !== !1) {
|
|
246
|
+
const j = this.addObjectClickHandler(o, p.css3DObject.opacityMesh, (k) => {
|
|
247
|
+
this.hooks.emit("click", { event: k, target: "TagContent", tag: o });
|
|
248
|
+
});
|
|
249
|
+
(S = this.store.css3DRenderDisposer.get(o.id)) == null || S.push(j);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
const p = this.css3DRenderPlugin.create3DDomContainer(f, s);
|
|
254
|
+
if (!p)
|
|
255
|
+
return;
|
|
256
|
+
this.store.css3DRenderDisposer.set(o.id, [p.dispose]);
|
|
257
|
+
const g = new E({
|
|
258
|
+
target: p.container,
|
|
259
|
+
props: {
|
|
260
|
+
tag: o,
|
|
261
|
+
hooks: this.hooks,
|
|
262
|
+
/** 模型标签要等模型加载好之后再展示 */
|
|
263
|
+
state: this.state,
|
|
264
|
+
mediaStore: this.mediaStore,
|
|
265
|
+
temporaryState: this.temporaryState
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
o.tag3DContentSvelte = {
|
|
269
|
+
svelteApp: g,
|
|
270
|
+
domContainer: p,
|
|
271
|
+
css3DInstance: p,
|
|
272
|
+
initialNormal: l,
|
|
273
|
+
currentNormal: l,
|
|
274
|
+
dispose: () => {
|
|
275
|
+
g.$destroy(), p.dispose();
|
|
276
|
+
}
|
|
277
|
+
}, P(o) && ((b = o.model) != null && b.object) && this.updateTagCss3DObjectMatrix(o, o.model.object);
|
|
278
|
+
}
|
|
279
|
+
}), this.clearUnusedPanelTag();
|
|
280
|
+
}
|
|
281
281
|
/** 更新标签中多媒体面片的位置
|
|
282
282
|
* @param tag 标签
|
|
283
283
|
* @param model 模型
|
|
@@ -29,30 +29,29 @@ var l = (d, a, e) => new Promise((t, i) => {
|
|
|
29
29
|
});
|
|
30
30
|
import * as v from "three";
|
|
31
31
|
import { objectAssignDeepExports as m } from "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { debounce as _ } from "../utils/debounce.js";
|
|
32
|
+
import { arrayPositionToVector3 as A } from "../../shared-utils/positionToVector3.js";
|
|
33
|
+
import { isModelTag as k, isMediaModelTag as w } from "../utils/tag/tagCheck.js";
|
|
34
|
+
import { debounce as M } from "../utils/debounce.js";
|
|
36
35
|
import { throttle as y } from "../utils/throttle.js";
|
|
37
|
-
import
|
|
38
|
-
import { generateBlankAudio as L, AudioNamespace as
|
|
36
|
+
import _, { getTagStickType as I } from "../utils/tag/format.js";
|
|
37
|
+
import { generateBlankAudio as L, AudioNamespace as B } from "../../shared-utils/audio.js";
|
|
39
38
|
import { resizeObserver as C } from "../../shared-utils/dom/resizeObserver.js";
|
|
40
|
-
import { TagRender as
|
|
41
|
-
import { isModelLike as
|
|
39
|
+
import { TagRender as O } from "./TagRender.js";
|
|
40
|
+
import { isModelLike as R } from "../../shared-utils/five/mode.js";
|
|
42
41
|
import "hammerjs";
|
|
43
42
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
44
43
|
import "@realsee/five/line";
|
|
45
44
|
import "../../shared-utils/three/THREESphere.js";
|
|
46
45
|
import "animejs";
|
|
47
|
-
import { nextFrame as
|
|
48
|
-
import { waitFiveModelLoaded as
|
|
49
|
-
import { DebugUtil as
|
|
46
|
+
import { nextFrame as G } from "../../shared-utils/animationFrame/index.js";
|
|
47
|
+
import { waitFiveModelLoaded as N } from "../../shared-utils/five/fiveModelLoad.js";
|
|
48
|
+
import { DebugUtil as V } from "../utils/DebugUtil.js";
|
|
50
49
|
import { safeObj as T } from "../../shared-utils/safeObj.js";
|
|
51
|
-
import { PointTag as
|
|
52
|
-
import { ModelTag as
|
|
53
|
-
import { PlaneTag as
|
|
54
|
-
import
|
|
55
|
-
import { tweenProgress as
|
|
50
|
+
import { PointTag as z } from "./Tag/PointTag.js";
|
|
51
|
+
import { ModelTag as x } from "./Tag/ModelTag.js";
|
|
52
|
+
import { PlaneTag as Q } from "./Tag/PlaneTag.js";
|
|
53
|
+
import $ from "../Components/TagContainer.js";
|
|
54
|
+
import { tweenProgress as W } from "../../shared-utils/animationFrame/BetterTween.js";
|
|
56
55
|
import "../Components/Tag/index.js";
|
|
57
56
|
import "../../vendor/svelte/internal/index.js";
|
|
58
57
|
import "../Components/Tag/TextTag/index.js";
|
|
@@ -184,18 +183,19 @@ import "../../shared-utils/five/FiveDomEvents.js";
|
|
|
184
183
|
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
185
184
|
import "../../shared-utils/three/THREERaycaster.js";
|
|
186
185
|
import "../../base/BasePlugin.js";
|
|
186
|
+
import "../utils/addDebugPoints.js";
|
|
187
187
|
import "../utils/requestIdleCallback.js";
|
|
188
188
|
import "../Components/TagItem.js";
|
|
189
189
|
import "../Components/Common/TagPoint.js";
|
|
190
|
-
const S = "Dnalogel-PanoTagPlugin",
|
|
191
|
-
class
|
|
190
|
+
const S = "Dnalogel-PanoTagPlugin", $i = (d) => `${S}--${d}`;
|
|
191
|
+
class Wi extends O {
|
|
192
192
|
constructor(e, t) {
|
|
193
193
|
super(e);
|
|
194
194
|
/** state */
|
|
195
195
|
p(this, "state", { enabled: !0, visible: !0 });
|
|
196
196
|
/** debug */
|
|
197
197
|
p(this, "debug");
|
|
198
|
-
p(this, "debugUtil", new
|
|
198
|
+
p(this, "debugUtil", new V(this));
|
|
199
199
|
/** 更改 tag 模型 */
|
|
200
200
|
p(this, "changeTagModel", (e, t) => l(this, null, function* () {
|
|
201
201
|
var i;
|
|
@@ -205,7 +205,7 @@ class ji extends R {
|
|
|
205
205
|
const t = () => {
|
|
206
206
|
this.tags.forEach((i) => {
|
|
207
207
|
i.state.visible = !1, i.applyVisible(), this.five.ready().then(() => {
|
|
208
|
-
i.updateVisible(),
|
|
208
|
+
i.updateVisible(), w(i) && e !== "Panorama" && this.changeTagMode(i, "behind");
|
|
209
209
|
});
|
|
210
210
|
});
|
|
211
211
|
};
|
|
@@ -236,7 +236,7 @@ class ji extends R {
|
|
|
236
236
|
p(this, "handleFivePanoArrived", () => l(this, null, function* () {
|
|
237
237
|
this.tags.forEach((e) => {
|
|
238
238
|
e.state.visible = !1, e.temporaryState = c(f({}, e.temporaryState), { visible: !0 }), e.applyVisible(), e.updateVisible();
|
|
239
|
-
}), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.updateRender3DDomTag(), this.tags.filter(
|
|
239
|
+
}), this.temporaryState.visible = !0, this.addRenderQueue({ type: "TagContainerSvelte", keys: ["temporaryState"] }), yield this.setUnfolded(), this.updateRender3DDomTag(), this.tags.filter(k).filter((e) => {
|
|
240
240
|
var t;
|
|
241
241
|
return (t = e.getConfig().modelConfig) == null ? void 0 : t.autoLookAtEnabled;
|
|
242
242
|
}).forEach((e) => {
|
|
@@ -247,7 +247,7 @@ class ji extends R {
|
|
|
247
247
|
t.position.copy(i.position), t.quaternion.copy(i.quaternion);
|
|
248
248
|
const o = this.five.camera.position;
|
|
249
249
|
t.lookAt(o.clone().setY(t.position.y));
|
|
250
|
-
const s = i.quaternion.clone(), n = t.quaternion.clone(), r =
|
|
250
|
+
const s = i.quaternion.clone(), n = t.quaternion.clone(), r = W();
|
|
251
251
|
r.onUpdate(({ progress: g }) => {
|
|
252
252
|
i.quaternion.copy(s.clone().slerp(n, g));
|
|
253
253
|
}), r.play();
|
|
@@ -258,7 +258,7 @@ class ji extends R {
|
|
|
258
258
|
this.tags.forEach((e) => e.updateVisible());
|
|
259
259
|
});
|
|
260
260
|
p(this, "onFiveEveryReady", () => {
|
|
261
|
-
this.setUnfoldedByCamera(),
|
|
261
|
+
this.setUnfoldedByCamera(), R(this.five.getCurrentState().mode) && this.tags.forEach((e) => e.updateVisible());
|
|
262
262
|
});
|
|
263
263
|
p(this, "render", () => {
|
|
264
264
|
this.renderQueue.forEach((e, t) => {
|
|
@@ -285,10 +285,10 @@ class ji extends R {
|
|
|
285
285
|
} else {
|
|
286
286
|
if (!this.container)
|
|
287
287
|
return console.error("updateRenderPlaneTag: tag2DContainer not found");
|
|
288
|
-
this.TagContainerSvelte = new
|
|
288
|
+
this.TagContainerSvelte = new $({
|
|
289
289
|
target: this.container,
|
|
290
290
|
props: c(f({}, n), { state: c(f({}, this.state), { enabled: !1 }) })
|
|
291
|
-
}),
|
|
291
|
+
}), G(() => {
|
|
292
292
|
var r;
|
|
293
293
|
(r = this.TagContainerSvelte) == null || r.$set({ state: this.state });
|
|
294
294
|
});
|
|
@@ -296,7 +296,7 @@ class ji extends R {
|
|
|
296
296
|
}
|
|
297
297
|
}), this.renderQueue.clear();
|
|
298
298
|
});
|
|
299
|
-
this.params = m({}, { debug: !1, config: this.config }, f({}, t)), this.debug = this.params.debug, this.config = this.params.config, L(1, { namespace:
|
|
299
|
+
this.params = m({}, { debug: !1, config: this.config }, f({}, t)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(), L(1, { namespace: B.PlayAudio });
|
|
300
300
|
try {
|
|
301
301
|
Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
|
|
302
302
|
get: function() {
|
|
@@ -308,7 +308,7 @@ class ji extends R {
|
|
|
308
308
|
}
|
|
309
309
|
appendTo(e) {
|
|
310
310
|
var i, o, s, n;
|
|
311
|
-
this.container = e, (i = this.css3DRenderPlugin) == null || i.appendToFrontFiveContainer(this.container);
|
|
311
|
+
this.debugUtil.addLog("appendTo"), this.container = e, (i = this.css3DRenderPlugin) == null || i.appendToFrontFiveContainer(this.container);
|
|
312
312
|
const t = (s = (o = this.TagContainerSvelte) == null ? void 0 : o.$$) == null ? void 0 : s.root;
|
|
313
313
|
t && t !== this.container && ((n = this.TagContainerSvelte) == null || n.$destroy(), this.TagContainerSvelte = void 0);
|
|
314
314
|
}
|
|
@@ -323,13 +323,7 @@ class ji extends R {
|
|
|
323
323
|
contentTypeConfig: (o = e.contentTypeConfig) != null ? o : {}
|
|
324
324
|
});
|
|
325
325
|
const t = yield this.addTag(e.tagList);
|
|
326
|
-
|
|
327
|
-
try {
|
|
328
|
-
A(this.five, this.tags);
|
|
329
|
-
} catch (s) {
|
|
330
|
-
console.error(s);
|
|
331
|
-
}
|
|
332
|
-
return t;
|
|
326
|
+
return this.hooks.emit("loaded"), t;
|
|
333
327
|
});
|
|
334
328
|
}
|
|
335
329
|
/**
|
|
@@ -338,15 +332,15 @@ class ji extends R {
|
|
|
338
332
|
addTag(e) {
|
|
339
333
|
return l(this, null, function* () {
|
|
340
334
|
const i = (Array.isArray(e) ? e : [e]).filter((o) => o.position).map((o) => {
|
|
341
|
-
const s =
|
|
335
|
+
const s = I(o);
|
|
342
336
|
if (s === "2DPoint" || s === "3DPoint")
|
|
343
|
-
return new
|
|
337
|
+
return new z(this, o);
|
|
344
338
|
if (s === "Model")
|
|
345
|
-
return new
|
|
339
|
+
return new x(this, o);
|
|
346
340
|
if (s === "Plane")
|
|
347
|
-
return new
|
|
341
|
+
return new Q(this, o);
|
|
348
342
|
});
|
|
349
|
-
return i.forEach(
|
|
343
|
+
return i.forEach(_), this.tags.push(...i), this.tagsLengthWillUpdate = !0, N(this.five).then(() => l(this, null, function* () {
|
|
350
344
|
var o, s;
|
|
351
345
|
this.store.eventListenerDisposer && ((s = (o = this.store).eventListenerDisposer) == null || s.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.addMediaModelTag(i), i.forEach((n) => {
|
|
352
346
|
n.updateVisible(), n.updateZIndex();
|
|
@@ -459,7 +453,7 @@ class ji extends R {
|
|
|
459
453
|
*/
|
|
460
454
|
changeTagNormalById(e, t) {
|
|
461
455
|
const i = this.getTagById(e);
|
|
462
|
-
i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal =
|
|
456
|
+
i && i.tag3DContentSvelte && (i.tag3DContentSvelte.currentNormal = A(t));
|
|
463
457
|
}
|
|
464
458
|
/**
|
|
465
459
|
* @description 改变data
|
|
@@ -555,7 +549,7 @@ class ji extends R {
|
|
|
555
549
|
}, 500),
|
|
556
550
|
e
|
|
557
551
|
), { observe: n, unobserve: r } = C(
|
|
558
|
-
|
|
552
|
+
M(() => t(), 400),
|
|
559
553
|
e
|
|
560
554
|
);
|
|
561
555
|
return o(), n(), () => {
|
|
@@ -599,7 +593,7 @@ class ji extends R {
|
|
|
599
593
|
}
|
|
600
594
|
}
|
|
601
595
|
export {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
596
|
+
Wi as PanoTagPluginController,
|
|
597
|
+
Wi as default,
|
|
598
|
+
$i as pluginFlag
|
|
605
599
|
};
|
|
@@ -4,7 +4,6 @@ import { defaultGlobalConfig as er } from "./typings/tag/TagConfig.js";
|
|
|
4
4
|
import { ContentType as ar, DimensionType as fr, PointType as gr } from "./Archive/deprecated.js";
|
|
5
5
|
import "three";
|
|
6
6
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
7
|
-
import "./utils/addDebugPoints.js";
|
|
8
7
|
import "../shared-utils/positionToVector3.js";
|
|
9
8
|
import "./utils/tag/tagCheck.js";
|
|
10
9
|
import "./utils/debounce.js";
|
|
@@ -154,6 +153,7 @@ import "../shared-utils/three/THREERaycaster.js";
|
|
|
154
153
|
import "../base/BasePlugin.js";
|
|
155
154
|
import "../shared-utils/animationFrame/index.js";
|
|
156
155
|
import "./utils/DebugUtil.js";
|
|
156
|
+
import "./utils/addDebugPoints.js";
|
|
157
157
|
import "./controller/Tag/PointTag.js";
|
|
158
158
|
import "./utils/requestIdleCallback.js";
|
|
159
159
|
import "./controller/Tag/PlaneTag.js";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type PanoTagPluginController from '../controller';
|
|
2
2
|
export declare class DebugUtil {
|
|
3
3
|
plugin: PanoTagPluginController;
|
|
4
|
+
get debug(): boolean;
|
|
5
|
+
private logBinded;
|
|
4
6
|
constructor(plugin: PanoTagPluginController);
|
|
7
|
+
addDebugPoints(): void;
|
|
8
|
+
bindLog(): void;
|
|
9
|
+
addLog(functionName: string, ...args: any[]): void;
|
|
5
10
|
private closeIntersectRaycaster;
|
|
6
11
|
}
|