@realsee/dnalogel 3.47.2 → 3.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/index.cjs.js +48 -48
- package/dist/index.js +2156 -2154
- package/dist/index.umd.js +41 -41
- package/libs/Sculpt/Meshes/Line.js +37 -35
- package/libs/Sculpt/Objects/Line/index.js +63 -63
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +26 -26
- package/package.json +2 -2
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var b = Object.getOwnPropertySymbols;
|
|
3
3
|
var S = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var f = (
|
|
4
|
+
var f = (s, o, e) => o in s ? _(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e, y = (s, o) => {
|
|
5
5
|
for (var e in o || (o = {}))
|
|
6
|
-
S.call(o, e) && f(
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
k.call(o, e) && f(
|
|
10
|
-
return
|
|
6
|
+
S.call(o, e) && f(s, e, o[e]);
|
|
7
|
+
if (b)
|
|
8
|
+
for (var e of b(o))
|
|
9
|
+
k.call(o, e) && f(s, e, o[e]);
|
|
10
|
+
return s;
|
|
11
11
|
};
|
|
12
|
-
var h = (
|
|
12
|
+
var h = (s, o, e) => (f(s, typeof o != "symbol" ? o + "" : o, e), e);
|
|
13
13
|
import * as a from "three";
|
|
14
|
-
import { DEFAULT_LINE_COLOR as
|
|
15
|
-
import { LineGeometry as
|
|
14
|
+
import { DEFAULT_LINE_COLOR as m, DEFAULT_LINE_WIDTH as M, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
|
|
15
|
+
import { LineGeometry as L, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
|
|
16
16
|
import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
|
|
17
17
|
import { IObject3D as I } from "../../shared-utils/three/IObject3D.js";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
20
|
-
import { centerPoint as
|
|
21
|
-
import { LightTag as
|
|
22
|
-
import { globalModules as
|
|
20
|
+
import { centerPoint as p } from "../../shared-utils/three/centerPoint.js";
|
|
21
|
+
import { LightTag as R } from "../../shared-utils/tag.js";
|
|
22
|
+
import { globalModules as x } from "../utils/Modules/Global.js";
|
|
23
23
|
import { removeAllTag as v } from "../utils/removeAllTag.js";
|
|
24
24
|
import "../../shared-utils/three/THREESphere.js";
|
|
25
25
|
import "animejs";
|
|
26
26
|
import { notNil as c } from "../../shared-utils/isNil.js";
|
|
27
27
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
28
|
-
class
|
|
28
|
+
class E extends w {
|
|
29
29
|
constructor(e) {
|
|
30
30
|
var n, t;
|
|
31
31
|
super(e);
|
|
@@ -44,7 +44,7 @@ class T extends w {
|
|
|
44
44
|
this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
class
|
|
47
|
+
class T extends H {
|
|
48
48
|
constructor(e, n) {
|
|
49
49
|
super(e, n);
|
|
50
50
|
h(this, "name", "Line3");
|
|
@@ -52,7 +52,7 @@ class E extends H {
|
|
|
52
52
|
}
|
|
53
53
|
class J extends I {
|
|
54
54
|
constructor(e) {
|
|
55
|
-
var
|
|
55
|
+
var l, r, g, u, d;
|
|
56
56
|
super();
|
|
57
57
|
h(this, "name", "LineMesh");
|
|
58
58
|
h(this, "points");
|
|
@@ -63,15 +63,15 @@ class J extends I {
|
|
|
63
63
|
h(this, "opacityBeforeHighlight");
|
|
64
64
|
h(this, "paramsStyle", {});
|
|
65
65
|
this.paramsStyle = e != null ? e : {};
|
|
66
|
-
const n = new
|
|
67
|
-
color: new a.Color((
|
|
66
|
+
const n = new L(), t = new E({
|
|
67
|
+
color: new a.Color((l = e == null ? void 0 : e.lineColor) != null ? l : m),
|
|
68
68
|
linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : M,
|
|
69
69
|
dashScale: 40,
|
|
70
|
-
opacity: (
|
|
70
|
+
opacity: (g = e == null ? void 0 : e.opacity) != null ? g : 1,
|
|
71
71
|
transparent: !0,
|
|
72
|
-
dashed: (
|
|
73
|
-
}), i = new
|
|
74
|
-
color: new a.Color((d = e == null ? void 0 : e.lineColor) != null ? d :
|
|
72
|
+
dashed: (u = e == null ? void 0 : e.dashed) != null ? u : !1
|
|
73
|
+
}), i = new E({
|
|
74
|
+
color: new a.Color((d = e == null ? void 0 : e.lineColor) != null ? d : m),
|
|
75
75
|
linewidth: t.linewidth * 0.9,
|
|
76
76
|
dashScale: t.dashScale,
|
|
77
77
|
opacity: t.opacity * 0.8,
|
|
@@ -80,7 +80,7 @@ class J extends I {
|
|
|
80
80
|
transparent: !0,
|
|
81
81
|
resolution: t.resolution
|
|
82
82
|
});
|
|
83
|
-
this.line = new
|
|
83
|
+
this.line = new T(n, t), this.backLine = new T(n, i), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
|
|
84
84
|
v(this);
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -111,11 +111,13 @@ class J extends I {
|
|
|
111
111
|
}
|
|
112
112
|
setPoints(e) {
|
|
113
113
|
const n = e.map(C).filter(c);
|
|
114
|
-
if (this.points = n, n.length < 2)
|
|
114
|
+
if (this.points = n, n.length < 2) {
|
|
115
|
+
this.line.geometry = new L(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
|
|
115
116
|
return;
|
|
117
|
+
}
|
|
116
118
|
this.addIfNotExists(this.line, this.backLine);
|
|
117
119
|
const t = n.flatMap((i) => [i.x, i.y, i.z]);
|
|
118
|
-
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new
|
|
120
|
+
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new L(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
|
|
119
121
|
}
|
|
120
122
|
setResolution(e, n) {
|
|
121
123
|
const t = this.line.material.resolution;
|
|
@@ -124,28 +126,28 @@ class J extends I {
|
|
|
124
126
|
(i.x !== e || i.y !== n) && (i.set(e, n), this.needsRender = !0);
|
|
125
127
|
}
|
|
126
128
|
setStyle(e) {
|
|
127
|
-
var i,
|
|
129
|
+
var i, l, r;
|
|
128
130
|
this.paramsStyle = y(y({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new a.Color(e.lineColor), this.backLine.material.three_color = new a.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
|
|
129
|
-
const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (r = (
|
|
131
|
+
const n = (i = e.occlusionVisibility) != null ? i : this.paramsStyle.occlusionVisibility, t = (r = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? r : "translucence";
|
|
130
132
|
n ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
|
|
131
133
|
}
|
|
132
134
|
highlight() {
|
|
133
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight *
|
|
135
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
|
|
134
136
|
}
|
|
135
137
|
unhighlight() {
|
|
136
138
|
this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
|
|
137
139
|
}
|
|
138
140
|
updateLengthItems() {
|
|
139
141
|
var e, n;
|
|
140
|
-
if (this.paramsStyle.lengthEnable) {
|
|
141
|
-
const t = (n = (e = this.points) == null ? void 0 : e.map((i,
|
|
142
|
-
if (
|
|
143
|
-
return [this.points[
|
|
142
|
+
if (this.points.length < 2 && (this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = []), this.paramsStyle.lengthEnable) {
|
|
143
|
+
const t = (n = (e = this.points) == null ? void 0 : e.map((i, l) => {
|
|
144
|
+
if (l !== 0)
|
|
145
|
+
return [this.points[l - 1], i];
|
|
144
146
|
}).filter(c)) != null ? n : [];
|
|
145
|
-
t.forEach(([i,
|
|
147
|
+
t.forEach(([i, l], r) => {
|
|
146
148
|
var d;
|
|
147
|
-
const
|
|
148
|
-
this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new x
|
|
149
|
+
const g = p(i, l), u = i.distanceTo(l).toFixed(2) + "m";
|
|
150
|
+
this.lengthDoms[r] = (d = this.lengthDoms[r]) != null ? d : new R(x.five), this.lengthDoms[r].setPosition(g), this.lengthDoms[r].container.innerHTML = `<div style="pointer-events:none;color:white;">${u}</div>`;
|
|
149
151
|
}), this.lengthDoms.length > t.length && (this.lengthDoms.slice(t.length).forEach((i) => i.destroy()), this.lengthDoms.length = t.length);
|
|
150
152
|
} else
|
|
151
153
|
this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = [];
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var W = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var O = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var C = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (i, t, e) => t in i ? W(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, P = (i, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
A.call(t, e) && u(i, e, t[e]);
|
|
8
|
+
if (C)
|
|
9
|
+
for (var e of C(t))
|
|
10
|
+
D.call(t, e) && u(i, e, t[e]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
}, y = (i, t) => j(i, O(t));
|
|
13
|
+
var L = (i, t, e) => (u(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var x = (i, t, e) => new Promise((s, c) => {
|
|
15
|
+
var a = (h) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
m(e.next(h));
|
|
18
18
|
} catch (p) {
|
|
19
|
-
|
|
19
|
+
c(p);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, d = (h) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
m(e.throw(h));
|
|
24
24
|
} catch (p) {
|
|
25
|
-
|
|
25
|
+
c(p);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, m = (h) => h.done ? s(h.value) : Promise.resolve(h.value).then(a, d);
|
|
28
|
+
m((e = e.apply(i, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import { hotkeys as
|
|
31
|
-
import { LineMesh as
|
|
32
|
-
import { BaseObject as
|
|
33
|
-
import * as
|
|
34
|
-
import { LineEditor as
|
|
35
|
-
import { vector3ToArray as
|
|
36
|
-
import { LineWithDotsMesh as
|
|
37
|
-
import { rayOnLine as
|
|
38
|
-
const
|
|
39
|
-
class
|
|
40
|
-
constructor(e,
|
|
41
|
-
super(e,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
e && (this.lineMesh = new
|
|
30
|
+
import { hotkeys as U } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
|
+
import { LineMesh as E } from "../../Meshes/Line.js";
|
|
32
|
+
import { BaseObject as k } from "../Base/index.js";
|
|
33
|
+
import * as r from "three";
|
|
34
|
+
import { LineEditor as z } from "./Editor.js";
|
|
35
|
+
import { vector3ToArray as B } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
|
+
import { LineWithDotsMesh as V } from "../../Meshes/LineWithDots.js";
|
|
37
|
+
import { rayOnLine as F } from "../../utils/three/rayOnLine.js";
|
|
38
|
+
const T = new r.Vector3();
|
|
39
|
+
class X extends k {
|
|
40
|
+
constructor(e, s) {
|
|
41
|
+
super(e, s);
|
|
42
|
+
L(this, "type", "Line");
|
|
43
|
+
L(this, "lineMesh");
|
|
44
|
+
e && (this.lineMesh = new V(P(P({}, e.style), e)), this.add(this.lineMesh)), this.editor = new z(this), U("esc", () => {
|
|
45
45
|
this.stopCreating();
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
get data() {
|
|
49
|
-
return
|
|
50
|
-
points:
|
|
49
|
+
return y(P({}, this.baseData), {
|
|
50
|
+
points: B(this.applyObjectMatrixWorld(this.lineMesh.points)),
|
|
51
51
|
style: {
|
|
52
|
-
lineColor: new
|
|
52
|
+
lineColor: new r.Color(this.lineMesh.color).getHex(),
|
|
53
53
|
lineWidth: this.lineMesh.lineWidth,
|
|
54
54
|
dashed: this.lineMesh.dashed
|
|
55
55
|
}
|
|
@@ -64,44 +64,44 @@ class Q extends U {
|
|
|
64
64
|
(e = this.lineMesh) == null || e.unhighlight();
|
|
65
65
|
}
|
|
66
66
|
create(e) {
|
|
67
|
-
return
|
|
67
|
+
return x(this, null, function* () {
|
|
68
68
|
this.removeChildren();
|
|
69
|
-
const
|
|
70
|
-
this.lineMesh =
|
|
69
|
+
const s = new V(e);
|
|
70
|
+
this.lineMesh = s, this.add(this.lineMesh), yield H(s, this.pointSelector, e), this.editor.enable();
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
function H(i, t, e) {
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
75
|
+
var m;
|
|
76
|
+
const s = i.parent;
|
|
77
|
+
if (!s)
|
|
78
78
|
return;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
let
|
|
79
|
+
const c = (m = e == null ? void 0 : e.limit) != null ? m : "none", a = new E(i.style);
|
|
80
|
+
s.add(a);
|
|
81
|
+
const d = new E(y(P({}, i.style), { dashed: !0 }));
|
|
82
|
+
return s.add(d), t.enable(), new Promise((h, p) => {
|
|
83
|
+
const n = [];
|
|
84
|
+
let o, f;
|
|
85
85
|
const g = (l) => {
|
|
86
|
-
const w =
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
if (!(
|
|
86
|
+
const w = n.length === 0 ? l.point : o.clone();
|
|
87
|
+
n.push(w), i.setPoints(n), n.length === 2 && (v(), h());
|
|
88
|
+
}, M = (l) => {
|
|
89
|
+
if (!(n != null && n.length) || !l)
|
|
90
90
|
return;
|
|
91
|
-
const w =
|
|
92
|
-
|
|
91
|
+
const w = n.at(-1).clone();
|
|
92
|
+
c === "none" ? (o = l.point, a.setPoints([w, o])) : c === "xoz" ? (t.plane = f, f = f != null ? f : new r.Plane().setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), o = f.projectPoint(l.point, T), a.setPoints([w, o]), d.setPoints([o, l.point])) : c === "y" && (l.isVirtual ? (o = F({
|
|
93
93
|
raycaster: l.raycaster,
|
|
94
|
-
line: new
|
|
94
|
+
line: new r.Line3(n[0].clone(), new r.Vector3(0, 1, 0).add(n[0])),
|
|
95
95
|
clampToLine: !1
|
|
96
|
-
}),
|
|
97
|
-
}, M = () => {
|
|
98
|
-
t.off("select", g), t.off("intersectionUpdate", L), t.off("disable", v), t.plane = null, t.disable(), n == null || n.remove(h, f);
|
|
96
|
+
}), d.setPoints([])) : (o = new r.Line3(n[0].clone(), new r.Vector3(0, 1, 0).add(n[0])).closestPointToPoint(l.point, !1, T), d.setPoints([o, l.point])), a.setPoints([w, o]));
|
|
99
97
|
}, v = () => {
|
|
100
|
-
M(),
|
|
98
|
+
t.off("select", g), t.off("intersectionUpdate", M), t.off("disable", b), t.plane = null, t.disable(), s == null || s.remove(a, d);
|
|
99
|
+
}, b = () => {
|
|
100
|
+
v(), n.length !== 2 && (s == null || s.remove(i)), p(new Error("Cancelled"));
|
|
101
101
|
};
|
|
102
|
-
t.on("select", g), t.on("intersectionUpdate",
|
|
102
|
+
t.on("select", g), t.on("intersectionUpdate", M), t.on("disable", b);
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
X as Line
|
|
107
107
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.47.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.47.3",
|
|
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",
|
|
@@ -2,15 +2,15 @@ var v = Object.defineProperty, E = Object.defineProperties;
|
|
|
2
2
|
var w = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var f = Object.getOwnPropertySymbols;
|
|
4
4
|
var S = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var p = (
|
|
5
|
+
var p = (o, s, e) => s in o ? v(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, l = (o, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
S.call(s, e) && p(
|
|
7
|
+
S.call(s, e) && p(o, e, s[e]);
|
|
8
8
|
if (f)
|
|
9
9
|
for (var e of f(s))
|
|
10
|
-
y.call(s, e) && p(
|
|
11
|
-
return
|
|
12
|
-
}, m = (
|
|
13
|
-
var i = (
|
|
10
|
+
y.call(s, e) && p(o, e, s[e]);
|
|
11
|
+
return o;
|
|
12
|
+
}, m = (o, s) => E(o, w(s));
|
|
13
|
+
var i = (o, s, e) => (p(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
14
|
import { PointSelectorHelper as I } from "./utils/PointSelectorHelper.js";
|
|
15
15
|
import { isTouchDevice as b } from "../../isTouchDevice.js";
|
|
16
16
|
import C from "hammerjs";
|
|
@@ -19,9 +19,9 @@ import { Subscribe as H } from "../../Subscribe.js";
|
|
|
19
19
|
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as M } from "../../five/getPosition.js";
|
|
20
20
|
import { getRaycasterByNdcPosition as N } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
21
|
const x = new u.Vector3(), d = () => !1;
|
|
22
|
-
class
|
|
22
|
+
class R extends H {
|
|
23
23
|
constructor(e, t) {
|
|
24
|
-
var
|
|
24
|
+
var h, n, c;
|
|
25
25
|
super();
|
|
26
26
|
/**
|
|
27
27
|
* @description: 不在 five canvas 上时为 true
|
|
@@ -108,16 +108,16 @@ class V extends H {
|
|
|
108
108
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
109
109
|
*/
|
|
110
110
|
i(this, "updateByNdcPosition", (e) => {
|
|
111
|
-
var
|
|
111
|
+
var a, h;
|
|
112
112
|
const t = N(this.five, e), r = F(this.five, t);
|
|
113
113
|
if (r)
|
|
114
114
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
115
115
|
if (this.plane) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
116
|
+
const n = t.ray.intersectPlane(this.plane, x);
|
|
117
|
+
if (n) {
|
|
118
118
|
const c = {
|
|
119
|
-
distance: this.five.camera.position.distanceTo(
|
|
120
|
-
point:
|
|
119
|
+
distance: this.five.camera.position.distanceTo(n),
|
|
120
|
+
point: n.clone(),
|
|
121
121
|
object: new u.Object3D(),
|
|
122
122
|
face: new u.Face3(0, 0, 0, this.plane.normal.clone()),
|
|
123
123
|
raycaster: t,
|
|
@@ -129,8 +129,8 @@ class V extends H {
|
|
|
129
129
|
if (this.actionIfNoModelUnderMouse === "lastPoint")
|
|
130
130
|
return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
|
|
131
131
|
if (this.actionIfNoModelUnderMouse === "virtualPoint") {
|
|
132
|
-
const
|
|
133
|
-
return
|
|
132
|
+
const n = M(t, (a = this.lastIntersection) == null ? void 0 : a.distance);
|
|
133
|
+
return n.face = new u.Face3(0, 0, 0, (h = this.lastIntersection) == null ? void 0 : h.face.normal), n.isVirtual = !0, this.lastIntersection = n, this.updatePointSelectorHelperIntersect(n), !0;
|
|
134
134
|
} else if (this.actionIfNoModelUnderMouse === "disable")
|
|
135
135
|
return this.updatePointSelectorHelperIntersect(null), !1;
|
|
136
136
|
});
|
|
@@ -146,9 +146,9 @@ class V extends H {
|
|
|
146
146
|
const t = l({}, e);
|
|
147
147
|
let r = !1;
|
|
148
148
|
if (typeof this.adherePoints == "function" && typeof this.adherePointsRadius == "number") {
|
|
149
|
-
for (const
|
|
150
|
-
if (
|
|
151
|
-
t.point =
|
|
149
|
+
for (const a of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
|
|
150
|
+
if (a.distanceTo(e.point) < this.adherePointsRadius) {
|
|
151
|
+
t.point = a.clone(), r = !0;
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -158,10 +158,10 @@ class V extends H {
|
|
|
158
158
|
const t = this.five.getElement();
|
|
159
159
|
if (!t)
|
|
160
160
|
return null;
|
|
161
|
-
const { top: r, left:
|
|
161
|
+
const { top: r, left: a, width: h, height: n } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
|
|
162
162
|
return {
|
|
163
|
-
x: (c -
|
|
164
|
-
y: 1 - (P - r) /
|
|
163
|
+
x: (c - a) / h,
|
|
164
|
+
y: 1 - (P - r) / n
|
|
165
165
|
};
|
|
166
166
|
});
|
|
167
167
|
i(this, "onFiveWantsPanGesture", () => {
|
|
@@ -174,15 +174,15 @@ class V extends H {
|
|
|
174
174
|
i(this, "emitIntersectionUpdate", (e) => {
|
|
175
175
|
this.emit("intersectionUpdate", e);
|
|
176
176
|
});
|
|
177
|
-
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (
|
|
178
|
-
const r = (
|
|
177
|
+
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (h = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? h : "virtualPoint";
|
|
178
|
+
const r = (n = t == null ? void 0 : t.mode) != null ? n : "auto";
|
|
179
179
|
r === "auto" ? this.mode = b ? "fixed" : "cursor" : this.mode = r;
|
|
180
|
-
const
|
|
180
|
+
const a = {
|
|
181
181
|
autoFixPCPosition: this.mode === "cursor",
|
|
182
182
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
183
183
|
};
|
|
184
184
|
this.pointSelectorHelper = new I(this.five, m(l({}, t == null ? void 0 : t.helper), {
|
|
185
|
-
magnifierParams: l(l({},
|
|
185
|
+
magnifierParams: l(l({}, a), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
|
|
186
186
|
})), this.pointSelectorHelper.hide();
|
|
187
187
|
}
|
|
188
188
|
get position() {
|
|
@@ -215,5 +215,5 @@ class V extends H {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
export {
|
|
218
|
-
|
|
218
|
+
R as PointSelector
|
|
219
219
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/dnalogel",
|
|
3
|
-
"version": "3.47.
|
|
3
|
+
"version": "3.47.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./libs/index.js",
|
|
6
6
|
"types": "./libs/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/core": "^7.22.9",
|
|
45
|
-
"@realsee/five": "6.1.
|
|
45
|
+
"@realsee/five": "6.1.3",
|
|
46
46
|
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
|
47
47
|
"@tsconfig/svelte": "^4.0.1",
|
|
48
48
|
"@tweenjs/tween.js": "^23.1.1",
|