@realsee/dnalogel 3.73.1 → 3.73.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/CHANGELOG.md +8 -0
- package/dist/MeasurePlugin/Controller.d.ts +3 -4
- package/dist/MeasurePlugin/index.d.ts +2 -1
- package/dist/Sculpt/utils/export.d.ts +1 -0
- package/dist/index.cjs.js +71 -71
- package/dist/index.js +4893 -4894
- package/dist/index.umd.js +76 -76
- package/dist/shared-utils/three/index.d.ts +2 -0
- package/libs/AreaMakerPlugin/Controller.js +3 -2
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.js +80 -79
- package/libs/CSS3DRenderPlugin/Controller.js +3 -2
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +1 -0
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/Work.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/CurrentPanoImagePlugin/Controller.js +3 -2
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +1 -1
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +1 -1
- package/libs/MeasurePlugin/Controller.d.ts +3 -4
- package/libs/MeasurePlugin/Controller.js +29 -29
- package/libs/MeasurePlugin/index.d.ts +2 -1
- package/libs/MeasurePlugin/index.js +6 -5
- package/libs/MeasurePlugin/utils/MeasureMesh.js +1 -1
- package/libs/ModelChassisCompassPlugin/Plugin.js +4 -3
- package/libs/ModelChassisCompassPlugin/index.js +1 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +6 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelMakerPlugin/Controller.js +1 -1
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/ModelMakerPlugin/item/baseItem.js +3 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
- package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
- package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -2
- package/libs/ModelViewPlugin/Plugin.js +4 -3
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +18 -17
- package/libs/Object3DHelperPlugin/index.js +6 -5
- package/libs/PanoCompassPlugin/Controller.js +3 -2
- package/libs/PanoCompassPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/Controller.js +3 -2
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoRulerProPlugin/Controller.js +3 -2
- package/libs/PanoRulerProPlugin/RulerItems.js +3 -2
- package/libs/PanoRulerProPlugin/index.js +4 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +4 -3
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/PopoverContent.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/TagPopoverToolBar.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/index.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +233 -232
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
- package/libs/PanoTagPlugin/Components/TagItem.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +22 -21
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +1 -1
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/PanoTagPlugin/index.js +1 -1
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
- package/libs/PanoVideoPlugin/Controller.js +3 -2
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +95 -94
- package/libs/PipelinePlugin/index.js +4 -3
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +22 -21
- package/libs/Sculpt/Meshes/Circle.js +3 -2
- package/libs/Sculpt/Meshes/Cylinder.js +3 -2
- package/libs/Sculpt/Meshes/Line.js +3 -2
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -4
- package/libs/Sculpt/Meshes/Point.js +3 -2
- package/libs/Sculpt/Meshes/Rectangle.js +4 -3
- package/libs/Sculpt/Objects/Base/index.js +1 -0
- package/libs/Sculpt/Objects/Line/Editor.js +7 -6
- package/libs/Sculpt/index.js +19 -18
- package/libs/Sculpt/utils/export.d.ts +1 -0
- package/libs/Sculpt/utils/export.js +23 -20
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -2
- package/libs/base/BasePlugin.js +8 -7
- package/libs/floorplan/FloorplanGuidePlugin/Controller.js +3 -2
- package/libs/floorplan/FloorplanGuidePlugin/index.js +4 -3
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +146 -145
- package/libs/shared-utils/CSS3DRender/CSS3DObject.js +3 -2
- package/libs/shared-utils/exports.js +62 -55
- package/libs/shared-utils/five/index.js +4 -3
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.js +3 -2
- package/libs/shared-utils/three/PointDomHelper.js +3 -2
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +3 -2
- package/libs/shared-utils/three/geometryUtil.js +12 -8
- package/libs/shared-utils/three/index.d.ts +2 -0
- package/libs/shared-utils/three/index.js +1 -0
- package/libs/vendor/hotkeys-js/dist/hotkeys.esm.js +139 -151
- 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 = (m, o,
|
|
5
|
-
for (var
|
|
6
|
-
P.call(o,
|
|
4
|
+
var A = (m, o, t) => o in m ? j(m, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[o] = t, u = (m, o) => {
|
|
5
|
+
for (var t in o || (o = {}))
|
|
6
|
+
P.call(o, t) && A(m, t, o[t]);
|
|
7
7
|
if (v)
|
|
8
|
-
for (var
|
|
9
|
-
_.call(o,
|
|
8
|
+
for (var t of v(o))
|
|
9
|
+
_.call(o, t) && A(m, t, o[t]);
|
|
10
10
|
return m;
|
|
11
11
|
};
|
|
12
|
-
var d = (m, o,
|
|
13
|
-
var c = (m, o,
|
|
12
|
+
var d = (m, o, t) => (A(m, typeof o != "symbol" ? o + "" : o, t), t);
|
|
13
|
+
var c = (m, o, t) => new Promise((e, i) => {
|
|
14
14
|
var s = (a) => {
|
|
15
15
|
try {
|
|
16
|
-
n(
|
|
16
|
+
n(t.next(a));
|
|
17
17
|
} catch (h) {
|
|
18
18
|
i(h);
|
|
19
19
|
}
|
|
20
20
|
}, r = (a) => {
|
|
21
21
|
try {
|
|
22
|
-
n(
|
|
22
|
+
n(t.throw(a));
|
|
23
23
|
} catch (h) {
|
|
24
24
|
i(h);
|
|
25
25
|
}
|
|
26
|
-
}, n = (a) => a.done ?
|
|
27
|
-
n((
|
|
26
|
+
}, n = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(s, r);
|
|
27
|
+
n((t = t.apply(m, o)).next());
|
|
28
28
|
});
|
|
29
29
|
import * as F from "three";
|
|
30
30
|
import { Controller as S } from "../base/BasePluginWithData.js";
|
|
@@ -40,6 +40,7 @@ import "../shared-utils/three/core/Sphere.js";
|
|
|
40
40
|
import "../shared-utils/three/blink.js";
|
|
41
41
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
42
42
|
import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
43
|
+
import "../vendor/earcut/src/earcut.js";
|
|
43
44
|
import { equal as O } from "../shared-utils/equal.js";
|
|
44
45
|
import "../shared-utils/five/FivePuppet.js";
|
|
45
46
|
import { loadTexture as x } from "../shared-utils/three/loadTexture.js";
|
|
@@ -106,9 +107,9 @@ import "../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
|
106
107
|
import "../shared-utils/three/Extras/Core/Interpolations.js";
|
|
107
108
|
import "../shared-utils/three/Extras/Core/Interpolations2.js";
|
|
108
109
|
const g = { flowSpeed: 0.6, rotateSpeed: 0 };
|
|
109
|
-
class
|
|
110
|
-
constructor(
|
|
111
|
-
super(
|
|
110
|
+
class re extends S {
|
|
111
|
+
constructor(t) {
|
|
112
|
+
super(t);
|
|
112
113
|
// ==================== public properties ====================
|
|
113
114
|
d(this, "data");
|
|
114
115
|
/** 插件状态
|
|
@@ -129,10 +130,10 @@ class st extends S {
|
|
|
129
130
|
d(this, "texturePromiseCache", /* @__PURE__ */ new Map());
|
|
130
131
|
/** 销毁插件,移除所有副作用,销毁后将不响应任何 API */
|
|
131
132
|
d(this, "dispose", () => {
|
|
132
|
-
this.disable(), this.five.scene.remove(this.group), this.texturePromiseCache.forEach((
|
|
133
|
+
this.disable(), this.five.scene.remove(this.group), this.texturePromiseCache.forEach((t) => t.then((e) => e.dispose())), this.texturePromiseCache.clear();
|
|
133
134
|
});
|
|
134
|
-
d(this, "onWantsFiveTapGesture", (...
|
|
135
|
-
const [
|
|
135
|
+
d(this, "onWantsFiveTapGesture", (...t) => {
|
|
136
|
+
const [e] = t, i = e.intersectObjects(this.pipeObjects, !1);
|
|
136
137
|
if (i.length === 0 || !this.data)
|
|
137
138
|
return;
|
|
138
139
|
const n = i[0].object.customID, a = this.data.pipes.find(({ id: p }) => p === n), h = this.data.pipelines.find((p) => a && p.pipes.includes(a));
|
|
@@ -141,7 +142,7 @@ class st extends S {
|
|
|
141
142
|
intersectObjects: i,
|
|
142
143
|
pipe: a,
|
|
143
144
|
pipeline: h,
|
|
144
|
-
wantsFiveTapGestureParams:
|
|
145
|
+
wantsFiveTapGestureParams: t
|
|
145
146
|
}), !1;
|
|
146
147
|
});
|
|
147
148
|
this.state = {
|
|
@@ -150,7 +151,7 @@ class st extends S {
|
|
|
150
151
|
enabled: !0,
|
|
151
152
|
isFlowing: !1,
|
|
152
153
|
speed: g
|
|
153
|
-
}, this.five =
|
|
154
|
+
}, this.five = t, 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);
|
|
154
155
|
}
|
|
155
156
|
/** 加载管道数据,重复调用会使用新数据覆盖旧数据
|
|
156
157
|
* @param `data` `<Plugin.ServerData>` Open API 接口返回的数据。
|
|
@@ -162,10 +163,10 @@ class st extends S {
|
|
|
162
163
|
* 函数返回的 string 就是当前 water 对应的贴图地址。
|
|
163
164
|
*/
|
|
164
165
|
// eslint-disable-next-line max-params
|
|
165
|
-
load(
|
|
166
|
+
load(t, e, i, s) {
|
|
166
167
|
return c(this, null, function* () {
|
|
167
168
|
const r = this.data;
|
|
168
|
-
this.data = yield this.formatData(
|
|
169
|
+
this.data = yield this.formatData(t, s), this.removeAllPipes(), this.hooks.emit("dataChange", this.data, r), this.pipeObjects = yield Promise.all(
|
|
169
170
|
this.data.pipes.filter((n) => !!(n != null && n.texture)).map((b) => c(this, [b], function* ({ id: n, texture: a, path: h, radius: p }) {
|
|
170
171
|
const l = yield this.loadPipeTexture(a), f = { id: n, path: h, textureURL: a, texture: l, geometryConfig: { radius: p } };
|
|
171
172
|
return new D(f);
|
|
@@ -175,7 +176,7 @@ class st extends S {
|
|
|
175
176
|
const p = this.findPipeObjectWithID(h.id);
|
|
176
177
|
return p == null || p.setInitialDisplacement(a), a + ((p == null ? void 0 : p.pathLength) || 0);
|
|
177
178
|
}, 0);
|
|
178
|
-
}), this.hooks.emit("dataLoaded", this.data), this.state.visible === !1 && this.pipeObjects.forEach((n) => n.setOpacity(0)), this.state.enabled && (this.group.add(...this.pipeObjects), this.five.needsRender = !0),
|
|
179
|
+
}), this.hooks.emit("dataLoaded", this.data), this.state.visible === !1 && this.pipeObjects.forEach((n) => n.setOpacity(0)), this.state.enabled && (this.group.add(...this.pipeObjects), this.five.needsRender = !0), e && this.setState(e, { userAction: i });
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
/** 更改插件 State
|
|
@@ -183,18 +184,18 @@ class st extends S {
|
|
|
183
184
|
* @param `options` `<Option> | <undefined>`
|
|
184
185
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
185
186
|
*/
|
|
186
|
-
setState(
|
|
187
|
+
setState(t, e = {}) {
|
|
187
188
|
const i = this.state;
|
|
188
|
-
if (O(
|
|
189
|
+
if (O(t, i, { deep: !0 }))
|
|
189
190
|
return;
|
|
190
|
-
const s =
|
|
191
|
-
if (this.updateState(
|
|
191
|
+
const s = e.userAction !== void 0 ? e.userAction : !0;
|
|
192
|
+
if (this.updateState(t, s), t.enabled !== void 0 && i.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: s }) : this._disable({ userAction: s })), t.visible !== void 0 && i.visible !== t.visible) {
|
|
192
193
|
const r = { userAction: s, anime: { duration: 500 } };
|
|
193
|
-
|
|
194
|
+
t.visible ? this._show(r) : this._hide(r);
|
|
194
195
|
}
|
|
195
|
-
if (
|
|
196
|
+
if (t.isFlowing !== void 0 && i.isFlowing !== t.isFlowing && (t.isFlowing ? this._flow() : this._stopFlow()), t.speed !== void 0 && !O(i.speed, this.state.speed, { deep: !0 }) && this._setSpeed(t.speed), t.target !== void 0 && !O(i.target, this.state.target, { deep: !0 })) {
|
|
196
197
|
const r = {
|
|
197
|
-
target:
|
|
198
|
+
target: t.target,
|
|
198
199
|
showAnime: { duration: 500 },
|
|
199
200
|
hideAnime: { duration: 500 }
|
|
200
201
|
};
|
|
@@ -205,23 +206,23 @@ class st extends S {
|
|
|
205
206
|
* @param `options` `<Option> | <undefined>`
|
|
206
207
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
207
208
|
*/
|
|
208
|
-
enable(
|
|
209
|
+
enable(t = {}) {
|
|
209
210
|
var i;
|
|
210
211
|
if (this.state.enabled)
|
|
211
212
|
return;
|
|
212
|
-
const
|
|
213
|
-
this.updateState({ enabled: !0 },
|
|
213
|
+
const e = (i = t.userAction) != null ? i : !0;
|
|
214
|
+
this.updateState({ enabled: !0 }, e), this._enable({ userAction: e });
|
|
214
215
|
}
|
|
215
216
|
/** 禁用插件
|
|
216
217
|
* @param `options` `<Option> | <undefined>`
|
|
217
218
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
218
219
|
*/
|
|
219
|
-
disable(
|
|
220
|
+
disable(t = {}) {
|
|
220
221
|
var i;
|
|
221
222
|
if (this.state.enabled === !1)
|
|
222
223
|
return;
|
|
223
|
-
const
|
|
224
|
-
this.updateState({ enabled: !1, isFlowing: !1 },
|
|
224
|
+
const e = (i = t.userAction) != null ? i : !0;
|
|
225
|
+
this.updateState({ enabled: !1, isFlowing: !1 }, e), this._disable({ userAction: e });
|
|
225
226
|
}
|
|
226
227
|
/** 展示管道模型,注意如果通过 `switchPipelines` 更改过 `visibleIDs`,则只会展示这一部分模型。
|
|
227
228
|
* @param `options` `<Partial<ShowHideOptions>> | <undefined>`
|
|
@@ -230,14 +231,14 @@ class st extends S {
|
|
|
230
231
|
* @param `options.anime.duration` `<number> | <undefined>` 动画时间,默认是 500ms。
|
|
231
232
|
*/
|
|
232
233
|
show() {
|
|
233
|
-
return c(this, arguments, function* (
|
|
234
|
+
return c(this, arguments, function* (t = {}) {
|
|
234
235
|
if (this.state.visible)
|
|
235
236
|
return;
|
|
236
|
-
const
|
|
237
|
+
const e = u({
|
|
237
238
|
userAction: !0,
|
|
238
239
|
anime: { duration: 500 }
|
|
239
|
-
},
|
|
240
|
-
this.updateState({ visible: !0 },
|
|
240
|
+
}, t);
|
|
241
|
+
this.updateState({ visible: !0 }, e.userAction), yield this._show(e);
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
/** 插件内容整体隐藏
|
|
@@ -247,14 +248,14 @@ class st extends S {
|
|
|
247
248
|
* @param `options.anime.duration` `<number> | <undefined>` 动画时间,默认是 500ms。
|
|
248
249
|
*/
|
|
249
250
|
hide() {
|
|
250
|
-
return c(this, arguments, function* (
|
|
251
|
+
return c(this, arguments, function* (t = {}) {
|
|
251
252
|
if (this.state.visible === !1)
|
|
252
253
|
return;
|
|
253
|
-
const
|
|
254
|
+
const e = u({
|
|
254
255
|
userAction: !0,
|
|
255
256
|
anime: { duration: 500 }
|
|
256
|
-
},
|
|
257
|
-
this.updateState({ visible: !1 },
|
|
257
|
+
}, t);
|
|
258
|
+
this.updateState({ visible: !1 }, e.userAction), yield this._hide(e);
|
|
258
259
|
});
|
|
259
260
|
}
|
|
260
261
|
/** 切换管路
|
|
@@ -267,15 +268,15 @@ class st extends S {
|
|
|
267
268
|
* @param `options.anime` `<AnimeOptions> | <undefined>` 兜底的动画配置。
|
|
268
269
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是否是用户操作。
|
|
269
270
|
* */
|
|
270
|
-
switchPipelines(
|
|
271
|
+
switchPipelines(t) {
|
|
271
272
|
return c(this, null, function* () {
|
|
272
273
|
var h, p, b, l, f, w;
|
|
273
274
|
if (!this.data)
|
|
274
275
|
return;
|
|
275
|
-
const
|
|
276
|
-
this.updateState({ target:
|
|
277
|
-
const s = { duration: 500 }, r = (l = (b =
|
|
278
|
-
target:
|
|
276
|
+
const e = (h = t == null ? void 0 : t.target) != null ? h : null, i = (p = t == null ? void 0 : t.userAction) != null ? p : !0;
|
|
277
|
+
this.updateState({ target: e }, i);
|
|
278
|
+
const s = { duration: 500 }, r = (l = (b = t == null ? void 0 : t.hideAnime) != null ? b : t == null ? void 0 : t.anime) != null ? l : s, n = (w = (f = t == null ? void 0 : t.showAnime) != null ? f : t == null ? void 0 : t.anime) != null ? w : s, a = {
|
|
279
|
+
target: e,
|
|
279
280
|
showAnime: n,
|
|
280
281
|
hideAnime: r
|
|
281
282
|
};
|
|
@@ -283,108 +284,108 @@ class st extends S {
|
|
|
283
284
|
});
|
|
284
285
|
}
|
|
285
286
|
/** 开始流动 */
|
|
286
|
-
flow(
|
|
287
|
+
flow(t = {}) {
|
|
287
288
|
var i;
|
|
288
289
|
if (this.state.isFlowing)
|
|
289
290
|
return;
|
|
290
|
-
const
|
|
291
|
-
this.updateState({ isFlowing: !0 },
|
|
291
|
+
const e = (i = t.userAction) != null ? i : !0;
|
|
292
|
+
this.updateState({ isFlowing: !0 }, e), this._flow();
|
|
292
293
|
}
|
|
293
294
|
/** 停止流动 */
|
|
294
|
-
stopFlow(
|
|
295
|
+
stopFlow(t = {}) {
|
|
295
296
|
var i;
|
|
296
297
|
if (this.state.isFlowing === !1)
|
|
297
298
|
return;
|
|
298
|
-
const
|
|
299
|
-
this.updateState({ isFlowing: !1 },
|
|
299
|
+
const e = (i = t.userAction) != null ? i : !0;
|
|
300
|
+
this.updateState({ isFlowing: !1 }, e), this._stopFlow();
|
|
300
301
|
}
|
|
301
302
|
/** 更改水管流速
|
|
302
303
|
* @param `options` `<SetSpeedOptions> | <undefined>`
|
|
303
304
|
* @param `options.speed` `<Speed> | <undefined>` 参考 `state.speed` 的描述。
|
|
304
305
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是否是用户操作。
|
|
305
306
|
*/
|
|
306
|
-
setSpeed(
|
|
307
|
+
setSpeed(t) {
|
|
307
308
|
var s, r;
|
|
308
|
-
const
|
|
309
|
-
this.updateState({ speed:
|
|
309
|
+
const e = (s = t == null ? void 0 : t.speed) != null ? s : g, i = (r = t.userAction) != null ? r : !0;
|
|
310
|
+
this.updateState({ speed: e }, i), this._setSpeed(e);
|
|
310
311
|
}
|
|
311
|
-
formatData(
|
|
312
|
+
formatData(t, e) {
|
|
312
313
|
return c(this, null, function* () {
|
|
313
|
-
return y(
|
|
314
|
+
return y(t, e);
|
|
314
315
|
});
|
|
315
316
|
}
|
|
316
|
-
_enable(
|
|
317
|
-
this.hooks.emit("enable", { userAction:
|
|
317
|
+
_enable(t) {
|
|
318
|
+
this.hooks.emit("enable", { userAction: t.userAction }), this.five.scene.add(this.group), this.five.needsRender = !0, this.five.on("wantsTapGesture", this.onWantsFiveTapGesture);
|
|
318
319
|
}
|
|
319
|
-
_disable(
|
|
320
|
-
this.hooks.emit("disable", { userAction:
|
|
320
|
+
_disable(t) {
|
|
321
|
+
this.hooks.emit("disable", { userAction: t.userAction }), this.disposeAnime(), this.five.scene.remove(this.group), this.five.needsRender = !0, this.five.off("wantsTapGesture", this.onWantsFiveTapGesture);
|
|
321
322
|
}
|
|
322
|
-
_show(
|
|
323
|
+
_show(t) {
|
|
323
324
|
return c(this, null, function* () {
|
|
324
325
|
var s;
|
|
325
|
-
this.hooks.emit("show", { userAction:
|
|
326
|
-
const
|
|
327
|
-
yield Promise.all(i.map((r) => r == null ? void 0 : r.show(
|
|
326
|
+
this.hooks.emit("show", { userAction: t.userAction });
|
|
327
|
+
const e = (s = t == null ? void 0 : t.anime) != null ? s : { duration: 500 }, i = this.findPipeObjectWithTarget(this.state.target);
|
|
328
|
+
yield Promise.all(i.map((r) => r == null ? void 0 : r.show(e))), this.five.needsRender = !0;
|
|
328
329
|
});
|
|
329
330
|
}
|
|
330
|
-
_hide(
|
|
331
|
+
_hide(t) {
|
|
331
332
|
return c(this, null, function* () {
|
|
332
333
|
var i;
|
|
333
|
-
this.hooks.emit("hide", { userAction:
|
|
334
|
-
const
|
|
335
|
-
yield Promise.all(this.pipeObjects.map((s) => s.hide(
|
|
334
|
+
this.hooks.emit("hide", { userAction: t.userAction });
|
|
335
|
+
const e = (i = t == null ? void 0 : t.anime) != null ? i : { duration: 500 };
|
|
336
|
+
yield Promise.all(this.pipeObjects.map((s) => s.hide(e))), this.five.needsRender = !0;
|
|
336
337
|
});
|
|
337
338
|
}
|
|
338
|
-
_switchPipelines(
|
|
339
|
+
_switchPipelines(t) {
|
|
339
340
|
return c(this, null, function* () {
|
|
340
341
|
if (!this.data)
|
|
341
342
|
return;
|
|
342
|
-
const
|
|
343
|
+
const e = this.findPipeObjectWithTarget(t.target), i = t.hideAnime;
|
|
343
344
|
yield Promise.all(this.pipeObjects.map((r) => r.hide(i)));
|
|
344
|
-
const s =
|
|
345
|
-
yield Promise.all(
|
|
345
|
+
const s = t.showAnime;
|
|
346
|
+
yield Promise.all(e.map((r) => r.show(s)));
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
349
|
_flow() {
|
|
349
|
-
this.pipeObjects.forEach((
|
|
350
|
+
this.pipeObjects.forEach((t) => t.flow());
|
|
350
351
|
}
|
|
351
352
|
_stopFlow() {
|
|
352
|
-
this.pipeObjects.forEach((
|
|
353
|
+
this.pipeObjects.forEach((t) => t.stopFlow());
|
|
353
354
|
}
|
|
354
|
-
_setSpeed(
|
|
355
|
-
this.pipeObjects.forEach((
|
|
355
|
+
_setSpeed(t) {
|
|
356
|
+
this.pipeObjects.forEach((e) => e.setSpeed(t));
|
|
356
357
|
}
|
|
357
|
-
updateState(
|
|
358
|
+
updateState(t, e) {
|
|
358
359
|
const i = this.state;
|
|
359
|
-
this.state = u(u({}, this.state),
|
|
360
|
+
this.state = u(u({}, this.state), t), this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
|
|
360
361
|
}
|
|
361
362
|
/** 加载管道贴图,如果再加载中,复用之前的加载 Promise */
|
|
362
|
-
loadPipeTexture(
|
|
363
|
+
loadPipeTexture(t) {
|
|
363
364
|
return c(this, null, function* () {
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
return
|
|
367
|
-
const i = x(
|
|
368
|
-
return this.texturePromiseCache.set(
|
|
365
|
+
const e = this.texturePromiseCache.get(t);
|
|
366
|
+
if (e)
|
|
367
|
+
return e;
|
|
368
|
+
const i = x(t);
|
|
369
|
+
return this.texturePromiseCache.set(t, i), i;
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
372
|
/** 销毁所有动画 */
|
|
372
373
|
disposeAnime() {
|
|
373
|
-
this.pipeObjects.forEach((
|
|
374
|
+
this.pipeObjects.forEach((t) => t.disposeAnime()), this.five.needsRender = !0;
|
|
374
375
|
}
|
|
375
376
|
/** 移除所有管道模型 */
|
|
376
377
|
removeAllPipes() {
|
|
377
|
-
this.disposeAnime(), this.group.remove(...this.pipeObjects), this.pipeObjects.forEach((
|
|
378
|
+
this.disposeAnime(), this.group.remove(...this.pipeObjects), this.pipeObjects.forEach((t) => t.dispose()), this.pipeObjects = [], this.five.needsRender = !0;
|
|
378
379
|
}
|
|
379
380
|
/** 根据 ID 查找管道模型 */
|
|
380
|
-
findPipeObjectWithID(
|
|
381
|
-
return this.pipeObjects.find(({ customID:
|
|
381
|
+
findPipeObjectWithID(t) {
|
|
382
|
+
return this.pipeObjects.find(({ customID: e }) => e === t);
|
|
382
383
|
}
|
|
383
384
|
/** 根据 target 查找管道模型 */
|
|
384
|
-
findPipeObjectWithTarget(
|
|
385
|
-
return
|
|
385
|
+
findPipeObjectWithTarget(t) {
|
|
386
|
+
return t ? C({ data: this.data, target: t }).map(({ id: i }) => this.findPipeObjectWithID(i)).filter(T) : this.pipeObjects;
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
389
|
export {
|
|
389
|
-
|
|
390
|
+
re as Controller
|
|
390
391
|
};
|
|
@@ -58,6 +58,7 @@ import "../shared-utils/three/core/Line2.js";
|
|
|
58
58
|
import "../shared-utils/three/core/LineMaterial2.js";
|
|
59
59
|
import "../Sculpt/utils/unit.js";
|
|
60
60
|
import "../Sculpt/utils/renderDom.js";
|
|
61
|
+
import "../vendor/earcut/src/earcut.js";
|
|
61
62
|
import "../shared-utils/five/FivePuppet.js";
|
|
62
63
|
import "@realsee/five";
|
|
63
64
|
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
@@ -78,8 +79,8 @@ import "../shared-utils/animationFrame/BetterTween.js";
|
|
|
78
79
|
import "../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
79
80
|
import "../shared-utils/three/Extras/Core/Interpolations.js";
|
|
80
81
|
import "../shared-utils/three/Extras/Core/Interpolations2.js";
|
|
81
|
-
const
|
|
82
|
+
const Br = (r) => new o(r);
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
Br as PipelinePlugin,
|
|
85
|
+
Br as default
|
|
85
86
|
};
|
|
@@ -13,6 +13,7 @@ import "../../../shared-utils/three/core/Sphere.js";
|
|
|
13
13
|
import "../../../shared-utils/three/blink.js";
|
|
14
14
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
15
15
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
16
|
+
import "../../../vendor/earcut/src/earcut.js";
|
|
16
17
|
import { requestAnimationFrameInterval as c } from "../../../shared-utils/animationFrame/index.js";
|
|
17
18
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
18
19
|
import { ObjectPipe as h } from "./Pipe.js";
|
|
@@ -91,7 +92,7 @@ const d = (
|
|
|
91
92
|
}
|
|
92
93
|
`
|
|
93
94
|
);
|
|
94
|
-
class
|
|
95
|
+
class jt extends h {
|
|
95
96
|
constructor(t) {
|
|
96
97
|
super(t, d);
|
|
97
98
|
/** 初始状态下,当前水管内的水流在整体管道上的位移
|
|
@@ -149,5 +150,5 @@ class Rt extends h {
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
export {
|
|
152
|
-
|
|
153
|
+
jt as ObjectFlowPipe
|
|
153
154
|
};
|
|
@@ -13,6 +13,7 @@ import "../../../shared-utils/three/core/Sphere.js";
|
|
|
13
13
|
import "../../../shared-utils/three/blink.js";
|
|
14
14
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
15
15
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
16
|
+
import "../../../vendor/earcut/src/earcut.js";
|
|
16
17
|
import { tweenProgress as h } from "../../../shared-utils/animationFrame/BetterTween.js";
|
|
17
18
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
18
19
|
import { ObjectPipe as a } from "./Pipe.js";
|
|
@@ -72,7 +73,7 @@ import "../../../shared-utils/animationFrame/index.js";
|
|
|
72
73
|
import "../../../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
73
74
|
import "../../../shared-utils/three/Extras/Core/Interpolations.js";
|
|
74
75
|
import "../../../shared-utils/three/Extras/Core/Interpolations2.js";
|
|
75
|
-
class
|
|
76
|
+
class Ri extends a {
|
|
76
77
|
constructor(i) {
|
|
77
78
|
super(i);
|
|
78
79
|
p(this, "imageCount", 64);
|
|
@@ -95,5 +96,5 @@ class Mi extends a {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
Ri as ObjectHighlightPipe
|
|
99
100
|
};
|
|
@@ -10,20 +10,20 @@ var f = (p, i, t) => i in p ? d(p, i, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
return p;
|
|
11
11
|
};
|
|
12
12
|
var n = (p, i, t) => (f(p, typeof i != "symbol" ? i + "" : i, t), t);
|
|
13
|
-
var l = (p, i, t) => new Promise((
|
|
13
|
+
var l = (p, i, t) => new Promise((r, m) => {
|
|
14
14
|
var o = (s) => {
|
|
15
15
|
try {
|
|
16
16
|
a(t.next(s));
|
|
17
17
|
} catch (c) {
|
|
18
18
|
m(c);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, e = (s) => {
|
|
21
21
|
try {
|
|
22
22
|
a(t.throw(s));
|
|
23
23
|
} catch (c) {
|
|
24
24
|
m(c);
|
|
25
25
|
}
|
|
26
|
-
}, a = (s) => s.done ?
|
|
26
|
+
}, a = (s) => s.done ? r(s.value) : Promise.resolve(s.value).then(o, e);
|
|
27
27
|
a((t = t.apply(p, i)).next());
|
|
28
28
|
});
|
|
29
29
|
import * as u from "three";
|
|
@@ -38,6 +38,7 @@ import "../../../shared-utils/three/core/Sphere.js";
|
|
|
38
38
|
import "../../../shared-utils/three/blink.js";
|
|
39
39
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
40
40
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
41
|
+
import "../../../vendor/earcut/src/earcut.js";
|
|
41
42
|
import { BetterTween as g } from "../../../shared-utils/animationFrame/BetterTween.js";
|
|
42
43
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
43
44
|
import { CustomBezierCurve3 as x } from "../../../shared-utils/three/Extras/Curves/BezierCurve3.js";
|
|
@@ -124,7 +125,7 @@ const C = (
|
|
|
124
125
|
`
|
|
125
126
|
);
|
|
126
127
|
class h extends u.Mesh {
|
|
127
|
-
constructor(t,
|
|
128
|
+
constructor(t, r = O) {
|
|
128
129
|
super();
|
|
129
130
|
n(this, "geometryConfig", {
|
|
130
131
|
radius: 1.5 / 100,
|
|
@@ -140,9 +141,9 @@ class h extends u.Mesh {
|
|
|
140
141
|
/** u / m: 每米水管对应到贴图上,应该对应的 u 的长度 */
|
|
141
142
|
n(this, "uPreMeter", 1);
|
|
142
143
|
t.geometryConfig && (this.geometryConfig = y(y({}, this.geometryConfig), t.geometryConfig)), this.customID = t.id || this.uuid, this.pathPoints = t.path, this.path = h.calculatePath(t.path.map((s) => new u.Vector3().fromArray(s))), this.pathLength = this.path.getLength(), this.texture = h.formatTexture(t.texture);
|
|
143
|
-
const { radius: m, tubularSegments: o, radialSegments:
|
|
144
|
+
const { radius: m, tubularSegments: o, radialSegments: e } = this.geometryConfig, a = h.formatTexture(t.texture);
|
|
144
145
|
this.geometry = h.formatGeometryUV(
|
|
145
|
-
new u.TubeBufferGeometry(this.path, o, m,
|
|
146
|
+
new u.TubeBufferGeometry(this.path, o, m, e),
|
|
146
147
|
this.pathLength,
|
|
147
148
|
this.uPreMeter
|
|
148
149
|
), this.material = new u.ShaderMaterial({
|
|
@@ -156,7 +157,7 @@ class h extends u.Mesh {
|
|
|
156
157
|
},
|
|
157
158
|
transparent: !0,
|
|
158
159
|
vertexShader: C,
|
|
159
|
-
fragmentShader:
|
|
160
|
+
fragmentShader: r
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
/** 根据控制点数量计算管道路径
|
|
@@ -166,11 +167,11 @@ class h extends u.Mesh {
|
|
|
166
167
|
static calculatePath(t) {
|
|
167
168
|
return t.length === 2 ? new u.LineCurve3(t[0], t[1]) : new x(t);
|
|
168
169
|
}
|
|
169
|
-
static formatGeometryUV(t,
|
|
170
|
+
static formatGeometryUV(t, r, m) {
|
|
170
171
|
const o = t.getAttribute("uv");
|
|
171
|
-
for (let
|
|
172
|
-
const a = o.getX(
|
|
173
|
-
o.setX(
|
|
172
|
+
for (let e = 0; e < o.count; e++) {
|
|
173
|
+
const a = o.getX(e) * r * m;
|
|
174
|
+
o.setX(e, a);
|
|
174
175
|
}
|
|
175
176
|
return t;
|
|
176
177
|
}
|
|
@@ -184,13 +185,13 @@ class h extends u.Mesh {
|
|
|
184
185
|
return l(this, null, function* () {
|
|
185
186
|
var o;
|
|
186
187
|
(o = this.opacityAnime) == null || o.dispose();
|
|
187
|
-
const
|
|
188
|
+
const r = 0;
|
|
188
189
|
if (typeof (t == null ? void 0 : t.duration) != "number")
|
|
189
|
-
return this.setOpacity(
|
|
190
|
+
return this.setOpacity(r);
|
|
190
191
|
const m = this.material.uniforms.opacity.value;
|
|
191
|
-
return m ===
|
|
192
|
-
this.opacityAnime = new g({ progress: m }).to({ progress:
|
|
193
|
-
this.setOpacity(
|
|
192
|
+
return m === r ? !0 : new Promise((e) => {
|
|
193
|
+
this.opacityAnime = new g({ progress: m }).to({ progress: r }).onUpdate(({ progress: a }) => this.setOpacity(a)).onComplete(() => e(!0)).onDispose(() => {
|
|
194
|
+
this.setOpacity(r), e(!1);
|
|
194
195
|
}).play();
|
|
195
196
|
});
|
|
196
197
|
});
|
|
@@ -199,13 +200,13 @@ class h extends u.Mesh {
|
|
|
199
200
|
return l(this, null, function* () {
|
|
200
201
|
var o;
|
|
201
202
|
(o = this.opacityAnime) == null || o.dispose();
|
|
202
|
-
const
|
|
203
|
+
const r = 1;
|
|
203
204
|
if (typeof (t == null ? void 0 : t.duration) != "number")
|
|
204
|
-
return this.setOpacity(
|
|
205
|
+
return this.setOpacity(r);
|
|
205
206
|
const m = this.material.uniforms.opacity.value;
|
|
206
|
-
return new Promise((
|
|
207
|
-
this.opacityAnime = new g({ progress: m }).to({ progress:
|
|
208
|
-
this.setOpacity(
|
|
207
|
+
return new Promise((e) => {
|
|
208
|
+
this.opacityAnime = new g({ progress: m }).to({ progress: r }).onUpdate(({ progress: a }) => this.setOpacity(a)).onComplete(() => e(!0)).onDispose(() => {
|
|
209
|
+
this.setOpacity(r), e(!1);
|
|
209
210
|
}).play();
|
|
210
211
|
});
|
|
211
212
|
});
|
|
@@ -17,8 +17,9 @@ import "../../shared-utils/three/core/Sphere.js";
|
|
|
17
17
|
import "../../shared-utils/three/blink.js";
|
|
18
18
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
19
19
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
20
|
+
import "../../vendor/earcut/src/earcut.js";
|
|
20
21
|
import "../../shared-utils/five/FivePuppet.js";
|
|
21
|
-
class
|
|
22
|
+
class S extends u {
|
|
22
23
|
constructor(t) {
|
|
23
24
|
super(t);
|
|
24
25
|
e(this, "_normal");
|
|
@@ -49,5 +50,5 @@ class N extends u {
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
S as CircleMesh
|
|
53
54
|
};
|
|
@@ -25,11 +25,12 @@ import "../../shared-utils/three/core/Sphere.js";
|
|
|
25
25
|
import "../../shared-utils/three/blink.js";
|
|
26
26
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
27
27
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
28
|
+
import "../../vendor/earcut/src/earcut.js";
|
|
28
29
|
import "../../shared-utils/five/FivePuppet.js";
|
|
29
30
|
import { CircleWithEdgeMesh as C } from "./CircleWithEdge.js";
|
|
30
31
|
import { radiusToSegments as M } from "../utils/radiusToSegments.js";
|
|
31
32
|
import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
|
|
32
|
-
class
|
|
33
|
+
class O extends b {
|
|
33
34
|
constructor(t) {
|
|
34
35
|
super();
|
|
35
36
|
o(this, "bottomCircle");
|
|
@@ -96,5 +97,5 @@ class H extends b {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
O as CylinderMesh
|
|
100
101
|
};
|
|
@@ -33,9 +33,10 @@ import "../../shared-utils/three/core/Sphere.js";
|
|
|
33
33
|
import "../../shared-utils/three/blink.js";
|
|
34
34
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
35
35
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
36
|
+
import "../../vendor/earcut/src/earcut.js";
|
|
36
37
|
import { notNil as m } from "../../shared-utils/isNil.js";
|
|
37
38
|
import "../../shared-utils/five/FivePuppet.js";
|
|
38
|
-
class
|
|
39
|
+
class We extends te {
|
|
39
40
|
constructor(e) {
|
|
40
41
|
var h, l, f, d;
|
|
41
42
|
super();
|
|
@@ -258,5 +259,5 @@ class Oe extends te {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
export {
|
|
261
|
-
|
|
262
|
+
We as LineMesh
|
|
262
263
|
};
|