@realsee/dnalogel 3.47.13 → 3.47.15
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 +8 -0
- package/dist/PanoTagPlugin/utils/requestIdleCallback.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +1 -0
- package/dist/Sculpt/Meshes/Polygon.d.ts +2 -1
- package/dist/index.cjs.js +53 -53
- package/dist/index.js +18650 -18640
- package/dist/index.umd.js +47 -47
- package/libs/AreaMakerPlugin/Controller.js +78 -150
- package/libs/AreaMakerPlugin/index.js +3 -75
- package/libs/AreaMakerPlugin/utils/Item.js +111 -185
- package/libs/CSS3DRenderPlugin/Controller.js +29 -86
- package/libs/CSS3DRenderPlugin/index.js +12 -69
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +58 -127
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +113 -174
- package/libs/CruisePlugin/BaseController.js +50 -122
- package/libs/CruisePlugin/Move.js +21 -74
- package/libs/CruisePlugin/Work.js +46 -99
- package/libs/CruisePlugin/index.js +26 -79
- package/libs/CurrentPanoImagePlugin/Controller.js +104 -176
- package/libs/CurrentPanoImagePlugin/index.js +4 -76
- package/libs/GuideLinePlugin/Controller.js +26 -79
- package/libs/GuideLinePlugin/GuideLineItem.js +24 -77
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +2 -3
- package/libs/GuideLinePlugin/GuideLineModeItem.js +22 -75
- package/libs/GuideLinePlugin/index.js +26 -79
- package/libs/ModelMakerPlugin/Controller.js +83 -139
- package/libs/ModelMakerPlugin/index.js +16 -72
- package/libs/ModelTVVideoPlugin/Plugin.js +48 -105
- package/libs/ModelTVVideoPlugin/index.js +7 -64
- package/libs/Object3DHelperPlugin/Controller.js +32 -56
- package/libs/Object3DHelperPlugin/index.js +12 -35
- package/libs/PanoCompassPlugin/Controller.js +37 -93
- package/libs/PanoCompassPlugin/index.js +11 -67
- package/libs/PanoDoorLabelPlugin/BaseController.js +25 -97
- package/libs/PanoDoorLabelPlugin/Controller.js +115 -187
- package/libs/PanoDoorLabelPlugin/index.js +4 -76
- package/libs/PanoMeasurePlugin/Components/Controller0.js +83 -128
- package/libs/PanoMeasurePlugin/Components/Controller1.js +96 -141
- package/libs/PanoMeasurePlugin/Controller/EditController.js +66 -111
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +51 -121
- package/libs/PanoMeasurePlugin/Controller/index.js +59 -101
- package/libs/PanoMeasurePlugin/Model/area.js +21 -91
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +0 -73
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +27 -72
- package/libs/PanoMeasurePlugin/index.js +25 -67
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +17 -89
- package/libs/PanoSpatialTagPlugin/Plugin.js +106 -163
- package/libs/PanoSpatialTagPlugin/index.js +5 -62
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +67 -141
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +208 -281
- package/libs/PanoTagPlugin/Components/Tag/index.js +180 -251
- package/libs/PanoTagPlugin/Components/TagContainer.js +80 -151
- package/libs/PanoTagPlugin/Components/TagItem.js +67 -138
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +61 -132
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +28 -99
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +30 -101
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +36 -107
- package/libs/PanoTagPlugin/controller/TagRender.js +68 -121
- package/libs/PanoTagPlugin/controller/TagUtil.js +79 -132
- package/libs/PanoTagPlugin/controller/index.js +55 -108
- package/libs/PanoTagPlugin/index.js +31 -84
- package/libs/PanoTagPlugin/utils/requestIdleCallback.d.ts +1 -1
- package/libs/PanoTagPlugin/utils/requestIdleCallback.js +5 -13
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +30 -104
- package/libs/PanoVideoPlugin/Controller.js +64 -136
- package/libs/PanoVideoPlugin/VideoMeshController.js +74 -148
- package/libs/PanoVideoPlugin/index.js +8 -80
- package/libs/PipelinePlugin/Controller.js +128 -199
- package/libs/PipelinePlugin/index.js +5 -76
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +17 -91
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +14 -88
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +56 -130
- package/libs/Sculpt/Meshes/Box.js +5 -6
- package/libs/Sculpt/Meshes/Cylinder.js +2 -3
- package/libs/Sculpt/Meshes/Line.d.ts +1 -0
- package/libs/Sculpt/Meshes/Line.js +50 -41
- package/libs/Sculpt/Meshes/Point.js +9 -10
- package/libs/Sculpt/Meshes/Polygon.d.ts +2 -1
- package/libs/Sculpt/Meshes/Polygon.js +47 -37
- package/libs/Sculpt/Meshes/Polyline.js +18 -16
- package/libs/Sculpt/Meshes/Rectangle.js +3 -4
- package/libs/Sculpt/Objects/Line/Editor.js +2 -3
- package/libs/Sculpt/Objects/Rectangle/index.js +1 -1
- package/libs/Sculpt/utils/removeAllTag.js +4 -4
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -4
- package/libs/base/BasePlugin.js +3 -4
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +59 -128
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +6 -75
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +59 -129
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -75
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +62 -134
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -76
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +81 -151
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -75
- package/libs/floorplan/index.js +0 -1
- package/libs/index.js +62 -62
- package/libs/shared-utils/five/index.js +2 -3
- package/libs/shared-utils/five/lookObject.js +17 -18
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/index.js +0 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var p = Object.getOwnPropertySymbols;
|
|
3
3
|
var v = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
v.call(
|
|
7
|
-
if (
|
|
8
|
-
for (var
|
|
9
|
-
b.call(
|
|
10
|
-
return
|
|
4
|
+
var g = (r, o, e) => o in r ? m(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, a = (r, o) => {
|
|
5
|
+
for (var e in o || (o = {}))
|
|
6
|
+
v.call(o, e) && g(r, e, o[e]);
|
|
7
|
+
if (p)
|
|
8
|
+
for (var e of p(o))
|
|
9
|
+
b.call(o, e) && g(r, e, o[e]);
|
|
10
|
+
return r;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var s = (
|
|
12
|
+
var n = (r, o, e) => (g(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
13
|
+
var u = (r, o, e) => new Promise((i, t) => {
|
|
14
|
+
var s = (d) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
t(
|
|
16
|
+
f(e.next(d));
|
|
17
|
+
} catch (c) {
|
|
18
|
+
t(c);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, l = (d) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
t(
|
|
22
|
+
f(e.throw(d));
|
|
23
|
+
} catch (c) {
|
|
24
|
+
t(c);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, f = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, l);
|
|
27
|
+
f((e = e.apply(r, o)).next());
|
|
28
28
|
});
|
|
29
29
|
import * as h from "three";
|
|
30
30
|
import { Controller as M } from "../base/BasePlugin.js";
|
|
@@ -33,7 +33,6 @@ import "hammerjs";
|
|
|
33
33
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
34
34
|
import "@realsee/five/line";
|
|
35
35
|
import "../shared-utils/tag.js";
|
|
36
|
-
import "../Sculpt/utils/Modules/Global.js";
|
|
37
36
|
import "../shared-utils/three/THREESphere.js";
|
|
38
37
|
import "animejs";
|
|
39
38
|
import { equal as P } from "../shared-utils/equal.js";
|
|
@@ -50,86 +49,15 @@ import "../shared-utils/animationFrame/index.js";
|
|
|
50
49
|
import "../shared-utils/positionToVector3.js";
|
|
51
50
|
import "../shared-utils/five/vector3ToScreen.js";
|
|
52
51
|
import "../shared-utils/three/temp.js";
|
|
53
|
-
import "../Sculpt/utils/Modules/Cursor.js";
|
|
54
|
-
import "../Object3DHelperPlugin/Controller.js";
|
|
55
|
-
import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
56
|
-
import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
57
|
-
import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
58
|
-
import "../shared-utils/three/IObject3D.js";
|
|
59
|
-
import "../shared-utils/three/boundingBox.js";
|
|
60
|
-
import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
61
|
-
import "../shared-utils/Object3DHelper/utils/direction.js";
|
|
62
|
-
import "../shared-utils/Object3DHelper/Constants/color.js";
|
|
63
|
-
import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
64
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
65
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
66
|
-
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
67
|
-
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
68
|
-
import "../CSS3DRenderPlugin/utils/even.js";
|
|
69
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
70
|
-
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
71
|
-
import "../shared-utils/three/centerPoint.js";
|
|
72
|
-
import "../shared-utils/three/getObjectVisible.js";
|
|
73
|
-
import "../shared-utils/isNil.js";
|
|
74
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
75
|
-
import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
76
|
-
import "../shared-utils/util.js";
|
|
77
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
78
|
-
import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
79
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
80
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
81
|
-
import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
82
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
83
|
-
import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
84
|
-
import "../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
85
|
-
import "../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
86
|
-
import "../shared-utils/threex/domevents/index.js";
|
|
87
|
-
import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
88
|
-
import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
89
|
-
import "../Sculpt/utils/three/rayOnLine.js";
|
|
90
|
-
import "../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
91
|
-
import "../shared-utils/Object3DHelper/index.js";
|
|
92
|
-
import "../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
93
|
-
import "../shared-utils/math/rad2Deg.js";
|
|
94
|
-
import "../shared-utils/math/deg2Rad.js";
|
|
95
|
-
import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
96
|
-
import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
97
|
-
import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
98
|
-
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
99
|
-
import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
100
|
-
import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
101
|
-
import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
102
|
-
import "../shared-utils/five/fiveModelLoad.js";
|
|
103
|
-
import "../shared-utils/five/FiveDomEvents.js";
|
|
104
|
-
import "../shared-utils/five/calculateThreeMouse.js";
|
|
105
|
-
import "../shared-utils/three/THREERaycaster.js";
|
|
106
|
-
import "../shared-utils/three/PointSelector/index.js";
|
|
107
|
-
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
108
|
-
import "../shared-utils/three/Magnifier.js";
|
|
109
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
110
|
-
import "../shared-utils/three/Assets/index.js";
|
|
111
|
-
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
112
|
-
import "../shared-utils/five/initialCSS3DRender.js";
|
|
113
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
114
|
-
import "../Sculpt/Meshes/Line.js";
|
|
115
|
-
import "../Sculpt/typings/style.js";
|
|
116
|
-
import "../shared-utils/five/FiveLine.js";
|
|
117
|
-
import "../Sculpt/utils/removeAllTag.js";
|
|
118
|
-
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
119
|
-
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
120
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
121
|
-
import "../shared-utils/isTouchDevice.js";
|
|
122
|
-
import "../shared-utils/five/getPosition.js";
|
|
123
|
-
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
124
52
|
import "../shared-utils/isTruelyObject.js";
|
|
125
|
-
class
|
|
126
|
-
constructor(
|
|
127
|
-
super(
|
|
53
|
+
class $ extends M {
|
|
54
|
+
constructor(e, i) {
|
|
55
|
+
super(e);
|
|
128
56
|
// ==================== public properties ====================
|
|
129
57
|
/** 插件当前状态 */
|
|
130
|
-
|
|
58
|
+
n(this, "state");
|
|
131
59
|
/** 查询问题使用的调试对象 */
|
|
132
|
-
|
|
60
|
+
n(this, "checkMsg", {
|
|
133
61
|
/** mesh 隐藏的原因 */
|
|
134
62
|
meshHidden: "",
|
|
135
63
|
/** 插件 enabled 校验信息 */
|
|
@@ -138,47 +66,47 @@ class le extends M {
|
|
|
138
66
|
pluginHidden: ""
|
|
139
67
|
});
|
|
140
68
|
// ==================== private properties ====================
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
69
|
+
n(this, "group", new h.Group());
|
|
70
|
+
n(this, "mesh");
|
|
71
|
+
n(this, "textureLoadingPromise");
|
|
72
|
+
n(this, "opacityAnimeTween");
|
|
145
73
|
/** 是否正在走点动画中 */
|
|
146
|
-
|
|
74
|
+
n(this, "isInPanoMoveAnime", !1);
|
|
147
75
|
/** 上一次走点的全景图索引 */
|
|
148
|
-
|
|
76
|
+
n(this, "lastArrivedPanoIndex", -1);
|
|
149
77
|
/** config 的原始值 */
|
|
150
|
-
|
|
78
|
+
n(this, "_config");
|
|
151
79
|
/** disposed 的原始值 */
|
|
152
|
-
|
|
80
|
+
n(this, "_disposed", !1);
|
|
153
81
|
/**
|
|
154
82
|
* 销毁插件
|
|
155
83
|
* @todo 销毁贴图时,最好还是直接销毁贴图吧,this.mesh?.material.map 这种都是很深层的引用了。THREE 的建议我看也是自己去管理和销毁公共贴图。
|
|
156
84
|
*/
|
|
157
|
-
|
|
85
|
+
n(this, "dispose", () => {
|
|
158
86
|
this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.five.off("dispose", this.dispose), this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("panoWillArrive", this.onFivePanoWillArrive);
|
|
159
87
|
});
|
|
160
|
-
|
|
88
|
+
n(this, "checkMeshVisible", () => this.state.visible ? this.config.imageURL === "" ? { result: !1, msg: "图片不存在" } : this.mesh.material.map ? this.five.work ? this.five.getCurrentState().mode !== "Panorama" ? { result: !1, msg: "非全景模式" } : this.isInPanoMoveAnime ? { result: !1, msg: "处于走点动画中" } : { result: !0, msg: "" } : { result: !1, msg: "Five 数据未加载" } : { result: !1, msg: "指南针贴图未加载" } : { result: !1, msg: "插件隐藏" });
|
|
161
89
|
/** 贴图加载完成的回调 */
|
|
162
|
-
|
|
163
|
-
this.mesh.material.map =
|
|
90
|
+
n(this, "onTextureLoaded", (e) => {
|
|
91
|
+
this.mesh.material.map = e, this.mesh.material.needsUpdate = !0, this.updateMeshVisible();
|
|
164
92
|
});
|
|
165
93
|
/** Five load Work 后 */
|
|
166
|
-
|
|
94
|
+
n(this, "onFiveWillLoad", () => {
|
|
167
95
|
this.lastArrivedPanoIndex = -1, this.updateMeshVisible();
|
|
168
96
|
});
|
|
169
97
|
/** 走点前 */
|
|
170
|
-
|
|
171
|
-
var
|
|
172
|
-
|
|
98
|
+
n(this, "onFivePanoWillArrive", (e) => {
|
|
99
|
+
var i;
|
|
100
|
+
e !== this.five.getCurrentState().panoIndex && (this.isInPanoMoveAnime = !0, (i = this.opacityAnimeTween) == null || i.dispose(), this.updateMeshVisible());
|
|
173
101
|
});
|
|
174
102
|
/** 走点后 */
|
|
175
103
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
176
|
-
|
|
177
|
-
|
|
104
|
+
n(this, "onFivePanoArrived", (e) => {
|
|
105
|
+
e !== this.lastArrivedPanoIndex && (this.lastArrivedPanoIndex = e, this.isInPanoMoveAnime = !1, this.updateMeshPosition(e), this.updateMeshVisible(), this.five.needsRender = !0);
|
|
178
106
|
});
|
|
179
|
-
|
|
180
|
-
var
|
|
181
|
-
if ((
|
|
107
|
+
n(this, "onMeshVisibleChange", (e) => {
|
|
108
|
+
var i;
|
|
109
|
+
if ((i = this.opacityAnimeTween) == null || i.dispose(), !e) {
|
|
182
110
|
this.mesh.visible = !1;
|
|
183
111
|
return;
|
|
184
112
|
}
|
|
@@ -187,21 +115,21 @@ class le extends M {
|
|
|
187
115
|
(s = this.mesh) == null || s.material.setValues({ opacity: t }), this.five.needsRender = !0;
|
|
188
116
|
}).play();
|
|
189
117
|
});
|
|
190
|
-
|
|
118
|
+
n(this, "onFiveModeChange", () => {
|
|
191
119
|
this.updateMeshVisible();
|
|
192
120
|
});
|
|
193
|
-
this.five =
|
|
121
|
+
this.five = e;
|
|
194
122
|
const t = {
|
|
195
123
|
enabled: !0,
|
|
196
124
|
visible: !0
|
|
197
125
|
};
|
|
198
|
-
this.state = Object.assign(t,
|
|
126
|
+
this.state = Object.assign(t, i == null ? void 0 : i.initialState);
|
|
199
127
|
const s = a({
|
|
200
128
|
width: 1.4,
|
|
201
129
|
yOffset: 0.01,
|
|
202
130
|
yRotate: 0,
|
|
203
131
|
imageURL: this.absoluteUrl("/release/web/logo.7febb17f.png")
|
|
204
|
-
},
|
|
132
|
+
}, i == null ? void 0 : i.config);
|
|
205
133
|
this._config = s, this.group.name = "current-pano-image-plugin-group", this.mesh = new h.Mesh(
|
|
206
134
|
new h.PlaneBufferGeometry(this.config.width, this.config.width),
|
|
207
135
|
new h.MeshBasicMaterial({ transparent: !0, opacity: 0, depthTest: !1 })
|
|
@@ -219,48 +147,48 @@ class le extends M {
|
|
|
219
147
|
* 启用插件,响应用户操作并展示UI
|
|
220
148
|
* @param options
|
|
221
149
|
*/
|
|
222
|
-
enable(
|
|
150
|
+
enable(e = {}) {
|
|
223
151
|
var t;
|
|
224
152
|
if (this.state.enabled)
|
|
225
153
|
return;
|
|
226
|
-
const
|
|
227
|
-
this.updateState({ enabled: !0 },
|
|
154
|
+
const i = (t = e.userAction) != null ? t : !0;
|
|
155
|
+
this.updateState({ enabled: !0 }, i), this.checkMsg.pluginDisabled = "", this._enable({ userAction: i });
|
|
228
156
|
}
|
|
229
157
|
/** 禁用插件
|
|
230
158
|
* @param `options` `<Option> | <undefined>`
|
|
231
159
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
232
160
|
*/
|
|
233
|
-
disable(
|
|
161
|
+
disable(e = {}) {
|
|
234
162
|
var t;
|
|
235
163
|
if (this.state.enabled === !1)
|
|
236
164
|
return;
|
|
237
|
-
const
|
|
238
|
-
this.updateState({ enabled: !1 },
|
|
165
|
+
const i = (t = e.userAction) != null ? t : !0;
|
|
166
|
+
this.updateState({ enabled: !1 }, i), this.checkMsg.pluginDisabled = "调用 disable 禁用", this._disable({ userAction: i });
|
|
239
167
|
}
|
|
240
168
|
/** 插件内容整体展示
|
|
241
169
|
* @param `options` `<Partial<BaseOptions>> | <undefined>`
|
|
242
170
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
243
171
|
*/
|
|
244
|
-
show(
|
|
245
|
-
return
|
|
172
|
+
show(e) {
|
|
173
|
+
return u(this, null, function* () {
|
|
246
174
|
if (this.state.visible)
|
|
247
175
|
return Promise.resolve();
|
|
248
176
|
if (this.disposed)
|
|
249
177
|
return Promise.reject(new Error("不能在已销毁的插件上调用 show"));
|
|
250
|
-
const
|
|
251
|
-
this.updateState({ visible: !0 },
|
|
178
|
+
const i = a({ userAction: !0 }, e);
|
|
179
|
+
this.updateState({ visible: !0 }, i.userAction), this.checkMsg.pluginHidden = "", this._show(i);
|
|
252
180
|
});
|
|
253
181
|
}
|
|
254
182
|
/** 插件内容整体隐藏
|
|
255
183
|
* @param `options` `<Partial<BaseOptions>> | <undefined>`
|
|
256
184
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
257
185
|
*/
|
|
258
|
-
hide(
|
|
259
|
-
return
|
|
186
|
+
hide(e) {
|
|
187
|
+
return u(this, null, function* () {
|
|
260
188
|
if (this.state.visible === !1)
|
|
261
189
|
return;
|
|
262
|
-
const
|
|
263
|
-
this.updateState({ visible: !1 },
|
|
190
|
+
const i = a({ userAction: !0 }, e);
|
|
191
|
+
this.updateState({ visible: !1 }, i.userAction), this.checkMsg.pluginDisabled = "调用 hide 隐藏", this._hide(i);
|
|
264
192
|
});
|
|
265
193
|
}
|
|
266
194
|
/** 更改插件 State
|
|
@@ -268,24 +196,24 @@ class le extends M {
|
|
|
268
196
|
* @param `options` `<Option> | <undefined>`
|
|
269
197
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
270
198
|
*/
|
|
271
|
-
setState(
|
|
199
|
+
setState(e, i = {}) {
|
|
272
200
|
const t = this.state;
|
|
273
|
-
if (P(
|
|
201
|
+
if (P(e, t, { deep: !0 }))
|
|
274
202
|
return;
|
|
275
|
-
const s =
|
|
276
|
-
if (this.updateState(
|
|
277
|
-
const
|
|
278
|
-
|
|
203
|
+
const s = i.userAction !== void 0 ? i.userAction : !0;
|
|
204
|
+
if (this.updateState(e, s), e.enabled !== void 0 && t.enabled !== e.enabled && (e.enabled ? this.checkMsg.pluginDisabled = "" : this.checkMsg.pluginDisabled = "调用 setState 禁用", e.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), e.visible !== void 0 && t.visible !== e.visible) {
|
|
205
|
+
const l = { userAction: s, anime: { duration: 500 } };
|
|
206
|
+
e.visible ? this.checkMsg.pluginHidden = "" : this.checkMsg.pluginHidden = "调用 setState 隐藏", e.visible ? this._show(l) : this._hide(l);
|
|
279
207
|
}
|
|
280
208
|
}
|
|
281
209
|
/** 更改插件 Config
|
|
282
210
|
* @param `config` `<Partial<Plugin.Config>>` 插件属性 `config` 的子集。
|
|
283
211
|
* @param `options` `<Option> | <undefined>`
|
|
284
212
|
*/
|
|
285
|
-
updateConfig(
|
|
286
|
-
var
|
|
287
|
-
const t = this.config, s = a(a({}, t),
|
|
288
|
-
this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new h.PlaneBufferGeometry(s.width, s.width)), this.hooks.emit("configChange", { prevConfig: t, config: s, userAction: (
|
|
213
|
+
updateConfig(e, i = {}) {
|
|
214
|
+
var l;
|
|
215
|
+
const t = this.config, s = a(a({}, t), e);
|
|
216
|
+
this._config = s, t.imageURL !== s.imageURL && this.reloadTexture(s.imageURL), t.yOffset !== s.yOffset && this.updateMeshPosition(this.five.getCurrentState().panoIndex), t.yRotate !== s.yRotate && this.updateMeshQuaternion(s.yRotate), t.width !== s.width && (this.mesh.geometry = new h.PlaneBufferGeometry(s.width, s.width)), this.hooks.emit("configChange", { prevConfig: t, config: s, userAction: (l = i.userAction) != null ? l : !0 });
|
|
289
217
|
}
|
|
290
218
|
/** 问什么看不到模型 */
|
|
291
219
|
__whyCantSeeMesh() {
|
|
@@ -298,60 +226,60 @@ class le extends M {
|
|
|
298
226
|
if (this.checkMsg.meshHidden)
|
|
299
227
|
return this.checkMsg.meshHidden;
|
|
300
228
|
}
|
|
301
|
-
updateState(
|
|
229
|
+
updateState(e, i) {
|
|
302
230
|
const t = this.state;
|
|
303
|
-
this.state = a(a({}, this.state),
|
|
231
|
+
this.state = a(a({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
|
|
304
232
|
}
|
|
305
233
|
/** 根据各种条件更新 Mesh 的可见性 */
|
|
306
234
|
updateMeshVisible() {
|
|
307
|
-
const { result:
|
|
308
|
-
this.checkMsg.meshHidden =
|
|
235
|
+
const { result: e, msg: i } = this.checkMeshVisible();
|
|
236
|
+
this.checkMsg.meshHidden = i, e !== this.mesh.visible && this.onMeshVisibleChange(e);
|
|
309
237
|
}
|
|
310
238
|
/** 根据点位更新 Mesh 坐标 */
|
|
311
|
-
updateMeshPosition(
|
|
312
|
-
const
|
|
313
|
-
if (!
|
|
239
|
+
updateMeshPosition(e) {
|
|
240
|
+
const i = this.workUtil.getObserverStandingPosition(e);
|
|
241
|
+
if (!i) {
|
|
314
242
|
console.warn("CurrentPanoImagePlugin: 无法获取到当前点位的 standingPosition");
|
|
315
243
|
return;
|
|
316
244
|
}
|
|
317
|
-
const t =
|
|
245
|
+
const t = i.clone().setY(i.y + this.config.yOffset);
|
|
318
246
|
t && this.mesh.position.copy(t);
|
|
319
247
|
}
|
|
320
248
|
/** 重新加载贴图,调用时会先清除已有的贴图 */
|
|
321
|
-
reloadTexture(
|
|
322
|
-
return
|
|
323
|
-
if (this.mesh.material.map = null,
|
|
324
|
-
const
|
|
325
|
-
this.textureLoadingPromise =
|
|
326
|
-
const t = yield
|
|
327
|
-
t.minFilter = h.LinearFilter, this.textureLoadingPromise ===
|
|
249
|
+
reloadTexture(e) {
|
|
250
|
+
return u(this, null, function* () {
|
|
251
|
+
if (this.mesh.material.map = null, e !== "") {
|
|
252
|
+
const i = w(e);
|
|
253
|
+
this.textureLoadingPromise = i;
|
|
254
|
+
const t = yield i;
|
|
255
|
+
t.minFilter = h.LinearFilter, this.textureLoadingPromise === i && (this.onTextureLoaded(t), this.textureLoadingPromise = null);
|
|
328
256
|
}
|
|
329
257
|
this.updateMeshVisible();
|
|
330
258
|
});
|
|
331
259
|
}
|
|
332
260
|
/** north_rad 变化时,需要更新模型的旋转角度 */
|
|
333
|
-
updateMeshQuaternion(
|
|
334
|
-
const
|
|
335
|
-
|
|
261
|
+
updateMeshQuaternion(e) {
|
|
262
|
+
const i = new h.Quaternion();
|
|
263
|
+
i.multiplyQuaternions(
|
|
336
264
|
// 沿着自身 X 轴旋转 -90 度
|
|
337
265
|
new h.Quaternion().setFromAxisAngle(new h.Vector3(1, 0, 0), -Math.PI / 2),
|
|
338
266
|
// 沿着自身 Z 轴旋转 rad 弧度
|
|
339
|
-
new h.Quaternion().setFromAxisAngle(new h.Vector3(0, 0, 1),
|
|
340
|
-
), this.mesh.quaternion.copy(
|
|
267
|
+
new h.Quaternion().setFromAxisAngle(new h.Vector3(0, 0, 1), e)
|
|
268
|
+
), this.mesh.quaternion.copy(i);
|
|
341
269
|
}
|
|
342
|
-
_enable(
|
|
343
|
-
this.hooks.emit("enable", { userAction:
|
|
270
|
+
_enable(e) {
|
|
271
|
+
this.hooks.emit("enable", { userAction: e.userAction }), this.config.imageURL && !this.mesh.material.map && !this.textureLoadingPromise && this.reloadTexture(this.config.imageURL), this.five.scene.add(this.group), this.five.needsRender = !0, this.five.work && this.onFiveWillLoad(), this.five.getCurrentState().mode === "Panorama" && (this.onFiveModeChange(), this.onFivePanoArrived(this.five.getCurrentState().panoIndex)), this.five.on("willLoad", this.onFiveWillLoad), this.five.on("panoArrived", this.onFivePanoArrived), this.five.on("panoWillArrive", this.onFivePanoWillArrive), this.five.on("modeChange", this.onFiveModeChange);
|
|
344
272
|
}
|
|
345
|
-
_disable(
|
|
346
|
-
this.hooks.emit("disable", { userAction:
|
|
273
|
+
_disable(e) {
|
|
274
|
+
this.hooks.emit("disable", { userAction: e.userAction }), this.five.scene.remove(this.group), this.five.needsRender = !0, this.five.off("willLoad", this.onFiveWillLoad), this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("panoWillArrive", this.onFivePanoWillArrive), this.five.off("modeChange", this.onFiveModeChange);
|
|
347
275
|
}
|
|
348
|
-
_show(
|
|
349
|
-
this.hooks.emit("show",
|
|
276
|
+
_show(e) {
|
|
277
|
+
this.hooks.emit("show", e), this.updateMeshVisible(), this.five.needsRender = !0;
|
|
350
278
|
}
|
|
351
|
-
_hide(
|
|
352
|
-
this.hooks.emit("hide",
|
|
279
|
+
_hide(e) {
|
|
280
|
+
this.hooks.emit("hide", e), this.updateMeshVisible(), this.five.needsRender = !0;
|
|
353
281
|
}
|
|
354
282
|
}
|
|
355
283
|
export {
|
|
356
|
-
|
|
284
|
+
$ as CurrentPanoImagePluginController
|
|
357
285
|
};
|
|
@@ -14,89 +14,17 @@ import "../shared-utils/Utils/BaseUtil.js";
|
|
|
14
14
|
import "../shared-utils/Utils/WorkUtil.js";
|
|
15
15
|
import "../shared-utils/five/transformPosition.js";
|
|
16
16
|
import "../shared-utils/three/temp.js";
|
|
17
|
-
import "../Sculpt/utils/Modules/Global.js";
|
|
18
|
-
import "../Sculpt/utils/Modules/Cursor.js";
|
|
19
|
-
import "../Object3DHelperPlugin/Controller.js";
|
|
20
17
|
import "../shared-utils/three/THREESphere.js";
|
|
21
|
-
import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
22
|
-
import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
23
|
-
import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
24
|
-
import "../shared-utils/three/IObject3D.js";
|
|
25
|
-
import "../shared-utils/three/boundingBox.js";
|
|
26
|
-
import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
27
|
-
import "../shared-utils/Object3DHelper/utils/direction.js";
|
|
28
|
-
import "../shared-utils/Object3DHelper/Constants/color.js";
|
|
29
|
-
import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
30
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
31
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
32
|
-
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
33
|
-
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
34
|
-
import "../CSS3DRenderPlugin/utils/even.js";
|
|
35
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
36
|
-
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
37
|
-
import "../shared-utils/three/centerPoint.js";
|
|
38
|
-
import "../shared-utils/three/getObjectVisible.js";
|
|
39
18
|
import "animejs";
|
|
40
|
-
import "../shared-utils/isNil.js";
|
|
41
|
-
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
42
19
|
import "../shared-utils/url/absoluteUrl.js";
|
|
43
|
-
import "../
|
|
44
|
-
import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
45
|
-
import "../shared-utils/util.js";
|
|
46
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
47
|
-
import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
48
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
49
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
50
|
-
import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
51
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
52
|
-
import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
53
|
-
import "../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
54
|
-
import "../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
55
|
-
import "../shared-utils/threex/domevents/index.js";
|
|
56
|
-
import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
57
|
-
import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
58
|
-
import "../Sculpt/utils/three/rayOnLine.js";
|
|
59
|
-
import "../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
60
|
-
import "../shared-utils/Object3DHelper/index.js";
|
|
61
|
-
import "../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
62
|
-
import "../shared-utils/math/rad2Deg.js";
|
|
63
|
-
import "../shared-utils/math/deg2Rad.js";
|
|
64
|
-
import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
65
|
-
import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
66
|
-
import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
67
|
-
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
68
|
-
import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
69
|
-
import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
70
|
-
import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
71
|
-
import "../shared-utils/five/fiveModelLoad.js";
|
|
72
|
-
import "../shared-utils/five/FiveDomEvents.js";
|
|
73
|
-
import "../shared-utils/five/calculateThreeMouse.js";
|
|
74
|
-
import "../shared-utils/three/THREERaycaster.js";
|
|
75
|
-
import "../shared-utils/three/PointSelector/index.js";
|
|
76
|
-
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
77
|
-
import "../shared-utils/three/Magnifier.js";
|
|
78
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
79
|
-
import "../shared-utils/three/Assets/index.js";
|
|
80
|
-
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
81
|
-
import "../shared-utils/five/initialCSS3DRender.js";
|
|
82
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
83
|
-
import "../Sculpt/Meshes/Line.js";
|
|
84
|
-
import "../Sculpt/typings/style.js";
|
|
85
|
-
import "../shared-utils/five/FiveLine.js";
|
|
86
|
-
import "../Sculpt/utils/removeAllTag.js";
|
|
87
|
-
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
88
|
-
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
89
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
90
|
-
import "../shared-utils/isTouchDevice.js";
|
|
91
|
-
import "../shared-utils/five/getPosition.js";
|
|
92
|
-
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
20
|
+
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
93
21
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
94
22
|
import "../shared-utils/animationFrame/index.js";
|
|
95
23
|
import "../shared-utils/equal.js";
|
|
96
24
|
import "../shared-utils/isTruelyObject.js";
|
|
97
25
|
import "../shared-utils/three/loadTexture.js";
|
|
98
|
-
const
|
|
26
|
+
const z = (r, o) => new t(r, o);
|
|
99
27
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
28
|
+
z as CurrentPanoImagePlugin,
|
|
29
|
+
z as default
|
|
102
30
|
};
|