@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.
Files changed (118) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/ModelMakerPlugin/Controller.d.ts +2 -0
  3. package/dist/Sculpt/utils/export.d.ts +18 -0
  4. package/dist/index.cjs.js +207 -207
  5. package/dist/index.js +34866 -34775
  6. package/dist/index.umd.js +211 -211
  7. package/dist/shared-utils/five/fiveEveryReadyListener.d.ts +2 -0
  8. package/dist/shared-utils/index.d.ts +1 -0
  9. package/dist/shared-utils/tag.d.ts +40 -1
  10. package/dist/shared-utils/three/temp.d.ts +2 -2
  11. package/libs/AreaMakerPlugin/Controller.js +100 -46
  12. package/libs/AreaMakerPlugin/index.js +64 -10
  13. package/libs/AreaMakerPlugin/utils/Item.js +156 -100
  14. package/libs/CSS3DRenderPlugin/Controller.js +93 -44
  15. package/libs/CSS3DRenderPlugin/index.js +62 -13
  16. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +105 -49
  17. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +130 -77
  18. package/libs/CruisePlugin/BaseController.js +143 -89
  19. package/libs/CruisePlugin/Move.js +83 -39
  20. package/libs/CruisePlugin/Work.js +95 -51
  21. package/libs/CruisePlugin/index.js +66 -22
  22. package/libs/CurrentPanoImagePlugin/Controller.js +139 -85
  23. package/libs/CurrentPanoImagePlugin/index.js +63 -9
  24. package/libs/GuideLinePlugin/Controller.js +57 -13
  25. package/libs/GuideLinePlugin/GuideLineItem.js +63 -19
  26. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +6 -2
  27. package/libs/GuideLinePlugin/GuideLineModeItem.js +58 -14
  28. package/libs/GuideLinePlugin/index.js +66 -22
  29. package/libs/ModelMakerPlugin/Controller.d.ts +2 -0
  30. package/libs/ModelMakerPlugin/Controller.js +190 -129
  31. package/libs/ModelMakerPlugin/index.js +63 -21
  32. package/libs/ModelMakerPlugin/item/baseItem.js +4 -2
  33. package/libs/ModelMakerPlugin/item/boxItem.js +5 -3
  34. package/libs/ModelMakerPlugin/item/polygonItem.js +9 -7
  35. package/libs/ModelMakerPlugin/item/prismItem.js +5 -3
  36. package/libs/ModelTVVideoPlugin/Plugin.js +96 -47
  37. package/libs/ModelTVVideoPlugin/index.js +55 -6
  38. package/libs/Object3DHelperPlugin/Controller.js +42 -25
  39. package/libs/Object3DHelperPlugin/index.js +28 -12
  40. package/libs/PanoCompassPlugin/Controller.js +92 -44
  41. package/libs/PanoCompassPlugin/index.js +63 -15
  42. package/libs/PanoDoorLabelPlugin/BaseController.js +79 -25
  43. package/libs/PanoDoorLabelPlugin/Controller.js +132 -78
  44. package/libs/PanoDoorLabelPlugin/index.js +63 -9
  45. package/libs/PanoMeasurePlugin/Components/Controller0.js +126 -77
  46. package/libs/PanoMeasurePlugin/Components/Controller1.js +139 -90
  47. package/libs/PanoMeasurePlugin/Controller/EditController.js +120 -71
  48. package/libs/PanoMeasurePlugin/Controller/WatchController.js +120 -70
  49. package/libs/PanoMeasurePlugin/Controller/index.js +132 -86
  50. package/libs/PanoMeasurePlugin/Model/area.js +72 -22
  51. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +56 -0
  52. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +64 -15
  53. package/libs/PanoMeasurePlugin/index.js +62 -16
  54. package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +57 -2
  55. package/libs/PanoRulerProPlugin/Controller.js +88 -33
  56. package/libs/PanoRulerProPlugin/RulerItems.js +146 -91
  57. package/libs/PanoRulerProPlugin/index.js +64 -9
  58. package/libs/PanoSpatialTagPlugin/Plugin.js +177 -128
  59. package/libs/PanoSpatialTagPlugin/index.js +53 -4
  60. package/libs/PanoTagPlugin/Components/Common/TagPoint.js +116 -60
  61. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +192 -136
  62. package/libs/PanoTagPlugin/Components/Tag/index.js +194 -139
  63. package/libs/PanoTagPlugin/Components/TagContainer.js +112 -57
  64. package/libs/PanoTagPlugin/Components/TagItem.js +204 -149
  65. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +157 -101
  66. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +75 -20
  67. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +86 -31
  68. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +93 -37
  69. package/libs/PanoTagPlugin/controller/TagRender.js +62 -18
  70. package/libs/PanoTagPlugin/controller/TagUtil.js +123 -79
  71. package/libs/PanoTagPlugin/controller/index.js +110 -72
  72. package/libs/PanoTagPlugin/index.js +72 -28
  73. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +77 -21
  74. package/libs/PanoVideoPlugin/Controller.js +95 -41
  75. package/libs/PanoVideoPlugin/VideoMeshController.js +119 -63
  76. package/libs/PanoVideoPlugin/index.js +66 -12
  77. package/libs/PipelinePlugin/Controller.js +173 -119
  78. package/libs/PipelinePlugin/index.js +63 -9
  79. package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +70 -14
  80. package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +58 -2
  81. package/libs/PipelinePlugin/utils/Objects/Pipe.js +98 -42
  82. package/libs/Sculpt/Meshes/Box.js +3 -2
  83. package/libs/Sculpt/Meshes/Cylinder.js +10 -6
  84. package/libs/Sculpt/Meshes/Line.js +43 -38
  85. package/libs/Sculpt/Meshes/LineWithDots.js +14 -10
  86. package/libs/Sculpt/Meshes/Point.js +24 -20
  87. package/libs/Sculpt/Meshes/Polygon.js +5 -2
  88. package/libs/Sculpt/Meshes/Prism.js +19 -16
  89. package/libs/Sculpt/Objects/Line/Editor.js +6 -5
  90. package/libs/Sculpt/index.js +15 -14
  91. package/libs/Sculpt/utils/export.d.ts +18 -0
  92. package/libs/Sculpt/utils/export.js +21 -0
  93. package/libs/Sculpt/utils/three/ColoredMesh.js +26 -22
  94. package/libs/base/BasePlugin.js +14 -10
  95. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +146 -94
  96. package/libs/floorplan/MapviewFloorplanPlugin/index.js +62 -10
  97. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +109 -56
  98. package/libs/floorplan/ModelFloorplanPlugin/index.js +62 -9
  99. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +116 -63
  100. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +62 -9
  101. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +105 -52
  102. package/libs/floorplan/TopviewFloorplanPlugin/index.js +62 -9
  103. package/libs/floorplan/index.js +4 -0
  104. package/libs/index.js +208 -206
  105. package/libs/shared-utils/five/fiveEveryReadyListener.d.ts +2 -0
  106. package/libs/shared-utils/five/fiveEveryReadyListener.js +15 -0
  107. package/libs/shared-utils/five/index.js +6 -2
  108. package/libs/shared-utils/five/lookObject.js +31 -27
  109. package/libs/shared-utils/index.d.ts +1 -0
  110. package/libs/shared-utils/index.js +19 -17
  111. package/libs/shared-utils/logger.js +1 -1
  112. package/libs/shared-utils/tag.d.ts +40 -1
  113. package/libs/shared-utils/tag.js +139 -86
  114. package/libs/shared-utils/three/index.js +4 -0
  115. package/libs/shared-utils/three/temp.d.ts +2 -2
  116. package/libs/shared-utils/three/temp.js +4 -4
  117. package/package.json +1 -1
  118. package/README.md +0 -116
