@realsee/dnalogel 2.28.1 → 2.28.3
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/AreaMakerPlugin/Controller.d.ts +2 -0
- package/dist/AreaMakerPlugin/index.d.ts +1 -1
- package/dist/AreaMakerPlugin/utils/Item.d.ts +9 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +29 -8
- package/dist/index.umd.js +24 -24
- package/libs/AreaMakerPlugin/Controller.d.ts +2 -0
- package/libs/AreaMakerPlugin/Controller.js +40 -38
- package/libs/AreaMakerPlugin/index.d.ts +1 -1
- package/libs/AreaMakerPlugin/index.js +3 -3
- package/libs/AreaMakerPlugin/utils/Item.d.ts +9 -0
- package/libs/AreaMakerPlugin/utils/Item.js +50 -31
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,8 @@ export declare class Controller extends BasePlugin.Controller<PluginType.State,
|
|
|
14
14
|
data?: PluginType.PluginData;
|
|
15
15
|
/** tag 容器 */
|
|
16
16
|
tagDomContainer: HTMLDivElement;
|
|
17
|
+
/** 用于监听容器尺寸变化的 iframe */
|
|
18
|
+
resizeIframe: HTMLIFrameElement;
|
|
17
19
|
/** 插件配置项 */
|
|
18
20
|
get config(): {
|
|
19
21
|
modelDepthTest: boolean;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
var C = Object.defineProperty, M = Object.defineProperties;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
2
|
+
var I = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (h, o, t) => o in h ? C(h, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[o] = t, d = (h, o) => {
|
|
6
6
|
for (var t in o || (o = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
A.call(o, t) && u(h, t, o[t]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var t of p(o))
|
|
10
|
+
S.call(o, t) && u(h, t, o[t]);
|
|
11
11
|
return h;
|
|
12
|
-
},
|
|
13
|
-
var r = (h, o, t) => (
|
|
14
|
-
var
|
|
12
|
+
}, f = (h, o) => M(h, I(o));
|
|
13
|
+
var r = (h, o, t) => (u(h, typeof o != "symbol" ? o + "" : o, t), t);
|
|
14
|
+
var m = (h, o, t) => new Promise((i, e) => {
|
|
15
15
|
var s = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
e(
|
|
17
|
+
l(t.next(n));
|
|
18
|
+
} catch (c) {
|
|
19
|
+
e(c);
|
|
20
20
|
}
|
|
21
21
|
}, a = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
e(
|
|
23
|
+
l(t.throw(n));
|
|
24
|
+
} catch (c) {
|
|
25
|
+
e(c);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, l = (n) => n.done ? i(n.value) : Promise.resolve(n.value).then(s, a);
|
|
28
|
+
l((t = t.apply(h, o)).next());
|
|
29
29
|
});
|
|
30
30
|
import * as g from "three";
|
|
31
|
-
import { Controller as
|
|
31
|
+
import { Controller as _ } from "../base/BasePluginWithData.js";
|
|
32
32
|
import "hammerjs";
|
|
33
33
|
import "@realsee/five";
|
|
34
34
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
35
35
|
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
36
36
|
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
37
|
-
import { equal as
|
|
38
|
-
import { AreaMakerItem as
|
|
37
|
+
import { equal as k } from "../shared-utils/equal.js";
|
|
38
|
+
import { AreaMakerItem as y } from "./utils/Item.js";
|
|
39
39
|
import "../base/BasePlugin.js";
|
|
40
40
|
import "../shared-utils/Subscribe.js";
|
|
41
41
|
import "../shared-utils/absoluteUrl.js";
|
|
@@ -59,7 +59,7 @@ import "../components/AreaLabel/LabelItem.js";
|
|
|
59
59
|
import "../vendor/svelte/internal/index.js";
|
|
60
60
|
import "../components/AreaLabel/Assets/roomLabelBg.js";
|
|
61
61
|
import "../shared-utils/math/planimetry.js";
|
|
62
|
-
class ot extends
|
|
62
|
+
class ot extends _ {
|
|
63
63
|
/** AreaMakerPlugin
|
|
64
64
|
* @param `five` `<Five>` Five 实例
|
|
65
65
|
* @param `params` `<PluginType.Params> | <undefined>` 插件初始化参数
|
|
@@ -78,6 +78,8 @@ class ot extends k {
|
|
|
78
78
|
r(this, "data");
|
|
79
79
|
/** tag 容器 */
|
|
80
80
|
r(this, "tagDomContainer");
|
|
81
|
+
/** 用于监听容器尺寸变化的 iframe */
|
|
82
|
+
r(this, "resizeIframe");
|
|
81
83
|
/** 查询问题使用的调试对象 */
|
|
82
84
|
r(this, "checkMsg", {
|
|
83
85
|
childrenMountedState: ""
|
|
@@ -124,9 +126,9 @@ class ot extends k {
|
|
|
124
126
|
})).filter(({ intersects: n }) => n.length > 0);
|
|
125
127
|
if (i.length === 0)
|
|
126
128
|
return;
|
|
127
|
-
const e = i.reduce((n,
|
|
128
|
-
const v = n.intersects[0].distance, b =
|
|
129
|
-
return v < b ? n :
|
|
129
|
+
const e = i.reduce((n, c) => {
|
|
130
|
+
const v = n.intersects[0].distance, b = c.intersects[0].distance;
|
|
131
|
+
return v < b ? n : c;
|
|
130
132
|
}), s = this.five.model.intersectRaycaster(t)[0];
|
|
131
133
|
if (this.config.modelDepthTest && s && s.distance < e.intersects[0].distance)
|
|
132
134
|
return;
|
|
@@ -136,7 +138,7 @@ class ot extends k {
|
|
|
136
138
|
}))
|
|
137
139
|
return !1;
|
|
138
140
|
});
|
|
139
|
-
this.five = t, this.tagDomContainer = document.createElement("div"), this.tagDomContainer.style.position = "absolute", this.tagDomContainer.style.top = "0", this.tagDomContainer.style.left = "0", this.tagDomContainer.style.width = "100%", this.tagDomContainer.style.height = "100%", this.tagDomContainer.style.pointerEvents = "none";
|
|
141
|
+
this.five = t, this.tagDomContainer = document.createElement("div"), this.tagDomContainer.style.position = "absolute", this.tagDomContainer.style.top = "0", this.tagDomContainer.style.left = "0", this.tagDomContainer.style.width = "100%", this.tagDomContainer.style.height = "100%", this.tagDomContainer.style.pointerEvents = "none", this.resizeIframe = document.createElement("iframe"), this.resizeIframe.style.position = "absolute", this.resizeIframe.style.top = "0", this.resizeIframe.style.left = "0", this.resizeIframe.style.width = "100%", this.resizeIframe.style.height = "100%", this.resizeIframe.style.border = "none", this.resizeIframe.style.pointerEvents = "none", this.resizeIframe.style.zIndex = "-1", this.tagDomContainer.appendChild(this.resizeIframe);
|
|
140
142
|
const e = {
|
|
141
143
|
enabled: !0,
|
|
142
144
|
visible: !0
|
|
@@ -157,10 +159,10 @@ class ot extends k {
|
|
|
157
159
|
}
|
|
158
160
|
/** 加载数据,重复调用会使用新数据覆盖旧数据 */
|
|
159
161
|
load(t) {
|
|
160
|
-
return
|
|
162
|
+
return m(this, null, function* () {
|
|
161
163
|
const i = this.data;
|
|
162
164
|
this.data = this.formatData(t), this.hooks.emit("dataChange", this.data, i), this.modelGroup.remove(...this.modelGroup.children), this.itemMap.clear(), this.data.list.forEach((e) => {
|
|
163
|
-
const s = new
|
|
165
|
+
const s = new y(this, e);
|
|
164
166
|
this.modelGroup.add(s.modelGroup), this.itemMap.set(e.id, s), s.hooks.on("tagClick", this.onMakerTagClick);
|
|
165
167
|
});
|
|
166
168
|
});
|
|
@@ -196,7 +198,7 @@ class ot extends k {
|
|
|
196
198
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
197
199
|
*/
|
|
198
200
|
show(t) {
|
|
199
|
-
return
|
|
201
|
+
return m(this, null, function* () {
|
|
200
202
|
if (this.state.visible)
|
|
201
203
|
return Promise.resolve();
|
|
202
204
|
if (this.disposed)
|
|
@@ -210,7 +212,7 @@ class ot extends k {
|
|
|
210
212
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
211
213
|
*/
|
|
212
214
|
hide(t) {
|
|
213
|
-
return
|
|
215
|
+
return m(this, null, function* () {
|
|
214
216
|
if (this.state.visible === !1)
|
|
215
217
|
return;
|
|
216
218
|
const i = d({ userAction: !0 }, t);
|
|
@@ -258,7 +260,7 @@ class ot extends k {
|
|
|
258
260
|
*/
|
|
259
261
|
setState(t, i = {}) {
|
|
260
262
|
const e = this.state;
|
|
261
|
-
if (
|
|
263
|
+
if (k(t, e, { deep: !0 }))
|
|
262
264
|
return;
|
|
263
265
|
const s = i.userAction !== void 0 ? i.userAction : !0;
|
|
264
266
|
if (this.updateState(t, s), t.enabled !== void 0 && e.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), t.visible !== void 0 && e.visible !== t.visible) {
|
|
@@ -286,9 +288,9 @@ class ot extends k {
|
|
|
286
288
|
return i(t) ? {
|
|
287
289
|
list: t.list.filter((e) => e.object_data.points.length >= 3).map((e) => {
|
|
288
290
|
const s = new g.Shape(), a = e.object_data.points[0];
|
|
289
|
-
return s.moveTo(a[0], a[2]), e.object_data.points.slice(1).forEach((n) => s.lineTo(n[0], n[2])), s.lineTo(a[0], a[2]),
|
|
291
|
+
return s.moveTo(a[0], a[2]), e.object_data.points.slice(1).forEach((n) => s.lineTo(n[0], n[2])), s.lineTo(a[0], a[2]), f(d({}, e), {
|
|
290
292
|
floor_index: e.object_data.floorIndex,
|
|
291
|
-
object_data:
|
|
293
|
+
object_data: f(d({}, e.object_data), {
|
|
292
294
|
bottom_y: a[1] + e.object_data.fixedY,
|
|
293
295
|
shape: s.toJSON(),
|
|
294
296
|
height: e.object_data.height + e.object_data.fixedHeight
|
|
@@ -315,18 +317,18 @@ class ot extends k {
|
|
|
315
317
|
this.state = d(d({}, this.state), t), this.hooks.emit("stateChange", { state: this.state, prevState: e, userAction: i });
|
|
316
318
|
}
|
|
317
319
|
_enable(t) {
|
|
318
|
-
this.hooks.emit("enable", { userAction: t.userAction }), this.five.scene.add(this.modelGroup), this.five.needsRender = !0, this.five.on("wantsTapGesture", this.onWantsFiveTapGesture), this.five.on("initAnimationWillStart", this.onFiveInitAnimationWillStart), this.five.on("initAnimationEnded", this.onFiveInitAnimationEnded), this.five.on("modeChange", this.onFiveModeChange), this.five.on("cameraUpdate", this.onFiveCameraUpdate);
|
|
320
|
+
this.hooks.emit("enable", { userAction: t.userAction }), this.five.scene.add(this.modelGroup), this.updateChildrenMountedState(), this.five.needsRender = !0, this.five.on("wantsTapGesture", this.onWantsFiveTapGesture), this.five.on("initAnimationWillStart", this.onFiveInitAnimationWillStart), this.five.on("initAnimationEnded", this.onFiveInitAnimationEnded), this.five.on("modeChange", this.onFiveModeChange), this.five.on("cameraUpdate", this.onFiveCameraUpdate);
|
|
319
321
|
}
|
|
320
322
|
_disable(t) {
|
|
321
|
-
this.hooks.emit("disable", { userAction: t.userAction }), this.five.scene.remove(this.modelGroup), this.five.needsRender = !0, this.five.off("wantsTapGesture", this.onWantsFiveTapGesture), this.five.off("initAnimationWillStart", this.onFiveInitAnimationWillStart), this.five.off("initAnimationEnded", this.onFiveInitAnimationEnded), this.five.off("modeChange", this.onFiveModeChange), this.five.off("cameraUpdate", this.onFiveCameraUpdate);
|
|
323
|
+
this.hooks.emit("disable", { userAction: t.userAction }), this.five.scene.remove(this.modelGroup), this.updateChildrenMountedState(), this.five.needsRender = !0, this.five.off("wantsTapGesture", this.onWantsFiveTapGesture), this.five.off("initAnimationWillStart", this.onFiveInitAnimationWillStart), this.five.off("initAnimationEnded", this.onFiveInitAnimationEnded), this.five.off("modeChange", this.onFiveModeChange), this.five.off("cameraUpdate", this.onFiveCameraUpdate);
|
|
322
324
|
}
|
|
323
325
|
_show(t) {
|
|
324
|
-
return
|
|
326
|
+
return m(this, null, function* () {
|
|
325
327
|
this.hooks.emit("show", t), this.five.needsRender = !0;
|
|
326
328
|
});
|
|
327
329
|
}
|
|
328
330
|
_hide(t) {
|
|
329
|
-
return
|
|
331
|
+
return m(this, null, function* () {
|
|
330
332
|
this.hooks.emit("hide", t), this.five.needsRender = !0;
|
|
331
333
|
});
|
|
332
334
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
2
|
import type * as AreaMakerPluginType from './typing';
|
|
3
|
-
export declare const AreaMakerPlugin: (five: Five) => AreaMakerPluginType.AreaMakerController;
|
|
3
|
+
export declare const AreaMakerPlugin: (five: Five, params?: AreaMakerPluginType.Params) => AreaMakerPluginType.AreaMakerController;
|
|
4
4
|
export type { AreaMakerPluginType };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Controller as
|
|
1
|
+
import { Controller as t } from "./Controller.js";
|
|
2
2
|
import "three";
|
|
3
3
|
import "../base/BasePluginWithData.js";
|
|
4
4
|
import "../base/BasePlugin.js";
|
|
@@ -31,7 +31,7 @@ import "../components/AreaLabel/LabelItem.js";
|
|
|
31
31
|
import "../vendor/svelte/internal/index.js";
|
|
32
32
|
import "../components/AreaLabel/Assets/roomLabelBg.js";
|
|
33
33
|
import "../shared-utils/math/planimetry.js";
|
|
34
|
-
const
|
|
34
|
+
const I = (r, o) => new t(r, o);
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
I as AreaMakerPlugin
|
|
37
37
|
};
|
|
@@ -56,11 +56,16 @@ export declare class AreaMakerItem {
|
|
|
56
56
|
};
|
|
57
57
|
/** 标注标签的显示层级 */
|
|
58
58
|
tagZIndex: number;
|
|
59
|
+
/** 标注实例的事件处理器 */
|
|
59
60
|
hooks: Subscribe<PluginType.AreaMakerItemEventMap>;
|
|
60
61
|
/** Plugin 实例 */
|
|
61
62
|
private plugin;
|
|
62
63
|
/** 标注透明度动画 */
|
|
63
64
|
private opacityAnime?;
|
|
65
|
+
/** 是否在容器 resize 动画中 */
|
|
66
|
+
private isInContainerResizeAnimation;
|
|
67
|
+
/** 监听容器 resize 的计时器 id,用于判断 resize 过程是否结束 */
|
|
68
|
+
private containerResizeTimeoutID;
|
|
64
69
|
constructor(plugin: Controller, data: PluginType.ServerAreaMakerItem);
|
|
65
70
|
/** 挂载标注 */
|
|
66
71
|
mount(): void;
|
|
@@ -94,6 +99,8 @@ export declare class AreaMakerItem {
|
|
|
94
99
|
private doOpacityAnime;
|
|
95
100
|
/** 插件 Config 变化时更新自身 depthTest */
|
|
96
101
|
private onPluginConfigChange;
|
|
102
|
+
/** 插件整体可见性变化时,需要更新自身可见性 */
|
|
103
|
+
private onPluginStateChange;
|
|
97
104
|
/** 更新标注可见性 */
|
|
98
105
|
private updateVisible;
|
|
99
106
|
/** 检测标注是否可见 */
|
|
@@ -110,5 +117,7 @@ export declare class AreaMakerItem {
|
|
|
110
117
|
private checkTagVisible;
|
|
111
118
|
/** 相机位姿发生变化时,更新标签 */
|
|
112
119
|
private onFiveCameraUpdate;
|
|
120
|
+
/** tag container DOM 发生 resize */
|
|
121
|
+
private onContainerResize;
|
|
113
122
|
}
|
|
114
123
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var d = (
|
|
3
|
-
var i = (
|
|
4
|
-
import * as
|
|
2
|
+
var d = (a, t, e) => t in a ? f(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var i = (a, t, e) => (d(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import * as n from "three";
|
|
5
5
|
import "hammerjs";
|
|
6
6
|
import "@realsee/five";
|
|
7
7
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
@@ -10,9 +10,9 @@ import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
|
10
10
|
import { Object3D as b } from "../../shared-utils/three/core/Object3D.js";
|
|
11
11
|
import { LineSegments as k } from "../../shared-utils/three/objects/LineSegments.js";
|
|
12
12
|
import { BetterTween as y } from "../../shared-utils/animationFrame/BetterTween.js";
|
|
13
|
-
import { LabelItem as
|
|
14
|
-
import { getCenterPointOfPoints as
|
|
15
|
-
import { Subscribe as
|
|
13
|
+
import { LabelItem as T } from "../../components/AreaLabel/LabelItem.js";
|
|
14
|
+
import { getCenterPointOfPoints as C } from "../../shared-utils/math/planimetry.js";
|
|
15
|
+
import { Subscribe as O } from "../../shared-utils/Subscribe.js";
|
|
16
16
|
import "../../shared-utils/positionToVector3.js";
|
|
17
17
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
18
18
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -27,7 +27,7 @@ import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
|
27
27
|
import "../../shared-utils/animationFrame/index.js";
|
|
28
28
|
import "../../vendor/svelte/internal/index.js";
|
|
29
29
|
import "../../components/AreaLabel/Assets/roomLabelBg.js";
|
|
30
|
-
class
|
|
30
|
+
class v extends b {
|
|
31
31
|
constructor(e) {
|
|
32
32
|
super();
|
|
33
33
|
i(this, "areaMakerItem");
|
|
@@ -75,18 +75,23 @@ class q {
|
|
|
75
75
|
/** 标注标签是否可见 */
|
|
76
76
|
i(this, "tagVisible", !1);
|
|
77
77
|
/** 标注标签的世界坐标 */
|
|
78
|
-
i(this, "tagPosition", new
|
|
78
|
+
i(this, "tagPosition", new n.Vector3());
|
|
79
79
|
/** 标注标签的 NDC 坐标 */
|
|
80
|
-
i(this, "tagNDCPosition", new
|
|
80
|
+
i(this, "tagNDCPosition", new n.Vector3());
|
|
81
81
|
/** 标注标签的 transform */
|
|
82
82
|
i(this, "tagTransform", { left: 0, top: 0 });
|
|
83
83
|
/** 标注标签的显示层级 */
|
|
84
84
|
i(this, "tagZIndex", 0);
|
|
85
|
-
|
|
85
|
+
/** 标注实例的事件处理器 */
|
|
86
|
+
i(this, "hooks", new O());
|
|
86
87
|
/** Plugin 实例 */
|
|
87
88
|
i(this, "plugin");
|
|
88
89
|
/** 标注透明度动画 */
|
|
89
90
|
i(this, "opacityAnime");
|
|
91
|
+
/** 是否在容器 resize 动画中 */
|
|
92
|
+
i(this, "isInContainerResizeAnimation", !1);
|
|
93
|
+
/** 监听容器 resize 的计时器 id,用于判断 resize 过程是否结束 */
|
|
94
|
+
i(this, "containerResizeTimeoutID", null);
|
|
90
95
|
/** 显示标注 */
|
|
91
96
|
// public show() {
|
|
92
97
|
// return this.doOpacityAnime({
|
|
@@ -129,6 +134,10 @@ class q {
|
|
|
129
134
|
i(this, "onPluginConfigChange", (t) => {
|
|
130
135
|
this.makerObject.material.depthTest = t.config.modelDepthTest, this.outline.material.depthTest = t.config.modelDepthTest, this.plugin.five.needsRender = !0;
|
|
131
136
|
});
|
|
137
|
+
/** 插件整体可见性变化时,需要更新自身可见性 */
|
|
138
|
+
i(this, "onPluginStateChange", () => {
|
|
139
|
+
this.updateVisible(), this.updateTagVisible();
|
|
140
|
+
});
|
|
132
141
|
/** 更新标注可见性 */
|
|
133
142
|
i(this, "updateVisible", () => {
|
|
134
143
|
const { result: t, msg: e } = this.checkVisible();
|
|
@@ -166,7 +175,9 @@ class q {
|
|
|
166
175
|
i(this, "checkTagVisible", () => {
|
|
167
176
|
if (!this.visible)
|
|
168
177
|
return { result: !1, msg: "标注整体不可见" };
|
|
169
|
-
|
|
178
|
+
if (this.isInContainerResizeAnimation)
|
|
179
|
+
return { result: !1, msg: "处于容器 resize 动画中" };
|
|
180
|
+
const e = this.plugin.five, s = new n.Raycaster(), o = e.camera.position.clone();
|
|
170
181
|
s.set(o.clone(), this.tagPosition.clone().sub(o).normalize());
|
|
171
182
|
const [r] = e.model.intersectRaycaster(s), l = this.tagPosition.distanceTo(e.camera.position);
|
|
172
183
|
if (r && r.distance + 0.1 < l)
|
|
@@ -178,12 +189,20 @@ class q {
|
|
|
178
189
|
i(this, "onFiveCameraUpdate", () => {
|
|
179
190
|
this.tagApp && this.visible && (this.updateTagNDCPosition(), this.updateTagDomTransform(), this.updateTagVisible());
|
|
180
191
|
});
|
|
192
|
+
/** tag container DOM 发生 resize */
|
|
193
|
+
i(this, "onContainerResize", () => {
|
|
194
|
+
this.isInContainerResizeAnimation === !1 && (this.isInContainerResizeAnimation = !0, this.updateTag());
|
|
195
|
+
const e = () => {
|
|
196
|
+
this.isInContainerResizeAnimation = !1, this.containerResizeTimeoutID = null, this.updateTag();
|
|
197
|
+
};
|
|
198
|
+
this.containerResizeTimeoutID && clearTimeout(this.containerResizeTimeoutID), this.containerResizeTimeoutID = setTimeout(e, 100);
|
|
199
|
+
});
|
|
181
200
|
var p, c, m;
|
|
182
|
-
const s = e.object_data, o = s.bottom_y, r = s.height, l = new
|
|
183
|
-
this.id = e.id, this.name = (m = e.name) != null ? m : "", this.plugin = t, this.height = r, this.bottomY = o, this.opacity = h, this.shape = new
|
|
184
|
-
new
|
|
185
|
-
new
|
|
186
|
-
),
|
|
201
|
+
const s = e.object_data, o = s.bottom_y, r = s.height, l = new n.Color((p = s.color) != null ? p : "#FFFFFF"), h = (c = s.opacity) != null ? c : 0.4;
|
|
202
|
+
this.id = e.id, this.name = (m = e.name) != null ? m : "", this.plugin = t, this.height = r, this.bottomY = o, this.opacity = h, this.shape = new n.Shape().fromJSON(s.shape), this.floorIndex = e.floor_index, this.makerObject = new n.Mesh(g(this.shape, r), M(l, h)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new k(
|
|
203
|
+
new n.EdgesGeometry(this.makerObject.geometry),
|
|
204
|
+
new n.LineBasicMaterial({ color: l, transparent: !0 })
|
|
205
|
+
), u(this.outline, o), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(r), this.modelGroup = new v(this);
|
|
187
206
|
}
|
|
188
207
|
/** 挂载标注 */
|
|
189
208
|
mount() {
|
|
@@ -194,14 +213,14 @@ class q {
|
|
|
194
213
|
transform: `translate(${this.tagTransform.left}px, ${this.tagTransform.top}px)`,
|
|
195
214
|
onClick: (o) => this.hooks.emit("tagClick", { target: this, nativeEvent: o })
|
|
196
215
|
};
|
|
197
|
-
this.tagApp = new
|
|
216
|
+
this.tagApp = new T({ target: e, props: s }), this.updateTag();
|
|
198
217
|
}
|
|
199
|
-
this.plugin.five.needsRender = !0, this.plugin.hooks.on("
|
|
218
|
+
this.plugin.five.needsRender = !0, this.plugin.hooks.on("stateChange", this.onPluginStateChange), this.plugin.hooks.on("configChange", this.onPluginConfigChange), this.plugin.five.on("modeChange", this.updateVisible), this.plugin.five.on("modelShownFloorChange", this.updateVisible), this.plugin.five.on("cameraUpdate", this.onFiveCameraUpdate), this.plugin.resizeIframe.contentWindow.addEventListener("resize", this.onContainerResize);
|
|
200
219
|
}
|
|
201
220
|
/** 卸载标注 */
|
|
202
221
|
unmount() {
|
|
203
222
|
var t;
|
|
204
|
-
this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (t = this.tagApp) == null || t.$destroy(), this.tagApp = null, this.plugin.hooks.off("
|
|
223
|
+
this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (t = this.tagApp) == null || t.$destroy(), this.tagApp = null, this.plugin.hooks.off("stateChange", this.onPluginStateChange), this.plugin.hooks.off("configChange", this.onPluginConfigChange), this.plugin.five.off("modeChange", this.updateVisible), this.plugin.five.off("modelShownFloorChange", this.updateVisible), this.plugin.five.off("cameraUpdate", this.onFiveCameraUpdate), this.plugin.resizeIframe.contentWindow.removeEventListener("resize", this.onContainerResize);
|
|
205
224
|
}
|
|
206
225
|
/** 更改标注透明度
|
|
207
226
|
* @param opacity 标注透明度,范围:0-1
|
|
@@ -215,7 +234,7 @@ class q {
|
|
|
215
234
|
* @example setColor('#FF0000')
|
|
216
235
|
*/
|
|
217
236
|
setColor(t) {
|
|
218
|
-
const e = new
|
|
237
|
+
const e = new n.Color(t);
|
|
219
238
|
this.makerObject.material.color = e, this.outline.material.color = e, this.plugin.five.needsRender = !0;
|
|
220
239
|
}
|
|
221
240
|
/** 更改标注高度
|
|
@@ -224,9 +243,9 @@ class q {
|
|
|
224
243
|
setHeight(t) {
|
|
225
244
|
if (t <= 0)
|
|
226
245
|
throw new Error("高度必须大于 0");
|
|
227
|
-
this.height = t, this.makerObject.geometry =
|
|
228
|
-
const e = this.shape.extractPoints(10).shape.slice(0, -1), s =
|
|
229
|
-
|
|
246
|
+
this.height = t, this.makerObject.geometry = g(this.shape, t), this.outline.geometry = new n.EdgesGeometry(this.makerObject.geometry);
|
|
247
|
+
const e = this.shape.extractPoints(10).shape.slice(0, -1), s = C(e), o = new n.Vector3(s.x, s.y, t);
|
|
248
|
+
u(o, this.bottomY), this.tagPosition.copy(o), this.updateTag(), this.plugin.five.needsRender = !0;
|
|
230
249
|
}
|
|
231
250
|
/** 更改标注标签的显示层级
|
|
232
251
|
* @description 为什么需要这个方法
|
|
@@ -241,22 +260,22 @@ class q {
|
|
|
241
260
|
this.tagZIndex !== t && ((e = this.tagApp) == null || e.$set({ zIndex: t }));
|
|
242
261
|
}
|
|
243
262
|
}
|
|
244
|
-
function
|
|
245
|
-
return new
|
|
263
|
+
function g(a, t) {
|
|
264
|
+
return new n.ExtrudeBufferGeometry(a, {
|
|
246
265
|
depth: t,
|
|
247
266
|
bevelEnabled: !1
|
|
248
267
|
});
|
|
249
268
|
}
|
|
250
|
-
function
|
|
251
|
-
return new
|
|
252
|
-
color:
|
|
269
|
+
function M(a, t) {
|
|
270
|
+
return new n.MeshBasicMaterial({
|
|
271
|
+
color: a,
|
|
253
272
|
opacity: t,
|
|
254
273
|
transparent: !0
|
|
255
274
|
});
|
|
256
275
|
}
|
|
257
|
-
function
|
|
258
|
-
const e = new
|
|
259
|
-
e.multiply(s), e.multiply(o), e.multiply(r),
|
|
276
|
+
function u(a, t) {
|
|
277
|
+
const e = new n.Matrix4(), s = new n.Matrix4().makeRotationX(Math.PI / 2), o = new n.Matrix4().makeTranslation(0, 0, -t), r = new n.Matrix4().makeScale(1, 1, -1);
|
|
278
|
+
e.multiply(s), e.multiply(o), e.multiply(r), a.applyMatrix4(e);
|
|
260
279
|
}
|
|
261
280
|
export {
|
|
262
281
|
q as AreaMakerItem
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv2.28.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv2.28.3",
|
|
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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
8
8
|
"description": "如视 VR 看房插件合集",
|
|
9
9
|
"private": false,
|
|
10
|
-
"version": "2.28.
|
|
10
|
+
"version": "2.28.3",
|
|
11
11
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",
|