@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
@@ -9,23 +9,23 @@ var V = (o, e, t) => e in o ? B(o, e, { enumerable: !0, configurable: !0, writab
9
9
  H.call(e, t) && V(o, t, e[t]);
10
10
  return o;
11
11
  };
12
- var g = (o, e, t) => new Promise((r, m) => {
13
- var u = (a) => {
12
+ var g = (o, e, t) => new Promise((n, l) => {
13
+ var u = (r) => {
14
14
  try {
15
- l(t.next(a));
16
- } catch (d) {
17
- m(d);
15
+ m(t.next(r));
16
+ } catch (p) {
17
+ l(p);
18
18
  }
19
- }, s = (a) => {
19
+ }, s = (r) => {
20
20
  try {
21
- l(t.throw(a));
22
- } catch (d) {
23
- m(d);
21
+ m(t.throw(r));
22
+ } catch (p) {
23
+ l(p);
24
24
  }
25
- }, l = (a) => a.done ? r(a.value) : Promise.resolve(a.value).then(u, s);
26
- l((t = t.apply(o, e)).next());
25
+ }, m = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(u, s);
26
+ m((t = t.apply(o, e)).next());
27
27
  });
28
- import * as n from "three";
28
+ import * as a from "three";
29
29
  import "hammerjs";
30
30
  import "../three/PointSelector/index.js";
31
31
  import "three/examples/jsm/renderers/CSS3DRenderer";
@@ -34,35 +34,39 @@ import { vectorToCoordinates as N } from "../vectorToCoordinate.js";
34
34
  import { FiveUtil as O } from "../Utils/FiveUtil.js";
35
35
  import { notNil as Y } from "../isNil.js";
36
36
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
37
+ import "../../Sculpt/Meshes/Polygon.js";
38
+ import "../../Sculpt/utils/Modules/Global.js";
37
39
  import "@realsee/five/line";
38
40
  import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
41
+ import "../../vendor/hotkeys-js/dist/hotkeys.esm.js";
42
+ import "../../Sculpt/utils/three/rayOnLine.js";
39
43
  import { worldBoundingSphere as j } from "../three/boundingBox.js";
40
44
  import "animejs";
41
- function et(o, e, t) {
45
+ function nt(o, e, t) {
42
46
  return g(this, null, function* () {
43
47
  var P, x, z;
44
48
  if (!e)
45
49
  return;
46
- const r = j(e);
47
- if (!r)
50
+ const n = j(e);
51
+ if (!n)
48
52
  return;
49
- const m = new O(o), u = (P = t == null ? void 0 : t.scale) != null ? P : 1.4, s = r.center, l = o.camera.position.clone().sub(s).setY(0).normalize(), a = o.state.mode === "Mapview" ? o.state.fov : 60, C = Math.max(1.5, r.radius * u), k = C * (1 / Math.tan(n.MathUtils.degToRad(a / 2)));
50
- let p = 0;
53
+ const l = new O(o), u = (P = t == null ? void 0 : t.scale) != null ? P : 1.4, s = n.center, m = o.camera.position.clone().sub(s).setY(0).normalize(), r = o.state.mode === "Mapview" ? o.state.fov : 60, C = Math.max(1.5, n.radius * u), k = C * (1 / Math.tan(a.MathUtils.degToRad(r / 2)));
54
+ let d = 0;
51
55
  const w = [], M = (c) => {
52
- const i = n.MathUtils.degToRad(c);
53
- return l.clone().applyAxisAngle(new n.Vector3(0, 1, 0), i).clone().multiplyScalar(k).add(new n.Vector3(0, C, 0)).add(s);
56
+ const i = a.MathUtils.degToRad(c);
57
+ return m.clone().applyAxisAngle(new a.Vector3(0, 1, 0), i).clone().multiplyScalar(k).add(new a.Vector3(0, C, 0)).add(s);
54
58
  };
55
- for (; p !== 360; ) {
59
+ for (; d !== 360; ) {
56
60
  let c = 0;
57
- const i = M(p), f = (y) => {
58
- const I = y.distanceTo(i), _ = new n.Raycaster(y, i.clone().sub(y).normalize()), h = m.model.intersectRaycaster(_, void 0, !0)[0], S = h == null ? void 0 : h.distance;
61
+ const i = M(d), f = (y) => {
62
+ const I = y.distanceTo(i), _ = new a.Raycaster(y, i.clone().sub(y).normalize()), h = l.model.intersectRaycaster(_, void 0, !0)[0], S = h == null ? void 0 : h.distance;
59
63
  Y(S) ? S > I && (c += 1) : c += 1;
60
- }, A = r.clampPoint(i, new n.Vector3());
64
+ }, A = n.clampPoint(i, new a.Vector3());
61
65
  f(A);
62
- const E = new n.Vector3(s.x, i.y, s.z);
63
- if (f(E), w[c] = p, c === 2)
66
+ const E = new a.Vector3(s.x, i.y, s.z);
67
+ if (f(E), w[c] = d, c === 2)
64
68
  break;
65
- p += 30;
69
+ d += 30;
66
70
  }
67
71
  const R = M((z = (x = w[2]) != null ? x : w[1]) != null ? z : 0), v = R.distanceTo(s), b = N(s.clone().sub(R).normalize());
68
72
  if (o.state.mode === "Mapview")
@@ -81,5 +85,5 @@ function et(o, e, t) {
81
85
  });
82
86
  }
83
87
  export {
84
- et as lookObject
88
+ nt as lookObject
85
89
  };
@@ -7,3 +7,4 @@ export * from './uuid';
7
7
  export * from './url/absoluteUrl';
8
8
  export * from './animationFrame';
9
9
  export * from './equal';
10
+ export * from '../Sculpt/utils/export';
@@ -18,16 +18,17 @@ import { uuid as j } from "./uuid.js";
18
18
  import { absoluteUrl as I, isAbsoluteURL as O } from "./url/absoluteUrl.js";
19
19
  import { awaitNextFrame as T, getFrameTime as _, nextFrame as y, requestAnimationFrameInterval as C } from "./animationFrame/index.js";
20
20
  import { equal as H } from "./equal.js";
21
- import { isModelLike as N, isPanoramaLike as q } from "./five/mode.js";
22
- import { lookObject as A } from "./five/lookObject.js";
23
- import { lookPoint as D } from "./five/lookPoint.js";
24
- import { fiveModelIsLoaded as E, waitFiveModelLoaded as R } from "./five/fiveModelLoad.js";
25
- import { FiveDomEvents as U } from "./five/FiveDomEvents.js";
26
- import { BetterTween as V, tweenProgress as z } from "./animationFrame/BetterTween.js";
27
- const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
21
+ import { sculpt as N } from "../Sculpt/utils/export.js";
22
+ import { isModelLike as q, isPanoramaLike as A } from "./five/mode.js";
23
+ import { lookObject as D } from "./five/lookObject.js";
24
+ import { lookPoint as E } from "./five/lookPoint.js";
25
+ import { fiveModelIsLoaded as R, waitFiveModelLoaded as U } from "./five/fiveModelLoad.js";
26
+ import { FiveDomEvents as V } from "./five/FiveDomEvents.js";
27
+ import { BetterTween as z, tweenProgress as G } from "./animationFrame/BetterTween.js";
28
+ const Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
28
29
  __proto__: null,
29
- BetterTween: V,
30
- FiveDomEvents: U,
30
+ BetterTween: z,
31
+ FiveDomEvents: V,
31
32
  Interval: r,
32
33
  LightTag: i,
33
34
  LineSegments: u,
@@ -49,30 +50,31 @@ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49
50
  checkFiveModelLoaded: n,
50
51
  convexHull: t,
51
52
  equal: H,
52
- fiveModelIsLoaded: E,
53
+ fiveModelIsLoaded: R,
53
54
  getCoordsFromClient: l,
54
55
  getCoordsFromElement: f,
55
56
  getFrameTime: _,
56
57
  inside: o,
57
58
  isAbsoluteURL: O,
58
- isModelLike: N,
59
+ isModelLike: q,
59
60
  isNil: B,
60
- isPanoramaLike: q,
61
- lookObject: A,
62
- lookPoint: D,
61
+ isPanoramaLike: A,
62
+ lookObject: D,
63
+ lookPoint: E,
63
64
  nextFrame: y,
64
65
  notNil: h,
65
66
  pointInPolygon: o,
66
67
  reblink: S,
67
68
  requestAnimationFrameInterval: C,
69
+ sculpt: N,
68
70
  tag: m,
69
- tweenProgress: z,
71
+ tweenProgress: G,
70
72
  uuid: j,
71
- waitFiveModelLoaded: R,
73
+ waitFiveModelLoaded: U,
72
74
  worldBounding: L,
73
75
  worldBoundingBox: P,
74
76
  worldBoundingSphere: k
75
77
  }, Symbol.toStringTag, { value: "Module" }));
76
78
  export {
77
- vo as index
79
+ Lo as index
78
80
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.50.17-alpha.0",
3
+ "%c %c@realsee/dnalogel %cv3.51.0",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
@@ -13,6 +13,16 @@ export declare class LightTag {
13
13
  container: HTMLDivElement;
14
14
  visible: boolean;
15
15
  enabled: boolean;
16
+ /**
17
+ * @description 标签的可见性数组
18
+ * ```
19
+ * [0] this.visible
20
+ * [1] 碰撞检测
21
+ * [2] 元素遮挡
22
+ * ```
23
+ */
24
+ visibles: boolean[];
25
+ get position(): THREE.Vector3;
16
26
  /**
17
27
  * @description 标签容器的父容器
18
28
  * @default this.five.getElement()?.parentElement
@@ -24,11 +34,16 @@ export declare class LightTag {
24
34
  * @default true
25
35
  */
26
36
  intersectCheck: boolean;
37
+ /**
38
+ * @description 用于碰撞检测的额外 Object3D
39
+ */
40
+ extraObjectsForIntersectCheck: THREE.Object3D[];
27
41
  /**
28
42
  * @description 模拟3D
29
43
  * @default true
30
44
  */
31
45
  simulate3D: boolean;
46
+ set needsRender(val: true);
32
47
  /**
33
48
  * @description 标签的容器,根据 namespace 区分
34
49
  */
@@ -41,16 +56,40 @@ export declare class LightTag {
41
56
  private fiveUtil;
42
57
  private disposers;
43
58
  constructor(five: Five, position?: AnyPosition, config?: LightTagConfig);
59
+ /**
60
+ * @description 显示标签
61
+ */
44
62
  show(): void;
63
+ /**
64
+ * @description 隐藏标签
65
+ */
45
66
  hide(): void;
67
+ /**
68
+ * @description 启用标签
69
+ */
46
70
  enable(): void;
71
+ /**
72
+ * @description 禁用标签
73
+ */
47
74
  disable(): void;
75
+ /**
76
+ * @description 销毁标签,并释放相关资源
77
+ */
48
78
  destroy(): void;
49
- setTransformMatrix(matrix: THREE.Matrix4): void;
79
+ /**
80
+ * @description 设置标签位置
81
+ * @param position 位置
82
+ * @param positionsForRotate 用于 css 旋转的斜线的两个端点
83
+ */
50
84
  setPosition(position: AnyPosition, positionsForRotate?: AnyPosition[]): void;
85
+ setTransformMatrix(matrix: THREE.Matrix4): void;
51
86
  updateScreenPosition(): void;
52
87
  private onCameraUpdate;
88
+ private onCameraFovUpdate;
53
89
  private onFiveEveryReady;
90
+ private updateVisible;
91
+ private applyVisible;
92
+ private updateIntersectCheckVisible;
54
93
  private addResizeListener;
55
94
  }
56
95
  export declare function tag(...params: ConstructorParameters<typeof LightTag>): LightTag;
@@ -1,152 +1,205 @@
1
- var u = Object.defineProperty;
2
- var P = (l, t, e) => t in l ? u(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
- var s = (l, t, e) => (P(l, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { anyPositionToVector3 as f } from "./positionToVector3.js";
5
- import * as g from "three";
6
- import { vector3ToScreen as d } from "./five/vector3ToScreen.js";
7
- import { getFiveModel as b } from "./five/getFiveModel.js";
8
- import { FiveUtil as U } from "./Utils/FiveUtil.js";
9
- import { _raycaster as m } from "./three/temp.js";
10
- import { resizeObserver as x } from "./dom/resizeObserver.js";
11
- const E = new g.Vector2();
1
+ var y = Object.defineProperty;
2
+ var b = (c, e, t) => e in c ? y(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
3
+ var i = (c, e, t) => (b(c, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { anyPositionToVector3 as d } from "./positionToVector3.js";
5
+ import * as P from "three";
6
+ import { vector3ToScreen as m } from "./five/vector3ToScreen.js";
7
+ import { getFiveModel as g } from "./five/getFiveModel.js";
8
+ import { FiveUtil as C } from "./Utils/FiveUtil.js";
9
+ import { _raycaster as v } from "./three/temp.js";
10
+ import { resizeObserver as U } from "./dom/resizeObserver.js";
11
+ import { fiveEveryReadyListener as x } from "./five/fiveEveryReadyListener.js";
12
+ const E = new P.Vector2();
12
13
  class w {
13
- constructor(t, e, i) {
14
+ constructor(e, t, o) {
14
15
  /**
15
16
  * @description 单个标签 dom
16
17
  */
17
- s(this, "container");
18
- s(this, "visible", !1);
19
- s(this, "enabled", !1);
18
+ i(this, "container");
19
+ i(this, "visible", !1);
20
+ i(this, "enabled", !1);
21
+ /**
22
+ * @description 标签的可见性数组
23
+ * ```
24
+ * [0] this.visible
25
+ * [1] 碰撞检测
26
+ * [2] 元素遮挡
27
+ * ```
28
+ */
29
+ i(this, "visibles", []);
20
30
  /**
21
31
  * @description 标签容器的父容器
22
32
  * @default this.five.getElement()?.parentElement
23
33
  */
24
- s(this, "wrapper");
25
- s(this, "positionsForRotate");
34
+ i(this, "wrapper");
35
+ i(this, "positionsForRotate");
26
36
  /**
27
37
  * @description 碰撞检测
28
38
  * @default true
29
39
  */
30
- s(this, "intersectCheck", !0);
40
+ i(this, "intersectCheck", !0);
41
+ /**
42
+ * @description 用于碰撞检测的额外 Object3D
43
+ */
44
+ i(this, "extraObjectsForIntersectCheck", []);
31
45
  /**
32
46
  * @description 模拟3D
33
47
  * @default true
34
48
  */
35
- s(this, "simulate3D", !1);
49
+ i(this, "simulate3D", !1);
36
50
  /**
37
51
  * @description 标签的容器,根据 namespace 区分
38
52
  */
39
- s(this, "tagWrapper");
40
- s(this, "five");
41
- s(this, "originPosition");
42
- s(this, "transformedPosition");
43
- s(this, "disposer");
44
- s(this, "config");
45
- s(this, "fiveUtil");
46
- s(this, "disposers", []);
47
- s(this, "onCameraUpdate", () => {
53
+ i(this, "tagWrapper");
54
+ i(this, "five");
55
+ i(this, "originPosition");
56
+ i(this, "transformedPosition");
57
+ i(this, "disposer");
58
+ i(this, "config");
59
+ i(this, "fiveUtil");
60
+ i(this, "disposers", []);
61
+ i(this, "onCameraUpdate", () => {
48
62
  this.visible !== !1 && this.updateScreenPosition();
49
63
  });
50
- s(this, "onFiveEveryReady", () => {
51
- var t;
52
- if (this.intersectCheck && this.visible && this.five.state.mode !== "Panorama") {
53
- let e = !1, i = 0.01;
54
- this.fiveUtil.workUtil.fromType === "poincare" && (i = 0.05);
55
- const a = this.transformedPosition.clone().sub(this.five.camera.position).normalize();
56
- m.set(this.five.camera.position, a);
57
- const n = (t = b(this.five).intersectRaycaster(m)) == null ? void 0 : t[0];
58
- n ? e = (n == null ? void 0 : n.distance) + i > this.transformedPosition.distanceTo(this.five.camera.position) : e = !0, e ? (this.container.style.opacity = "1", this.container.style.pointerEvents = "auto") : (this.container.style.opacity = "0", this.container.style.pointerEvents = "none");
64
+ i(this, "onCameraFovUpdate", () => {
65
+ this.onCameraUpdate(), this.five.off("render.prepare", this.onCameraUpdate), this.five.on("render.prepare", this.onCameraUpdate), setTimeout(() => {
66
+ this.five.off("render.prepare", this.onCameraUpdate);
67
+ }, 1e3);
68
+ });
69
+ i(this, "onFiveEveryReady", () => {
70
+ this.five.state.mode !== "Panorama" && this.updateVisible();
71
+ });
72
+ i(this, "updateVisible", () => {
73
+ this.visible && (this.updateIntersectCheckVisible(), this.needsRender = !0);
74
+ });
75
+ i(this, "applyVisible", () => {
76
+ console.log(this.visibles), this.visibles.every((t) => t !== !1) ? (this.container.style.opacity = "1", this.container.style.pointerEvents = "auto") : (this.container.style.opacity = "0", this.container.style.pointerEvents = "none");
77
+ });
78
+ i(this, "updateIntersectCheckVisible", () => {
79
+ var n, r;
80
+ if (!this.intersectCheck) {
81
+ this.visibles[1] = !0;
82
+ return;
59
83
  }
84
+ let e = !1, t = 0.01;
85
+ this.fiveUtil.workUtil.fromType === "poincare" && (t = 0.05);
86
+ const o = this.transformedPosition.clone().sub(this.five.camera.position).normalize();
87
+ v.set(this.five.camera.position, o);
88
+ const h = (n = g(this.five).intersectRaycaster(v)) != null ? n : [], a = (r = v.intersectObjects(this.extraObjectsForIntersectCheck, !0)) != null ? r : [], s = [...h, ...a].sort((p, f) => p.distance - f.distance)[0];
89
+ s ? e = (s == null ? void 0 : s.distance) + t > this.transformedPosition.distanceTo(this.five.camera.position) : e = !0, this.visibles[1] = e;
60
90
  });
61
- var a, n, h;
62
- this.five = t, this.fiveUtil = (a = t.__fiveUtil__) != null ? a : t.__fiveUtil__ = new U(t), this.originPosition = e ? f(e).clone() : void 0, this.transformedPosition = (n = this.originPosition) == null ? void 0 : n.clone(), this.positionsForRotate = (h = i == null ? void 0 : i.positionsForRotate) == null ? void 0 : h.map((o) => f(o).clone()), this.config = i != null ? i : {}, this.container = (() => {
63
- const o = document.createElement("div");
64
- return o.classList.add("light-tag"), o.style.width = "0", o.style.height = "0", o.style.position = "absolute", o.style.transition = "opacity 0.2s linear", o;
65
- })(), this.enable(), this.show(), this.addResizeListener();
91
+ var h, a, l;
92
+ this.five = e, this.fiveUtil = (h = e.__fiveUtil__) != null ? h : e.__fiveUtil__ = new C(e), this.originPosition = t ? d(t).clone() : void 0, this.transformedPosition = (a = this.originPosition) == null ? void 0 : a.clone(), this.positionsForRotate = (l = o == null ? void 0 : o.positionsForRotate) == null ? void 0 : l.map((s) => d(s).clone()), this.config = o != null ? o : {}, this.container = (() => {
93
+ const s = document.createElement("div");
94
+ return s.classList.add("light-tag"), s.style.width = "0", s.style.height = "0", s.style.position = "absolute", s.style.transition = "opacity 0.2s linear", s;
95
+ })(), this.addResizeListener(), this.show(), this.enable(), setTimeout(() => {
96
+ this.updateVisible(), this.needsRender = !0;
97
+ }, 0);
66
98
  }
99
+ get position() {
100
+ return this.transformedPosition;
101
+ }
102
+ set needsRender(e) {
103
+ this.applyVisible();
104
+ }
105
+ /**
106
+ * @description 显示标签
107
+ */
67
108
  show() {
68
- this.visible = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.onCameraUpdate();
109
+ this.visible = !0, this.visibles[0] = !0, this.container.style.opacity = "1", this.container.style.pointerEvents = "auto", this.updateVisible(), this.onCameraUpdate();
69
110
  }
111
+ /**
112
+ * @description 隐藏标签
113
+ */
70
114
  hide() {
71
- this.visible = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
115
+ this.visible = !1, this.visibles[0] = !1, this.container.style.opacity = "0", this.container.style.pointerEvents = "none";
72
116
  }
117
+ /**
118
+ * @description 启用标签
119
+ */
73
120
  enable() {
74
- var a, n, h, o, c;
121
+ var o, h, a, l, s;
75
122
  if (this.enabled)
76
123
  return;
77
- this.enabled = !0, this.wrapper = (h = (n = this.config.wrapper) != null ? n : (a = this.five.getElement()) == null ? void 0 : a.parentElement) != null ? h : document.body;
78
- const t = `light-tag-wrapper-${(c = (o = this.config) == null ? void 0 : o.namespace) != null ? c : "default"}`;
124
+ this.enabled = !0, this.wrapper = (a = (h = this.config.wrapper) != null ? h : (o = this.five.getElement()) == null ? void 0 : o.parentElement) != null ? a : document.body;
125
+ const e = `light-tag-wrapper-${(s = (l = this.config) == null ? void 0 : l.namespace) != null ? s : "default"}`;
79
126
  if (!this.tagWrapper) {
80
- let p = Array.from(this.wrapper.children).find((r) => r.id === t);
81
- if (!p) {
127
+ let n = Array.from(this.wrapper.children).find((r) => r.id === e);
128
+ if (!n) {
82
129
  const r = document.createElement("div");
83
- p = r, r.id = t, r.style.position = "absolute", r.style.overflow = "hidden", r.style.top = "0", r.style.left = "0", r.style.width = "100%", r.style.height = "100%", r.style.pointerEvents = "none", r.style.zIndex = "1", this.wrapper.appendChild(p);
130
+ n = r, r.id = e, r.style.position = "absolute", r.style.overflow = "hidden", r.style.top = "0", r.style.left = "0", r.style.width = "100%", r.style.height = "100%", r.style.pointerEvents = "none", r.style.zIndex = "1", this.wrapper.appendChild(n);
84
131
  }
85
- this.tagWrapper = p;
132
+ this.tagWrapper = n;
86
133
  }
87
- this.tagWrapper.appendChild(this.container);
88
- let e = !1;
89
- const i = () => {
90
- e || (e = !0, this.five.ready().then(() => {
91
- this.onFiveEveryReady(), e = !1;
92
- }));
93
- };
94
- this.five.on("cameraUpdate", i), this.five.on("cameraUpdate", this.onCameraUpdate), this.disposer = () => {
95
- this.five.off("cameraUpdate", i), this.five.off("cameraUpdate", this.onCameraUpdate);
134
+ this.tagWrapper.appendChild(this.container), this.updateVisible();
135
+ const t = x(this.five, this.onFiveEveryReady);
136
+ this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("cameraFovUpdate", this.onCameraFovUpdate), this.five.on("panoArrived", this.updateVisible), this.five.on("modeChange", this.updateVisible), this.disposer = () => {
137
+ t(), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("cameraFovUpdate", this.onCameraFovUpdate), this.five.off("panoArrived", this.updateVisible), this.five.off("modeChange", this.updateVisible);
96
138
  };
97
139
  }
140
+ /**
141
+ * @description 禁用标签
142
+ */
98
143
  disable() {
99
- var t;
100
- this.enabled && (this.enabled = !1, this.tagWrapper.removeChild(this.container), (t = this.disposer) == null || t.call(this));
144
+ var e;
145
+ this.enabled && (this.enabled = !1, this.tagWrapper.removeChild(this.container), (e = this.disposer) == null || e.call(this));
101
146
  }
147
+ /**
148
+ * @description 销毁标签,并释放相关资源
149
+ */
102
150
  destroy() {
103
- this.disable(), this.container.remove(), this.disposers.forEach((t) => t());
151
+ this.disable(), this.container.remove(), this.disposers.forEach((e) => e());
104
152
  }
105
- setTransformMatrix(t) {
106
- var e;
107
- this.transformedPosition = (e = this.originPosition) == null ? void 0 : e.clone().applyMatrix4(t), this.onCameraUpdate();
153
+ /**
154
+ * @description 设置标签位置
155
+ * @param position 位置
156
+ * @param positionsForRotate 用于 css 旋转的斜线的两个端点
157
+ */
158
+ setPosition(e, t) {
159
+ this.transformedPosition = d(e).clone(), this.positionsForRotate = t == null ? void 0 : t.map((o) => d(o).clone()), this.onCameraUpdate(), setTimeout(() => this.onCameraUpdate(), 0);
108
160
  }
109
- setPosition(t, e) {
110
- this.transformedPosition = f(t).clone(), this.positionsForRotate = e == null ? void 0 : e.map((i) => f(i).clone()), this.onCameraUpdate(), setTimeout(() => this.onCameraUpdate(), 0);
161
+ setTransformMatrix(e) {
162
+ var t;
163
+ this.transformedPosition = (t = this.originPosition) == null ? void 0 : t.clone().applyMatrix4(e), this.onCameraUpdate();
111
164
  }
112
165
  updateScreenPosition() {
113
166
  if (!this.transformedPosition) {
114
167
  this.container.style.left = "-100%", this.container.style.top = "-100%";
115
168
  return;
116
169
  }
117
- const t = this.five.renderer.getSize(E), e = d(this.five.camera, this.transformedPosition, t);
118
- if (!e) {
170
+ const e = this.five.renderer.getSize(E), t = m(this.five.camera, this.transformedPosition, e);
171
+ if (!t) {
119
172
  this.container.style.left = "-100%", this.container.style.top = "-100%";
120
173
  return;
121
174
  }
122
- const i = (() => {
175
+ const o = (() => {
123
176
  if (!this.simulate3D)
124
177
  return 1;
125
- const n = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), h = this.transformedPosition.distanceTo(this.five.camera.position);
126
- return Math.max(Math.min(1 - n * h / 40, 1), 0.5);
127
- })(), a = (() => {
178
+ const a = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), l = this.transformedPosition.distanceTo(this.five.camera.position);
179
+ return Math.max(Math.min(1 - a * l / 40, 1), 0.5);
180
+ })(), h = (() => {
128
181
  if (this.positionsForRotate === void 0 || this.positionsForRotate.length !== 2)
129
182
  return 0;
130
- const [n, h] = this.positionsForRotate, o = d(this.five.camera, n, t), c = d(this.five.camera, h, t);
131
- if (!o || !c)
183
+ const [a, l] = this.positionsForRotate, s = m(this.five.camera, a, e), n = m(this.five.camera, l, e);
184
+ if (!s || !n)
132
185
  return 0;
133
- const p = o.leftPx > c.leftPx ? c : o, r = o.leftPx > c.leftPx ? o : c, v = r.leftPx - p.leftPx, y = r.topPx - p.topPx;
134
- return Math.atan2(y, v) * (180 / Math.PI);
186
+ const r = s.leftPx > n.leftPx ? n : s, p = s.leftPx > n.leftPx ? s : n, f = p.leftPx - r.leftPx, u = p.topPx - r.topPx;
187
+ return Math.atan2(u, f) * (180 / Math.PI);
135
188
  })();
136
- this.container.style.left = e.leftPx + "px", this.container.style.top = e.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${i})`, a && (this.container.style.transform += ` rotate(${a}deg)`);
189
+ this.container.style.left = t.leftPx + "px", this.container.style.top = t.topPx + "px", this.container.style.transformOrigin = "center", this.container.style.transform = `scale(${o})`, h && (this.container.style.transform += ` rotate(${h}deg)`);
137
190
  }
138
191
  addResizeListener() {
139
- const t = this.five.getElement();
140
- if (t) {
141
- const { observe: e, unobserve: i } = x(this.onCameraUpdate, t);
142
- e(), this.disposers.push(i);
192
+ const e = this.five.getElement();
193
+ if (e) {
194
+ const { observe: t, unobserve: o } = U(this.onCameraUpdate, e);
195
+ t(), this.disposers.push(o);
143
196
  }
144
197
  }
145
198
  }
146
- function S(...l) {
147
- return new w(...l);
199
+ function k(...c) {
200
+ return new w(...c);
148
201
  }
149
202
  export {
150
203
  w as LightTag,
151
- S as tag
204
+ k as tag
152
205
  };
@@ -8,3 +8,7 @@ import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
8
8
  import "./core/Sphere.js";
9
9
  import "animejs";
10
10
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
11
+ import "../../Sculpt/Meshes/Polygon.js";
12
+ import "../../Sculpt/utils/Modules/Global.js";
13
+ import "../../vendor/hotkeys-js/dist/hotkeys.esm.js";
14
+ import "../../Sculpt/utils/three/rayOnLine.js";
@@ -1,2 +1,2 @@
1
- import * as THREE from 'three';
2
- export declare const _raycaster: THREE.Raycaster;
1
+ import { THREERaycaster } from './core/Raycaster';
2
+ export declare const _raycaster: THREERaycaster;
@@ -1,6 +1,6 @@
1
- import * as r from "three";
2
- const a = new r.Raycaster();
3
- a.params.Points.threshold = 0.02;
1
+ import { THREERaycaster as r } from "./core/Raycaster.js";
2
+ const t = new r();
3
+ t.params.Points.threshold = 0.02;
4
4
  export {
5
- a as _raycaster
5
+ t as _raycaster
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.50.17-alpha.0",
3
+ "version": "3.51.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",