@realsee/dnalogel 3.45.0 → 3.46.0
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 +3 -0
- package/dist/Sculpt/Meshes/Line.d.ts +6 -1
- package/dist/index.cjs.js +53 -53
- package/dist/index.js +29609 -29576
- package/dist/index.umd.js +49 -49
- package/dist/shared-utils/tag.d.ts +6 -3
- package/libs/AreaMakerPlugin/Controller.js +150 -78
- package/libs/AreaMakerPlugin/index.js +76 -4
- package/libs/AreaMakerPlugin/utils/Item.js +190 -111
- package/libs/CSS3DRenderPlugin/Controller.js +89 -29
- package/libs/CSS3DRenderPlugin/index.js +75 -15
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +132 -58
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +181 -116
- package/libs/CruisePlugin/BaseController.js +121 -49
- package/libs/CruisePlugin/Move.js +73 -21
- package/libs/CruisePlugin/Work.js +98 -46
- package/libs/CruisePlugin/index.js +79 -27
- package/libs/CurrentPanoImagePlugin/Controller.js +176 -104
- package/libs/CurrentPanoImagePlugin/index.js +76 -4
- package/libs/GuideLinePlugin/Controller.js +82 -30
- package/libs/GuideLinePlugin/GuideLineItem.js +82 -30
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +81 -29
- package/libs/GuideLinePlugin/index.js +79 -27
- package/libs/ModelMakerPlugin/Controller.js +139 -82
- package/libs/ModelMakerPlugin/index.js +75 -18
- package/libs/ModelTVVideoPlugin/Plugin.js +117 -57
- package/libs/ModelTVVideoPlugin/index.js +68 -8
- package/libs/Object3DHelperPlugin/Controller.js +54 -31
- package/libs/Object3DHelperPlugin/index.js +35 -13
- package/libs/PanoCompassPlugin/Controller.js +97 -42
- package/libs/PanoCompassPlugin/index.js +71 -16
- package/libs/PanoDoorLabelPlugin/BaseController.js +98 -26
- package/libs/PanoDoorLabelPlugin/Controller.js +187 -115
- package/libs/PanoDoorLabelPlugin/index.js +76 -4
- package/libs/PanoMeasurePlugin/Components/Controller0.js +140 -88
- package/libs/PanoMeasurePlugin/Components/Controller1.js +178 -126
- package/libs/PanoMeasurePlugin/Controller/EditController.js +124 -72
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +167 -92
- package/libs/PanoMeasurePlugin/Controller/index.js +109 -64
- package/libs/PanoMeasurePlugin/Model/area.js +114 -38
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +78 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +97 -45
- package/libs/PanoMeasurePlugin/index.js +76 -31
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +98 -20
- package/libs/PanoSpatialTagPlugin/Plugin.js +210 -150
- package/libs/PanoSpatialTagPlugin/index.js +66 -6
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +133 -53
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +295 -216
- package/libs/PanoTagPlugin/Components/Tag/index.js +257 -187
- package/libs/PanoTagPlugin/Components/TagContainer.js +157 -87
- package/libs/PanoTagPlugin/Components/TagItem.js +144 -74
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +73 -3
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +109 -39
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +105 -35
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +113 -43
- package/libs/PanoTagPlugin/controller/TagRender.js +132 -80
- package/libs/PanoTagPlugin/controller/TagUtil.js +136 -84
- package/libs/PanoTagPlugin/controller/index.js +113 -61
- package/libs/PanoTagPlugin/index.js +89 -37
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +121 -41
- package/libs/PanoVideoPlugin/Controller.js +137 -65
- package/libs/PanoVideoPlugin/VideoMeshController.js +149 -69
- package/libs/PanoVideoPlugin/index.js +82 -10
- package/libs/PipelinePlugin/Controller.js +199 -128
- package/libs/PipelinePlugin/index.js +76 -5
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +102 -22
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +95 -15
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +136 -56
- package/libs/Sculpt/Meshes/Box.js +6 -5
- package/libs/Sculpt/Meshes/Cylinder.js +7 -6
- package/libs/Sculpt/Meshes/Line.d.ts +6 -1
- package/libs/Sculpt/Meshes/Line.js +76 -56
- package/libs/Sculpt/Meshes/Point.js +6 -5
- package/libs/Sculpt/Meshes/Polyline.js +5 -4
- package/libs/Sculpt/Meshes/Rectangle.js +3 -2
- package/libs/Sculpt/Objects/Line/Editor.js +11 -10
- package/libs/Sculpt/utils/three/ColoredMesh.js +14 -13
- package/libs/base/BasePlugin.js +14 -13
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +128 -59
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +75 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +129 -59
- package/libs/floorplan/ModelFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +158 -86
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +76 -4
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +151 -81
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +67 -67
- package/libs/shared-utils/five/index.js +3 -2
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +6 -3
- package/libs/shared-utils/tag.js +38 -24
- package/libs/shared-utils/three/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var b = (
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
2
|
+
var b = (a, i, t) => i in a ? f(a, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[i] = t;
|
|
3
|
+
var e = (a, i, t) => (b(a, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
|
+
import * as r from "three";
|
|
5
5
|
import "hammerjs";
|
|
6
6
|
import { Subscribe as k } from "../../shared-utils/Subscribe.js";
|
|
7
7
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
8
8
|
import "@realsee/five/line";
|
|
9
|
+
import "../../Sculpt/utils/Modules/Global.js";
|
|
9
10
|
import { Object3D as y } from "../../shared-utils/three/core/Object3D.js";
|
|
10
11
|
import { LineSegments as T } from "../../shared-utils/three/objects/LineSegments.js";
|
|
11
12
|
import "../../shared-utils/three/THREESphere.js";
|
|
@@ -14,80 +15,158 @@ import { BetterTween as C } from "../../shared-utils/animationFrame/BetterTween.
|
|
|
14
15
|
import { LabelItem as O } from "../../components/AreaLabel/LabelItem.js";
|
|
15
16
|
import { getCenterPointOfPoints as v } from "../../shared-utils/math/planimetry.js";
|
|
16
17
|
import { resizeObserver as M } from "../../shared-utils/dom/resizeObserver.js";
|
|
18
|
+
import "../../Sculpt/utils/Modules/Cursor.js";
|
|
19
|
+
import "../../Object3DHelperPlugin/Controller.js";
|
|
20
|
+
import "../../base/BasePlugin.js";
|
|
21
|
+
import "../../shared-utils/Utils/FiveUtil.js";
|
|
22
|
+
import "../../shared-utils/Utils/BaseUtil.js";
|
|
23
|
+
import "../../shared-utils/Utils/WorkUtil.js";
|
|
24
|
+
import "../../shared-utils/five/transformPosition.js";
|
|
25
|
+
import "../../shared-utils/five/getFiveModel.js";
|
|
26
|
+
import "../../shared-utils/url/absoluteUrl.js";
|
|
17
27
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
28
|
+
import "../../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
29
|
+
import "../../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
30
|
+
import "../../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
31
|
+
import "../../shared-utils/three/IObject3D.js";
|
|
32
|
+
import "../../shared-utils/three/boundingBox.js";
|
|
33
|
+
import "../../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
34
|
+
import "../../shared-utils/Object3DHelper/utils/direction.js";
|
|
35
|
+
import "../../shared-utils/Object3DHelper/Constants/color.js";
|
|
36
|
+
import "../../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
37
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
38
|
+
import "../../shared-utils/positionToVector3.js";
|
|
39
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
40
|
+
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
41
|
+
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
42
|
+
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
43
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
44
|
+
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
45
|
+
import "../../shared-utils/three/centerPoint.js";
|
|
46
|
+
import "../../shared-utils/three/getObjectVisible.js";
|
|
47
|
+
import "../../shared-utils/isNil.js";
|
|
48
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
49
|
+
import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
50
|
+
import "../../shared-utils/util.js";
|
|
51
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
52
|
+
import "../../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
53
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
54
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
55
|
+
import "../../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
56
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
57
|
+
import "../../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
58
|
+
import "../../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
59
|
+
import "../../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
60
|
+
import "../../shared-utils/threex/domevents/index.js";
|
|
61
|
+
import "../../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
62
|
+
import "../../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
63
|
+
import "../../Sculpt/utils/three/rayOnLine.js";
|
|
64
|
+
import "../../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
65
|
+
import "../../shared-utils/Object3DHelper/index.js";
|
|
66
|
+
import "../../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
67
|
+
import "../../shared-utils/math/rad2Deg.js";
|
|
68
|
+
import "../../shared-utils/math/deg2Rad.js";
|
|
69
|
+
import "../../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
70
|
+
import "../../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
71
|
+
import "../../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
72
|
+
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
73
|
+
import "../../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
74
|
+
import "../../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
75
|
+
import "../../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
76
|
+
import "../../shared-utils/five/fiveModelLoad.js";
|
|
77
|
+
import "../../shared-utils/five/FiveDomEvents.js";
|
|
78
|
+
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
79
|
+
import "../../shared-utils/three/THREERaycaster.js";
|
|
80
|
+
import "../../shared-utils/three/PointSelector/index.js";
|
|
81
|
+
import "../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
82
|
+
import "../../shared-utils/three/Magnifier.js";
|
|
83
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
84
|
+
import "../../shared-utils/three/Assets/index.js";
|
|
85
|
+
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
86
|
+
import "../../shared-utils/five/initialCSS3DRender.js";
|
|
87
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
88
|
+
import "../../Sculpt/Meshes/Line.js";
|
|
89
|
+
import "../../Sculpt/typings/style.js";
|
|
90
|
+
import "../../shared-utils/five/FiveLine.js";
|
|
91
|
+
import "../../shared-utils/tag.js";
|
|
92
|
+
import "../../shared-utils/five/vector3ToScreen.js";
|
|
93
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
94
|
+
import "../../shared-utils/isTouchDevice.js";
|
|
95
|
+
import "../../shared-utils/five/getPosition.js";
|
|
96
|
+
import "../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
18
97
|
import "../../shared-utils/animationFrame/index.js";
|
|
19
98
|
import "../../vendor/svelte/internal/index.js";
|
|
20
99
|
import "../../components/AreaLabel/Assets/roomLabelBg.js";
|
|
21
100
|
class V extends y {
|
|
22
101
|
constructor(t) {
|
|
23
102
|
super();
|
|
24
|
-
|
|
103
|
+
e(this, "areaMakerItem");
|
|
25
104
|
this.areaMakerItem = t;
|
|
26
105
|
}
|
|
27
|
-
raycast(t,
|
|
28
|
-
this.areaMakerItem.makerObject.raycast(t,
|
|
106
|
+
raycast(t, o) {
|
|
107
|
+
this.areaMakerItem.makerObject.raycast(t, o);
|
|
29
108
|
}
|
|
30
109
|
}
|
|
31
|
-
class
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
110
|
+
class di {
|
|
111
|
+
constructor(i, t) {
|
|
112
|
+
e(this, "id");
|
|
34
113
|
/** 标注名称 */
|
|
35
|
-
|
|
114
|
+
e(this, "name", "");
|
|
36
115
|
/** 标注几何体 */
|
|
37
|
-
|
|
116
|
+
e(this, "makerObject");
|
|
38
117
|
/** 标注几何体的边框 */
|
|
39
|
-
|
|
118
|
+
e(this, "outline");
|
|
40
119
|
/** 标注底面 Y 坐标 */
|
|
41
|
-
|
|
120
|
+
e(this, "bottomY");
|
|
42
121
|
/** 标注透明度 */
|
|
43
|
-
|
|
122
|
+
e(this, "opacity");
|
|
44
123
|
/** 标注高度 */
|
|
45
|
-
|
|
124
|
+
e(this, "height");
|
|
46
125
|
/** 标注所在楼层 */
|
|
47
|
-
|
|
126
|
+
e(this, "floorIndex");
|
|
48
127
|
/** 标注底面形状 */
|
|
49
|
-
|
|
128
|
+
e(this, "shape");
|
|
50
129
|
/** 是否被挂载 */
|
|
51
|
-
|
|
130
|
+
e(this, "mounted", !1);
|
|
52
131
|
/** 查询问题使用的调试对象 */
|
|
53
|
-
|
|
132
|
+
e(this, "checkMsg", {
|
|
54
133
|
/** 当标注没有展示时,可以通过这个字段查看原因 */
|
|
55
134
|
checkVisibleMsg: "",
|
|
56
135
|
/** 当标注标签没有展示时,可以通过这个字段查看原因 */
|
|
57
136
|
checkTagVisibleMsg: ""
|
|
58
137
|
});
|
|
59
138
|
/** 模型容器 */
|
|
60
|
-
|
|
139
|
+
e(this, "modelGroup");
|
|
61
140
|
/** 标注是否可见 */
|
|
62
|
-
|
|
141
|
+
e(this, "visible", !0);
|
|
63
142
|
// ==================== 标签相关 ====================
|
|
64
143
|
/** 标注标签实例 */
|
|
65
|
-
|
|
144
|
+
e(this, "tagApp");
|
|
66
145
|
/** 标注标签是否可见 */
|
|
67
|
-
|
|
146
|
+
e(this, "tagVisible", null);
|
|
68
147
|
/** 标注标签的世界坐标 */
|
|
69
|
-
|
|
148
|
+
e(this, "tagPosition", new r.Vector3());
|
|
70
149
|
/** 标注标签的 NDC 坐标 */
|
|
71
|
-
|
|
150
|
+
e(this, "tagNDCPosition", new r.Vector3());
|
|
72
151
|
/** 标注标签的 transform */
|
|
73
|
-
|
|
152
|
+
e(this, "tagTransform", { left: 0, top: 0 });
|
|
74
153
|
/** 标注标签的显示层级 */
|
|
75
|
-
|
|
154
|
+
e(this, "tagZIndex", 0);
|
|
76
155
|
/** 标注实例的事件处理器 */
|
|
77
|
-
|
|
156
|
+
e(this, "hooks", new k());
|
|
78
157
|
/** 自定义 Dom */
|
|
79
|
-
|
|
158
|
+
e(this, "itemRenderer");
|
|
80
159
|
/** 数据 */
|
|
81
|
-
|
|
160
|
+
e(this, "data");
|
|
82
161
|
/** Plugin 实例 */
|
|
83
|
-
|
|
162
|
+
e(this, "plugin");
|
|
84
163
|
/** 标注透明度动画 */
|
|
85
|
-
|
|
164
|
+
e(this, "opacityAnime");
|
|
86
165
|
/** 是否在容器 resize 动画中 */
|
|
87
|
-
|
|
166
|
+
e(this, "isInContainerResizeAnimation", !1);
|
|
88
167
|
/** 监听容器 resize 的计时器 id,用于判断 resize 过程是否结束 */
|
|
89
|
-
|
|
90
|
-
|
|
168
|
+
e(this, "containerResizeTimeoutID", null);
|
|
169
|
+
e(this, "resizeObserver");
|
|
91
170
|
/** 显示标注 */
|
|
92
171
|
// public show() {
|
|
93
172
|
// return this.doOpacityAnime({
|
|
@@ -107,111 +186,111 @@ class Y {
|
|
|
107
186
|
// })
|
|
108
187
|
// }
|
|
109
188
|
/** 透明度动画 */
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
(
|
|
113
|
-
const t =
|
|
189
|
+
e(this, "doOpacityAnime", (i) => {
|
|
190
|
+
var m;
|
|
191
|
+
(m = this.opacityAnime) == null || m.dispose();
|
|
192
|
+
const t = i.duration, [o, s] = i.makerObjectOpacity, [n, p] = i.outlineOpacity;
|
|
114
193
|
if (t === 0) {
|
|
115
|
-
this.makerObject.material.opacity =
|
|
194
|
+
this.makerObject.material.opacity = s, this.outline.material.opacity = p;
|
|
116
195
|
return;
|
|
117
196
|
}
|
|
118
|
-
return new Promise((
|
|
119
|
-
this.opacityAnime = new C({ makerObjectOpacity:
|
|
120
|
-
makerObjectOpacity:
|
|
121
|
-
outlineOpacity:
|
|
122
|
-
}).onUpdate(({ makerObjectOpacity:
|
|
123
|
-
this.makerObject.material.opacity =
|
|
124
|
-
}).onComplete(() =>
|
|
125
|
-
this.makerObject.material.opacity =
|
|
197
|
+
return new Promise((h) => {
|
|
198
|
+
this.opacityAnime = new C({ makerObjectOpacity: o, outlineOpacity: n }).to({
|
|
199
|
+
makerObjectOpacity: s,
|
|
200
|
+
outlineOpacity: p
|
|
201
|
+
}).onUpdate(({ makerObjectOpacity: l, outlineOpacity: c }) => {
|
|
202
|
+
this.makerObject.material.opacity = l, this.outline.material.opacity = c, this.plugin.five.needsRender = !0;
|
|
203
|
+
}).onComplete(() => h(!0)).onDispose(() => {
|
|
204
|
+
this.makerObject.material.opacity = s, this.outline.material.opacity = p, this.plugin.five.needsRender = !0, h(!1);
|
|
126
205
|
}).play();
|
|
127
206
|
});
|
|
128
207
|
});
|
|
129
208
|
/** 插件 Config 变化时更新自身 depthTest */
|
|
130
|
-
|
|
131
|
-
this.makerObject.material.depthTest =
|
|
209
|
+
e(this, "onPluginConfigChange", (i) => {
|
|
210
|
+
this.makerObject.material.depthTest = i.config.modelDepthTest, this.outline.material.depthTest = i.config.modelDepthTest, this.plugin.five.needsRender = !0;
|
|
132
211
|
});
|
|
133
212
|
/** 插件整体可见性变化时,需要更新自身可见性 */
|
|
134
|
-
|
|
213
|
+
e(this, "onPluginStateChange", () => {
|
|
135
214
|
this.updateVisible(), this.updateTagVisible();
|
|
136
215
|
});
|
|
137
216
|
/** 更新标注可见性 */
|
|
138
|
-
|
|
139
|
-
var
|
|
140
|
-
const { result:
|
|
141
|
-
if (this.checkMsg.checkVisibleMsg = t, this.visible ===
|
|
217
|
+
e(this, "updateVisible", () => {
|
|
218
|
+
var s;
|
|
219
|
+
const { result: i, msg: t } = this.checkVisible();
|
|
220
|
+
if (this.checkMsg.checkVisibleMsg = t, this.visible === i)
|
|
142
221
|
return;
|
|
143
|
-
this.visible =
|
|
144
|
-
const
|
|
145
|
-
this.modelGroup.visible =
|
|
222
|
+
this.visible = i;
|
|
223
|
+
const o = (s = this.data.object_data.visible) != null ? s : !0;
|
|
224
|
+
this.modelGroup.visible = i && o, this.plugin.five.needsRender = !0;
|
|
146
225
|
});
|
|
147
226
|
/** 检测标注是否可见 */
|
|
148
|
-
|
|
227
|
+
e(this, "checkVisible", () => {
|
|
149
228
|
if (!this.plugin.state.visible)
|
|
150
229
|
return { result: !1, msg: "插件不可见" };
|
|
151
230
|
const t = this.plugin.fiveUtil.model.shownFloor;
|
|
152
231
|
return t === null || t === this.floorIndex ? { result: !0, msg: "" } : { result: !1, msg: `模型高亮楼层不符合展示条件, 当前高亮楼层为:${t}` };
|
|
153
232
|
});
|
|
154
233
|
/** 更新标注标签 */
|
|
155
|
-
|
|
234
|
+
e(this, "updateTag", () => {
|
|
156
235
|
this.tagApp && (this.updateTagNDCPosition(), this.updateTagDomTransform(), this.updateTagVisible());
|
|
157
236
|
});
|
|
158
237
|
/** 更新标注标签的 NDC Position */
|
|
159
|
-
|
|
238
|
+
e(this, "updateTagNDCPosition", () => {
|
|
160
239
|
const t = this.tagPosition.clone().project(this.plugin.five.camera);
|
|
161
240
|
this.tagNDCPosition.copy(t);
|
|
162
241
|
});
|
|
163
242
|
/** 更新标注标签的 transform */
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
const
|
|
167
|
-
this.tagTransform.left === t && this.tagTransform.top ===
|
|
243
|
+
e(this, "updateTagDomTransform", () => {
|
|
244
|
+
var s;
|
|
245
|
+
const i = this.tagNDCPosition, t = Math.round((i.x + 1) / 2 * this.plugin.tagDomContainer.clientWidth), o = Math.round((-i.y + 1) / 2 * this.plugin.tagDomContainer.clientHeight);
|
|
246
|
+
this.tagTransform.left === t && this.tagTransform.top === o || (this.tagTransform = { left: t, top: o }, (s = this.tagApp) == null || s.$set({ transform: `translate(${t}px, ${o}px)` }));
|
|
168
247
|
});
|
|
169
248
|
/** 更新标注标签可见性 */
|
|
170
|
-
|
|
171
|
-
var
|
|
172
|
-
const { result:
|
|
173
|
-
this.checkMsg.checkTagVisibleMsg = t, this.tagVisible !==
|
|
249
|
+
e(this, "updateTagVisible", () => {
|
|
250
|
+
var o;
|
|
251
|
+
const { result: i, msg: t } = this.checkTagVisible();
|
|
252
|
+
this.checkMsg.checkTagVisibleMsg = t, this.tagVisible !== i && (this.tagVisible = i, this.tagApp && (this.tagVisible ? this.hooks.emit("tagShow") : this.hooks.emit("tagHide"), (o = this.tagApp) == null || o.$set({ visible: i })));
|
|
174
253
|
});
|
|
175
254
|
/** 检测标注标签是否可见 */
|
|
176
|
-
|
|
255
|
+
e(this, "checkTagVisible", () => {
|
|
177
256
|
if (!this.visible)
|
|
178
257
|
return { result: !1, msg: "标注整体不可见" };
|
|
179
258
|
if (this.isInContainerResizeAnimation)
|
|
180
259
|
return { result: !1, msg: "处于容器 resize 动画中" };
|
|
181
|
-
const t = this.plugin.five,
|
|
182
|
-
|
|
183
|
-
const [
|
|
184
|
-
if (
|
|
260
|
+
const t = this.plugin.five, o = new r.Raycaster(), s = t.camera.position.clone();
|
|
261
|
+
o.set(s.clone(), this.tagPosition.clone().sub(s).normalize());
|
|
262
|
+
const [n] = this.plugin.fiveUtil.model.intersectRaycaster(o), p = this.tagPosition.distanceTo(t.camera.position);
|
|
263
|
+
if (n && n.distance + 0.1 < p)
|
|
185
264
|
return { result: !1, msg: "标注标签被 Five 模型遮挡" };
|
|
186
|
-
const
|
|
187
|
-
return Math.abs(
|
|
265
|
+
const m = this.tagNDCPosition;
|
|
266
|
+
return Math.abs(m.x) > 1.2 || Math.abs(m.y) > 1.2 || Math.abs(m.z) > 1 ? { result: !1, msg: "标注标签不在屏幕内" } : { result: !0, msg: "" };
|
|
188
267
|
});
|
|
189
268
|
/** 相机位姿发生变化时,更新标签 */
|
|
190
|
-
|
|
269
|
+
e(this, "onFiveCameraUpdate", () => {
|
|
191
270
|
this.tagApp && this.visible && (this.updateTagNDCPosition(), this.updateTagDomTransform(), this.updateTagVisible());
|
|
192
271
|
});
|
|
193
272
|
/** tag container DOM 发生 resize */
|
|
194
|
-
|
|
273
|
+
e(this, "onContainerResize", () => {
|
|
195
274
|
this.isInContainerResizeAnimation === !1 && (this.isInContainerResizeAnimation = !0, this.updateTag());
|
|
196
275
|
const t = () => {
|
|
197
276
|
this.isInContainerResizeAnimation = !1, this.containerResizeTimeoutID = null, this.updateTag();
|
|
198
277
|
};
|
|
199
278
|
this.containerResizeTimeoutID && clearTimeout(this.containerResizeTimeoutID), this.containerResizeTimeoutID = setTimeout(t, 100);
|
|
200
279
|
});
|
|
201
|
-
var
|
|
202
|
-
const
|
|
203
|
-
this.data = t, this.id = t.id, this.name = (
|
|
204
|
-
new
|
|
205
|
-
new
|
|
206
|
-
), u(this.outline,
|
|
280
|
+
var h, l, c, g;
|
|
281
|
+
const o = t.object_data, s = o.bottom_y, n = o.height, p = new r.Color((h = o.color) != null ? h : "#FFFFFF"), m = (l = o.opacity) != null ? l : 0.4;
|
|
282
|
+
this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = i, this.height = n, this.bottomY = s, this.opacity = m, this.shape = new r.Shape().fromJSON(o.shape), this.floorIndex = t.floor_index, this.makerObject = new r.Mesh(d(this.shape, n), P(p, m)), u(this.makerObject, s), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new T(
|
|
283
|
+
new r.EdgesGeometry(this.makerObject.geometry),
|
|
284
|
+
new r.LineBasicMaterial({ color: p, transparent: !0 })
|
|
285
|
+
), u(this.outline, s), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(n), this.modelGroup = new V(this), this.modelGroup.visible = (g = o.visible) != null ? g : !0;
|
|
207
286
|
}
|
|
208
287
|
/** 挂载标注 */
|
|
209
288
|
mount() {
|
|
210
289
|
if (this.mounted)
|
|
211
290
|
return;
|
|
212
291
|
this.mounted = !0, this.updateVisible(), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.modelGroup.add(this.makerObject, this.outline);
|
|
213
|
-
const
|
|
214
|
-
|
|
292
|
+
const i = !!this.name, t = this.plugin.tagDomContainer;
|
|
293
|
+
i && (this.tagApp = new O({
|
|
215
294
|
target: t,
|
|
216
295
|
props: {
|
|
217
296
|
rendererData: this.data,
|
|
@@ -219,39 +298,39 @@ class Y {
|
|
|
219
298
|
visible: this.tagVisible,
|
|
220
299
|
rendererIfNeed: this.itemRenderer,
|
|
221
300
|
transform: `translate(${this.tagTransform.left}px, ${this.tagTransform.top}px)`,
|
|
222
|
-
onClick: (
|
|
301
|
+
onClick: (o) => this.hooks.emit("tagClick", { target: this, nativeEvent: o })
|
|
223
302
|
}
|
|
224
303
|
}), this.updateTag()), this.plugin.five.needsRender = !0, this.plugin.hooks.on("stateChange", this.onPluginStateChange), this.plugin.hooks.on("configChange", this.onPluginConfigChange), this.plugin.five.on("modeChange", this.updateVisible), this.plugin.five.on("modelShownFloorChange", this.updateVisible), this.plugin.five.on("cameraUpdate", this.onFiveCameraUpdate), this.resizeObserver = M(this.onContainerResize, t), this.resizeObserver.observe();
|
|
225
304
|
}
|
|
226
305
|
/** 卸载标注 */
|
|
227
306
|
unmount() {
|
|
228
|
-
var
|
|
229
|
-
this.mounted && (this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (
|
|
307
|
+
var i, t;
|
|
308
|
+
this.mounted && (this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (i = this.tagApp) == null || i.$destroy(), this.tagApp = null, this.plugin.hooks.off("stateChange", this.onPluginStateChange), this.plugin.hooks.off("configChange", this.onPluginConfigChange), this.plugin.five.off("modeChange", this.updateVisible), this.plugin.five.off("modelShownFloorChange", this.updateVisible), this.plugin.five.off("cameraUpdate", this.onFiveCameraUpdate), (t = this.resizeObserver) == null || t.unobserve());
|
|
230
309
|
}
|
|
231
310
|
/** 更改标注透明度
|
|
232
311
|
* @param opacity 标注透明度,范围:0-1
|
|
233
312
|
*/
|
|
234
|
-
setOpacity(
|
|
313
|
+
setOpacity(i) {
|
|
235
314
|
var t;
|
|
236
|
-
this.opacity =
|
|
315
|
+
this.opacity = i, (t = this.opacityAnime) == null || t.dispose(), this.makerObject.material.opacity = i, this.plugin.five.needsRender = !0;
|
|
237
316
|
}
|
|
238
317
|
/** 更改标注颜色
|
|
239
318
|
* @param color 标注颜色,支持 hex
|
|
240
319
|
* @example setColor('#FF0000')
|
|
241
320
|
*/
|
|
242
|
-
setColor(
|
|
243
|
-
const t = new
|
|
321
|
+
setColor(i) {
|
|
322
|
+
const t = new r.Color(i);
|
|
244
323
|
this.makerObject.material.color = t, this.outline.material.color = t, this.plugin.five.needsRender = !0;
|
|
245
324
|
}
|
|
246
325
|
/** 更改标注高度
|
|
247
326
|
* @param height 标注高度,单位:米
|
|
248
327
|
*/
|
|
249
|
-
setHeight(
|
|
250
|
-
if (
|
|
328
|
+
setHeight(i) {
|
|
329
|
+
if (i <= 0)
|
|
251
330
|
throw new Error("高度必须大于 0");
|
|
252
|
-
this.height =
|
|
253
|
-
const t = this.shape.extractPoints(10).shape.slice(0, -1),
|
|
254
|
-
u(
|
|
331
|
+
this.height = i, this.makerObject.geometry = d(this.shape, i), this.outline.geometry = new r.EdgesGeometry(this.makerObject.geometry);
|
|
332
|
+
const t = this.shape.extractPoints(10).shape.slice(0, -1), o = v(t), s = new r.Vector3(o.x, o.y, i);
|
|
333
|
+
u(s, this.bottomY), this.tagPosition.copy(s), this.updateTag(), this.plugin.five.needsRender = !0;
|
|
255
334
|
}
|
|
256
335
|
/** 更改标注标签的显示层级
|
|
257
336
|
* @description 为什么需要这个方法
|
|
@@ -261,28 +340,28 @@ class Y {
|
|
|
261
340
|
* - 标签 A <- 标签 B <- 相机: 标签 A 在标签 B 的后面
|
|
262
341
|
* 但是当前元素是无法感知到这种变化的,所以需要通过父元素调用这个方法来更新标签的层级。
|
|
263
342
|
*/
|
|
264
|
-
setTagZIndex(
|
|
343
|
+
setTagZIndex(i) {
|
|
265
344
|
var t;
|
|
266
|
-
this.tagZIndex !==
|
|
345
|
+
this.tagZIndex !== i && ((t = this.tagApp) == null || t.$set({ zIndex: i }));
|
|
267
346
|
}
|
|
268
347
|
}
|
|
269
|
-
function d(
|
|
270
|
-
return new
|
|
271
|
-
depth:
|
|
348
|
+
function d(a, i) {
|
|
349
|
+
return new r.ExtrudeBufferGeometry(a, {
|
|
350
|
+
depth: i,
|
|
272
351
|
bevelEnabled: !1
|
|
273
352
|
});
|
|
274
353
|
}
|
|
275
|
-
function P(
|
|
276
|
-
return new
|
|
277
|
-
color:
|
|
278
|
-
opacity:
|
|
354
|
+
function P(a, i) {
|
|
355
|
+
return new r.MeshBasicMaterial({
|
|
356
|
+
color: a,
|
|
357
|
+
opacity: i,
|
|
279
358
|
transparent: !0
|
|
280
359
|
});
|
|
281
360
|
}
|
|
282
|
-
function u(
|
|
283
|
-
const t = new
|
|
284
|
-
t.multiply(
|
|
361
|
+
function u(a, i) {
|
|
362
|
+
const t = new r.Matrix4(), o = new r.Matrix4().makeRotationX(Math.PI / 2), s = new r.Matrix4().makeTranslation(0, 0, -i), n = new r.Matrix4().makeScale(1, 1, -1);
|
|
363
|
+
t.multiply(o), t.multiply(s), t.multiply(n), a.applyMatrix4(t);
|
|
285
364
|
}
|
|
286
365
|
export {
|
|
287
|
-
|
|
366
|
+
di as AreaMakerItem
|
|
288
367
|
};
|