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