@realsee/dnalogel 3.77.2-alpha.0 → 3.77.3-alpha.1
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 +15 -0
- package/dist/Sculpt/Meshes/Line.d.ts +4 -0
- package/dist/Sculpt/Objects/Base/Editor.d.ts +20 -1
- package/dist/Sculpt/Objects/Box/index.d.ts +5 -2
- package/dist/Sculpt/Objects/Rectangle/index.d.ts +7 -4
- package/dist/floorplan/MapviewFloorplanPlugin/Controller.d.ts +21 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -0
- package/dist/floorplan/typings/index.d.ts +3 -0
- package/dist/index.cjs.js +79 -79
- package/dist/index.js +6181 -6031
- package/dist/index.umd.js +71 -71
- package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
- package/dist/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
- package/dist/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/AreaMakerPlugin/Controller.js +3 -2
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.js +3 -2
- package/libs/CSS3DRenderPlugin/Controller.js +3 -2
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +39 -38
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +10 -9
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/CurrentPanoImagePlugin/Controller.js +15 -14
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/MeasurePlugin/Controller.js +11 -10
- package/libs/MeasurePlugin/index.js +5 -4
- package/libs/MeasurePlugin/utils/MeasureMesh.js +3 -2
- 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 +3 -2
- package/libs/ModelMakerPlugin/index.js +3 -2
- 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 +20 -19
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +3 -2
- 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 +24 -23
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Components/Controller0.js +3 -2
- package/libs/PanoMeasurePlugin/Components/Controller1.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/EditController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +7 -10
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/index.js +3 -2
- package/libs/PanoMeasurePlugin/Model/area.js +3 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +16 -15
- package/libs/PanoMeasurePlugin/index.js +14 -13
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoRulerProPlugin/Controller.js +3 -2
- package/libs/PanoRulerProPlugin/RulerItems.js +42 -41
- package/libs/PanoRulerProPlugin/index.js +4 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +34 -33
- 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 +3 -2
- 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 +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +3 -2
- 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 +6 -5
- package/libs/PanoTagPlugin/index.js +12 -11
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
- package/libs/PanoVideoPlugin/Controller.js +9 -8
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +3 -2
- 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 +1 -0
- package/libs/Sculpt/Meshes/Line.d.ts +4 -0
- package/libs/Sculpt/Meshes/Line.js +85 -76
- package/libs/Sculpt/Meshes/Point.js +28 -28
- package/libs/Sculpt/Meshes/Polygon.js +43 -43
- package/libs/Sculpt/Objects/Base/Editor.d.ts +20 -1
- package/libs/Sculpt/Objects/Base/Editor.js +91 -35
- package/libs/Sculpt/Objects/Box/index.d.ts +5 -2
- package/libs/Sculpt/Objects/Box/index.js +61 -55
- package/libs/Sculpt/Objects/Prism/index.js +48 -47
- package/libs/Sculpt/Objects/Rectangle/index.d.ts +7 -4
- package/libs/Sculpt/Objects/Rectangle/index.js +119 -117
- package/libs/Sculpt/index.js +1 -1
- package/libs/Sculpt/utils/Modules/Cursor.js +7 -7
- package/libs/Sculpt/utils/Modules/Global.js +24 -24
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/FloorplanGuidePlugin/Controller.js +3 -2
- package/libs/floorplan/FloorplanGuidePlugin/index.js +4 -3
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.d.ts +21 -0
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +134 -92
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +133 -104
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -4
- 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 -1
- package/libs/floorplan/typings/index.d.ts +3 -0
- package/libs/index.js +151 -150
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +18 -18
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +4 -3
- package/libs/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
- package/libs/shared-utils/five/getFiveFromParentChain.js +15 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.js +1 -0
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var D = Object.defineProperty, T = Object.defineProperties;
|
|
2
|
+
var R = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var P = Object.getOwnPropertySymbols;
|
|
4
4
|
var k = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var w = (l, h, t) => h in l ? D(l, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[h] = t, d = (l, h) => {
|
|
6
6
|
for (var t in h || (h = {}))
|
|
7
|
-
k.call(h, t) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
H.call(h, t) &&
|
|
7
|
+
k.call(h, t) && w(l, t, h[t]);
|
|
8
|
+
if (P)
|
|
9
|
+
for (var t of P(h))
|
|
10
|
+
H.call(h, t) && w(l, t, h[t]);
|
|
11
11
|
return l;
|
|
12
|
-
},
|
|
13
|
-
var o = (l, h, t) => (
|
|
14
|
-
var
|
|
12
|
+
}, u = (l, h) => T(l, R(h));
|
|
13
|
+
var o = (l, h, t) => (w(l, typeof h != "symbol" ? h + "" : h, t), t);
|
|
14
|
+
var c = (l, h, t) => new Promise((e, i) => {
|
|
15
15
|
var s = (a) => {
|
|
16
16
|
try {
|
|
17
17
|
r(t.next(a));
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
18
|
+
} catch (m) {
|
|
19
|
+
i(m);
|
|
20
20
|
}
|
|
21
21
|
}, n = (a) => {
|
|
22
22
|
try {
|
|
23
23
|
r(t.throw(a));
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
24
|
+
} catch (m) {
|
|
25
|
+
i(m);
|
|
26
26
|
}
|
|
27
27
|
}, r = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(s, n);
|
|
28
28
|
r((t = t.apply(l, h)).next());
|
|
29
29
|
});
|
|
30
30
|
import S from "./items.js";
|
|
31
|
-
import * as
|
|
32
|
-
import { to as
|
|
33
|
-
import { equal as
|
|
34
|
-
import { Main as
|
|
35
|
-
import { formatData as
|
|
36
|
-
import { CAMERA_IMAGE as
|
|
37
|
-
import { omit as
|
|
38
|
-
import { FLOOR_PLAN_ATTACHED_TO as
|
|
39
|
-
import { Controller as
|
|
40
|
-
import { getPxmm as B, getAttachedY as
|
|
31
|
+
import * as v from "three";
|
|
32
|
+
import { to as U } from "../../shared-utils/to.js";
|
|
33
|
+
import { equal as z } from "../../shared-utils/equal.js";
|
|
34
|
+
import { Main as W } from "../Components/Main.js";
|
|
35
|
+
import { formatData as x } from "../utils/formatData.js";
|
|
36
|
+
import { CAMERA_IMAGE as N } from "../Assets/camera.js";
|
|
37
|
+
import { omit as A } from "../../shared-utils/filter.js";
|
|
38
|
+
import { FLOOR_PLAN_ATTACHED_TO as G } from "../constant.js";
|
|
39
|
+
import { Controller as j } from "../../base/BasePluginWithData.js";
|
|
40
|
+
import { getPxmm as B, getAttachedY as C } from "../../shared-utils/getPxmm.js";
|
|
41
41
|
import { correctFiveState as V } from "../utils/correctFiveState.js";
|
|
42
|
-
import { changeModelCanvasOpacity as
|
|
43
|
-
import { FloorplanErrorType as
|
|
42
|
+
import { changeModelCanvasOpacity as I } from "../../shared-utils/changeModelCanvasOpacity.js";
|
|
43
|
+
import { FloorplanErrorType as f, SHOW_ANIME_DURATION as Z } from "../utils/constant.js";
|
|
44
44
|
import "../../shared-utils/tag.js";
|
|
45
45
|
import "../../vendor/hammerjs/hammer.js";
|
|
46
46
|
import "../../shared-utils/three/PointSelector/index.js";
|
|
47
47
|
import "../../shared-utils/three/CSS3DRenderer/index.js";
|
|
48
|
-
import { waitFiveModelLoaded as
|
|
48
|
+
import { waitFiveModelLoaded as $ } from "../../shared-utils/five/fiveModelLoad.js";
|
|
49
49
|
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
50
50
|
import "@realsee/five/line";
|
|
51
|
-
import { isNil as
|
|
51
|
+
import { isNil as Y } from "../../shared-utils/isNil.js";
|
|
52
52
|
import "../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
53
53
|
import "../../shared-utils/three/core/Sphere.js";
|
|
54
54
|
import "../../shared-utils/three/blink.js";
|
|
55
55
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
56
56
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
57
57
|
import "../../vendor/earcut/src/earcut.js";
|
|
58
|
-
import { FLOORPLAN_DEFAULT_IMAGE as
|
|
59
|
-
import { replaceStaticPrefix as
|
|
58
|
+
import { FLOORPLAN_DEFAULT_IMAGE as q } from "../../shared-utils/url/defaultUrls.js";
|
|
59
|
+
import { replaceStaticPrefix as J } from "../../shared-utils/url/replace-static-prefix.js";
|
|
60
60
|
import "../../shared-utils/five/FivePuppet.js";
|
|
61
61
|
import "../../shared-utils/isTruelyObject.js";
|
|
62
62
|
import "../../vendor/svelte/internal/index.js";
|
|
@@ -129,6 +129,7 @@ import "../../shared-utils/three/IObject3D.js";
|
|
|
129
129
|
import "../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
130
130
|
import "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
131
131
|
import "../../shared-utils/util.js";
|
|
132
|
+
import "../../shared-utils/five/getFiveFromParentChain.js";
|
|
132
133
|
import "../../shared-utils/three/core/LineGeometry.js";
|
|
133
134
|
import "../../shared-utils/three/core/LineMaterial.js";
|
|
134
135
|
import "../../shared-utils/three/core/Line2.js";
|
|
@@ -147,7 +148,7 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
|
147
148
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
148
149
|
import "@realsee/five";
|
|
149
150
|
import "../../shared-utils/url/absoluteUrl.js";
|
|
150
|
-
const
|
|
151
|
+
const X = "//vr-image-4.realsee-cdn.cn/release/static/image/doctorstrange/0.6.201-beta/";
|
|
151
152
|
function K(l) {
|
|
152
153
|
const { latitude: h, longitude: t } = l, e = Math.abs(h - Math.PI / 2) > 5 * Math.PI / 180, i = t > 5 * (Math.PI / 180) && t < 355 * (Math.PI / 180);
|
|
153
154
|
return e || i;
|
|
@@ -156,9 +157,9 @@ function Q(l) {
|
|
|
156
157
|
const { latitude: h, longitude: t } = l, e = Math.abs(h - Math.PI / 2) < 10 * Math.PI / 180, i = t < 30 * (Math.PI / 180) || t > 330 * (Math.PI / 180);
|
|
157
158
|
return e && i;
|
|
158
159
|
}
|
|
159
|
-
class
|
|
160
|
+
class ci extends j {
|
|
160
161
|
constructor(t, e) {
|
|
161
|
-
var a,
|
|
162
|
+
var a, m;
|
|
162
163
|
super(t);
|
|
163
164
|
// =============== public properties =================
|
|
164
165
|
o(this, "name", "modelFloorplanPlugin");
|
|
@@ -209,22 +210,22 @@ class pi extends G {
|
|
|
209
210
|
* @param opts.isAutoShow 是否是自动展示
|
|
210
211
|
* @param opts.userAction 是否是用户行为
|
|
211
212
|
*/
|
|
212
|
-
o(this, "show", (...e) =>
|
|
213
|
+
o(this, "show", (...e) => c(this, [...e], function* (t = {}) {
|
|
213
214
|
if (!this.state.enabled || !this.showPromise && this.state.visible)
|
|
214
215
|
return;
|
|
215
216
|
const i = t.userAction !== void 0 ? t.userAction : !0;
|
|
216
217
|
this.updateState({ visible: !0 }, i), this._show(t);
|
|
217
218
|
}));
|
|
218
219
|
/** 隐藏户型图 */
|
|
219
|
-
o(this, "hide", (...e) =>
|
|
220
|
+
o(this, "hide", (...e) => c(this, [...e], function* (t = {}) {
|
|
220
221
|
this.state.enabled && (this.isHiddenByHideFunc = !0, this.state.visible !== !1 && (this.updateState({ visible: !1 }, t.userAction || !0), this._hide(t)));
|
|
221
222
|
}));
|
|
222
223
|
/** 更新户型图大小 */
|
|
223
224
|
o(this, "updateSize", () => {
|
|
224
225
|
if (!this.data || !this.container || !this.wrapper)
|
|
225
226
|
return !1;
|
|
226
|
-
const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, n = this.
|
|
227
|
-
return this.size.width ===
|
|
227
|
+
const { min: t, max: e } = this.data.bounding, i = e.x - t.x, s = e.y - t.y, n = this.getPxmmWithRotation(), r = Math.ceil(i * n), a = Math.ceil(s * n);
|
|
228
|
+
return this.size.width === r && this.size.height === a || (this.container.style.width = r + "px", this.container.style.height = a + "px", this.size = { width: r, height: a }), !0;
|
|
228
229
|
});
|
|
229
230
|
o(this, "highlight", (t) => {
|
|
230
231
|
this.state.config.highlightEnable && (this.highlightData = t, this.render());
|
|
@@ -232,23 +233,33 @@ class pi extends G {
|
|
|
232
233
|
o(this, "unhighlight", () => {
|
|
233
234
|
this.highlightData = {}, this.render();
|
|
234
235
|
});
|
|
236
|
+
/** 更新展示状态
|
|
237
|
+
* @description 可以更新 longitude、latitude、offset 等参数
|
|
238
|
+
* @param showState 需要更新的状态,会与现有状态合并
|
|
239
|
+
* @example
|
|
240
|
+
* // 更新 longitude
|
|
241
|
+
* plugin.updateShowState({ longitude: Math.PI / 2 })
|
|
242
|
+
*/
|
|
243
|
+
o(this, "updateShowState", (t) => {
|
|
244
|
+
this.showState = d(d({}, this.showState), t);
|
|
245
|
+
});
|
|
235
246
|
o(this, "_disable", (t) => {
|
|
236
247
|
var i, s, n;
|
|
237
248
|
const { userAction: e } = t;
|
|
238
|
-
this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this,
|
|
249
|
+
this.hooks.emit("disable", { userAction: e }), (i = this.showRejection) == null || i.call(this, f.BreakOffByDisable), this.showPromise = void 0, (s = this.app) == null || s.$destroy(), this.app = void 0, (n = this.container) == null || n.remove(), this.removeEventListener();
|
|
239
250
|
});
|
|
240
251
|
o(this, "_enable", (t) => {
|
|
241
252
|
const { userAction: e } = t;
|
|
242
253
|
this.addEventListener(), this.wrapper && (this.wrapper.append(this.container), this.hooks.emit("enable", { userAction: e }), this.state.visible && this._show({ userAction: e }));
|
|
243
254
|
});
|
|
244
|
-
o(this, "_show", (t) =>
|
|
255
|
+
o(this, "_show", (t) => c(this, null, function* () {
|
|
245
256
|
var n;
|
|
246
257
|
if (!this.state.enabled)
|
|
247
258
|
return;
|
|
248
259
|
if (!((n = this.fiveUtil.model) != null && n.loaded))
|
|
249
|
-
throw new Error(
|
|
260
|
+
throw new Error(f.ModelNotLoaded);
|
|
250
261
|
if (!this.data)
|
|
251
|
-
throw new Error(
|
|
262
|
+
throw new Error(f.DataNotLoaded);
|
|
252
263
|
if (this.showPromise)
|
|
253
264
|
return this.showPromise;
|
|
254
265
|
const e = {
|
|
@@ -257,25 +268,25 @@ class pi extends G {
|
|
|
257
268
|
immediately: !1,
|
|
258
269
|
isAutoShow: !1,
|
|
259
270
|
userAction: !0
|
|
260
|
-
}, i =
|
|
271
|
+
}, i = d(d({}, e), t), s = () => c(this, null, function* () {
|
|
261
272
|
this.hooks.emit("show", { userAction: i.userAction, auto: i.isAutoShow });
|
|
262
273
|
let r = !1, a;
|
|
263
|
-
this.showRejection = (
|
|
264
|
-
r = !0, a =
|
|
274
|
+
this.showRejection = (g) => {
|
|
275
|
+
r = !0, a = g;
|
|
265
276
|
};
|
|
266
|
-
const [
|
|
267
|
-
if (
|
|
268
|
-
throw
|
|
277
|
+
const [m] = yield U(V(this.five, this.showState, i.userAction));
|
|
278
|
+
if (m)
|
|
279
|
+
throw m;
|
|
269
280
|
if (r)
|
|
270
|
-
throw a ? new Error(a) : new Error(
|
|
281
|
+
throw a ? new Error(a) : new Error(f.UnknownError);
|
|
271
282
|
if (!this.updateSize())
|
|
272
|
-
throw new Error(
|
|
283
|
+
throw new Error(f.UpdateSizeError);
|
|
273
284
|
this.updatePosition(), this.floorIndex = i.floorIndex, this.fiveUtil.model.show(this.floorIndex);
|
|
274
285
|
});
|
|
275
286
|
return this.isHiddenByHideFunc = !1, this.showPromise = s().then(() => {
|
|
276
287
|
this.showPromise = void 0, this.showRejection = void 0;
|
|
277
|
-
const r = i.modelOpacity, a = i.immediately ? 0 :
|
|
278
|
-
|
|
288
|
+
const r = i.modelOpacity, a = i.immediately ? 0 : Z;
|
|
289
|
+
I(this.five, r, a), this.render(a), this.hooks.emit("showAnimationEnded", {
|
|
279
290
|
auto: i.isAutoShow,
|
|
280
291
|
userAction: i.userAction
|
|
281
292
|
});
|
|
@@ -286,12 +297,12 @@ class pi extends G {
|
|
|
286
297
|
}));
|
|
287
298
|
o(this, "_hide", (t) => {
|
|
288
299
|
var s;
|
|
289
|
-
(s = this.showRejection) == null || s.call(this,
|
|
290
|
-
const i =
|
|
300
|
+
(s = this.showRejection) == null || s.call(this, f.BreakOffByHide), this.showPromise = void 0;
|
|
301
|
+
const i = d(d({}, {
|
|
291
302
|
userAction: !0,
|
|
292
303
|
isAutoHide: !1
|
|
293
304
|
}), t);
|
|
294
|
-
|
|
305
|
+
I(this.five, 1, 0), this.hooks.emit("hide", { auto: i.isAutoHide, userAction: i.userAction }), this.render();
|
|
295
306
|
});
|
|
296
307
|
o(this, "handleClick", () => {
|
|
297
308
|
if (!this.state.visible)
|
|
@@ -301,7 +312,7 @@ class pi extends G {
|
|
|
301
312
|
});
|
|
302
313
|
/** modelLoaded 之后自动执行 append container 操作 */
|
|
303
314
|
o(this, "onFiveModelLoaded", () => {
|
|
304
|
-
const i = this.five.models.find((n) => n.name === this.five.state.workCode).bounding.getCenter(new
|
|
315
|
+
const i = this.five.models.find((n) => n.name === this.five.state.workCode).bounding.getCenter(new v.Vector3());
|
|
305
316
|
if (this.showState.offset = i, this.state.enabled === !1 || this.wrapper || !this.selector)
|
|
306
317
|
return;
|
|
307
318
|
const s = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
|
|
@@ -318,7 +329,10 @@ class pi extends G {
|
|
|
318
329
|
if (!e || this.state.visible || this.state.config.autoShowEnable === !1 || this.isHiddenByHideFunc)
|
|
319
330
|
return;
|
|
320
331
|
const i = this.five.getCurrentState();
|
|
321
|
-
i.mode
|
|
332
|
+
if (i.mode !== this.showState.mode)
|
|
333
|
+
return;
|
|
334
|
+
const s = this.getRelativePose(i);
|
|
335
|
+
Q(s) && (this.updateState({ visible: !0 }, !0), this._show({ isAutoShow: !0 }));
|
|
322
336
|
});
|
|
323
337
|
/** panoIndex 改变时,更新 floorIndex */
|
|
324
338
|
o(this, "onFivePanoArrived", (t) => {
|
|
@@ -330,12 +344,14 @@ class pi extends G {
|
|
|
330
344
|
if (!this.state.visible || this.showPromise)
|
|
331
345
|
return;
|
|
332
346
|
const i = this.five.getCurrentState();
|
|
333
|
-
this.updatePosition(), this.updateSize()
|
|
347
|
+
this.updatePosition(), this.updateSize();
|
|
348
|
+
const s = this.getRelativePose(i);
|
|
349
|
+
K(s) && (this.updateState({ visible: !1 }, e), this._hide({ userAction: e }));
|
|
334
350
|
});
|
|
335
351
|
/** 户型图展示中,转动三维模型,结束时应该自动修复模型状态 */
|
|
336
352
|
o(this, "onFiveWantsPanGesture", (t, e) => {
|
|
337
353
|
if (this.five.getCurrentState().mode === this.showState.mode && this.state.config.autoShowEnable !== !1 && e && this.state.visible)
|
|
338
|
-
return this.five.updateCamera(
|
|
354
|
+
return this.five.updateCamera(A(this.showState, ["offset"]), 0), !1;
|
|
339
355
|
});
|
|
340
356
|
/** 阻止点击分间走点 */
|
|
341
357
|
o(this, "onFiveWantsTapGesture", () => this.handleClick());
|
|
@@ -354,15 +370,15 @@ class pi extends G {
|
|
|
354
370
|
this.floorIndex = t, this.updateSize(), this.render();
|
|
355
371
|
}
|
|
356
372
|
});
|
|
357
|
-
e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = {
|
|
373
|
+
e != null && e.selector && (this.selector = e.selector, console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")), this.showState = d({
|
|
358
374
|
mode: "Mapview",
|
|
359
375
|
longitude: 0,
|
|
360
376
|
latitude: Math.PI / 2
|
|
361
|
-
}, this.defaultMissingFloorConfig = {
|
|
362
|
-
imageURL:
|
|
377
|
+
}, e == null ? void 0 : e.showState), this.defaultMissingFloorConfig = {
|
|
378
|
+
imageURL: J(e == null ? void 0 : e.staticPrefix, q),
|
|
363
379
|
imageWidth: 200,
|
|
364
380
|
imageHeight: 120,
|
|
365
|
-
text: (
|
|
381
|
+
text: (m = (a = e.i18n) == null ? void 0 : a.call(e, "暂无平面图")) != null ? m : "暂无平面图",
|
|
366
382
|
textFontSize: 14
|
|
367
383
|
};
|
|
368
384
|
const i = {
|
|
@@ -379,44 +395,44 @@ class pi extends G {
|
|
|
379
395
|
roomNameEnable: !0,
|
|
380
396
|
roomNameOtherTypeEnable: !0,
|
|
381
397
|
roomDimensionEnable: !0,
|
|
382
|
-
cameraImageUrl:
|
|
383
|
-
attachedTo:
|
|
398
|
+
cameraImageUrl: N,
|
|
399
|
+
attachedTo: G.BOUNDING_CENTER,
|
|
384
400
|
getLabelElement: void 0,
|
|
385
401
|
adaptiveRoomLabelVisibleEnable: !0,
|
|
386
|
-
missingFloorConfig:
|
|
402
|
+
missingFloorConfig: d(d({}, this.defaultMissingFloorConfig), e.missingFloorConfig),
|
|
387
403
|
i18n: (p) => p,
|
|
388
404
|
getRoomAreaText: (p) => (p / 1e6).toFixed(1) + "㎡",
|
|
389
|
-
getRoomDimensionText: (p,
|
|
405
|
+
getRoomDimensionText: (p, g) => (p / 1e3).toFixed(1) + "m × " + (g / 1e3).toFixed(1) + "m",
|
|
390
406
|
getRuleDistanceText: (p) => p.toString()
|
|
391
|
-
}, s = e ?
|
|
392
|
-
this.state = { enabled: !0, visible: !1, config: r }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(),
|
|
407
|
+
}, s = e ? A(e, ["selector", "scale"]) : {}, n = d(d({}, i.missingFloorConfig), s.missingFloorConfig), r = u(d(d({}, i), s), { missingFloorConfig: n });
|
|
408
|
+
this.state = { enabled: !0, visible: !1, config: r }, this.panoIndex = t.getCurrentState().panoIndex, this.initContainer(), $(t).then(this.onFiveModelLoaded), t.once("dispose", this.dispose), this.addEventListener();
|
|
393
409
|
}
|
|
394
410
|
load(t, e, i = !0) {
|
|
395
|
-
return
|
|
411
|
+
return c(this, null, function* () {
|
|
396
412
|
function s(p) {
|
|
397
413
|
return Object.prototype.hasOwnProperty.apply(p, ["version"]);
|
|
398
414
|
}
|
|
399
415
|
const n = t;
|
|
400
|
-
n &&
|
|
401
|
-
const r = JSON.parse(JSON.stringify(t)), a = s(r) ? r.data : r,
|
|
402
|
-
this.data = yield
|
|
416
|
+
n && Y(n.version) && console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");
|
|
417
|
+
const r = JSON.parse(JSON.stringify(t)), a = s(r) ? r.data : r, m = this.data;
|
|
418
|
+
this.data = yield x(a), this.hooks.emit("dataLoaded", this.data), this.hooks.emit("dataChange", this.data, m), e && this.updateState(e, i), this.render();
|
|
403
419
|
});
|
|
404
420
|
}
|
|
405
421
|
loadItems(t) {
|
|
406
422
|
const { min: e, max: i } = this.data.bounding, s = i.x - e.x, n = i.y - e.y;
|
|
407
423
|
this.data.floorDatas.forEach((r, a) => {
|
|
408
|
-
r.items = t[a].filter((
|
|
409
|
-
const { x: p, y:
|
|
424
|
+
r.items = t[a].filter((m) => m.displayName === "Item-SimpleItem").map((m) => {
|
|
425
|
+
const { x: p, y: g, width: F, height: M, notes: E, type: b, id: y, rotateX: L, rotateY: _, rotateZ: O = 0 } = m;
|
|
410
426
|
return {
|
|
411
|
-
id:
|
|
412
|
-
positionInImage: { x: (p - e.x) / s, y: (i.y -
|
|
413
|
-
width:
|
|
414
|
-
height:
|
|
415
|
-
src:
|
|
416
|
-
notes:
|
|
417
|
-
rotateX:
|
|
418
|
-
rotateY:
|
|
419
|
-
rotateZ:
|
|
427
|
+
id: y,
|
|
428
|
+
positionInImage: { x: (p - e.x) / s, y: (i.y - g) / n },
|
|
429
|
+
width: F / s,
|
|
430
|
+
height: M / n,
|
|
431
|
+
src: X + S[b].href.replace(/\{\{\stheme\s\}\}/, "realsee"),
|
|
432
|
+
notes: E || S[b].description,
|
|
433
|
+
rotateX: L,
|
|
434
|
+
rotateY: _,
|
|
435
|
+
rotateZ: O
|
|
420
436
|
};
|
|
421
437
|
});
|
|
422
438
|
});
|
|
@@ -451,24 +467,42 @@ class pi extends G {
|
|
|
451
467
|
changeConfigs(t, e = !0) {
|
|
452
468
|
this.updateState({ config: t }, e), this.render();
|
|
453
469
|
}
|
|
470
|
+
/** 根据旋转角度计算 pxmm
|
|
471
|
+
* @description 当 longitude 大于 45° 或小于 -45°(相对于基准方向)时,使用 Z 轴计算
|
|
472
|
+
*/
|
|
473
|
+
getPxmmWithRotation() {
|
|
474
|
+
if (!this.wrapper)
|
|
475
|
+
return 0;
|
|
476
|
+
const t = this.state.config.attachedTo ? { attachedTo: this.state.config.attachedTo } : void 0, e = this.showState.longitude, i = Math.abs((e % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI));
|
|
477
|
+
return i > Math.PI / 4 && i < 3 * Math.PI / 4 || i > 5 * Math.PI / 4 && i < 7 * Math.PI / 4 ? this.getPxmmZAxis(t) : B(this.five, this.wrapper, this.floorIndex, t);
|
|
478
|
+
}
|
|
479
|
+
/** 使用 Z 轴计算 pxmm
|
|
480
|
+
* @description 当相机旋转导致 X 轴接近垂直于屏幕时,改用 Z 轴计算
|
|
481
|
+
*/
|
|
482
|
+
getPxmmZAxis(t) {
|
|
483
|
+
if (!this.wrapper)
|
|
484
|
+
return 0;
|
|
485
|
+
const e = C(this.five, this.floorIndex, t == null ? void 0 : t.attachedTo), i = new v.Vector3(0, e, 0), s = new v.Vector3(0, e, 1), n = i.clone().project(this.five.camera), r = s.clone().project(this.five.camera);
|
|
486
|
+
return Math.abs((r.x - n.x) / 1e3) * (this.wrapper.getBoundingClientRect().width / 2);
|
|
487
|
+
}
|
|
454
488
|
/** 更新户型图位置 */
|
|
455
489
|
updatePosition() {
|
|
456
490
|
var r;
|
|
457
|
-
const t =
|
|
491
|
+
const t = C(this.five, this.floorIndex, this.state.config.attachedTo), e = (r = this.fiveUtil.model) == null ? void 0 : r.bounding.getCenter(new v.Vector3()).setY(t);
|
|
458
492
|
if (!e)
|
|
459
493
|
return;
|
|
460
494
|
const i = e.clone().project(this.five.camera), s = (i.x + 1) / 2, n = -(i.y - 1) / 2;
|
|
461
495
|
this.container.style.left = s * 100 + "%", this.container.style.top = n * 100 + "%";
|
|
462
496
|
}
|
|
463
497
|
formatData(t) {
|
|
464
|
-
return
|
|
465
|
-
return yield
|
|
498
|
+
return c(this, null, function* () {
|
|
499
|
+
return yield x(t.data);
|
|
466
500
|
});
|
|
467
501
|
}
|
|
468
502
|
updateState(t, e) {
|
|
469
503
|
var r;
|
|
470
|
-
const i = this.state, s = (r = t.config) != null && r.missingFloorConfig ?
|
|
471
|
-
this.state =
|
|
504
|
+
const i = this.state, s = (r = t.config) != null && r.missingFloorConfig ? d(d({}, i.config.missingFloorConfig), t.config.missingFloorConfig) : i.config.missingFloorConfig, n = t.config ? u(d(d({}, i.config), t.config), { missingFloorConfig: s }) : i.config;
|
|
505
|
+
this.state = u(d(d({}, this.state), t), { config: n }), !z(this.state, i, { deep: !0 }) && this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: e });
|
|
472
506
|
}
|
|
473
507
|
/** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
|
|
474
508
|
*
|
|
@@ -494,10 +528,18 @@ class pi extends G {
|
|
|
494
528
|
const t = this.five;
|
|
495
529
|
this.hasAddedEventListener = !1, t.off("modelLoaded", this.onFiveModelLoaded), t.off("modeChange", this.onFiveModeChange), t.off("panoArrived", this.onFivePanoArrived), t.off("cameraUpdate", this.onFiveCameraUpdate), t.off("wantsPanGesture", this.onFiveWantsPanGesture), t.off("wantsTapGesture", this.onFiveWantsTapGesture), t.off("wantsChangeMode", this.onFiveWantsChangeMode), t.off("modelShownFloorChange", this.onModelShownFloorChange);
|
|
496
530
|
}
|
|
531
|
+
/** 获取相对于 showState 的 pose 偏差
|
|
532
|
+
* @description 将当前相机状态的 longitude 减去 showState.longitude,归一化后返回
|
|
533
|
+
* 这样自动隐藏逻辑会检查相对偏差,而不是绝对值
|
|
534
|
+
*/
|
|
535
|
+
getRelativePose(t) {
|
|
536
|
+
const e = this.showState.longitude || 0, s = ((t.longitude - e) % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
|
|
537
|
+
return u(d({}, t), { longitude: s });
|
|
538
|
+
}
|
|
497
539
|
render(t) {
|
|
498
540
|
if (!this.state.enabled || !this.container || !this.data || this.size.width === 0 || this.showPromise)
|
|
499
541
|
return;
|
|
500
|
-
const e =
|
|
542
|
+
const e = u(d({}, this.state.config), {
|
|
501
543
|
visible: this.state.visible,
|
|
502
544
|
duration: t != null ? t : 0,
|
|
503
545
|
panoIndex: this.panoIndex,
|
|
@@ -510,9 +552,9 @@ class pi extends G {
|
|
|
510
552
|
});
|
|
511
553
|
if (this.app)
|
|
512
554
|
return this.app.$set(e);
|
|
513
|
-
this.app = new
|
|
555
|
+
this.app = new W({ target: this.container, intro: !0, props: e });
|
|
514
556
|
}
|
|
515
557
|
}
|
|
516
558
|
export {
|
|
517
|
-
|
|
559
|
+
ci as Controller
|
|
518
560
|
};
|
|
@@ -94,6 +94,7 @@ import "../../Sculpt/typings/style.js";
|
|
|
94
94
|
import "../../shared-utils/three/IObject3D.js";
|
|
95
95
|
import "../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
96
96
|
import "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
97
|
+
import "../../shared-utils/five/getFiveFromParentChain.js";
|
|
97
98
|
import "../../shared-utils/three/core/LineGeometry.js";
|
|
98
99
|
import "../../shared-utils/three/core/LineMaterial.js";
|
|
99
100
|
import "../../shared-utils/three/core/Line2.js";
|
|
@@ -119,8 +120,8 @@ import "../../shared-utils/translateMode/getDistanceFromModel.js";
|
|
|
119
120
|
import "../../shared-utils/changeModelCanvasOpacity.js";
|
|
120
121
|
import "../../shared-utils/url/replace-static-prefix.js";
|
|
121
122
|
import "../../shared-utils/url/absoluteUrl.js";
|
|
122
|
-
const
|
|
123
|
+
const xr = (o, r) => new t(o, r);
|
|
123
124
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
xr as MapviewFloorplanPlugin,
|
|
126
|
+
xr as default
|
|
126
127
|
};
|
|
@@ -65,8 +65,24 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
|
|
|
65
65
|
changeConfigs(config: Partial<Config>, userAction?: boolean): void;
|
|
66
66
|
/** 更新户型图大小 */
|
|
67
67
|
updateSize: () => boolean;
|
|
68
|
+
/** 根据旋转角度计算 pxmm
|
|
69
|
+
* @description 当 longitude 大于 45° 或小于 -45°(相对于基准方向)时,使用 Z 轴计算
|
|
70
|
+
*/
|
|
71
|
+
private getPxmmWithRotation;
|
|
72
|
+
/** 使用 Z 轴计算 pxmm
|
|
73
|
+
* @description 当相机旋转导致 X 轴接近垂直于屏幕时,改用 Z 轴计算
|
|
74
|
+
*/
|
|
75
|
+
private getPxmmZAxis;
|
|
68
76
|
highlight: (highlightData: HighlightData) => void;
|
|
69
77
|
unhighlight: () => void;
|
|
78
|
+
/** 更新展示状态
|
|
79
|
+
* @description 可以更新 longitude、latitude、fov 等参数
|
|
80
|
+
* @param showState 需要更新的状态,会与现有状态合并
|
|
81
|
+
* @example
|
|
82
|
+
* // 更新 longitude
|
|
83
|
+
* plugin.updateShowState({ longitude: Math.PI / 2 })
|
|
84
|
+
*/
|
|
85
|
+
updateShowState: (showState: Partial<ShowState>) => void;
|
|
70
86
|
protected formatData(serverData: PluginServerData): Promise<PluginData>;
|
|
71
87
|
private _disable;
|
|
72
88
|
private _enable;
|