@realsee/dnalogel 3.46.1 → 3.47.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 (34) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/Sculpt/Meshes/Polygon.d.ts +6 -0
  3. package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
  4. package/dist/Sculpt/Meshes/Polyline.d.ts +7 -0
  5. package/dist/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
  6. package/dist/index.cjs.js +39 -39
  7. package/dist/index.js +2161 -2118
  8. package/dist/index.umd.js +34 -34
  9. package/dist/shared-utils/five/getPosition.d.ts +2 -0
  10. package/dist/shared-utils/three/PointSelector/index.d.ts +14 -10
  11. package/dist/typings/typings.d.ts +2 -0
  12. package/libs/Sculpt/Meshes/Polygon.d.ts +6 -0
  13. package/libs/Sculpt/Meshes/Polygon.js +7 -4
  14. package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
  15. package/libs/Sculpt/Meshes/PolygonWithEdge.js +38 -24
  16. package/libs/Sculpt/Meshes/Polyline.d.ts +7 -0
  17. package/libs/Sculpt/Meshes/Polyline.js +32 -23
  18. package/libs/Sculpt/Objects/Line/Editor.js +6 -6
  19. package/libs/Sculpt/Objects/Line/index.js +16 -16
  20. package/libs/Sculpt/Objects/Point/Editor.js +10 -10
  21. package/libs/Sculpt/Objects/Polygon/Editor.js +6 -6
  22. package/libs/Sculpt/Objects/Polygon/index.js +43 -37
  23. package/libs/Sculpt/Objects/Polyline/Editor.js +3 -3
  24. package/libs/Sculpt/Objects/Polyline/index.js +43 -43
  25. package/libs/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
  26. package/libs/Sculpt/utils/three/ColoredMesh.js +39 -31
  27. package/libs/base/BasePlugin.js +1 -1
  28. package/libs/shared-utils/five/getPosition.d.ts +2 -0
  29. package/libs/shared-utils/five/getPosition.js +25 -30
  30. package/libs/shared-utils/logger.js +1 -1
  31. package/libs/shared-utils/three/PointSelector/index.d.ts +14 -10
  32. package/libs/shared-utils/three/PointSelector/index.js +74 -57
  33. package/libs/typings/typings.d.ts +2 -0
  34. package/package.json +1 -1
@@ -2,50 +2,50 @@ var F = Object.defineProperty, L = Object.defineProperties;
2
2
  var N = Object.getOwnPropertyDescriptors;
3
3
  var x = Object.getOwnPropertySymbols;
4
4
  var O = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