@@ -1,6 +1,6 @@
1
1
  var b = Object.defineProperty;
2
- var k = (a, e, t) => e in a ? b(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var i = (a, e, t) => (k(a, typeof e != "symbol" ? e + "" : e, t), t);
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
- i(this, "areaMakerItem");
122
+ e(this, "areaMakerItem");
67
123
  this.areaMakerItem = t;
68
124
  }
69
- raycast(t, s) {
70
- this.areaMakerItem.makerObject.raycast(t, s);
125
+ raycast(t, o) {
126
+ this.areaMakerItem.makerObject.raycast(t, o);
71
127
  }
72
128
  }
73
- class At {
74
- constructor(e, t) {
75
- i(this, "id");
129
+ class Si {
130
+ constructor(i, t) {
131
+ e(this, "id");
76
132
  /** 标注名称 */
77
- i(this, "name", "");
133
+ e(this, "name", "");
78
134
  /** 标注几何体 */
79
- i(this, "makerObject");
135
+ e(this, "makerObject");
80
136
  /** 标注几何体的边框 */
81
- i(this, "outline");
137
+ e(this, "outline");
82
138
  /** 标注底面 Y 坐标 */
83
- i(this, "bottomY");
139
+ e(this, "bottomY");
84
140
  /** 标注透明度 */
85
- i(this, "opacity");
141
+ e(this, "opacity");
86
142
  /** 标注高度 */
87
- i(this, "height");
143
+ e(this, "height");
88
144
  /** 标注所在楼层 */
89
- i(this, "floorIndex");
145
+ e(this, "floorIndex");
90
146
  /** 标注底面形状 */
91
- i(this, "shape");
147
+ e(this, "shape");
92
148
  /** 是否被挂载 */
93
- i(this, "mounted", !1);
149
+ e(this, "mounted", !1);
94
150
  /** 查询问题使用的调试对象 */
95
- i(this, "checkMsg", {
151
+ e(this, "checkMsg", {
96
152
  /** 当标注没有展示时,可以通过这个字段查看原因 */
97
153
  checkVisibleMsg: "",
98
154
  /** 当标注标签没有展示时,可以通过这个字段查看原因 */
99
155
  checkTagVisibleMsg: ""
100
156
  });
101
157
  /** 模型容器 */
102
- i(this, "modelGroup");
158
+ e(this, "modelGroup");
103
159
  /** 标注是否可见 */
104
- i(this, "visible", !0);
160
+ e(this, "visible", !0);
105
161
  // ==================== 标签相关 ====================
106
162
  /** 标注标签实例 */
107
- i(this, "tagApp");
163
+ e(this, "tagApp");
108
164
  /** 标注标签是否可见 */
109
- i(this, "tagVisible", null);
165
+ e(this, "tagVisible", null);
110
166
  /** 标注标签的世界坐标 */
111
- i(this, "tagPosition", new r.Vector3());
167
+ e(this, "tagPosition", new r.Vector3());
112
168
  /** 标注标签的 NDC 坐标 */
113
- i(this, "tagNDCPosition", new r.Vector3());
169
+ e(this, "tagNDCPosition", new r.Vector3());
114
170
  /** 标注标签的 transform */
115
- i(this, "tagTransform", { left: 0, top: 0 });
171
+ e(this, "tagTransform", { left: 0, top: 0 });
116
172
  /** 标注标签的显示层级 */
117
- i(this, "tagZIndex", 0);
173
+ e(this, "tagZIndex", 0);
118
174
  /** 标注实例的事件处理器 */
119
- i(this, "hooks", new y());
175
+ e(this, "hooks", new y());
120
176
  /** 自定义 Dom */
121
- i(this, "itemRenderer");
177
+ e(this, "itemRenderer");
122
178
  /** 数据 */
123
- i(this, "data");
179
+ e(this, "data");
124
180
  /** Plugin 实例 */
125
- i(this, "plugin");
181
+ e(this, "plugin");
126
182
  /** 标注透明度动画 */
127
- i(this, "opacityAnime");
183
+ e(this, "opacityAnime");
128
184
  /** 是否在容器 resize 动画中 */
129
- i(this, "isInContainerResizeAnimation", !1);
185
+ e(this, "isInContainerResizeAnimation", !1);
130
186
  /** 监听容器 resize 的计时器 id,用于判断 resize 过程是否结束 */
131
- i(this, "containerResizeTimeoutID", null);
132
- i(this, "resizeObserver");
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
- i(this, "doOpacityAnime", (e) => {
153
- var m;
154
- (m = this.opacityAnime) == null || m.dispose();
155
- const t = e.duration, [s, o] = e.makerObjectOpacity, [h, n] = e.outlineOpacity;
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 = o, this.outline.material.opacity = n;
213
+ this.makerObject.material.opacity = s, this.outline.material.opacity = n;
158
214
  return;
159
215
  }
160
- return new Promise((p) => {
161
- this.opacityAnime = new O({ makerObjectOpacity: s, outlineOpacity: h }).to({
162
- makerObjectOpacity: o,
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(() => p(!0)).onDispose(() => {
167
- this.makerObject.material.opacity = o, this.outline.material.opacity = n, this.plugin.five.needsRender = !0, p(!1);
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
- i(this, "onPluginConfigChange", (e) => {
173
- this.makerObject.material.depthTest = e.config.modelDepthTest, this.outline.material.depthTest = e.config.modelDepthTest, this.plugin.five.needsRender = !0;
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
- i(this, "onPluginStateChange", () => {
232
+ e(this, "onPluginStateChange", () => {
177
233
  this.updateVisible(), this.updateTagVisible();
178
234
  });
179
235
  /** 更新标注可见性 */
180
- i(this, "updateVisible", () => {
181
- var o;
182
- const { result: e, msg: t } = this.checkVisible();
183
- if (this.checkMsg.checkVisibleMsg = t, this.visible === e)
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 = e;
186
- const s = (o = this.data.object_data.visible) != null ? o : !0;
187
- this.modelGroup.visible = e && s, this.plugin.five.needsRender = !0;
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
- i(this, "checkVisible", () => {
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
- i(this, "updateTag", () => {
253
+ e(this, "updateTag", () => {
198
254
  this.tagApp && (this.updateTagNDCPosition(), this.updateTagDomTransform(), this.updateTagVisible());
199
255
  });
200
256
  /** 更新标注标签的 NDC Position */
201
- i(this, "updateTagNDCPosition", () => {
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
- i(this, "updateTagDomTransform", () => {
207
- var o;
208
- const e = this.tagNDCPosition, t = Math.round((e.x + 1) / 2 * this.plugin.tagDomContainer.clientWidth), s = Math.round((-e.y + 1) / 2 * this.plugin.tagDomContainer.clientHeight);
209
- this.tagTransform.left === t && this.tagTransform.top === s || (this.tagTransform = { left: t, top: s }, (o = this.tagApp) == null || o.$set({ transform: `translate(${t}px, ${s}px)` }));
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
- i(this, "updateTagVisible", () => {
213
- var s;
214
- const { result: e, msg: t } = this.checkTagVisible();
215
- this.checkMsg.checkTagVisibleMsg = t, this.tagVisible !== e && (this.tagVisible = e, this.tagApp && (this.tagVisible ? this.hooks.emit("tagShow") : this.hooks.emit("tagHide"), (s = this.tagApp) == null || s.$set({ visible: e })));
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
- i(this, "checkTagVisible", () => {
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, s = t.camera.position.clone();
224
- d.set(s.clone(), this.tagPosition.clone().sub(s).normalize());
225
- const [o] = this.plugin.fiveUtil.model.intersectRaycaster(d), h = this.tagPosition.distanceTo(t.camera.position);
226
- if (o && o.distance + 0.1 < h)
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
- i(this, "onFiveCameraUpdate", () => {
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
- i(this, "onContainerResize", () => {
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 p, l, c, g;
244
- const s = t.object_data, o = s.bottom_y, h = s.height, n = new r.Color((p = s.color) != null ? p : "#FFFFFF"), m = (l = s.opacity) != null ? l : 0.4;
245
- this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = h, this.bottomY = o, this.opacity = m, this.shape = new r.Shape().fromJSON(s.shape), this.floorIndex = t.floor_index, this.makerObject = new r.Mesh(f(this.shape, h), j(n, m)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new C(
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, o), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(h), this.modelGroup = new P(this), this.modelGroup.visible = (g = s.visible) != null ? g : !0;
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 e = !!this.name, t = this.plugin.tagDomContainer;
256
- e && (this.tagApp = new v({
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: (s) => this.hooks.emit("tagClick", { target: this, nativeEvent: s })
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 e, t;
271
- this.mounted && (this.mounted = !1, this.modelGroup.remove(...this.modelGroup.children), (e = this.tagApp) == null || e.$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());
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(e) {
332
+ setOpacity(i) {
277
333
  var t;
278
- this.opacity = e, (t = this.opacityAnime) == null || t.dispose(), this.makerObject.material.opacity = e, this.plugin.five.needsRender = !0;
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(e) {
285
- const t = new r.Color(e);
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(e) {
292
- if (e <= 0)
347
+ setHeight(i) {
348
+ if (i <= 0)
293
349
  throw new Error("高度必须大于 0");
294
- this.height = e, this.makerObject.geometry = f(this.shape, e), this.outline.geometry = new r.EdgesGeometry(this.makerObject.geometry);
295
- const t = this.shape.extractPoints(10).shape.slice(0, -1), s = M(t), o = new r.Vector3(s.x, s.y, e);
296
- u(o, this.bottomY), this.tagPosition.copy(o), this.updateTag(), this.plugin.five.needsRender = !0;
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(e) {
362
+ setTagZIndex(i) {
307
363
  var t;
308
- this.tagZIndex !== e && ((t = this.tagApp) == null || t.$set({ zIndex: e }));
364
+ this.tagZIndex !== i && ((t = this.tagApp) == null || t.$set({ zIndex: i }));
309
365
  }
310
366
  }
311
- function f(a, e) {
367
+ function f(a, i) {
312
368
  return new r.ExtrudeBufferGeometry(a, {
313
- depth: e,
369
+ depth: i,
314
370
  bevelEnabled: !1
315
371
  });
316
372
  }
317
- function j(a, e) {
373
+ function j(a, i) {
318
374
  return new r.MeshBasicMaterial({
319
375
  color: a,
320
- opacity: e,
376
+ opacity: i,
321
377
  transparent: !0
322
378
  });
323
379
  }
324
- function u(a, e) {
325
- const t = new r.Matrix4(), s = new r.Matrix4().makeRotationX(Math.PI / 2), o = new r.Matrix4().makeTranslation(0, 0, -e), h = new r.Matrix4().makeScale(1, 1, -1);
326
- t.multiply(s), t.multiply(o), t.multiply(h), a.applyMatrix4(t);
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
- At as AreaMakerItem
385
+ Si as AreaMakerItem
330
386
  };