@realsee/dnalogel 3.77.5 → 3.77.7
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 +17 -11
- package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/dist/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/dist/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/controller/index.d.ts +55 -2
- package/dist/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/dist/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/dist/Sculpt/Meshes/Line.d.ts +4 -0
- package/dist/index.cjs.js +178 -95
- package/dist/index.js +11378 -9801
- package/dist/index.umd.js +173 -90
- package/dist/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
- 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 +8 -2
- package/libs/CruisePlugin/Work.js +8 -2
- package/libs/CruisePlugin/index.js +12 -6
- package/libs/CurrentPanoImagePlugin/Controller.js +15 -14
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +10 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +8 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +8 -2
- package/libs/GuideLinePlugin/index.js +12 -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/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 +125 -124
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +321 -289
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.js +516 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.js +816 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.js +94 -0
- 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/Tag/PolygonTag.d.ts +112 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.js +479 -0
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +22 -19
- package/libs/PanoTagPlugin/controller/index.d.ts +55 -2
- package/libs/PanoTagPlugin/controller/index.js +243 -129
- package/libs/PanoTagPlugin/index.js +17 -11
- package/libs/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -13
- package/libs/PanoTagPlugin/utils/index.js +29 -26
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.js +18 -0
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.js +26 -14
- package/libs/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/libs/PanoTagPlugin/utils/tagPosition.js +49 -16
- 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/index.js +1 -1
- package/libs/Sculpt/utils/Modules/Cursor.js +7 -7
- 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.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/index.js +164 -158
- 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/utils/PointHelper2.js +1 -0
- package/package.json +1 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
var Q = Object.defineProperty, Y = Object.defineProperties;
|
|
2
2
|
var ee = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var e in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
3
|
+
var V = Object.getOwnPropertySymbols;
|
|
4
|
+
var $ = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var P = Math.pow, D = (g, t, e) => t in g ? Q(g, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[t] = e, y = (g, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
$.call(t, e) && D(g, e, t[e]);
|
|
8
|
+
if (V)
|
|
9
|
+
for (var e of V(t))
|
|
10
|
+
z.call(t, e) && D(g, e, t[e]);
|
|
11
|
+
return g;
|
|
12
|
+
}, j = (g, t) => Y(g, ee(t));
|
|
13
|
+
var W = (g, t) => {
|
|
14
14
|
var e = {};
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var
|
|
19
|
-
|
|
15
|
+
for (var i in g)
|
|
16
|
+
$.call(g, i) && t.indexOf(i) < 0 && (e[i] = g[i]);
|
|
17
|
+
if (g != null && V)
|
|
18
|
+
for (var i of V(g))
|
|
19
|
+
t.indexOf(i) < 0 && z.call(g, i) && (e[i] = g[i]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var a = (
|
|
23
|
-
var
|
|
24
|
-
var
|
|
22
|
+
var a = (g, t, e) => (D(g, typeof t != "symbol" ? t + "" : t, e), e);
|
|
23
|
+
var L = (g, t, e) => new Promise((i, s) => {
|
|
24
|
+
var o = (n) => {
|
|
25
25
|
try {
|
|
26
26
|
r(e.next(n));
|
|
27
27
|
} catch (f) {
|
|
28
|
-
|
|
28
|
+
s(f);
|
|
29
29
|
}
|
|
30
30
|
}, l = (n) => {
|
|
31
31
|
try {
|
|
32
32
|
r(e.throw(n));
|
|
33
33
|
} catch (f) {
|
|
34
|
-
|
|
34
|
+
s(f);
|
|
35
35
|
}
|
|
36
|
-
}, r = (n) => n.done ?
|
|
37
|
-
r((e = e.apply(
|
|
36
|
+
}, r = (n) => n.done ? i(n.value) : Promise.resolve(n.value).then(o, l);
|
|
37
|
+
r((e = e.apply(g, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { Subscribe as
|
|
40
|
-
import { calculateTagConfig as
|
|
41
|
-
import { getTagStickType as
|
|
39
|
+
import { Subscribe as te } from "../../../shared-utils/Subscribe.js";
|
|
40
|
+
import { calculateTagConfig as R } from "../../utils/tag/calculateTagConfig.js";
|
|
41
|
+
import { getTagStickType as ie } from "../../utils/tag/format.js";
|
|
42
42
|
import "../../../shared-utils/tag.js";
|
|
43
|
-
import { isPanoramaLike as
|
|
44
|
-
import * as
|
|
43
|
+
import { isPanoramaLike as E, isModelLike as B } from "../../../shared-utils/five/mode.js";
|
|
44
|
+
import * as k from "three";
|
|
45
45
|
import "../../../vendor/hammerjs/hammer.js";
|
|
46
46
|
import "../../../shared-utils/three/PointSelector/index.js";
|
|
47
47
|
import { centerPoint as ne } from "../../../shared-utils/three/centerPoint.js";
|
|
48
48
|
import "../../../shared-utils/three/CSS3DRenderer/index.js";
|
|
49
49
|
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
50
|
-
import { anyPositionToVector3 as
|
|
50
|
+
import { anyPositionToVector3 as w } from "../../../shared-utils/positionToVector3.js";
|
|
51
51
|
import { toArray as se } from "../../../shared-utils/util.js";
|
|
52
52
|
import "@realsee/five/line";
|
|
53
|
-
import { isNil as
|
|
53
|
+
import { isNil as J, notNil as H } from "../../../shared-utils/isNil.js";
|
|
54
54
|
import "../../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
55
55
|
import "../../../shared-utils/three/core/Sphere.js";
|
|
56
56
|
import { blink as oe, reblink as re } from "../../../shared-utils/three/blink.js";
|
|
@@ -58,19 +58,19 @@ import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
|
58
58
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
59
59
|
import "../../../vendor/earcut/src/earcut.js";
|
|
60
60
|
import { vectorToCoordinates as le } from "../../../shared-utils/vectorToCoordinate.js";
|
|
61
|
-
import { transformPosition as
|
|
61
|
+
import { transformPosition as O } from "../../../shared-utils/five/transformPosition.js";
|
|
62
62
|
import { lookPoint as ae } from "../../../shared-utils/five/lookPoint.js";
|
|
63
63
|
import { uuid as fe } from "../../../shared-utils/uuid.js";
|
|
64
64
|
import "../../../shared-utils/five/FivePuppet.js";
|
|
65
|
-
import { objectAssignDeepExports as
|
|
66
|
-
import { getTagPosition as
|
|
67
|
-
import { checkRange as
|
|
68
|
-
import { isMediaPlaneTag as
|
|
69
|
-
import { getUrlExt as
|
|
65
|
+
import { objectAssignDeepExports as T } from "../../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
66
|
+
import { getTagPosition as q, getTagCenterPosition as X } from "../../utils/tagPosition.js";
|
|
67
|
+
import { checkRange as S } from "../../utils/checkRange.js";
|
|
68
|
+
import { isMediaPlaneTag as Z, isMediaModelTag as _ } from "../../utils/tag/tagCheck.js";
|
|
69
|
+
import { getUrlExt as G } from "../../../shared-utils/url/getUrl.js";
|
|
70
70
|
import { getFloorIndex as de } from "../../../shared-utils/five/getFloorIndex.js";
|
|
71
|
-
import { safeObj as
|
|
71
|
+
import { safeObj as K } from "../../../shared-utils/safeObj.js";
|
|
72
72
|
import { Cache as ce } from "../../utils/Cache.js";
|
|
73
|
-
import { _raycaster as
|
|
73
|
+
import { _raycaster as N } from "../../../shared-utils/three/temp.js";
|
|
74
74
|
import { withResolvers as ue } from "../../../shared-utils/promise/withResolvers.js";
|
|
75
75
|
import "../../../shared-utils/typescript/entries.js";
|
|
76
76
|
import "../../utils/tag/adaptConfig.js";
|
|
@@ -105,6 +105,7 @@ import "../../../Sculpt/typings/style.js";
|
|
|
105
105
|
import "../../../shared-utils/three/IObject3D.js";
|
|
106
106
|
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
107
107
|
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
108
|
+
import "../../../shared-utils/five/getFiveFromParentChain.js";
|
|
108
109
|
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
109
110
|
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
110
111
|
import "../../../shared-utils/three/core/Line2.js";
|
|
@@ -122,8 +123,8 @@ import "../../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
|
122
123
|
import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
123
124
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
124
125
|
import "../../../shared-utils/formatRad.js";
|
|
125
|
-
class
|
|
126
|
-
constructor(
|
|
126
|
+
class Ht {
|
|
127
|
+
constructor(t, e) {
|
|
127
128
|
a(this, "plugin");
|
|
128
129
|
a(this, "id");
|
|
129
130
|
a(this, "contentType");
|
|
@@ -150,6 +151,8 @@ class Ji {
|
|
|
150
151
|
a(this, "pause");
|
|
151
152
|
a(this, "tag3DContentSvelte");
|
|
152
153
|
a(this, "rectanglePlane");
|
|
154
|
+
a(this, "boxShape");
|
|
155
|
+
a(this, "polygonShape");
|
|
153
156
|
a(this, "dom");
|
|
154
157
|
a(this, "contentDom");
|
|
155
158
|
a(this, "initialConfig");
|
|
@@ -167,53 +170,68 @@ class Ji {
|
|
|
167
170
|
*/
|
|
168
171
|
a(this, "hoverEnabled");
|
|
169
172
|
a(this, "ready", () => {
|
|
170
|
-
const { promise:
|
|
173
|
+
const { promise: t, resolve: e } = ue();
|
|
171
174
|
if (!this._updating)
|
|
172
175
|
e();
|
|
173
176
|
else {
|
|
174
|
-
const
|
|
175
|
-
this._updating || (clearInterval(
|
|
177
|
+
const i = setInterval(() => {
|
|
178
|
+
this._updating || (clearInterval(i), e());
|
|
176
179
|
}, 17);
|
|
177
180
|
setTimeout(() => {
|
|
178
|
-
clearInterval(
|
|
181
|
+
clearInterval(i), e();
|
|
179
182
|
}, 300);
|
|
180
183
|
}
|
|
181
|
-
return
|
|
184
|
+
return t;
|
|
182
185
|
});
|
|
183
|
-
var f,
|
|
184
|
-
this.plugin =
|
|
185
|
-
const
|
|
186
|
-
e.stickType =
|
|
187
|
-
const
|
|
188
|
-
e.initialConfig =
|
|
189
|
-
const l =
|
|
190
|
-
e.config = r, this.id = (
|
|
186
|
+
var f, m, p, d, c, u, v, b;
|
|
187
|
+
this.plugin = t;
|
|
188
|
+
const i = ie(e);
|
|
189
|
+
e.stickType = i;
|
|
190
|
+
const s = JSON.parse(JSON.stringify(e.data)), o = (f = e.initialConfig) != null ? f : e.config ? JSON.parse(JSON.stringify(e.config)) : {};
|
|
191
|
+
e.initialConfig = o;
|
|
192
|
+
const l = R(e, t.config), r = this.getConfig(e);
|
|
193
|
+
e.config = r, this.id = (m = e.id) != null ? m : fe(), this.enabled = (p = e.enabled) != null ? p : !0, this.contentType = e.contentType, this.hoverEnabled = (c = (d = r.popoverConfig) == null ? void 0 : d.enabled) != null ? c : !0, this.data = (u = r.initialData) != null && u.important ? T(e.data, s, r.initialData) : T(e.data, r.initialData, s);
|
|
191
194
|
let n;
|
|
192
195
|
typeof r.unfoldedConfig == "object" ? r.unfoldedConfig.keep === "unfolded" ? n = !0 : r.unfoldedConfig.keep === "folded" ? n = !1 : n = !this.can("fold") : n = !this.can("fold"), this.state = y({
|
|
193
196
|
visible: void 0,
|
|
194
197
|
unfolded: n
|
|
195
198
|
}, r.initialState), this.isPopoverConfigEnabled() && (this.state.unfolded = !1), this.normalLineLength = (b = (v = e.style) == null ? void 0 : v.point) == null ? void 0 : b.normalLen, this.originPosition = e.position, e.originPosition = this.originPosition, this.position = (() => {
|
|
196
|
-
var
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
+
var U;
|
|
200
|
+
const h = e.originPosition, x = t.workUtil.transform;
|
|
201
|
+
if (e.stickType === "3DBox") {
|
|
202
|
+
if (!h)
|
|
203
|
+
return {
|
|
204
|
+
start: [0, 0, 0],
|
|
205
|
+
end: [0, 0, 0],
|
|
206
|
+
rotation: [0, 0, 0]
|
|
207
|
+
};
|
|
208
|
+
const { start: C, end: A, rotation: F } = h;
|
|
209
|
+
return {
|
|
210
|
+
start: w(C.map((I) => Number(I))).toArray(),
|
|
211
|
+
end: w(A.map((I) => Number(I))).toArray(),
|
|
212
|
+
rotation: w(F.map((I) => Number(I))).toArray()
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
if (e.stickType === "Polygon")
|
|
216
|
+
return h ? h.map(w).map((C) => O(C, x).toArray()) : [];
|
|
217
|
+
if (!h)
|
|
199
218
|
return;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
C = new P.Vector3().fromArray(C).clone().add(I.clone().setLength(this.normalLineLength)).toArray();
|
|
219
|
+
let M = h;
|
|
220
|
+
if (Array.isArray(h) && h.length === 4 ? M = h.map(w).map((C) => O(C, x).toArray()) : M = O(w(h), x).toArray(), (e.stickType === "2DPoint" || e.stickType === "3DPoint") && ((U = r == null ? void 0 : r.tagNormalLineConfig) != null && U.enabled) && e.normal && this.normalLineLength) {
|
|
221
|
+
const C = new k.Vector3().fromArray(e.normal);
|
|
222
|
+
M = new k.Vector3().fromArray(M).clone().add(C.clone().setLength(this.normalLineLength)).toArray();
|
|
205
223
|
}
|
|
206
|
-
return
|
|
224
|
+
return M;
|
|
207
225
|
})(), this.matrix = e.matrix ? (() => {
|
|
208
|
-
const
|
|
209
|
-
return
|
|
210
|
-
})() : e.matrix, this.initialConfig =
|
|
211
|
-
this[
|
|
226
|
+
const h = new k.Matrix4().fromArray(e.matrix);
|
|
227
|
+
return h.premultiply(t.workUtil.transform), h.elements;
|
|
228
|
+
})() : e.matrix, this.initialConfig = o, this.computedConfig = l, this.stickType = i, this.config = e.config, this.fiveState = e.fiveState, this.normal = e.normal, this.cache = new ce(), this.hooks = new te(), Object.keys(e).forEach((h) => {
|
|
229
|
+
this[h] === void 0 && e[h] !== void 0 && (this[h] = e[h]);
|
|
212
230
|
});
|
|
213
231
|
}
|
|
214
232
|
get visible() {
|
|
215
|
-
var
|
|
216
|
-
return ((
|
|
233
|
+
var t;
|
|
234
|
+
return ((t = this.temporaryState) == null ? void 0 : t.visible) !== !1 && this.state.visible !== !1 && this.enabled !== !1;
|
|
217
235
|
}
|
|
218
236
|
get five() {
|
|
219
237
|
return this.plugin.five;
|
|
@@ -225,13 +243,13 @@ class Ji {
|
|
|
225
243
|
return this.plugin.workUtil;
|
|
226
244
|
}
|
|
227
245
|
get centerPosition() {
|
|
228
|
-
const
|
|
229
|
-
return ne(...Array.isArray(
|
|
246
|
+
const t = q(this);
|
|
247
|
+
return ne(...Array.isArray(t) ? t : [t]);
|
|
230
248
|
}
|
|
231
249
|
get currentConfig() {
|
|
232
|
-
var
|
|
233
|
-
const
|
|
234
|
-
return (
|
|
250
|
+
var s, o;
|
|
251
|
+
const t = R(this, this.plugin.config, { useCache: !0 }), e = this.five.getCurrentState().mode, i = (s = t.configWithFiveMode) == null ? void 0 : s[e];
|
|
252
|
+
return (o = i != null ? i : t) != null ? o : {};
|
|
235
253
|
}
|
|
236
254
|
get currentVisible() {
|
|
237
255
|
return !(!this.plugin.state.enabled || !this.plugin.state.visible || !this.enabled || !this.state.visible);
|
|
@@ -248,25 +266,25 @@ class Ji {
|
|
|
248
266
|
/**
|
|
249
267
|
* @description 找到标签
|
|
250
268
|
*/
|
|
251
|
-
find(
|
|
252
|
-
return
|
|
253
|
-
var
|
|
269
|
+
find(t) {
|
|
270
|
+
return L(this, null, function* () {
|
|
271
|
+
var s;
|
|
254
272
|
const e = this.fiveState;
|
|
255
273
|
if (!this.fiveState)
|
|
256
274
|
return this;
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
275
|
+
const i = (s = t == null ? void 0 : t.targetMode) != null ? s : this.five.state.mode;
|
|
276
|
+
if (i === "Panorama") {
|
|
277
|
+
const o = e == null ? void 0 : e.panoIndex;
|
|
278
|
+
if (J(o))
|
|
261
279
|
return this;
|
|
262
|
-
const l = this.workUtil.getObserverPosition(
|
|
280
|
+
const l = this.workUtil.getObserverPosition(o), r = this.centerPosition.clone().sub(l).normalize();
|
|
263
281
|
this.five.setState(y({
|
|
264
282
|
mode: "Panorama",
|
|
265
283
|
workCode: this.workUtil.workCode,
|
|
266
|
-
panoIndex:
|
|
284
|
+
panoIndex: o
|
|
267
285
|
}, le(r))), yield this.five.ready();
|
|
268
286
|
} else
|
|
269
|
-
|
|
287
|
+
i === "Mapview" && (yield ae(this.five, this.centerPosition, t == null ? void 0 : t.pointConfig));
|
|
270
288
|
return this;
|
|
271
289
|
});
|
|
272
290
|
}
|
|
@@ -280,12 +298,12 @@ class Ji {
|
|
|
280
298
|
/**
|
|
281
299
|
* @description 闪烁
|
|
282
300
|
*/
|
|
283
|
-
blink(
|
|
284
|
-
return
|
|
285
|
-
var r, n, f,
|
|
301
|
+
blink(t) {
|
|
302
|
+
return L(this, null, function* () {
|
|
303
|
+
var r, n, f, m, p, d;
|
|
286
304
|
yield this.ready(), this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((n = (r = this._currentBlinkInstance).preComplete) == null || n.call(r), this._currentBlinkInstance = void 0);
|
|
287
|
-
const e = (f = this.enabled) != null ? f : !0,
|
|
288
|
-
|
|
305
|
+
const e = (f = this.enabled) != null ? f : !0, i = (m = this.state) == null ? void 0 : m.visible, s = e && i;
|
|
306
|
+
s === !1 && (this.state.visible = !0, this.enabled = !0, this.applyVisible(), this.plugin.render(), this.computeRenderType() !== "Mesh" ? yield new Promise((c) => {
|
|
289
307
|
if (this.dom || this.contentDom) {
|
|
290
308
|
c();
|
|
291
309
|
return;
|
|
@@ -293,7 +311,7 @@ class Ji {
|
|
|
293
311
|
const u = setInterval(() => {
|
|
294
312
|
(this.dom || this.contentDom) && (c(), clearInterval(u));
|
|
295
313
|
}, 16.7);
|
|
296
|
-
}) : this.stickType === "Model" && !((
|
|
314
|
+
}) : this.stickType === "Model" && !((p = this.model) != null && p.object) ? yield (d = this.model) == null ? void 0 : d.promise : this.stickType === "Plane" && (yield new Promise((c) => {
|
|
297
315
|
if (this.mediaPlane) {
|
|
298
316
|
c();
|
|
299
317
|
return;
|
|
@@ -302,30 +320,30 @@ class Ji {
|
|
|
302
320
|
this.mediaPlane && (c(), clearInterval(u));
|
|
303
321
|
}, 16.7);
|
|
304
322
|
})), this.dom && (this.dom.style.visibility = "hidden"), this.contentDom && (this.contentDom.style.visibility = "hidden"));
|
|
305
|
-
const
|
|
306
|
-
var v, b,
|
|
323
|
+
const o = (() => {
|
|
324
|
+
var v, b, h;
|
|
307
325
|
const c = [];
|
|
308
|
-
c.push(this.dom), c.push((b = (v = this.tag3DContentSvelte) == null ? void 0 : v.css3DInstance) == null ? void 0 : b.container), c.push((
|
|
326
|
+
c.push(this.dom), c.push((b = (v = this.tag3DContentSvelte) == null ? void 0 : v.css3DInstance) == null ? void 0 : b.container), c.push((h = this.model) == null ? void 0 : h.object), c.push(this.mediaPlane), c.push(this.boxShape), c.push(this.polygonShape);
|
|
309
327
|
const u = this.getAdditionalBlinkTargets();
|
|
310
328
|
if (u) {
|
|
311
|
-
const
|
|
312
|
-
c.push(...
|
|
329
|
+
const x = Array.isArray(u) ? u : [u];
|
|
330
|
+
c.push(...x);
|
|
313
331
|
}
|
|
314
332
|
return c.filter(Boolean);
|
|
315
333
|
})();
|
|
316
|
-
if (!
|
|
334
|
+
if (!o.length) {
|
|
317
335
|
console.warn("tagDom is empty");
|
|
318
336
|
return;
|
|
319
337
|
}
|
|
320
|
-
const l =
|
|
321
|
-
this._currentBlinkInstance = l(
|
|
338
|
+
const l = s ? oe : re;
|
|
339
|
+
this._currentBlinkInstance = l(o, y({
|
|
322
340
|
begin: () => {
|
|
323
|
-
|
|
341
|
+
s === !1 && (this.dom && (this.dom.style.visibility = ""), this.contentDom && (this.contentDom.style.visibility = ""));
|
|
324
342
|
},
|
|
325
343
|
updateRender: () => {
|
|
326
344
|
this.five.needsRender = !0;
|
|
327
345
|
}
|
|
328
|
-
},
|
|
346
|
+
}, t));
|
|
329
347
|
try {
|
|
330
348
|
yield this._currentBlinkInstance.finished;
|
|
331
349
|
} catch (c) {
|
|
@@ -333,7 +351,7 @@ class Ji {
|
|
|
333
351
|
} finally {
|
|
334
352
|
this._currentBlinkInstance = void 0;
|
|
335
353
|
}
|
|
336
|
-
e === !1 && (this.enabled = !1, this.updateVisible()),
|
|
354
|
+
e === !1 && (this.enabled = !1, this.updateVisible()), i === !1 && this.updateVisible(), s === !1 && (this.dom && (this.dom.style.visibility = ""), this.contentDom && (this.contentDom.style.visibility = ""));
|
|
337
355
|
});
|
|
338
356
|
}
|
|
339
357
|
/**
|
|
@@ -361,49 +379,49 @@ class Ji {
|
|
|
361
379
|
* @description 禁用
|
|
362
380
|
*/
|
|
363
381
|
disable() {
|
|
364
|
-
var i;
|
|
365
|
-
this.enabled = !1, this.hooks.emit("disable"), (
|
|
382
|
+
var t, e, i;
|
|
383
|
+
this.enabled = !1, this.hooks.emit("disable"), (t = this.rectanglePlane) == null || t.delete(), (e = this.boxShape) == null || e.delete(), (i = this.polygonShape) == null || i.delete(), this.five.needsRender = !0, this.applyVisible();
|
|
366
384
|
}
|
|
367
385
|
/**
|
|
368
386
|
* @deprecated use `setData` instead
|
|
369
387
|
*/
|
|
370
|
-
changeData(
|
|
371
|
-
return this.setData(
|
|
388
|
+
changeData(t, e = !0) {
|
|
389
|
+
return this.setData(t, e);
|
|
372
390
|
}
|
|
373
391
|
/**
|
|
374
392
|
* @deprecated use `setPosition` instead
|
|
375
393
|
*/
|
|
376
|
-
changePosition(
|
|
377
|
-
return this.setPosition(
|
|
394
|
+
changePosition(t) {
|
|
395
|
+
return this.setPosition(t);
|
|
378
396
|
}
|
|
379
397
|
/**
|
|
380
398
|
* @description 修改标签数据
|
|
381
399
|
* @param deepMerge 是否深度合并 data,默认为 true
|
|
382
400
|
*/
|
|
383
|
-
setData(
|
|
384
|
-
e ? this.data =
|
|
401
|
+
setData(t, e = !0) {
|
|
402
|
+
e ? this.data = T(this.data, t) : this.data = y(y({}, this.data), t), this.hooks.emit("dataChanged", this.data);
|
|
385
403
|
}
|
|
386
404
|
/**
|
|
387
405
|
* @description 修改标签位置
|
|
388
406
|
*/
|
|
389
|
-
setPosition(
|
|
407
|
+
setPosition(t) {
|
|
390
408
|
throw new Error("Method not implemented.");
|
|
391
409
|
}
|
|
392
410
|
/**
|
|
393
411
|
* @description 设置标签实例的属性
|
|
394
412
|
* @param deepMerge 是否深度合并 data,默认为 true
|
|
395
413
|
*/
|
|
396
|
-
set(
|
|
397
|
-
this.plugin.tagsLengthWillUpdate = !0, e ?
|
|
414
|
+
set(t, e = !0) {
|
|
415
|
+
this.plugin.tagsLengthWillUpdate = !0, e ? T(this, t) : Object.assign(this, t), this.cache.clear();
|
|
398
416
|
}
|
|
399
417
|
updateConfig() {
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
this.computedConfig =
|
|
418
|
+
var i;
|
|
419
|
+
const t = this.getConfig(void 0, { useCache: !1 });
|
|
420
|
+
this.computedConfig = t;
|
|
403
421
|
const e = this.getConfig();
|
|
404
422
|
if (this.config = e, this.config.initialData) {
|
|
405
|
-
const
|
|
406
|
-
this.data = (
|
|
423
|
+
const s = JSON.parse(JSON.stringify(this.data));
|
|
424
|
+
this.data = (i = e.initialData) != null && i.important ? T(this.data, s, e.initialData) : T(this.data, e.initialData, s);
|
|
407
425
|
}
|
|
408
426
|
this.cache.clear();
|
|
409
427
|
}
|
|
@@ -411,156 +429,170 @@ class Ji {
|
|
|
411
429
|
this.enabled ? (this.state.visible = this.getVisible(), this.applyVisible()) : this.applyVisible(), this.five.needsRender = !0, this._updating = !1;
|
|
412
430
|
}
|
|
413
431
|
updateZIndex() {
|
|
414
|
-
const
|
|
415
|
-
this.zIndex = Math.round((1e4 - (
|
|
432
|
+
const t = this.getSquaredDistance();
|
|
433
|
+
this.zIndex = Math.round((1e4 - (t != null ? t : 0)) * 100);
|
|
416
434
|
}
|
|
417
|
-
getConfig(
|
|
435
|
+
getConfig(t, e) {
|
|
418
436
|
var l, r, n;
|
|
419
|
-
const
|
|
420
|
-
return (n =
|
|
437
|
+
const i = R(t != null ? t : this, this.plugin.config, { useCache: e == null ? void 0 : e.useCache }), s = (l = e == null ? void 0 : e.fiveMode) != null ? l : this.five.getCurrentState().mode, o = (r = i.configWithFiveMode) == null ? void 0 : r[s];
|
|
438
|
+
return (n = o != null ? o : i) != null ? n : {};
|
|
421
439
|
}
|
|
422
|
-
getDistance(
|
|
423
|
-
const
|
|
440
|
+
getDistance(t, e = 3) {
|
|
441
|
+
const i = y(y({}, this.five.getCurrentState()), t), { panoIndex: s, mode: o } = i, l = o === "Panorama" ? this.workUtil.getObserverPosition(s) : this.five.camera.position, r = this.centerPosition;
|
|
424
442
|
return !l || !r ? -1 : l.distanceTo(r);
|
|
425
443
|
}
|
|
426
444
|
/**
|
|
427
445
|
* @description 用于排序的距离,性能更好
|
|
428
446
|
*/
|
|
429
447
|
getSquaredDistance() {
|
|
430
|
-
const
|
|
448
|
+
const t = this.five.camera.position;
|
|
449
|
+
if (this.stickType === "3DBox") {
|
|
450
|
+
const i = this.position;
|
|
451
|
+
if (!i || !i.start)
|
|
452
|
+
return 1 / 0;
|
|
453
|
+
const s = i.start;
|
|
454
|
+
return P(s[0] - t.x, 2) + P(s[1] - t.y, 2) + P(s[2] - t.z, 2);
|
|
455
|
+
}
|
|
456
|
+
if (this.stickType === "Polygon") {
|
|
457
|
+
const i = this.position;
|
|
458
|
+
if (!i || i.length === 0)
|
|
459
|
+
return 1 / 0;
|
|
460
|
+
const s = i[0];
|
|
461
|
+
return P(s[0] - t.x, 2) + P(s[1] - t.y, 2) + P(s[2] - t.z, 2);
|
|
462
|
+
}
|
|
431
463
|
let e;
|
|
432
|
-
return Array.isArray(this.position[0]) ? e = this.position[0] : e = this.position,
|
|
464
|
+
return this.position || console.log(this, "no position"), Array.isArray(this.position[0]) ? e = this.position[0] : e = this.position, P(e[0] - t.x, 2) + P(e[1] - t.y, 2) + P(e[2] - t.z, 2);
|
|
433
465
|
}
|
|
434
|
-
getVisible(
|
|
466
|
+
getVisible(t) {
|
|
435
467
|
if (!this.enabled || !this.plugin.state.enabled || !this.fiveUtil.model)
|
|
436
468
|
return !1;
|
|
437
|
-
const e = y(y({}, this.five.getCurrentState()),
|
|
438
|
-
let
|
|
439
|
-
return
|
|
469
|
+
const e = y(y({}, this.five.getCurrentState()), t);
|
|
470
|
+
let i = this.cache.getVisible(this, e);
|
|
471
|
+
return J(i) && (i = this.computeVisible(e).value, this.cache.setVisible(this, e, i)), i;
|
|
440
472
|
}
|
|
441
|
-
getUnfoldedByPanoIndex(
|
|
473
|
+
getUnfoldedByPanoIndex(t) {
|
|
442
474
|
if (!this.currentVisible)
|
|
443
475
|
return;
|
|
444
|
-
const
|
|
445
|
-
return
|
|
476
|
+
const i = this.computeUnfoldedByPanoIndex(t);
|
|
477
|
+
return i && this.getUnfoldedByCamera();
|
|
446
478
|
}
|
|
447
479
|
getUnfoldedByCamera() {
|
|
448
480
|
return this.currentVisible ? this.computeUnfoldedByCamera() : void 0;
|
|
449
481
|
}
|
|
450
|
-
can(
|
|
451
|
-
var
|
|
452
|
-
if ((
|
|
482
|
+
can(t) {
|
|
483
|
+
var i, s;
|
|
484
|
+
if ((t === "fold" || t === "unfold") && ((s = (i = this.currentConfig) == null ? void 0 : i.popoverConfig) == null ? void 0 : s.enabled) === !0)
|
|
453
485
|
return !1;
|
|
454
486
|
const e = this.currentConfig;
|
|
455
487
|
if (!e || typeof e != "object")
|
|
456
488
|
return !0;
|
|
457
|
-
if (
|
|
489
|
+
if (t === "show" || t === "hide") {
|
|
458
490
|
if (!e.visibleConfig || typeof e.visibleConfig != "object")
|
|
459
491
|
return !0;
|
|
460
|
-
if (
|
|
492
|
+
if (t === "show" && e.visibleConfig.keep === "hidden" || t === "hide" && e.visibleConfig.keep === "visible")
|
|
461
493
|
return !1;
|
|
462
494
|
}
|
|
463
|
-
if (
|
|
495
|
+
if (t === "fold" || t === "unfold") {
|
|
464
496
|
if (!e.unfoldedConfig || typeof e.unfoldedConfig != "object")
|
|
465
497
|
return !0;
|
|
466
|
-
if (
|
|
498
|
+
if (t === "fold" && e.unfoldedConfig.keep === "unfolded" || t === "unfold" && e.unfoldedConfig.keep === "folded")
|
|
467
499
|
return !1;
|
|
468
500
|
}
|
|
469
501
|
return !0;
|
|
470
502
|
}
|
|
471
|
-
onClick(
|
|
503
|
+
onClick(t) {
|
|
472
504
|
}
|
|
473
505
|
computeRenderType() {
|
|
474
|
-
const
|
|
506
|
+
const t = (() => {
|
|
475
507
|
if (this.stickType === "3DPoint")
|
|
476
508
|
return "Dom";
|
|
477
509
|
const e = this.getConfig();
|
|
478
510
|
if (!e || typeof e != "object" || !e.renderType)
|
|
479
511
|
return;
|
|
480
|
-
const
|
|
481
|
-
if ((!
|
|
512
|
+
const i = this.data.mediaData;
|
|
513
|
+
if ((!i || i.length === 0) && Z(this))
|
|
482
514
|
return e.renderType;
|
|
483
515
|
if (e.renderType === "Mesh") {
|
|
484
|
-
if (
|
|
485
|
-
if (
|
|
486
|
-
if (
|
|
516
|
+
if (Z(this)) {
|
|
517
|
+
if (i.length === 1) {
|
|
518
|
+
if (i[0].type === "Video")
|
|
487
519
|
return navigator.userAgent.toLowerCase().indexOf("firefox") > -1 && navigator.userAgent.toLowerCase().indexOf("mobile") > -1 ? "Dom" : "Mesh";
|
|
488
|
-
if (
|
|
489
|
-
return
|
|
520
|
+
if (i[0].type === "Image")
|
|
521
|
+
return G(i[0].url) === "gif" ? "Dom" : "Mesh";
|
|
490
522
|
}
|
|
491
|
-
} else if (
|
|
492
|
-
return
|
|
523
|
+
} else if (_(this))
|
|
524
|
+
return i.length === 1 && i[0].type === "Image" ? G(i[0].url) === "gif" ? "Dom" : "Mesh" : "BehindDom";
|
|
493
525
|
}
|
|
494
526
|
})();
|
|
495
|
-
return
|
|
527
|
+
return t != null ? t : "Dom";
|
|
496
528
|
}
|
|
497
|
-
computeVisible(
|
|
498
|
-
const e = y(y({}, this.five.getCurrentState()),
|
|
529
|
+
computeVisible(t) {
|
|
530
|
+
const e = y(y({}, this.five.getCurrentState()), t), { panoIndex: i, mode: s } = e, o = [];
|
|
499
531
|
return (() => {
|
|
500
|
-
var f,
|
|
532
|
+
var f, p, d, c;
|
|
501
533
|
const n = (f = this.getConfig().visibleConfig) != null ? f : {};
|
|
502
534
|
if (typeof n == "function")
|
|
503
535
|
return {
|
|
504
536
|
value: n(this.five, { tag: this, distance: this.getDistance(e, void 0) }),
|
|
505
|
-
checkedList:
|
|
537
|
+
checkedList: o,
|
|
506
538
|
reason: "config function result"
|
|
507
539
|
};
|
|
508
540
|
{
|
|
509
541
|
if (n.keep === "hidden")
|
|
510
|
-
return { value: !1, checkedList:
|
|
542
|
+
return { value: !1, checkedList: o, reason: "config.keep is hidden" };
|
|
511
543
|
if (n.keep === "visible")
|
|
512
|
-
return { value: !0, checkedList:
|
|
513
|
-
const u = this.computeVisibleByFiveMode(n,
|
|
544
|
+
return { value: !0, checkedList: o, reason: "config.keep is visible" };
|
|
545
|
+
const u = this.computeVisibleByFiveMode(n, s);
|
|
514
546
|
if ((u == null ? void 0 : u.value) === !1)
|
|
515
547
|
return u;
|
|
516
|
-
if (n.followModelVisibility === !0 && ["poincare", "aerophoto", "sand"].includes(this.workUtil.fromType) && (
|
|
517
|
-
const
|
|
548
|
+
if (n.followModelVisibility === !0 && ["poincare", "aerophoto", "sand"].includes(this.workUtil.fromType) && (s === "Floorplan" || s === "Mapview")) {
|
|
549
|
+
const m = this.computeVisibleByFloorIndex(), { value: v } = m, b = W(m, ["value"]);
|
|
518
550
|
if (v === !1)
|
|
519
|
-
return y({ value: !1, checkedList:
|
|
551
|
+
return y({ value: !1, checkedList: o, reason: "followModelVisibility check failed" }, b);
|
|
520
552
|
}
|
|
521
|
-
if (
|
|
522
|
-
if (
|
|
553
|
+
if (E(s) && n.visiblePanoIndex !== void 0 && n.visiblePanoIndex !== "all" && i !== void 0) {
|
|
554
|
+
if (o.push("visiblePanoIndex"), Array.isArray(n.visiblePanoIndex) && !n.visiblePanoIndex.includes(i))
|
|
523
555
|
return {
|
|
524
556
|
value: !1,
|
|
525
|
-
checkedList:
|
|
526
|
-
reason: `current panoIndex is not included in visiblePano. currentPanoIndex: ${
|
|
557
|
+
checkedList: o,
|
|
558
|
+
reason: `current panoIndex is not included in visiblePano. currentPanoIndex: ${i}, visiblePanoIndex: ${n.visiblePanoIndex}`
|
|
527
559
|
};
|
|
528
|
-
if (n.visiblePanoIndex === "current" &&
|
|
560
|
+
if (n.visiblePanoIndex === "current" && i !== ((p = this.fiveState) == null ? void 0 : p.panoIndex))
|
|
529
561
|
return {
|
|
530
562
|
value: !1,
|
|
531
|
-
checkedList:
|
|
532
|
-
reason: `current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${
|
|
563
|
+
checkedList: o,
|
|
564
|
+
reason: `current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${i}, tag.panoIndex: ${(d = this.fiveState) == null ? void 0 : d.panoIndex}`
|
|
533
565
|
};
|
|
534
566
|
}
|
|
535
|
-
if (n.visibleDistance !== void 0 && (
|
|
567
|
+
if (n.visibleDistance !== void 0 && (o.push("visibleDistance"), n.visibleDistance !== "unLimited")) {
|
|
536
568
|
const v = this.getDistance(e, 1);
|
|
537
|
-
if (
|
|
569
|
+
if (S(v, n.visibleDistance) === !1)
|
|
538
570
|
return {
|
|
539
571
|
value: !1,
|
|
540
|
-
checkedList:
|
|
541
|
-
panoIndex:
|
|
572
|
+
checkedList: o,
|
|
573
|
+
panoIndex: i,
|
|
542
574
|
visibleDistance: n.visibleDistance,
|
|
543
575
|
reason: `distance is not in visibleDistance. distance: ${v}, visibleDistance: ${n.visibleDistance.min} - ${n.visibleDistance.max}`
|
|
544
576
|
};
|
|
545
577
|
}
|
|
546
578
|
if (n.intersectRaycaster !== !1 && (typeof n.intersectRaycaster != "object" || n.intersectRaycaster.enabled !== !1)) {
|
|
547
|
-
if (
|
|
579
|
+
if (o.push("intersectRaycaster"), i === void 0)
|
|
548
580
|
return {
|
|
549
581
|
value: !1,
|
|
550
|
-
checkedList:
|
|
551
|
-
reason: `intersectRaycaster check failed: panoIndex is ${
|
|
582
|
+
checkedList: o,
|
|
583
|
+
reason: `intersectRaycaster check failed: panoIndex is ${i}`
|
|
552
584
|
};
|
|
553
|
-
if (
|
|
554
|
-
|
|
585
|
+
if (i === ((c = this.fiveState) == null ? void 0 : c.panoIndex))
|
|
586
|
+
o.push("intersectCheckSkiped");
|
|
555
587
|
else {
|
|
556
|
-
const v = this.computeVisibleByIntersect(
|
|
588
|
+
const v = this.computeVisibleByIntersect(i);
|
|
557
589
|
if (v.value === !1)
|
|
558
|
-
return Object.assign(v, { checkedList:
|
|
590
|
+
return Object.assign(v, { checkedList: o });
|
|
559
591
|
}
|
|
560
592
|
}
|
|
561
593
|
return {
|
|
562
594
|
value: !0,
|
|
563
|
-
checkedList:
|
|
595
|
+
checkedList: o,
|
|
564
596
|
reason: "all check passed"
|
|
565
597
|
};
|
|
566
598
|
}
|
|
@@ -569,70 +601,70 @@ class Ji {
|
|
|
569
601
|
/**
|
|
570
602
|
* @description 计算标签可见性
|
|
571
603
|
*/
|
|
572
|
-
computeVisibleByFiveMode(
|
|
573
|
-
const
|
|
604
|
+
computeVisibleByFiveMode(t, e) {
|
|
605
|
+
const i = () => {
|
|
574
606
|
var l, r;
|
|
575
|
-
let
|
|
576
|
-
if (
|
|
577
|
-
return
|
|
578
|
-
if (
|
|
579
|
-
return
|
|
580
|
-
if (
|
|
581
|
-
return !
|
|
582
|
-
if (
|
|
607
|
+
let o = typeof t.visibleFiveMode == "function" ? t.visibleFiveMode(this) : t.visibleFiveMode;
|
|
608
|
+
if (o || (o = (r = (l = this.fiveState) == null ? void 0 : l.mode) != null ? r : this.workUtil.observers.length ? "Panorama" : "ModelLike"), Array.isArray(o))
|
|
609
|
+
return o.includes(e);
|
|
610
|
+
if (o === "ModelLike")
|
|
611
|
+
return B(e);
|
|
612
|
+
if (o === "PanoramaLike")
|
|
613
|
+
return !E(e);
|
|
614
|
+
if (o === "all")
|
|
583
615
|
return !0;
|
|
584
|
-
if (typeof
|
|
585
|
-
return
|
|
616
|
+
if (typeof o == "string")
|
|
617
|
+
return o === e;
|
|
586
618
|
};
|
|
587
619
|
if ((() => {
|
|
588
620
|
var l;
|
|
589
|
-
const
|
|
590
|
-
if (
|
|
591
|
-
if (
|
|
621
|
+
const o = i();
|
|
622
|
+
if (H((l = this.fiveState) == null ? void 0 : l.panoIndex) && t.entryFromModel) {
|
|
623
|
+
if (B(e) && o ? this.entryFromModel = !1 : this.entryFromModel = !0, B(e))
|
|
592
624
|
return !0;
|
|
593
625
|
} else
|
|
594
626
|
this.entryFromModel = !1;
|
|
595
|
-
return
|
|
627
|
+
return o;
|
|
596
628
|
})() === !1)
|
|
597
629
|
return {
|
|
598
630
|
value: !1,
|
|
599
631
|
reason: "current mode is not included in visibleFiveMode",
|
|
600
|
-
visibleFiveMode:
|
|
632
|
+
visibleFiveMode: t.visibleFiveMode,
|
|
601
633
|
mode: e
|
|
602
634
|
};
|
|
603
635
|
}
|
|
604
636
|
/** 通过射线检测标签可用性 */
|
|
605
|
-
computeVisibleByIntersect(
|
|
606
|
-
var n, f,
|
|
607
|
-
const e =
|
|
608
|
-
if (
|
|
609
|
-
return { value: !1, reason: { type: "startPosition is undefined", fivePanoIndex:
|
|
610
|
-
const
|
|
637
|
+
computeVisibleByIntersect(t) {
|
|
638
|
+
var n, f, m, p;
|
|
639
|
+
const e = K(K((n = this.getConfig().visibleConfig) != null ? n : {}).intersectRaycaster), i = t != null ? t : this.five.getCurrentState().panoIndex, s = E(this.five.getCurrentState().mode) ? this.workUtil.getObserverPosition(i) : this.five.camera.position;
|
|
640
|
+
if (s === void 0)
|
|
641
|
+
return { value: !1, reason: { type: "startPosition is undefined", fivePanoIndex: i } };
|
|
642
|
+
const o = se(
|
|
611
643
|
(() => {
|
|
612
644
|
var c;
|
|
613
645
|
const d = (c = e.checkPoints) != null ? c : "center";
|
|
614
|
-
return d === "center" ?
|
|
646
|
+
return d === "center" ? X(this) : d === "corner" ? q(this) : Array.isArray(d) ? d : [];
|
|
615
647
|
})()
|
|
616
648
|
);
|
|
617
649
|
let l = 0, r = 0;
|
|
618
|
-
for (const d of
|
|
619
|
-
const c = new
|
|
650
|
+
for (const d of o) {
|
|
651
|
+
const c = new k.Vector3().subVectors(d, s).normalize();
|
|
620
652
|
let u;
|
|
621
|
-
|
|
622
|
-
const [v] = this.fiveUtil.model.intersectRaycaster(
|
|
653
|
+
N.set(s, c);
|
|
654
|
+
const [v] = this.fiveUtil.model.intersectRaycaster(N);
|
|
623
655
|
u = v == null ? void 0 : v.distance;
|
|
624
656
|
const b = (() => {
|
|
625
|
-
if (!
|
|
657
|
+
if (!_(this))
|
|
626
658
|
return;
|
|
627
|
-
const
|
|
628
|
-
var
|
|
629
|
-
return (
|
|
630
|
-
}).filter(
|
|
631
|
-
return
|
|
632
|
-
})(),
|
|
633
|
-
u = Math.min(u != null ? u : 1 / 0, (
|
|
634
|
-
const
|
|
635
|
-
if (l >=
|
|
659
|
+
const C = this.plugin.tags.filter(_).map((F) => {
|
|
660
|
+
var I;
|
|
661
|
+
return (I = F.model) == null ? void 0 : I.object;
|
|
662
|
+
}).filter(H), [A] = N.intersectObjects(C, !0);
|
|
663
|
+
return A;
|
|
664
|
+
})(), h = s.distanceTo(d), x = (f = e.distanceAccuracy) != null ? f : 0.01;
|
|
665
|
+
u = Math.min(u != null ? u : 1 / 0, (m = b == null ? void 0 : b.distance) != null ? m : 1 / 0), u + x >= h ? l++ : r++;
|
|
666
|
+
const U = (p = e.needPassed) != null ? p : 1;
|
|
667
|
+
if (l >= U)
|
|
636
668
|
return { value: !0 };
|
|
637
669
|
}
|
|
638
670
|
return r === 0 ? { value: !0 } : {
|
|
@@ -646,124 +678,124 @@ class Ji {
|
|
|
646
678
|
};
|
|
647
679
|
}
|
|
648
680
|
computeVisibleByFloorIndex() {
|
|
649
|
-
var
|
|
650
|
-
let
|
|
651
|
-
const e = (
|
|
652
|
-
e !== void 0 ?
|
|
681
|
+
var s, o, l, r, n, f, m;
|
|
682
|
+
let t = 0;
|
|
683
|
+
const e = (s = this.fiveState) == null ? void 0 : s.panoIndex;
|
|
684
|
+
e !== void 0 ? t = (o = this.workUtil.getObserver(e)) == null ? void 0 : o.floorIndex : t = de(
|
|
653
685
|
this.workUtil.work,
|
|
654
|
-
(
|
|
686
|
+
(m = (f = (r = (l = this.model) == null ? void 0 : l.object) == null ? void 0 : r.position) != null ? f : (n = this.mediaPlane) == null ? void 0 : n.position) != null ? m : X(this)
|
|
655
687
|
);
|
|
656
|
-
const
|
|
688
|
+
const i = this.fiveUtil.model.shownFloor;
|
|
657
689
|
return {
|
|
658
|
-
value:
|
|
659
|
-
currentFiveFloorIndex:
|
|
660
|
-
tagFloorIndex:
|
|
690
|
+
value: i === null || i === t,
|
|
691
|
+
currentFiveFloorIndex: i,
|
|
692
|
+
tagFloorIndex: t
|
|
661
693
|
};
|
|
662
694
|
}
|
|
663
695
|
/**
|
|
664
696
|
* @description 获取是否展开
|
|
665
697
|
*/
|
|
666
|
-
computeUnfoldedByPanoIndex(
|
|
698
|
+
computeUnfoldedByPanoIndex(t) {
|
|
667
699
|
const e = this.getConfig().unfoldedConfig;
|
|
668
700
|
if (e) {
|
|
669
701
|
if (typeof e == "function")
|
|
670
|
-
return e(this.five, { tag: this, distance: this.getDistance({ panoIndex:
|
|
702
|
+
return e(this.five, { tag: this, distance: this.getDistance({ panoIndex: t }) });
|
|
671
703
|
if (e.keep === "folded")
|
|
672
704
|
return !1;
|
|
673
705
|
if (e.keep === "unfolded")
|
|
674
706
|
return !0;
|
|
675
|
-
if (e.unfoldDistance &&
|
|
707
|
+
if (e.unfoldDistance && S(this.getDistance({ panoIndex: t }), e.unfoldDistance) === !1)
|
|
676
708
|
return !1;
|
|
677
709
|
}
|
|
678
710
|
}
|
|
679
711
|
// 该方法有很大优化空间,这个检测显示方法不应该挂在tagBase下,做了多次不必要计算(MinimumDistance,ScreenCenter)。
|
|
680
712
|
computeUnfoldedByCamera() {
|
|
681
|
-
var e,
|
|
682
|
-
if (this.entryFromModel &&
|
|
713
|
+
var e, i;
|
|
714
|
+
if (this.entryFromModel && B(this.five.state.mode))
|
|
683
715
|
return !1;
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
if (typeof
|
|
687
|
-
return
|
|
688
|
-
if (
|
|
716
|
+
const t = this.getConfig().unfoldedConfig;
|
|
717
|
+
if (t) {
|
|
718
|
+
if (typeof t == "function")
|
|
719
|
+
return t(this.five, { tag: this, distance: this.getDistance() });
|
|
720
|
+
if (t.keep === "folded")
|
|
689
721
|
return !1;
|
|
690
|
-
if (
|
|
722
|
+
if (t.keep === "unfolded")
|
|
691
723
|
return !0;
|
|
692
|
-
if (typeof
|
|
724
|
+
if (typeof t != "object" || t.autoUnfold === void 0 || t.autoUnfold === !1 || t.autoUnfold.enable === !1 || !t.autoUnfold.strategy)
|
|
693
725
|
return;
|
|
694
|
-
if (
|
|
695
|
-
const
|
|
696
|
-
if (
|
|
726
|
+
if (t.autoUnfold.strategy === "ScreenPostion") {
|
|
727
|
+
const s = this.computeTagProject();
|
|
728
|
+
if (s && S(s.x, t.autoUnfold.autoUnfoldProjectX) === !1)
|
|
697
729
|
return !1;
|
|
698
730
|
}
|
|
699
|
-
if (
|
|
731
|
+
if (t.autoUnfold.strategy === "MinimumDistance") {
|
|
700
732
|
const l = this.plugin.filterPointTag.filter((n) => n.currentVisible).filter((n) => {
|
|
701
733
|
const f = this.computeTagProject();
|
|
702
734
|
if (!f)
|
|
703
735
|
return !1;
|
|
704
|
-
const { x:
|
|
705
|
-
return !(Math.abs(d) > 1 || Math.abs(
|
|
736
|
+
const { x: m, y: p, z: d } = f;
|
|
737
|
+
return !(Math.abs(d) > 1 || Math.abs(m) > 1 || Math.abs(p) > 1);
|
|
706
738
|
}).map((n) => ({ tag: n, id: n.id, tagConfig: n.getConfig().unfoldedConfig })).filter(({ tagConfig: n }) => {
|
|
707
|
-
var f,
|
|
708
|
-
return !(typeof n == "function" || n.keep || n.autoUnfold === !1 || ((f = n.autoUnfold) == null ? void 0 : f.enable) === !1 || ((
|
|
709
|
-
}).map((n) =>
|
|
710
|
-
const
|
|
711
|
-
return !(
|
|
739
|
+
var f, m;
|
|
740
|
+
return !(typeof n == "function" || n.keep || n.autoUnfold === !1 || ((f = n.autoUnfold) == null ? void 0 : f.enable) === !1 || ((m = n.autoUnfold) == null ? void 0 : m.strategy) !== "MinimumDistance");
|
|
741
|
+
}).map((n) => j(y({}, n), { distance: n.tag.getDistance() })).filter(({ distance: n, tagConfig: f }) => {
|
|
742
|
+
const m = f.autoUnfold.distance;
|
|
743
|
+
return !(m && S(n, m) === !1);
|
|
712
744
|
}).sort((n, f) => n.distance - f.distance).findIndex((n) => n.id === this.id);
|
|
713
|
-
if (l === -1 || l <= ((e =
|
|
745
|
+
if (l === -1 || l <= ((e = t.autoUnfold.maxNumber) != null ? e : 1) - 1 === !1)
|
|
714
746
|
return !1;
|
|
715
747
|
}
|
|
716
|
-
if (
|
|
748
|
+
if (t.autoUnfold.strategy === "FoldWhenMove")
|
|
717
749
|
return !1;
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
const l = new
|
|
722
|
-
l.setFromProjectionMatrix(
|
|
723
|
-
const r = this.five.camera.getWorldDirection(new
|
|
750
|
+
if (t.autoUnfold.strategy === "ScreenCenter") {
|
|
751
|
+
const s = this.plugin.filterPointTag, o = new k.Matrix4();
|
|
752
|
+
o.multiplyMatrices(this.five.camera.projectionMatrix, this.five.camera.matrixWorldInverse);
|
|
753
|
+
const l = new k.Frustum();
|
|
754
|
+
l.setFromProjectionMatrix(o);
|
|
755
|
+
const r = this.five.camera.getWorldDirection(new k.Vector3()), f = s.filter((p) => {
|
|
724
756
|
var v, b;
|
|
725
|
-
if (!
|
|
757
|
+
if (!p.currentVisible)
|
|
726
758
|
return !1;
|
|
727
|
-
const d =
|
|
728
|
-
if (
|
|
759
|
+
const d = p.getConfig().unfoldedConfig;
|
|
760
|
+
if (p.manuallyOperated || typeof d != "object" || (d == null ? void 0 : d.autoUnfold) === !1 || ((v = d == null ? void 0 : d.autoUnfold) == null ? void 0 : v.strategy) !== "ScreenCenter" || d.keep || ((b = d.autoUnfold) == null ? void 0 : b.enable) === !1 || !l.containsPoint(new k.Vector3().fromArray(p.position)))
|
|
729
761
|
return !1;
|
|
730
762
|
const u = d.autoUnfold.distance;
|
|
731
763
|
if (u) {
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
764
|
+
const h = p.getDistance();
|
|
765
|
+
if (S(h, u) === !1)
|
|
734
766
|
return !1;
|
|
735
767
|
}
|
|
736
768
|
return !0;
|
|
737
|
-
}).sort((
|
|
738
|
-
const c = new
|
|
769
|
+
}).sort((p, d) => {
|
|
770
|
+
const c = new k.Vector3().fromArray(p.position), u = new k.Vector3().fromArray(d.position);
|
|
739
771
|
return r.angleTo(c.sub(this.five.camera.position)) - r.angleTo(u.sub(this.five.camera.position));
|
|
740
|
-
}).findIndex((
|
|
741
|
-
if (f === -1 || f <= ((
|
|
772
|
+
}).findIndex((p) => p.id === this.id);
|
|
773
|
+
if (f === -1 || f <= ((i = t.autoUnfold.maxNumber) != null ? i : 1) - 1 === !1)
|
|
742
774
|
return !1;
|
|
743
775
|
}
|
|
744
776
|
return !0;
|
|
745
777
|
}
|
|
746
778
|
}
|
|
747
779
|
computeTagProject() {
|
|
748
|
-
const
|
|
749
|
-
if (!
|
|
780
|
+
const t = this.centerPosition;
|
|
781
|
+
if (!t)
|
|
750
782
|
return;
|
|
751
|
-
const { x: e, y:
|
|
752
|
-
if (!(
|
|
753
|
-
return { x: e, y:
|
|
783
|
+
const { x: e, y: i, z: s } = t.project(this.five.camera);
|
|
784
|
+
if (!(s > 1))
|
|
785
|
+
return { x: e, y: i, z: s };
|
|
754
786
|
}
|
|
755
|
-
addObjectClickHandler(
|
|
787
|
+
addObjectClickHandler(t, e, i) {
|
|
756
788
|
if (!e || !this.plugin.domEvents)
|
|
757
789
|
return () => {
|
|
758
790
|
};
|
|
759
|
-
const
|
|
760
|
-
if (!
|
|
791
|
+
const s = () => !(!t.currentVisible || t.loading), o = (l) => {
|
|
792
|
+
if (!s())
|
|
761
793
|
return !1;
|
|
762
|
-
|
|
794
|
+
i(l.origDomEvent);
|
|
763
795
|
};
|
|
764
|
-
return this.plugin.domEvents.addEventListener(e, "click",
|
|
796
|
+
return this.plugin.domEvents.addEventListener(e, "click", o), () => {
|
|
765
797
|
var l;
|
|
766
|
-
(l = this.plugin.domEvents) == null || l.removeEventListener(e, "click",
|
|
798
|
+
(l = this.plugin.domEvents) == null || l.removeEventListener(e, "click", o);
|
|
767
799
|
};
|
|
768
800
|
}
|
|
769
801
|
whyHide() {
|
|
@@ -774,38 +806,38 @@ class Ji {
|
|
|
774
806
|
return { reason: `plugin.state.visible is ${this.plugin.state.visible}` };
|
|
775
807
|
if (!this.enabled)
|
|
776
808
|
return { reason: `tag ${this.id} enabled is: ${this.enabled}` };
|
|
777
|
-
const
|
|
809
|
+
const t = j(y({}, this.computeVisible()), {
|
|
778
810
|
tagInstance: this
|
|
779
811
|
});
|
|
780
|
-
return
|
|
812
|
+
return t.value !== this.state.visible ? { reason: "插件故障,请联系维护人员, err: 0", info: t } : this.state.visible ? { reason: "应该是能看见才对", info: t } : t.value === !0 ? { reason: "插件故障,请联系维护人员, err: 1", info: t } : { reason: (e = t.reason.type) != null ? e : t.reason, info: t };
|
|
781
813
|
}
|
|
782
814
|
/**
|
|
783
815
|
* @description 销毁并移除
|
|
784
816
|
*/
|
|
785
817
|
destroy() {
|
|
786
|
-
var e,
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
818
|
+
var e, i, s, o;
|
|
819
|
+
const t = this.plugin.tags.findIndex((l) => l.id === this.id);
|
|
820
|
+
if (t === -1) {
|
|
789
821
|
console.warn(`Destroy failed: tag ${this.id} not found`);
|
|
790
822
|
return;
|
|
791
823
|
}
|
|
792
|
-
this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((
|
|
824
|
+
this._currentBlinkInstance && !this._currentBlinkInstance.completed && ((i = (e = this._currentBlinkInstance).preComplete) == null || i.call(e), this._currentBlinkInstance = void 0), this.disable(), (o = (s = this.tag3DContentSvelte) == null ? void 0 : s.dispose) == null || o.call(s), this.hooks.off(), this.cache.clear(), this.plugin.tags.splice(t, 1), this.plugin.tagsLengthWillUpdate = !0, this.plugin.hooks.emit("tagsLengthChange");
|
|
793
825
|
}
|
|
794
826
|
/**
|
|
795
827
|
* @description 判断 popover 是否在配置上启用(永久配置)
|
|
796
828
|
*/
|
|
797
829
|
isPopoverConfigEnabled() {
|
|
798
|
-
var
|
|
799
|
-
return ((e = (
|
|
830
|
+
var t, e;
|
|
831
|
+
return ((e = (t = this.currentConfig) == null ? void 0 : t.popoverConfig) == null ? void 0 : e.enabled) === !0;
|
|
800
832
|
}
|
|
801
833
|
/**
|
|
802
834
|
* @description 判断当前标签是否允许临时 hover 弹出 popover(临时控制)
|
|
803
835
|
*/
|
|
804
836
|
isHoverEnabled() {
|
|
805
|
-
var
|
|
806
|
-
return !(((
|
|
837
|
+
var t;
|
|
838
|
+
return !(((t = this.plugin) == null ? void 0 : t.globalHoverEnabled) === !1 || this.hoverEnabled === !1);
|
|
807
839
|
}
|
|
808
840
|
}
|
|
809
841
|
export {
|
|
810
|
-
|
|
842
|
+
Ht as BaseTag
|
|
811
843
|
};
|