@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.
- package/CHANGELOG.md +4 -0
- package/dist/Sculpt/Meshes/Polygon.d.ts +6 -0
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
- package/dist/Sculpt/Meshes/Polyline.d.ts +7 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
- package/dist/index.cjs.js +39 -39
- package/dist/index.js +2161 -2118
- package/dist/index.umd.js +34 -34
- package/dist/shared-utils/five/getPosition.d.ts +2 -0
- package/dist/shared-utils/three/PointSelector/index.d.ts +14 -10
- package/dist/typings/typings.d.ts +2 -0
- package/libs/Sculpt/Meshes/Polygon.d.ts +6 -0
- package/libs/Sculpt/Meshes/Polygon.js +7 -4
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
- package/libs/Sculpt/Meshes/PolygonWithEdge.js +38 -24
- package/libs/Sculpt/Meshes/Polyline.d.ts +7 -0
- package/libs/Sculpt/Meshes/Polyline.js +32 -23
- package/libs/Sculpt/Objects/Line/Editor.js +6 -6
- package/libs/Sculpt/Objects/Line/index.js +16 -16
- package/libs/Sculpt/Objects/Point/Editor.js +10 -10
- package/libs/Sculpt/Objects/Polygon/Editor.js +6 -6
- package/libs/Sculpt/Objects/Polygon/index.js +43 -37
- package/libs/Sculpt/Objects/Polyline/Editor.js +3 -3
- package/libs/Sculpt/Objects/Polyline/index.js +43 -43
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
- package/libs/Sculpt/utils/three/ColoredMesh.js +39 -31
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/five/getPosition.d.ts +2 -0
- package/libs/shared-utils/five/getPosition.js +25 -30
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +14 -10
- package/libs/shared-utils/three/PointSelector/index.js +74 -57
- package/libs/typings/typings.d.ts +2 -0
- 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
|
|
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) &&
|
|
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) &&
|
|
10
|
+
U.call(e, t) && w(o, t, e[t]);
|
|
11
11
|
return o;
|
|
12
|
-
},
|
|
13
|
-
var y = (o, e, t) => (
|
|
14
|
-
var
|
|
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
|
-
|
|
17
|
+
r(t.next(l));
|
|
18
18
|
} catch (s) {
|
|
19
19
|
d(s);
|
|
20
20
|
}
|
|
21
21
|
}, p = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
r(t.throw(l));
|
|
24
24
|
} catch (s) {
|
|
25
25
|
d(s);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
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
|
|
34
|
-
import { AreaMesh as
|
|
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,
|
|
40
|
-
super(t,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
71
|
-
this.areaMesh =
|
|
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((
|
|
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",
|
|
84
|
-
|
|
85
|
-
|
|
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,
|
|
89
|
-
const C = (
|
|
90
|
-
const
|
|
91
|
-
s.push(
|
|
92
|
-
},
|
|
93
|
-
if (!(s != null && s.length) || !
|
|
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
|
|
96
|
-
if (s.length < 3 && (p === "none" ? (i =
|
|
97
|
-
i = o.projectPoint(
|
|
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(
|
|
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
|
-
},
|
|
103
|
-
e.off("select", C), e.off("intersectionUpdate",
|
|
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
|
-
|
|
111
|
+
v(), n == null || n.remove(o, l, r), d(new Error("Cancelled"));
|
|
106
112
|
};
|
|
107
|
-
e.on("select", C), e.on("intersectionUpdate",
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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 (
|
|
9
|
-
for (var e of
|
|
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((
|
|
15
|
-
var a = (
|
|
14
|
+
var L = (i, t, e) => new Promise((n, d) => {
|
|
15
|
+
var a = (h) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
d(
|
|
17
|
+
P(e.next(h));
|
|
18
|
+
} catch (m) {
|
|
19
|
+
d(m);
|
|
20
20
|
}
|
|
21
|
-
}, p = (
|
|
21
|
+
}, p = (h) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
d(
|
|
23
|
+
P(e.throw(h));
|
|
24
|
+
} catch (m) {
|
|
25
|
+
d(m);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
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
|
|
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
|
|
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
|
|
36
|
+
const x = new c.Vector3();
|
|
37
37
|
class G extends O {
|
|
38
|
-
constructor(e,
|
|
39
|
-
super(e,
|
|
38
|
+
constructor(e, n) {
|
|
39
|
+
super(e, n);
|
|
40
40
|
u(this, "type", "Polyline");
|
|
41
41
|
u(this, "polyLineMesh");
|
|
42
|
-
e && (this.polyLineMesh = new
|
|
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
|
|
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
|
|
68
|
-
this.polyLineMesh =
|
|
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
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
73
|
+
var P;
|
|
74
|
+
const n = i.parent;
|
|
75
|
+
if (!n)
|
|
76
76
|
return;
|
|
77
|
-
const d = (
|
|
78
|
-
|
|
79
|
-
const p = new
|
|
80
|
-
return
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
if (!(
|
|
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
|
|
90
|
-
d === "none" ? (
|
|
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",
|
|
93
|
-
if (t.off("select",
|
|
94
|
-
return
|
|
95
|
-
|
|
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,
|
|
4
|
-
var
|
|
5
|
-
for (var
|
|
6
|
-
f.call(
|
|
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
|
|
9
|
-
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
26
|
-
var h,
|
|
25
|
+
constructor(t) {
|
|
26
|
+
var h, m;
|
|
27
27
|
super();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.paramsStyle =
|
|
34
|
-
const
|
|
35
|
-
color: (h =
|
|
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: (
|
|
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 *
|
|
47
|
-
}), o = new s.Mesh(this.geometry,
|
|
48
|
-
o.name = "MeshFront",
|
|
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(
|
|
63
|
-
this._geometry =
|
|
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(
|
|
69
|
-
this.paramsStyle =
|
|
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(
|
|
72
|
-
var o,
|
|
73
|
-
const
|
|
74
|
-
|
|
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 {
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -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,
|
|
2
|
-
var
|
|
1
|
+
var u = Object.defineProperty, m = Object.defineProperties;
|
|
2
|
+
var d = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var c = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var s = (
|
|
6
|
-
for (var n in
|
|
7
|
-
|
|
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(
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
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 {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
), r =
|
|
21
|
+
e.ray.origin,
|
|
22
|
+
e.ray.direction.clone().normalize().multiplyScalar(t)
|
|
23
|
+
), r = e.ray.direction.clone().negate();
|
|
29
24
|
return {
|
|
30
|
-
distance:
|
|
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:
|
|
29
|
+
raycaster: e,
|
|
35
30
|
isVirtual: !0
|
|
36
31
|
};
|
|
37
32
|
}
|
|
38
|
-
function V(
|
|
39
|
-
const o =
|
|
33
|
+
function V(e, t) {
|
|
34
|
+
const o = R(e).intersectRaycaster(t)[0];
|
|
40
35
|
if (o)
|
|
41
|
-
return l(
|
|
36
|
+
return a(l({}, o), { raycaster: t, isVirtual: !1 });
|
|
42
37
|
}
|
|
43
38
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
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.
|
|
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
|
|
1
|
+
import type { Five } from '@realsee/five';
|
|
2
2
|
import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
|
|
3
|
-
import type
|
|
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
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* virtualPoint: 生成一个虚拟点
|
|
18
|
+
* lastPoint: 选点器停留在上一个点处
|
|
19
|
+
* disable: 禁止选点
|
|
18
20
|
* ```
|
|
19
|
-
* @default
|
|
21
|
+
* @default 'virtualPoint'
|
|
20
22
|
*/
|
|
21
|
-
|
|
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:
|
|
116
|
+
* @description: 根据鼠标位置计算焦点位置并更新
|
|
113
117
|
*/
|
|
114
118
|
private updateByNdcPosition;
|
|
115
119
|
/**
|