@realsee/dnalogel 3.10.3 → 3.11.0
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/typing.d.ts +8 -0
- package/dist/AreaMakerPlugin/utils/Item.d.ts +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +7 -5
- package/dist/index.umd.js +3 -3
- package/libs/AreaMakerPlugin/typing.d.ts +8 -0
- package/libs/AreaMakerPlugin/utils/Item.d.ts +1 -1
- package/libs/AreaMakerPlugin/utils/Item.js +12 -10
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -80,6 +80,14 @@ export type AreaMakerItemEventMap = {
|
|
|
80
80
|
target: AreaMakerItem;
|
|
81
81
|
nativeEvent: MouseEvent;
|
|
82
82
|
}) => void;
|
|
83
|
+
/**
|
|
84
|
+
* @description: 标注标签没有被遮挡,自动展示
|
|
85
|
+
*/
|
|
86
|
+
tagShow: () => void;
|
|
87
|
+
/**
|
|
88
|
+
* @description: 标注标签被模型遮挡,自动隐藏
|
|
89
|
+
*/
|
|
90
|
+
tagHide: () => void;
|
|
83
91
|
};
|
|
84
92
|
/** 动画相关的配置 */
|
|
85
93
|
export interface AnimeOptions {
|
|
@@ -76,7 +76,7 @@ class it {
|
|
|
76
76
|
/** 标注标签实例 */
|
|
77
77
|
i(this, "tagApp");
|
|
78
78
|
/** 标注标签是否可见 */
|
|
79
|
-
i(this, "tagVisible",
|
|
79
|
+
i(this, "tagVisible", null);
|
|
80
80
|
/** 标注标签的世界坐标 */
|
|
81
81
|
i(this, "tagPosition", new a.Vector3());
|
|
82
82
|
/** 标注标签的 NDC 坐标 */
|
|
@@ -127,14 +127,14 @@ class it {
|
|
|
127
127
|
this.makerObject.material.opacity = o, this.outline.material.opacity = l;
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
return new Promise((
|
|
130
|
+
return new Promise((m) => {
|
|
131
131
|
this.opacityAnime = new T({ makerObjectOpacity: s, outlineOpacity: r }).to({
|
|
132
132
|
makerObjectOpacity: o,
|
|
133
133
|
outlineOpacity: l
|
|
134
|
-
}).onUpdate(({ makerObjectOpacity:
|
|
135
|
-
this.makerObject.material.opacity =
|
|
136
|
-
}).onComplete(() =>
|
|
137
|
-
this.makerObject.material.opacity = o, this.outline.material.opacity = l, this.plugin.five.needsRender = !0,
|
|
134
|
+
}).onUpdate(({ makerObjectOpacity: p, outlineOpacity: c }) => {
|
|
135
|
+
this.makerObject.material.opacity = p, this.outline.material.opacity = c, this.plugin.five.needsRender = !0;
|
|
136
|
+
}).onComplete(() => m(!0)).onDispose(() => {
|
|
137
|
+
this.makerObject.material.opacity = o, this.outline.material.opacity = l, this.plugin.five.needsRender = !0, m(!1);
|
|
138
138
|
}).play();
|
|
139
139
|
});
|
|
140
140
|
});
|
|
@@ -182,7 +182,7 @@ class it {
|
|
|
182
182
|
i(this, "updateTagVisible", () => {
|
|
183
183
|
var s;
|
|
184
184
|
const { result: e, msg: t } = this.checkTagVisible();
|
|
185
|
-
this.checkMsg.checkTagVisibleMsg = t, this.tagVisible !== e && (this.tagVisible = e, (s = this.tagApp) == null || s.$set({ visible: e }));
|
|
185
|
+
this.checkMsg.checkTagVisibleMsg = t, this.tagVisible !== e && (this.tagVisible = e, this.tagVisible ? this.hooks.emit("tagShow") : this.hooks.emit("tagHide"), (s = this.tagApp) == null || s.$set({ visible: e }));
|
|
186
186
|
});
|
|
187
187
|
/** 检测标注标签是否可见 */
|
|
188
188
|
i(this, "checkTagVisible", () => {
|
|
@@ -210,8 +210,8 @@ class it {
|
|
|
210
210
|
};
|
|
211
211
|
this.containerResizeTimeoutID && clearTimeout(this.containerResizeTimeoutID), this.containerResizeTimeoutID = setTimeout(t, 100);
|
|
212
212
|
});
|
|
213
|
-
var
|
|
214
|
-
const s = t.object_data, o = s.bottom_y, r = s.height, l = new a.Color((
|
|
213
|
+
var m, p, c, g;
|
|
214
|
+
const s = t.object_data, o = s.bottom_y, r = s.height, l = new a.Color((m = s.color) != null ? m : "#FFFFFF"), h = (p = s.opacity) != null ? p : 0.4;
|
|
215
215
|
this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = r, this.bottomY = o, this.opacity = h, this.shape = new a.Shape().fromJSON(s.shape), this.floorIndex = t.floor_index, this.makerObject = new a.Mesh(d(this.shape, r), V(l, h)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new y(
|
|
216
216
|
new a.EdgesGeometry(this.makerObject.geometry),
|
|
217
217
|
new a.LineBasicMaterial({ color: l, transparent: !0 })
|
|
@@ -219,6 +219,8 @@ class it {
|
|
|
219
219
|
}
|
|
220
220
|
/** 挂载标注 */
|
|
221
221
|
mount() {
|
|
222
|
+
if (this.mounted)
|
|
223
|
+
return;
|
|
222
224
|
this.mounted = !0, this.updateVisible(), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.modelGroup.add(this.makerObject, this.outline);
|
|
223
225
|
const e = !!this.name, t = this.plugin.tagDomContainer;
|
|
224
226
|
if (e) {
|
|
@@ -237,7 +239,7 @@ class it {
|
|
|
237
239
|
/** 卸载标注 */
|
|
238
240
|
unmount() {
|
|
239
241
|
var e, t;
|
|
240
|
-
this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (e = this.tagApp) == null || e.$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), (t = this.resizeObserver) == null || t.unobserve();
|
|
242
|
+
this.mounted && (this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (e = this.tagApp) == null || e.$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), (t = this.resizeObserver) == null || t.unobserve());
|
|
241
243
|
}
|
|
242
244
|
/** 更改标注透明度
|
|
243
245
|
* @param opacity 标注透明度,范围:0-1
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.11.0",
|
|
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": "3.
|
|
10
|
+
"version": "3.11.0",
|
|
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*",
|