5
- var u = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, g = (o, e) => {
5
+ var w = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, u = (o, e) => {
6
6
  for (var t in e || (e = {}))
7
- O.call(e, t) && u(o, t, e[t]);
7
+ O.call(e, t) && w(o, t, e[t]);
8
8
  if (x)
9
9
  for (var t of x(e))
10
- U.call(e, t) && u(o, t, e[t]);
10
+ U.call(e, t) && w(o, t, e[t]);
11
11
  return o;
12
- }, j = (o, e) => L(o, N(e));
13
- var y = (o, e, t) => (u(o, typeof e != "symbol" ? e + "" : e, t), t);
14
- var T = (o, e, t) => new Promise((f, d) => {
12
+ }, V = (o, e) => L(o, N(e));
13
+ var y = (o, e, t) => (w(o, typeof e != "symbol" ? e + "" : e, t), t);
14
+ var j = (o, e, t) => new Promise((c, d) => {
15
15
  var n = (l) => {
16
16
  try {
17
- h(t.next(l));
17
+ r(t.next(l));
18
18
  } catch (s) {
19
19
  d(s);
20
20
  }
21
21
  }, p = (l) => {
22
22
  try {
23
- h(t.throw(l));
23
+ r(t.throw(l));
24
24
  } catch (s) {
25
25
  d(s);
26
26
  }
27
- }, h = (l) => l.done ? f(l.value) : Promise.resolve(l.value).then(n, p);
28
- h((t = t.apply(o, e)).next());
27
+ }, r = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(n, p);
28
+ r((t = t.apply(o, e)).next());
29
29
  });
30
30
  import { hotkeys as k } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
31
  import { BaseObject as z } from "../Base/index.js";
32
32
  import * as P from "three";
33
- import { PolylineMesh as A } from "../../Meshes/Polyline.js";
34
- import { AreaMesh as V } from "../../Meshes/Area.js";
33
+ import { PolylineMesh as T } from "../../Meshes/Polyline.js";
34
+ import { AreaMesh as A } from "../../Meshes/Area.js";
35
35
  import { PolygonEditor as B } from "./Editor.js";
36
36
  import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
37
37
  const D = new P.Vector3();
38
38
  class X extends z {
39
- constructor(t, f) {
40
- super(t, f);
39
+ constructor(t, c) {
40
+ super(t, c);
41
41
  y(this, "type", "Polygon");
42
42
  y(this, "areaMesh");
43
- this.editor = new B(this), t && (this.areaMesh = new V(g(g({}, t.style), t)), this.add(this.areaMesh)), k("esc", () => {
43
+ this.editor = new B(this), t && (this.areaMesh = new A(u(u({}, t.style), t)), this.add(this.areaMesh)), k("esc", () => {
44
44
  this.stopCreating();
45
45
  });
46
46
  }
47
47
  get data() {
48
- return j(g({}, this.baseData), {
48
+ return V(u({}, this.baseData), {
49
49
  points: H(this.applyObjectMatrixWorld(this.areaMesh.points)),
50
50
  style: {
51
51
  color: this.areaMesh.color.getHex(),
@@ -63,48 +63,54 @@ class X extends z {
63
63
  (t = this.areaMesh) == null || t.unhighlight();
64
64
  }
65
65
  create(t) {
66
- return T(this, null, function* () {
66
+ return j(this, null, function* () {
67
67
  this.children.forEach((d) => {
68
68
  d.parent === this && this.remove(d);
69
69
  }), this.children.length = 0;
70
- const f = new V(t);
71
- this.areaMesh = f, this.add(this.areaMesh), yield I(this.areaMesh, this.pointSelector, t), this.editor.enable();
70
+ const c = new A(t);
71
+ this.areaMesh = c, this.add(this.areaMesh), yield I(this.areaMesh, this.pointSelector, t), this.editor.enable();
72
72
  });
73
73
  }
74
74
  }
75
75
  function I(o, e, t) {
76
- return new Promise((f, d) => {
76
+ return new Promise((c, d) => {
77
77
  var M;
78
78
  const n = o.parent;
79
79
  if (!n) {
80
80
  d(new Error("No container"));
81
81
  return;
82
82
  }
83
- const p = (M = t == null ? void 0 : t.limit) != null ? M : "none", h = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
84
- n == null || n.add(h);
85
- const l = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
83
+ const p = (M = t == null ? void 0 : t.limit) != null ? M : "none", r = new T({
84
+ dashed: !1,
85
+ lineColor: o.lineColor,
86
+ lineWidth: o.lineWidth,
87
+ occlusionMode: o.occlusionMode,
88
+ occlusionVisibility: o.occlusionVisibility
89
+ });
90
+ n == null || n.add(r);
91
+ const l = new T({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
86
92
  n == null || n.add(l), e.enable();
87
93
  const s = [];
88
- let i, a, w = !1;
89
- const C = (r) => {
90
- const c = s.length === 0 ? r.point : i.clone();
91
- s.push(c), o.setPoints(s, { closed: !1 }), w && (b(), f());
92
- }, v = (r) => {
93
- if (!(s != null && s.length) || !r)
94
+ let i, a, g = !1;
95
+ const C = (h) => {
96
+ const f = s.length === 0 ? h.point : i.clone();
97
+ s.push(f), o.setPoints(s, { closed: !1 }), g && (v(), c());
98
+ }, b = (h) => {
99
+ if (!(s != null && s.length) || !h)
94
100
  return;
95
- const c = s.at(-1).clone();
96
- if (s.length < 3 && (p === "none" ? (i = r.point, h.setPoints([c, i])) : p === "xoz" ? (a = a != null ? a : new P.Plane().setFromNormalAndCoplanarPoint(new P.Vector3(0, 1, 0), s[0]), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])) : p === "y" && (s.length === 1 ? (i = r.point, h.setPoints([c, i])) : (a = a != null ? a : new P.Plane().setFromCoplanarPoints(s[0], s[1], new P.Vector3(0, 1, 0).add(s[0])), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])))), s.length >= 3) {
97
- i = o.projectPoint(r.point);
101
+ const f = s.at(-1).clone();
102
+ if (s.length < 3 && (p === "none" ? (i = h.point, r.setPoints([f, i])) : p === "xoz" ? (a = a != null ? a : new P.Plane().setFromNormalAndCoplanarPoint(new P.Vector3(0, 1, 0), s[0]), e.plane = a, i = a.projectPoint(h.point, D), r.setPoints([f, i]), l.setPoints([i, h.point])) : p === "y" && (s.length === 1 ? (i = h.point, r.setPoints([f, i])) : (a = a != null ? a : new P.Plane().setFromCoplanarPoints(s[0], s[1], new P.Vector3(0, 1, 0).add(s[0])), e.plane = a, i = a.projectPoint(h.point, D), r.setPoints([f, i]), l.setPoints([i, h.point])))), s.length >= 3) {
103
+ i = o.projectPoint(h.point);
98
104
  const m = s[0], W = 0.2;
99
- m.distanceTo(i) < W || m.distanceTo(r.point) < W ? (i = m, r.point.copy(m), e.pointSelectorHelper.updateWithIntersect(r, { emitEvent: !1 }), w = !0) : w = !1, h.setPoints([c, i]), l.setPoints([i, r.point]);
105
+ m.distanceTo(i) < W || m.distanceTo(h.point) < W ? (i = m, h.point.copy(m), e.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 }), g = !0) : g = !1, r.setPoints([f, i]), l.setPoints([i, h.point]);
100
106
  }
101
107
  s.length >= 2 && o.setPoints([...s, i], { closed: !1 });
102
- }, b = () => {
103
- e.off("select", C), e.off("intersectionUpdate", v), e.off("disable", E), e.disable(), n == null || n.remove(h, l);
108
+ }, v = () => {
109
+ e.off("select", C), e.off("intersectionUpdate", b), e.off("disable", E), e.plane = null, e.disable(), n == null || n.remove(r, l);
104
110
  }, E = () => {
105
- b(), n == null || n.remove(o, l, h), d(new Error("Cancelled"));
111
+ v(), n == null || n.remove(o, l, r), d(new Error("Cancelled"));
106
112
  };
107
- e.on("select", C), e.on("intersectionUpdate", v), e.on("disable", E);
113
+ e.on("select", C), e.on("intersectionUpdate", b), e.on("disable", E);
108
114
  });
109
115
  }
110
116
  export {
@@ -4,13 +4,13 @@ var r = (o, i, t) => (p(o, typeof i != "symbol" ? i + "" : i, t), t);
4
4
  import { Sculpt as g } from "../../index.js";
5
5
  import { getIntersectByRaycaster as c } from "../../../shared-utils/five/getPosition.js";
6
6
  import { LineEditorAbstract as a } from "../Line/Editor.js";
7
- class d extends a {
7
+ class y extends a {
8
8
  constructor(t) {
9
9
  super(t);
10
10
  r(this, "onDrag", (t) => {
11
11
  if (!this.draggingPoints || this.draggingPoints.length === 0)
12
12
  return;
13
- const e = c(g.modules.five, t.raycaster, { virtualPoint: !0 });
13
+ const e = c(g.modules.five, t.raycaster);
14
14
  this.draggingPoints.forEach((s) => s.position.copy(e.point)), this.originObject.polyLineMesh.setPoints(this.pointMeshes.map((s) => s.position));
15
15
  });
16
16
  }
@@ -19,5 +19,5 @@ class d extends a {
19
19
  }
20
20
  }
21
21
  export {
22
- d as PolylineEditor
22
+ y as PolylineEditor
23
23
  };
@@ -1,45 +1,45 @@
1
1
  var j = Object.defineProperty, E = Object.defineProperties;
2
2
  var V = Object.getOwnPropertyDescriptors;
3
- var v = Object.getOwnPropertySymbols;
3
+ var C = Object.getOwnPropertySymbols;
4
4
  var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
5
  var f = (i, t, e) => t in i ? j(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, w = (i, t) => {
6
6
  for (var e in t || (t = {}))
7
7
  A.call(t, e) && f(i, e, t[e]);
8
- if (v)
9
- for (var e of v(t))
8
+ if (C)
9
+ for (var e of C(t))
10
10
  D.call(t, e) && f(i, e, t[e]);
11
11
  return i;
12
12
  }, M = (i, t) => E(i, V(t));
13
13
  var u = (i, t, e) => (f(i, typeof t != "symbol" ? t + "" : t, e), e);
14
- var L = (i, t, e) => new Promise((o, d) => {
15
- var a = (r) => {
14
+ var L = (i, t, e) => new Promise((n, d) => {
15
+ var a = (h) => {
16
16
  try {
17
- c(e.next(r));
18
- } catch (y) {
19
- d(y);
17
+ P(e.next(h));
18
+ } catch (m) {
19
+ d(m);
20
20
  }
21
- }, p = (r) => {
21
+ }, p = (h) => {
22
22
  try {
23
- c(e.throw(r));
24
- } catch (y) {
25
- d(y);
23
+ P(e.throw(h));
24
+ } catch (m) {
25
+ d(m);
26
26
  }
27
- }, c = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(a, p);
28
- c((e = e.apply(i, t)).next());
27
+ }, P = (h) => h.done ? n(h.value) : Promise.resolve(h.value).then(a, p);
28
+ P((e = e.apply(i, t)).next());
29
29
  });
30
30
  import { hotkeys as F } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
- import { PolylineWithDotsMesh as W, PolylineMesh as b } from "../../Meshes/Polyline.js";
31
+ import { PolylineWithDotsMesh as b, PolylineMesh as W } from "../../Meshes/Polyline.js";
32
32
  import { BaseObject as O } from "../Base/index.js";
33
- import * as m from "three";
33
+ import * as c from "three";
34
34
  import { PolylineEditor as T } from "./Editor.js";
35
35
  import { vector3ToArray as U } from "../../../shared-utils/three/vector3ToArray.js";
36
- const x = new m.Vector3();
36
+ const x = new c.Vector3();
37
37
  class G extends O {
38
- constructor(e, o) {
39
- super(e, o);
38
+ constructor(e, n) {
39
+ super(e, n);
40
40
  u(this, "type", "Polyline");
41
41
  u(this, "polyLineMesh");
42
- e && (this.polyLineMesh = new W(w(w({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new T(this), F("esc", () => {
42
+ e && (this.polyLineMesh = new b(w(w({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new T(this), F("esc", () => {
43
43
  this.stopCreating();
44
44
  });
45
45
  }
@@ -47,7 +47,7 @@ class G extends O {
47
47
  return M(w({}, this.baseData), {
48
48
  points: U(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
49
49
  style: {
50
- lineColor: new m.Color(this.polyLineMesh.lineColor).getHex(),
50
+ lineColor: new c.Color(this.polyLineMesh.lineColor).getHex(),
51
51
  lineWidth: this.polyLineMesh.lineWidth,
52
52
  dashed: this.polyLineMesh.dashed
53
53
  }
@@ -64,35 +64,35 @@ class G extends O {
64
64
  create(e) {
65
65
  return L(this, null, function* () {
66
66
  this.removeChildren();
67
- const o = new W(e);
68
- this.polyLineMesh = o, this.add(this.polyLineMesh), yield k(o, this.pointSelector, e), this.editor.enable();
67
+ const n = new b(e);
68
+ this.polyLineMesh = n, this.add(this.polyLineMesh), yield k(n, this.pointSelector, e), this.editor.enable();
69
69
  });
70
70
  }
71
71
  }
72
72
  function k(i, t, e) {
73
- var c;
74
- const o = i.parent;
75
- if (!o)
73
+ var P;
74
+ const n = i.parent;
75
+ if (!n)
76
76
  return;
77
- const d = (c = e == null ? void 0 : e.limit) != null ? c : "none", a = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
78
- o.add(a);
79
- const p = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
80
- return o.add(p), t.enable(), new Promise((r, y) => {
81
- const n = [];
82
- let s, l;
83
- const C = (h) => {
84
- const P = n.length === 0 ? h.point : s.clone();
85
- n.push(P), i.setPoints(n);
86
- }, g = (h) => {
87
- if (!(n != null && n.length) || !h)
77
+ const d = (P = e == null ? void 0 : e.limit) != null ? P : "none", a = new W(i.style);
78
+ n.add(a);
79
+ const p = new W({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
80
+ return n.add(p), t.enable(), new Promise((h, m) => {
81
+ const o = [];
82
+ let l, s;
83
+ const g = (r) => {
84
+ const y = o.length === 0 ? r.point : l.clone();
85
+ o.push(y), i.setPoints(o);
86
+ }, v = (r) => {
87
+ if (!(o != null && o.length) || !r)
88
88
  return;
89
- const P = n.at(-1).clone();
90
- d === "none" ? (s = h.point, a.setPoints([P, s])) : d === "xoz" ? (l = l != null ? l : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), n[0]), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])) : d === "y" && (n.length === 1 ? (s = h.point, a.setPoints([P, s])) : (l = l != null ? l : new m.Plane().setFromCoplanarPoints(n[0], n[1], new m.Vector3(0, 1, 0).add(n[0])), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])));
89
+ const y = o.at(-1).clone();
90
+ d === "none" ? (l = r.point, a.setPoints([y, l])) : d === "xoz" ? (s = s != null ? s : new c.Plane().setFromNormalAndCoplanarPoint(new c.Vector3(0, 1, 0), o[0]), t.plane = s, l = s.projectPoint(r.point, x), a.setPoints([y, l]), p.setPoints([l, r.point])) : d === "y" && (o.length === 1 ? (l = r.point, a.setPoints([y, l])) : (s = s != null ? s : new c.Plane().setFromCoplanarPoints(o[0], o[1], new c.Vector3(0, 1, 0).add(o[0])), t.plane = s, l = s.projectPoint(r.point, x), a.setPoints([y, l]), p.setPoints([l, r.point])));
91
91
  };
92
- t.on("select", C), t.on("intersectionUpdate", g), t.on("disable", () => {
93
- if (t.off("select", C), t.off("intersectionUpdate", g), o.remove(a), o.remove(p), n.length < 2)
94
- return o.remove(i), y(new Error("Cancelled"));
95
- r();
92
+ t.on("select", g), t.on("intersectionUpdate", v), t.on("disable", () => {
93
+ if (t.off("select", g), t.off("intersectionUpdate", v), t.plane = null, n.remove(a), n.remove(p), o.length < 2)
94
+ return n.remove(i), m(new Error("Cancelled"));
95
+ h();
96
96
  });
97
97
  });
98
98
  }
@@ -6,6 +6,12 @@ export default class ColoredMesh<TGeometry extends THREE.Geometry | THREE.Buffer
6
6
  name: string;
7
7
  meshFont: THREE.Mesh<TGeometry, THREE.MeshBasicMaterial>;
8
8
  meshBackground: THREE.Mesh<TGeometry, THREE.MeshBasicMaterial>;
9
+ get style(): {
10
+ color: THREE.Color;
11
+ opacity: number;
12
+ occlusionVisibility: boolean;
13
+ occlusionMode: string;
14
+ };
9
15
  get color(): THREE.Color;
10
16
  get opacity(): number;
11
17
  get occlusionVisibility(): boolean;
@@ -1,17 +1,17 @@
1
1
  var g = Object.defineProperty;
2
2
  var a = Object.getOwnPropertySymbols;
3
- var f = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
4
- var d = (i, t, e) => t in i ? g(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, u = (i, t) => {
5
- for (var e in t || (t = {}))
6
- f.call(t, e) && d(i, e, t[e]);
3
+ var f = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
4
+ var u = (i, e, t) => e in i ? g(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, d = (i, e) => {
5
+ for (var t in e || (e = {}))
6
+ f.call(e, t) && u(i, t, e[t]);
7
7
  if (a)
8
- for (var e of a(t))
9
- F.call(t, e) && d(i, e, t[e]);
8
+ for (var t of a(e))
9
+ M.call(e, t) && u(i, t, e[t]);
10
10
  return i;
11
11
  };
12
- var r = (i, t, e) => (d(i, typeof t != "symbol" ? t + "" : t, e), e);
12
+ var n = (i, e, t) => (u(i, typeof e != "symbol" ? e + "" : e, t), t);
13
13
  import * as s from "three";
14
- import { DEFAULT_COLOR as M } from "../../typings/style.js";
14
+ import { DEFAULT_COLOR as F } from "../../typings/style.js";
15
15
  import { IObject3D as B } from "../../../shared-utils/three/IObject3D.js";
16
16
  import "hammerjs";
17
17
  import "three/examples/jsm/renderers/CSS3DRenderer";
@@ -19,33 +19,41 @@ import "@realsee/five/line";
19
19
  import "../Modules/Global.js";
20
20
  import "../../../shared-utils/three/THREESphere.js";
21
21
  import "animejs";
22
- import { notNil as m } from "../../../shared-utils/isNil.js";
22
+ import { notNil as y } from "../../../shared-utils/isNil.js";
23
23
  import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
24
24
  class _ extends B {
25
- constructor(e) {
26
- var h, y;
25
+ constructor(t) {
26
+ var h, m;
27
27
  super();
28
- r(this, "name", "ColoredMesh");
29
- r(this, "meshFont");
30
- r(this, "meshBackground");
31
- r(this, "paramsStyle", {});
32
- r(this, "_geometry", new s.BufferGeometry());
33
- this.paramsStyle = e != null ? e : {};
34
- const c = new s.MeshBasicMaterial({
35
- color: (h = e == null ? void 0 : e.color) != null ? h : M,
28
+ n(this, "name", "ColoredMesh");
29
+ n(this, "meshFont");
30
+ n(this, "meshBackground");
31
+ n(this, "paramsStyle", {});
32
+ n(this, "_geometry", new s.BufferGeometry());
33
+ this.paramsStyle = t != null ? t : {};
34
+ const r = new s.MeshBasicMaterial({
35
+ color: (h = t == null ? void 0 : t.color) != null ? h : F,
36
36
  transparent: !0,
37
37
  side: s.DoubleSide,
38
38
  depthTest: !0,
39
- opacity: (y = e == null ? void 0 : e.opacity) != null ? y : 0.5
39
+ opacity: (m = t == null ? void 0 : t.opacity) != null ? m : 0.5
40
40
  }), l = new s.MeshBasicMaterial({
41
41
  color: 16777215,
42
42
  transparent: !0,
43
43
  side: s.DoubleSide,
44
44
  depthTest: !1,
45
45
  depthWrite: !1,
46
- opacity: 0.3 / 0.5 * c.opacity
47
- }), o = new s.Mesh(this.geometry, c), n = new s.Mesh(this.geometry, l);
48
- o.name = "MeshFront", n.name = "MeshBackground", o.renderOrder = 1, n.renderOrder = 0, this.meshFont = o, this.meshBackground = n, this.add(o), this.setOcclusionVisibility({ occlusionVisibility: e == null ? void 0 : e.occlusionVisibility, occlusionMode: e == null ? void 0 : e.occlusionMode });
46
+ opacity: 0.3 / 0.5 * r.opacity
47
+ }), o = new s.Mesh(this.geometry, r), c = new s.Mesh(this.geometry, l);
48
+ o.name = "MeshFront", c.name = "MeshBackground", o.renderOrder = 1, c.renderOrder = 0, this.meshFont = o, this.meshBackground = c, this.add(o), this.setOcclusionVisibility({ occlusionVisibility: t == null ? void 0 : t.occlusionVisibility, occlusionMode: t == null ? void 0 : t.occlusionMode });
49
+ }
50
+ get style() {
51
+ return {
52
+ color: this.color,
53
+ opacity: this.opacity,
54
+ occlusionVisibility: this.occlusionVisibility,
55
+ occlusionMode: this.occlusionMode
56
+ };
49
57
  }
50
58
  get color() {
51
59
  return this.meshFont.material.color;
@@ -59,19 +67,19 @@ class _ extends B {
59
67
  get occlusionMode() {
60
68
  return this.meshFont.material.depthTest === !1 ? "depthTest" : "translucence";
61
69
  }
62
- set geometry(e) {
63
- this._geometry = e, this.meshFont.geometry = e, this.meshBackground.geometry = e;
70
+ set geometry(t) {
71
+ this._geometry = t, this.meshFont.geometry = t, this.meshBackground.geometry = t;
64
72
  }
65
73
  get geometry() {
66
74
  return this._geometry;
67
75
  }
68
- setStyle(e) {
69
- this.paramsStyle = u(u({}, this.paramsStyle), e), m(e.color) && (this.meshFont.material.color.set(e.color), this.needsRender = !0), m(e.opacity) && (this.meshFont.material.opacity = e.opacity, this.meshBackground.material.opacity = 0.3 / 0.5 * e.opacity, this.needsRender = !0), this.setOcclusionVisibility(e);
76
+ setStyle(t) {
77
+ this.paramsStyle = d(d({}, this.paramsStyle), t), y(t.color) && (this.meshFont.material.color.set(t.color), this.needsRender = !0), y(t.opacity) && (this.meshFont.material.opacity = t.opacity, this.meshBackground.material.opacity = 0.3 / 0.5 * t.opacity, this.needsRender = !0), this.setOcclusionVisibility(t);
70
78
  }
71
- setOcclusionVisibility(e) {
72
- var o, n, h;
73
- const c = (n = (o = e.occlusionMode) != null ? o : this.paramsStyle.occlusionMode) != null ? n : "translucence", l = (h = e.occlusionVisibility) != null ? h : this.paramsStyle.occlusionVisibility;
74
- m(l) && (l ? c === "depthTest" ? (this.meshFont.material.depthTest = !1, this.remove(this.meshBackground)) : c === "translucence" && (this.meshFont.material.depthTest = !0, this.addIfNotExists(this.meshBackground)) : (this.meshFont.material.depthTest = !0, this.remove(this.meshBackground)));
79
+ setOcclusionVisibility(t) {
80
+ var o, c, h;
81
+ const r = (c = (o = t.occlusionMode) != null ? o : this.paramsStyle.occlusionMode) != null ? c : "translucence", l = (h = t.occlusionVisibility) != null ? h : this.paramsStyle.occlusionVisibility;
82
+ y(l) && (l ? r === "depthTest" ? (this.meshFont.material.depthTest = !1, this.remove(this.meshBackground)) : r === "translucence" && (this.meshFont.material.depthTest = !0, this.addIfNotExists(this.meshBackground)) : (this.meshFont.material.depthTest = !0, this.remove(this.meshBackground)));
75
83
  }
76
84
  }
77
85
  export {
@@ -17,7 +17,7 @@ let x = class {
17
17
  /**
18
18
  * @realsee/dnalogel 版本号
19
19
  */
20
- i(this, "VERSION", "3.46.1");
20
+ i(this, "VERSION", "3.47.0");
21
21
  i(this, "NAME");
22
22
  i(this, "five");
23
23
  i(this, "workUtil");
@@ -19,4 +19,6 @@ export declare function getIntersectByNdcPosition(five: Five, position: {
19
19
  export declare function getIntersectByRaycaster(five: Five, raycaster: THREE.Raycaster, config?: {
20
20
  virtualPoint?: boolean;
21
21
  }): IIntersection | undefined;
22
+ export declare function getVirtualIntersectByRaycaster(raycaster: THREE.Raycaster, distance?: number): IIntersection;
23
+ export declare function getRealIntersectByRaycaster(five: Five, raycaster: THREE.Raycaster): IIntersection;
22
24
  export {};
@@ -1,46 +1,41 @@
1
- var u = Object.defineProperty, d = Object.defineProperties;
2
- var m = Object.getOwnPropertyDescriptors;
1
+ var u = Object.defineProperty, m = Object.defineProperties;
2
+ var d = Object.getOwnPropertyDescriptors;
3
3
  var c = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
5
- var s = (t, e, n) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, a = (t, e) => {
6
- for (var n in e || (e = {}))
7
- y.call(e, n) && s(t, n, e[n]);
4
+ var p = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
+ var s = (e, t, n) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, l = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ p.call(t, n) && s(e, n, t[n]);
8
8
  if (c)
9
- for (var n of c(e))
10
- p.call(e, n) && s(t, n, e[n]);
11
- return t;
12
- }, l = (t, e) => d(t, m(e));
9
+ for (var n of c(t))
10
+ y.call(t, n) && s(e, n, t[n]);
11
+ return e;
12
+ }, a = (e, t) => m(e, d(t));
13
13
  import * as i from "three";
14
- import { getRaycasterByNdcPosition as R } from "./getRaycasterByNdcPosition.js";
15
- import { getFiveModel as f } from "./getFiveModel.js";
16
- function P(t, e, n) {
17
- const r = R(t, e);
18
- return B(t, r, n);
14
+ import { getFiveModel as R } from "./getFiveModel.js";
15
+ function w(e, t, n) {
16
+ const r = V(e, t);
17
+ return n != null && n.virtualPoint ? r != null ? r : f(t) : r;
19
18
  }
20
- function B(t, e, n) {
21
- const r = V(t, e);
22
- return n != null && n.virtualPoint ? r != null ? r : I(e) : r;
23
- }
24
- function I(t) {
19
+ function f(e, t = 3) {
25
20
  const n = new i.Vector3().addVectors(
26
- t.ray.origin,
27
- t.ray.direction.clone().normalize().multiplyScalar(3)
28
- ), r = t.ray.direction.clone().negate();
21
+ e.ray.origin,
22
+ e.ray.direction.clone().normalize().multiplyScalar(t)
23
+ ), r = e.ray.direction.clone().negate();
29
24
  return {
30
- distance: 3,
25
+ distance: t,
31
26
  point: n,
32
27
  object: new i.Object3D(),
33
28
  face: new i.Face3(0, 0, 0, r),
34
- raycaster: t,
29
+ raycaster: e,
35
30
  isVirtual: !0
36
31
  };
37
32
  }
38
- function V(t, e) {
39
- const o = f(t).intersectRaycaster(e)[0];
33
+ function V(e, t) {
34
+ const o = R(e).intersectRaycaster(t)[0];
40
35
  if (o)
41
- return l(a({}, o), { raycaster: e, isVirtual: !1 });
36
+ return a(l({}, o), { raycaster: t, isVirtual: !1 });
42
37
  }
43
38
  export {
44
- P as getIntersectByNdcPosition,
45
- B as getIntersectByRaycaster
39
+ w as getIntersectByRaycaster,
40
+ f as getVirtualIntersectByRaycaster
46
41
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.46.1",
3
+ "%c %c@realsee/dnalogel %cv3.47.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",
@@ -1,8 +1,10 @@
1
- import type { Five, Mode as FiveMode } from '@realsee/five';
1
+ import type { Five } from '@realsee/five';
2
2
  import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
3
- import type { Vector3 } from 'three';
3
+ import { type Vector3 } from 'three';
4
+ import * as THREE from 'three';
4
5
  import { Subscribe } from '../../Subscribe';
5
6
  export type { PointIntersection };
7
+ type ActionIfNoModelUnderMouse = 'virtualPoint' | 'lastPoint' | 'disable';
6
8
  interface Config {
7
9
  /**
8
10
  * @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
@@ -10,15 +12,15 @@ interface Config {
10
12
  */
11
13
  mode: 'fixed' | 'cursor' | 'auto';
12
14
  /**
13
- * @description 当鼠标位置没有模型时,是否生成一个虚拟点
15
+ * @description 当鼠标位置没有模型时的行为
14
16
  * ```markdown
15
- * true: 生成虚拟点
16
- * false: 不生成虚拟点
17
- * FiveMode[]: 指定的five mode下才生成虚拟点,推荐 ['Panorama']
17
+ * virtualPoint: 生成一个虚拟点
18
+ * lastPoint: 选点器停留在上一个点处
19
+ * disable: 禁止选点
18
20
  * ```
19
- * @default: true
21
+ * @default 'virtualPoint'
20
22
  */
21
- virtualPoint: boolean | FiveMode[];
23
+ actionIfNoModelUnderMouse: ActionIfNoModelUnderMouse;
22
24
  helper: PointSelectorHelperConfig;
23
25
  }
24
26
  export type PointSelectorConfig = Partial<Config>;
@@ -55,6 +57,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
55
57
  */
56
58
  outOfFive: boolean;
57
59
  enabled: boolean;
60
+ actionIfNoModelUnderMouse: ActionIfNoModelUnderMouse;
61
+ plane?: THREE.Plane | null;
58
62
  pointSelectorHelper: PointSelectorHelper;
59
63
  /** @deprecated directly use `pointSelector.on/off` instead */
60
64
  hook: this;
@@ -68,10 +72,10 @@ export declare class PointSelector extends Subscribe<EventMap> {
68
72
  /** 吸附点的半径 */
69
73
  private adherePointsRadius;
70
74
  private lastFiveHelperVisible?;
75
+ private lastIntersection?;
71
76
  private mousePosition;
72
77
  private config;
73
78
  private get mouseNdcPosition();
74
- private get virtualPoint();
75
79
  constructor(five: Five, config?: PointSelectorConfig);
76
80
  enable(): void;
77
81
  disable(): void;
@@ -109,7 +113,7 @@ export declare class PointSelector extends Subscribe<EventMap> {
109
113
  private onPanEnd;
110
114
  private updateByMousePosition;
111
115
  /**
112
- * @description: 根据鼠标位置更新helper位置
116
+ * @description: 根据鼠标位置计算焦点位置并更新
113
117
  */
114
118
  private updateByNdcPosition;
115
119
  /**