@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
1
|
var j = Object.defineProperty;
|
|
2
2
|
var v = Object.getOwnPropertySymbols;
|
|
3
3
|
var P = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var A = (
|
|
5
|
-
for (var
|
|
6
|
-
P.call(
|
|
4
|
+
var A = (p, n, e) => n in p ? j(p, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : p[n] = e, l = (p, n) => {
|
|
5
|
+
for (var e in n || (n = {}))
|
|
6
|
+
P.call(n, e) && A(p, e, n[e]);
|
|
7
7
|
if (v)
|
|
8
|
-
for (var
|
|
9
|
-
_.call(
|
|
10
|
-
return
|
|
8
|
+
for (var e of v(n))
|
|
9
|
+
_.call(n, e) && A(p, e, n[e]);
|
|
10
|
+
return p;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var s = (
|
|
12
|
+
var u = (p, n, e) => (A(p, typeof n != "symbol" ? n + "" : n, e), e);
|
|
13
|
+
var d = (p, n, e) => new Promise((t, i) => {
|
|
14
|
+
var s = (a) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
i(
|
|
16
|
+
h(e.next(a));
|
|
17
|
+
} catch (c) {
|
|
18
|
+
i(c);
|
|
19
19
|
}
|
|
20
|
-
}, r = (
|
|
20
|
+
}, r = (a) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
i(
|
|
22
|
+
h(e.throw(a));
|
|
23
|
+
} catch (c) {
|
|
24
|
+
i(c);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, h = (a) => a.done ? t(a.value) : Promise.resolve(a.value).then(s, r);
|
|
27
|
+
h((e = e.apply(p, n)).next());
|
|
28
28
|
});
|
|
29
29
|
import * as F from "three";
|
|
30
30
|
import { Controller as S } from "../base/BasePluginWithData.js";
|
|
@@ -47,81 +47,10 @@ import "../shared-utils/Utils/BaseUtil.js";
|
|
|
47
47
|
import "../shared-utils/Utils/WorkUtil.js";
|
|
48
48
|
import "../shared-utils/five/transformPosition.js";
|
|
49
49
|
import "../shared-utils/three/temp.js";
|
|
50
|
-
import "../Sculpt/utils/Modules/Global.js";
|
|
51
|
-
import "../Sculpt/utils/Modules/Cursor.js";
|
|
52
|
-
import "../Object3DHelperPlugin/Controller.js";
|
|
53
50
|
import "../shared-utils/three/THREESphere.js";
|
|
54
|
-
import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
55
|
-
import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
56
|
-
import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
57
|
-
import "../shared-utils/three/IObject3D.js";
|
|
58
|
-
import "../shared-utils/three/boundingBox.js";
|
|
59
|
-
import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
60
|
-
import "../shared-utils/Object3DHelper/utils/direction.js";
|
|
61
|
-
import "../shared-utils/Object3DHelper/Constants/color.js";
|
|
62
|
-
import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
63
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
64
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
65
|
-
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
66
|
-
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
67
|
-
import "../CSS3DRenderPlugin/utils/even.js";
|
|
68
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
69
|
-
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
70
|
-
import "../shared-utils/three/centerPoint.js";
|
|
71
|
-
import "../shared-utils/three/getObjectVisible.js";
|
|
72
51
|
import "animejs";
|
|
73
|
-
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
74
52
|
import "../shared-utils/url/absoluteUrl.js";
|
|
75
|
-
import "../
|
|
76
|
-
import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
77
|
-
import "../shared-utils/util.js";
|
|
78
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
79
|
-
import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
80
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
81
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
82
|
-
import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
83
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
84
|
-
import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
85
|
-
import "../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
86
|
-
import "../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
87
|
-
import "../shared-utils/threex/domevents/index.js";
|
|
88
|
-
import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
89
|
-
import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
90
|
-
import "../Sculpt/utils/three/rayOnLine.js";
|
|
91
|
-
import "../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
92
|
-
import "../shared-utils/Object3DHelper/index.js";
|
|
93
|
-
import "../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
94
|
-
import "../shared-utils/math/rad2Deg.js";
|
|
95
|
-
import "../shared-utils/math/deg2Rad.js";
|
|
96
|
-
import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
97
|
-
import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
98
|
-
import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
99
|
-
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
100
|
-
import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
101
|
-
import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
102
|
-
import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
103
|
-
import "../shared-utils/five/fiveModelLoad.js";
|
|
104
|
-
import "../shared-utils/five/FiveDomEvents.js";
|
|
105
|
-
import "../shared-utils/five/calculateThreeMouse.js";
|
|
106
|
-
import "../shared-utils/three/THREERaycaster.js";
|
|
107
|
-
import "../shared-utils/three/PointSelector/index.js";
|
|
108
|
-
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
109
|
-
import "../shared-utils/three/Magnifier.js";
|
|
110
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
111
|
-
import "../shared-utils/three/Assets/index.js";
|
|
112
|
-
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
113
|
-
import "../shared-utils/five/initialCSS3DRender.js";
|
|
114
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
115
|
-
import "../Sculpt/Meshes/Line.js";
|
|
116
|
-
import "../Sculpt/typings/style.js";
|
|
117
|
-
import "../shared-utils/five/FiveLine.js";
|
|
118
|
-
import "../Sculpt/utils/removeAllTag.js";
|
|
119
|
-
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
120
|
-
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
121
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
122
|
-
import "../shared-utils/isTouchDevice.js";
|
|
123
|
-
import "../shared-utils/five/getPosition.js";
|
|
124
|
-
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
53
|
+
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
125
54
|
import "../shared-utils/isTruelyObject.js";
|
|
126
55
|
import "../shared-utils/animationFrame/index.js";
|
|
127
56
|
import "./utils/Objects/Pipe.js";
|
|
@@ -130,11 +59,11 @@ import "../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
|
130
59
|
import "../shared-utils/three/Extras/Core/Interpolations.js";
|
|
131
60
|
import "../shared-utils/three/Extras/Core/Interpolations2.js";
|
|
132
61
|
const g = { flowSpeed: 0.6, rotateSpeed: 0 };
|
|
133
|
-
class
|
|
134
|
-
constructor(
|
|
135
|
-
super(
|
|
62
|
+
class pe extends S {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
super(e);
|
|
136
65
|
// ==================== public properties ====================
|
|
137
|
-
|
|
66
|
+
u(this, "data");
|
|
138
67
|
/** 插件状态
|
|
139
68
|
* @property `visible` `<boolean>` 是否可见
|
|
140
69
|
* @property `enabled` `<boolean>` 是否启用
|
|
@@ -143,29 +72,29 @@ class Te extends S {
|
|
|
143
72
|
* @property `speed.flowSpeed` `<number>` 横向流动速度,默认是 0.6 m/s
|
|
144
73
|
* @property `speed.rotateSpeed` `<number>` 纵向旋转速度:默认是 0 deg/s
|
|
145
74
|
*/
|
|
146
|
-
|
|
75
|
+
u(this, "state");
|
|
147
76
|
/** 当前插件所有新增 THREE 相关副作用都在 group 下 */
|
|
148
|
-
|
|
77
|
+
u(this, "group");
|
|
149
78
|
/** 用于展示水流的水管 */
|
|
150
|
-
|
|
79
|
+
u(this, "pipeObjects", []);
|
|
151
80
|
// ==================== private properties ====================
|
|
152
81
|
/** 水管贴图缓存 */
|
|
153
|
-
|
|
82
|
+
u(this, "texturePromiseCache", /* @__PURE__ */ new Map());
|
|
154
83
|
/** 销毁插件,移除所有副作用,销毁后将不响应任何 API */
|
|
155
|
-
|
|
156
|
-
this.disable(), this.five.scene.remove(this.group), this.texturePromiseCache.forEach((
|
|
84
|
+
u(this, "dispose", () => {
|
|
85
|
+
this.disable(), this.five.scene.remove(this.group), this.texturePromiseCache.forEach((e) => e.then((t) => t.dispose())), this.texturePromiseCache.clear();
|
|
157
86
|
});
|
|
158
|
-
|
|
159
|
-
const [
|
|
87
|
+
u(this, "onWantsFiveTapGesture", (...e) => {
|
|
88
|
+
const [t] = e, i = t.intersectObjects(this.pipeObjects, !1);
|
|
160
89
|
if (i.length === 0 || !this.data)
|
|
161
90
|
return;
|
|
162
|
-
const
|
|
163
|
-
if (!(!
|
|
91
|
+
const h = i[0].object.customID, a = this.data.pipes.find(({ id: o }) => o === h), c = this.data.pipelines.find((o) => a && o.pipes.includes(a));
|
|
92
|
+
if (!(!a || !c))
|
|
164
93
|
return this.hooks.emit("tap", {
|
|
165
94
|
intersectObjects: i,
|
|
166
|
-
pipe:
|
|
167
|
-
pipeline:
|
|
168
|
-
wantsFiveTapGestureParams:
|
|
95
|
+
pipe: a,
|
|
96
|
+
pipeline: c,
|
|
97
|
+
wantsFiveTapGestureParams: e
|
|
169
98
|
}), !1;
|
|
170
99
|
});
|
|
171
100
|
this.state = {
|
|
@@ -174,7 +103,7 @@ class Te extends S {
|
|
|
174
103
|
enabled: !0,
|
|
175
104
|
isFlowing: !1,
|
|
176
105
|
speed: g
|
|
177
|
-
}, this.five =
|
|
106
|
+
}, this.five = e, this.group = new F.Group(), this.group.name = "water-pipe-group", this.five.scene.add(this.group), this.five.once("dispose", this.dispose), this.five.on("wantsTapGesture", this.onWantsFiveTapGesture);
|
|
178
107
|
}
|
|
179
108
|
/** 加载管道数据,重复调用会使用新数据覆盖旧数据
|
|
180
109
|
* @param `data` `<Plugin.ServerData>` Open API 接口返回的数据。
|
|
@@ -186,20 +115,20 @@ class Te extends S {
|
|
|
186
115
|
* 函数返回的 string 就是当前 water 对应的贴图地址。
|
|
187
116
|
*/
|
|
188
117
|
// eslint-disable-next-line max-params
|
|
189
|
-
load(
|
|
190
|
-
return
|
|
118
|
+
load(e, t, i, s) {
|
|
119
|
+
return d(this, null, function* () {
|
|
191
120
|
const r = this.data;
|
|
192
|
-
this.data = yield this.formatData(
|
|
193
|
-
this.data.pipes.filter((
|
|
194
|
-
const
|
|
121
|
+
this.data = yield this.formatData(e, s), this.removeAllPipes(), this.hooks.emit("dataChange", this.data, r), this.pipeObjects = yield Promise.all(
|
|
122
|
+
this.data.pipes.filter((h) => !!(h != null && h.texture)).map((b) => d(this, [b], function* ({ id: h, texture: a, path: c, radius: o }) {
|
|
123
|
+
const m = yield this.loadPipeTexture(a), f = { id: h, path: c, textureURL: a, texture: m, geometryConfig: { radius: o } };
|
|
195
124
|
return new D(f);
|
|
196
125
|
}))
|
|
197
|
-
), this.data.pipelines.forEach((
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
return
|
|
126
|
+
), this.data.pipelines.forEach((h) => {
|
|
127
|
+
h.pipes.reduce((a, c) => {
|
|
128
|
+
const o = this.findPipeObjectWithID(c.id);
|
|
129
|
+
return o == null || o.setInitialDisplacement(a), a + ((o == null ? void 0 : o.pathLength) || 0);
|
|
201
130
|
}, 0);
|
|
202
|
-
}), this.hooks.emit("dataLoaded", this.data), this.state.visible === !1 && this.pipeObjects.forEach((
|
|
131
|
+
}), this.hooks.emit("dataLoaded", this.data), this.state.visible === !1 && this.pipeObjects.forEach((h) => h.setOpacity(0)), this.state.enabled && (this.group.add(...this.pipeObjects), this.five.needsRender = !0), t && this.setState(t, { userAction: i });
|
|
203
132
|
});
|
|
204
133
|
}
|
|
205
134
|
/** 更改插件 State
|
|
@@ -207,18 +136,18 @@ class Te extends S {
|
|
|
207
136
|
* @param `options` `<Option> | <undefined>`
|
|
208
137
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
209
138
|
*/
|
|
210
|
-
setState(
|
|
139
|
+
setState(e, t = {}) {
|
|
211
140
|
const i = this.state;
|
|
212
|
-
if (O(
|
|
141
|
+
if (O(e, i, { deep: !0 }))
|
|
213
142
|
return;
|
|
214
|
-
const s =
|
|
215
|
-
if (this.updateState(
|
|
143
|
+
const s = t.userAction !== void 0 ? t.userAction : !0;
|
|
144
|
+
if (this.updateState(e, s), e.enabled !== void 0 && i.enabled !== e.enabled && (e.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), e.visible !== void 0 && i.visible !== e.visible) {
|
|
216
145
|
const r = { userAction: s, anime: { duration: 500 } };
|
|
217
|
-
|
|
146
|
+
e.visible ? this._show(r) : this._hide(r);
|
|
218
147
|
}
|
|
219
|
-
if (
|
|
148
|
+
if (e.isFlowing !== void 0 && i.isFlowing !== e.isFlowing && (e.isFlowing ? this._flow() : this._stopFlow()), e.speed !== void 0 && !O(i.speed, this.state.speed, { deep: !0 }) && this._setSpeed(e.speed), e.target !== void 0 && !O(i.target, this.state.target, { deep: !0 })) {
|
|
220
149
|
const r = {
|
|
221
|
-
target:
|
|
150
|
+
target: e.target,
|
|
222
151
|
showAnime: { duration: 500 },
|
|
223
152
|
hideAnime: { duration: 500 }
|
|
224
153
|
};
|
|
@@ -229,23 +158,23 @@ class Te extends S {
|
|
|
229
158
|
* @param `options` `<Option> | <undefined>`
|
|
230
159
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
231
160
|
*/
|
|
232
|
-
enable(
|
|
161
|
+
enable(e = {}) {
|
|
233
162
|
var i;
|
|
234
163
|
if (this.state.enabled)
|
|
235
164
|
return;
|
|
236
|
-
const
|
|
237
|
-
this.updateState({ enabled: !0 },
|
|
165
|
+
const t = (i = e.userAction) != null ? i : !0;
|
|
166
|
+
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
|
|
238
167
|
}
|
|
239
168
|
/** 禁用插件
|
|
240
169
|
* @param `options` `<Option> | <undefined>`
|
|
241
170
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
242
171
|
*/
|
|
243
|
-
disable(
|
|
172
|
+
disable(e = {}) {
|
|
244
173
|
var i;
|
|
245
174
|
if (this.state.enabled === !1)
|
|
246
175
|
return;
|
|
247
|
-
const
|
|
248
|
-
this.updateState({ enabled: !1, isFlowing: !1 },
|
|
176
|
+
const t = (i = e.userAction) != null ? i : !0;
|
|
177
|
+
this.updateState({ enabled: !1, isFlowing: !1 }, t), this._disable({ userAction: t });
|
|
249
178
|
}
|
|
250
179
|
/** 展示管道模型,注意如果通过 `switchPipelines` 更改过 `visibleIDs`,则只会展示这一部分模型。
|
|
251
180
|
* @param `options` `<Partial<ShowHideOptions>> | <undefined>`
|
|
@@ -254,14 +183,14 @@ class Te extends S {
|
|
|
254
183
|
* @param `options.anime.duration` `<number> | <undefined>` 动画时间,默认是 500ms。
|
|
255
184
|
*/
|
|
256
185
|
show() {
|
|
257
|
-
return
|
|
186
|
+
return d(this, arguments, function* (e = {}) {
|
|
258
187
|
if (this.state.visible)
|
|
259
188
|
return;
|
|
260
|
-
const
|
|
189
|
+
const t = l({
|
|
261
190
|
userAction: !0,
|
|
262
191
|
anime: { duration: 500 }
|
|
263
|
-
},
|
|
264
|
-
this.updateState({ visible: !0 },
|
|
192
|
+
}, e);
|
|
193
|
+
this.updateState({ visible: !0 }, t.userAction), yield this._show(t);
|
|
265
194
|
});
|
|
266
195
|
}
|
|
267
196
|
/** 插件内容整体隐藏
|
|
@@ -271,14 +200,14 @@ class Te extends S {
|
|
|
271
200
|
* @param `options.anime.duration` `<number> | <undefined>` 动画时间,默认是 500ms。
|
|
272
201
|
*/
|
|
273
202
|
hide() {
|
|
274
|
-
return
|
|
203
|
+
return d(this, arguments, function* (e = {}) {
|
|
275
204
|
if (this.state.visible === !1)
|
|
276
205
|
return;
|
|
277
|
-
const
|
|
206
|
+
const t = l({
|
|
278
207
|
userAction: !0,
|
|
279
208
|
anime: { duration: 500 }
|
|
280
|
-
},
|
|
281
|
-
this.updateState({ visible: !1 },
|
|
209
|
+
}, e);
|
|
210
|
+
this.updateState({ visible: !1 }, t.userAction), yield this._hide(t);
|
|
282
211
|
});
|
|
283
212
|
}
|
|
284
213
|
/** 切换管路
|
|
@@ -291,124 +220,124 @@ class Te extends S {
|
|
|
291
220
|
* @param `options.anime` `<AnimeOptions> | <undefined>` 兜底的动画配置。
|
|
292
221
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是否是用户操作。
|
|
293
222
|
* */
|
|
294
|
-
switchPipelines(
|
|
295
|
-
return
|
|
296
|
-
var
|
|
223
|
+
switchPipelines(e) {
|
|
224
|
+
return d(this, null, function* () {
|
|
225
|
+
var c, o, b, m, f, w;
|
|
297
226
|
if (!this.data)
|
|
298
227
|
return;
|
|
299
|
-
const
|
|
300
|
-
this.updateState({ target:
|
|
301
|
-
const s = { duration: 500 }, r = (
|
|
302
|
-
target:
|
|
303
|
-
showAnime:
|
|
228
|
+
const t = (c = e == null ? void 0 : e.target) != null ? c : null, i = (o = e == null ? void 0 : e.userAction) != null ? o : !0;
|
|
229
|
+
this.updateState({ target: t }, i);
|
|
230
|
+
const s = { duration: 500 }, r = (m = (b = e == null ? void 0 : e.hideAnime) != null ? b : e == null ? void 0 : e.anime) != null ? m : s, h = (w = (f = e == null ? void 0 : e.showAnime) != null ? f : e == null ? void 0 : e.anime) != null ? w : s, a = {
|
|
231
|
+
target: t,
|
|
232
|
+
showAnime: h,
|
|
304
233
|
hideAnime: r
|
|
305
234
|
};
|
|
306
|
-
this._switchPipelines(
|
|
235
|
+
this._switchPipelines(a);
|
|
307
236
|
});
|
|
308
237
|
}
|
|
309
238
|
/** 开始流动 */
|
|
310
|
-
flow(
|
|
239
|
+
flow(e = {}) {
|
|
311
240
|
var i;
|
|
312
241
|
if (this.state.isFlowing)
|
|
313
242
|
return;
|
|
314
|
-
const
|
|
315
|
-
this.updateState({ isFlowing: !0 },
|
|
243
|
+
const t = (i = e.userAction) != null ? i : !0;
|
|
244
|
+
this.updateState({ isFlowing: !0 }, t), this._flow();
|
|
316
245
|
}
|
|
317
246
|
/** 停止流动 */
|
|
318
|
-
stopFlow(
|
|
247
|
+
stopFlow(e = {}) {
|
|
319
248
|
var i;
|
|
320
249
|
if (this.state.isFlowing === !1)
|
|
321
250
|
return;
|
|
322
|
-
const
|
|
323
|
-
this.updateState({ isFlowing: !1 },
|
|
251
|
+
const t = (i = e.userAction) != null ? i : !0;
|
|
252
|
+
this.updateState({ isFlowing: !1 }, t), this._stopFlow();
|
|
324
253
|
}
|
|
325
254
|
/** 更改水管流速
|
|
326
255
|
* @param `options` `<SetSpeedOptions> | <undefined>`
|
|
327
256
|
* @param `options.speed` `<Speed> | <undefined>` 参考 `state.speed` 的描述。
|
|
328
257
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是否是用户操作。
|
|
329
258
|
*/
|
|
330
|
-
setSpeed(
|
|
259
|
+
setSpeed(e) {
|
|
331
260
|
var s, r;
|
|
332
|
-
const
|
|
333
|
-
this.updateState({ speed:
|
|
261
|
+
const t = (s = e == null ? void 0 : e.speed) != null ? s : g, i = (r = e.userAction) != null ? r : !0;
|
|
262
|
+
this.updateState({ speed: t }, i), this._setSpeed(t);
|
|
334
263
|
}
|
|
335
|
-
formatData(
|
|
336
|
-
return
|
|
337
|
-
return y(
|
|
264
|
+
formatData(e, t) {
|
|
265
|
+
return d(this, null, function* () {
|
|
266
|
+
return y(e, t);
|
|
338
267
|
});
|
|
339
268
|
}
|
|
340
|
-
_enable(
|
|
341
|
-
this.hooks.emit("enable", { userAction:
|
|
269
|
+
_enable(e) {
|
|
270
|
+
this.hooks.emit("enable", { userAction: e.userAction }), this.five.scene.add(this.group), this.five.needsRender = !0, this.five.on("wantsTapGesture", this.onWantsFiveTapGesture);
|
|
342
271
|
}
|
|
343
|
-
_disable(
|
|
344
|
-
this.hooks.emit("disable", { userAction:
|
|
272
|
+
_disable(e) {
|
|
273
|
+
this.hooks.emit("disable", { userAction: e.userAction }), this.disposeAnime(), this.five.scene.remove(this.group), this.five.needsRender = !0, this.five.off("wantsTapGesture", this.onWantsFiveTapGesture);
|
|
345
274
|
}
|
|
346
|
-
_show(
|
|
347
|
-
return
|
|
275
|
+
_show(e) {
|
|
276
|
+
return d(this, null, function* () {
|
|
348
277
|
var s;
|
|
349
|
-
this.hooks.emit("show", { userAction:
|
|
350
|
-
const
|
|
351
|
-
yield Promise.all(i.map((r) => r == null ? void 0 : r.show(
|
|
278
|
+
this.hooks.emit("show", { userAction: e.userAction });
|
|
279
|
+
const t = (s = e == null ? void 0 : e.anime) != null ? s : { duration: 500 }, i = this.findPipeObjectWithTarget(this.state.target);
|
|
280
|
+
yield Promise.all(i.map((r) => r == null ? void 0 : r.show(t))), this.five.needsRender = !0;
|
|
352
281
|
});
|
|
353
282
|
}
|
|
354
|
-
_hide(
|
|
355
|
-
return
|
|
283
|
+
_hide(e) {
|
|
284
|
+
return d(this, null, function* () {
|
|
356
285
|
var i;
|
|
357
|
-
this.hooks.emit("hide", { userAction:
|
|
358
|
-
const
|
|
359
|
-
yield Promise.all(this.pipeObjects.map((s) => s.hide(
|
|
286
|
+
this.hooks.emit("hide", { userAction: e.userAction });
|
|
287
|
+
const t = (i = e == null ? void 0 : e.anime) != null ? i : { duration: 500 };
|
|
288
|
+
yield Promise.all(this.pipeObjects.map((s) => s.hide(t))), this.five.needsRender = !0;
|
|
360
289
|
});
|
|
361
290
|
}
|
|
362
|
-
_switchPipelines(
|
|
363
|
-
return
|
|
291
|
+
_switchPipelines(e) {
|
|
292
|
+
return d(this, null, function* () {
|
|
364
293
|
if (!this.data)
|
|
365
294
|
return;
|
|
366
|
-
const
|
|
295
|
+
const t = this.findPipeObjectWithTarget(e.target), i = e.hideAnime;
|
|
367
296
|
yield Promise.all(this.pipeObjects.map((r) => r.hide(i)));
|
|
368
|
-
const s =
|
|
369
|
-
yield Promise.all(
|
|
297
|
+
const s = e.showAnime;
|
|
298
|
+
yield Promise.all(t.map((r) => r.show(s)));
|
|
370
299
|
});
|
|
371
300
|
}
|
|
372
301
|
_flow() {
|
|
373
|
-
this.pipeObjects.forEach((
|
|
302
|
+
this.pipeObjects.forEach((e) => e.flow());
|
|
374
303
|
}
|
|
375
304
|
_stopFlow() {
|
|
376
|
-
this.pipeObjects.forEach((
|
|
305
|
+
this.pipeObjects.forEach((e) => e.stopFlow());
|
|
377
306
|
}
|
|
378
|
-
_setSpeed(
|
|
379
|
-
this.pipeObjects.forEach((
|
|
307
|
+
_setSpeed(e) {
|
|
308
|
+
this.pipeObjects.forEach((t) => t.setSpeed(e));
|
|
380
309
|
}
|
|
381
|
-
updateState(
|
|
310
|
+
updateState(e, t) {
|
|
382
311
|
const i = this.state;
|
|
383
|
-
this.state =
|
|
312
|
+
this.state = l(l({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: t });
|
|
384
313
|
}
|
|
385
314
|
/** 加载管道贴图,如果再加载中,复用之前的加载 Promise */
|
|
386
|
-
loadPipeTexture(
|
|
387
|
-
return
|
|
388
|
-
const
|
|
389
|
-
if (
|
|
390
|
-
return
|
|
391
|
-
const i = x(
|
|
392
|
-
return this.texturePromiseCache.set(
|
|
315
|
+
loadPipeTexture(e) {
|
|
316
|
+
return d(this, null, function* () {
|
|
317
|
+
const t = this.texturePromiseCache.get(e);
|
|
318
|
+
if (t)
|
|
319
|
+
return t;
|
|
320
|
+
const i = x(e);
|
|
321
|
+
return this.texturePromiseCache.set(e, i), i;
|
|
393
322
|
});
|
|
394
323
|
}
|
|
395
324
|
/** 销毁所有动画 */
|
|
396
325
|
disposeAnime() {
|
|
397
|
-
this.pipeObjects.forEach((
|
|
326
|
+
this.pipeObjects.forEach((e) => e.disposeAnime()), this.five.needsRender = !0;
|
|
398
327
|
}
|
|
399
328
|
/** 移除所有管道模型 */
|
|
400
329
|
removeAllPipes() {
|
|
401
|
-
this.disposeAnime(), this.group.remove(...this.pipeObjects), this.pipeObjects.forEach((
|
|
330
|
+
this.disposeAnime(), this.group.remove(...this.pipeObjects), this.pipeObjects.forEach((e) => e.dispose()), this.pipeObjects = [], this.five.needsRender = !0;
|
|
402
331
|
}
|
|
403
332
|
/** 根据 ID 查找管道模型 */
|
|
404
|
-
findPipeObjectWithID(
|
|
405
|
-
return this.pipeObjects.find(({ customID:
|
|
333
|
+
findPipeObjectWithID(e) {
|
|
334
|
+
return this.pipeObjects.find(({ customID: t }) => t === e);
|
|
406
335
|
}
|
|
407
336
|
/** 根据 target 查找管道模型 */
|
|
408
|
-
findPipeObjectWithTarget(
|
|
409
|
-
return
|
|
337
|
+
findPipeObjectWithTarget(e) {
|
|
338
|
+
return e ? C({ data: this.data, target: e }).map(({ id: i }) => this.findPipeObjectWithID(i)).filter(T) : this.pipeObjects;
|
|
410
339
|
}
|
|
411
340
|
}
|
|
412
341
|
export {
|
|
413
|
-
|
|
342
|
+
pe as Controller
|
|
414
343
|
};
|
|
@@ -15,84 +15,13 @@ import "../shared-utils/Utils/BaseUtil.js";
|
|
|
15
15
|
import "../shared-utils/Utils/WorkUtil.js";
|
|
16
16
|
import "../shared-utils/five/transformPosition.js";
|
|
17
17
|
import "../shared-utils/three/temp.js";
|
|
18
|
-
import "../Sculpt/utils/Modules/Global.js";
|
|
19
|
-
import "../Sculpt/utils/Modules/Cursor.js";
|
|
20
|
-
import "../Object3DHelperPlugin/Controller.js";
|
|
21
18
|
import "../shared-utils/three/THREESphere.js";
|
|
22
|
-
import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
23
|
-
import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
24
|
-
import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
25
|
-
import "../shared-utils/three/IObject3D.js";
|
|
26
|
-
import "../shared-utils/three/boundingBox.js";
|
|
27
|
-
import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
28
|
-
import "../shared-utils/Object3DHelper/utils/direction.js";
|
|
29
|
-
import "../shared-utils/Object3DHelper/Constants/color.js";
|
|
30
|
-
import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
31
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
32
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
33
|
-
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
34
|
-
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
35
|
-
import "../CSS3DRenderPlugin/utils/even.js";
|
|
36
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
37
|
-
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
38
|
-
import "../shared-utils/three/centerPoint.js";
|
|
39
|
-
import "../shared-utils/three/getObjectVisible.js";
|
|
40
19
|
import "animejs";
|
|
41
|
-
import "../shared-utils/isNil.js";
|
|
42
|
-
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
43
20
|
import "../shared-utils/url/absoluteUrl.js";
|
|
44
|
-
import "../
|
|
45
|
-
import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
46
|
-
import "../shared-utils/util.js";
|
|
47
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
48
|
-
import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
49
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
50
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
51
|
-
import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
52
|
-
import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
53
|
-
import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
54
|
-
import "../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
55
|
-
import "../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
56
|
-
import "../shared-utils/threex/domevents/index.js";
|
|
57
|
-
import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
58
|
-
import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
59
|
-
import "../Sculpt/utils/three/rayOnLine.js";
|
|
60
|
-
import "../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
61
|
-
import "../shared-utils/Object3DHelper/index.js";
|
|
62
|
-
import "../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
63
|
-
import "../shared-utils/math/rad2Deg.js";
|
|
64
|
-
import "../shared-utils/math/deg2Rad.js";
|
|
65
|
-
import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
66
|
-
import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
67
|
-
import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
68
|
-
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
69
|
-
import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
70
|
-
import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
71
|
-
import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
72
|
-
import "../shared-utils/five/fiveModelLoad.js";
|
|
73
|
-
import "../shared-utils/five/FiveDomEvents.js";
|
|
74
|
-
import "../shared-utils/five/calculateThreeMouse.js";
|
|
75
|
-
import "../shared-utils/three/THREERaycaster.js";
|
|
76
|
-
import "../shared-utils/three/PointSelector/index.js";
|
|
77
|
-
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
78
|
-
import "../shared-utils/three/Magnifier.js";
|
|
79
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
80
|
-
import "../shared-utils/three/Assets/index.js";
|
|
81
|
-
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
82
|
-
import "../shared-utils/five/initialCSS3DRender.js";
|
|
83
|
-
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
84
|
-
import "../Sculpt/Meshes/Line.js";
|
|
85
|
-
import "../Sculpt/typings/style.js";
|
|
86
|
-
import "../shared-utils/five/FiveLine.js";
|
|
87
|
-
import "../Sculpt/utils/removeAllTag.js";
|
|
88
|
-
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
89
|
-
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
90
|
-
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
91
|
-
import "../shared-utils/isTouchDevice.js";
|
|
92
|
-
import "../shared-utils/five/getPosition.js";
|
|
93
|
-
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
21
|
+
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
94
22
|
import "../shared-utils/equal.js";
|
|
95
23
|
import "../shared-utils/isTruelyObject.js";
|
|
24
|
+
import "../shared-utils/isNil.js";
|
|
96
25
|
import "../shared-utils/three/loadTexture.js";
|
|
97
26
|
import "./utils/formatData.js";
|
|
98
27
|
import "./utils/Objects/FlowPipe.js";
|
|
@@ -102,8 +31,8 @@ import "../shared-utils/animationFrame/BetterTween.js";
|
|
|
102
31
|
import "../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
103
32
|
import "../shared-utils/three/Extras/Core/Interpolations.js";
|
|
104
33
|
import "../shared-utils/three/Extras/Core/Interpolations2.js";
|
|
105
|
-
const
|
|
34
|
+
const I = (r) => new o(r);
|
|
106
35
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
36
|
+
I as PipelinePlugin,
|
|
37
|
+
I as default
|
|
109
38
|
};
|