@realsee/dnalogel 3.45.0 → 3.46.1

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