@realsee/dnalogel 3.49.9 → 3.49.11
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 +6 -0
- package/dist/Sculpt/Meshes/Line.d.ts +5 -7
- package/dist/Sculpt/Meshes/Point.d.ts +8 -2
- package/dist/Sculpt/Objects/Base/index.d.ts +1 -0
- package/dist/Sculpt/typings/style.d.ts +6 -0
- package/dist/index.cjs.js +57 -57
- package/dist/index.js +2420 -2385
- package/dist/index.umd.js +51 -51
- package/dist/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/Sculpt/Meshes/Line.d.ts +5 -7
- package/libs/Sculpt/Meshes/Line.js +75 -67
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -5
- package/libs/Sculpt/Meshes/Point.d.ts +8 -2
- package/libs/Sculpt/Meshes/Point.js +77 -44
- package/libs/Sculpt/Objects/Base/index.d.ts +1 -0
- package/libs/Sculpt/Objects/Base/index.js +5 -2
- package/libs/Sculpt/Objects/Line/index.js +2 -0
- package/libs/Sculpt/Objects/Point/index.js +46 -43
- package/libs/Sculpt/index.js +1 -1
- package/libs/Sculpt/typings/style.d.ts +6 -0
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +12 -15
- package/package.json +1 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var g = Object.defineProperty, u = Object.defineProperties;
|
|
2
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var d = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var P = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var p = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, a = (e, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
|
|
7
|
+
P.call(i, t) && p(e, t, i[t]);
|
|
8
8
|
if (d)
|
|
9
9
|
for (var t of d(i))
|
|
10
|
-
|
|
10
|
+
w.call(i, t) && p(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, m = (e, i) => u(e, y(i));
|
|
13
|
+
var c = (e, i, t) => (p(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
|
+
var b = (e, i, t) => new Promise((h, n) => {
|
|
15
15
|
var r = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
o(t.next(s));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
n(l);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, f = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
o(t.throw(s));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
n(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, o = (s) => s.done ? h(s.value) : Promise.resolve(s.value).then(r, f);
|
|
28
|
+
o((t = t.apply(e, i)).next());
|
|
29
29
|
});
|
|
30
|
-
import { PointMesh as
|
|
31
|
-
import { BaseObject as
|
|
32
|
-
import { PointEditor as
|
|
33
|
-
import { vector3ToArray as
|
|
34
|
-
class
|
|
35
|
-
constructor(t,
|
|
36
|
-
super(t,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.editor = new
|
|
30
|
+
import { PointMesh as M } from "../../Meshes/Point.js";
|
|
31
|
+
import { BaseObject as v } from "../Base/index.js";
|
|
32
|
+
import { PointEditor as x } from "./Editor.js";
|
|
33
|
+
import { vector3ToArray as E } from "../../../shared-utils/three/vector3ToArray.js";
|
|
34
|
+
class C extends v {
|
|
35
|
+
constructor(t, h) {
|
|
36
|
+
super(t, h);
|
|
37
|
+
c(this, "type", "Point");
|
|
38
|
+
c(this, "pointMesh");
|
|
39
|
+
this.editor = new x(this), t && (this.pointMesh = new M(a(a({}, t.style), t)), this.add(this.pointMesh));
|
|
40
40
|
}
|
|
41
41
|
get data() {
|
|
42
|
-
return
|
|
43
|
-
point:
|
|
42
|
+
return m(a({}, this.baseData), {
|
|
43
|
+
point: E(this.applyObjectMatrixWorld(this.pointMesh.position)),
|
|
44
44
|
style: {
|
|
45
45
|
color: this.pointMesh.color.getHex(),
|
|
46
46
|
size: this.pointMesh.size
|
|
@@ -67,24 +67,27 @@ class D extends x {
|
|
|
67
67
|
* @description: 创建点
|
|
68
68
|
*/
|
|
69
69
|
create(t) {
|
|
70
|
-
return
|
|
71
|
-
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new
|
|
70
|
+
return b(this, null, function* () {
|
|
71
|
+
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new M(t)), yield U(this.pointMesh, this.pointSelector), this.editor.enable();
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return new Promise((t,
|
|
77
|
-
i.enable();
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
function U(e, i) {
|
|
76
|
+
return new Promise((t, h) => {
|
|
77
|
+
i.enable(), e.visible = !1;
|
|
78
|
+
const n = (s) => {
|
|
79
|
+
s && (e.visible = !0, e.position.copy(s.point));
|
|
80
|
+
}, r = (s) => {
|
|
81
|
+
s && (e.position.copy(s.point), f());
|
|
82
|
+
}, f = () => {
|
|
83
|
+
i.off("select", r), i.off("disable", o), i.off("intersectionUpdate", n), i.disable(), t();
|
|
84
|
+
}, o = () => {
|
|
85
|
+
i.off("select", r), i.off("disable", o), i.off("intersectionUpdate", n), e.removeFromParent(), h(new Error("Cancelled"));
|
|
81
86
|
};
|
|
82
|
-
i.on("disable",
|
|
83
|
-
i.off("select", h), o(new Error("Cancelled"));
|
|
84
|
-
}), i.once("select", h);
|
|
87
|
+
i.on("intersectionUpdate", n), i.on("disable", o), i.once("select", r);
|
|
85
88
|
});
|
|
86
89
|
}
|
|
87
90
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
C as Point,
|
|
92
|
+
U as createPoint
|
|
90
93
|
};
|
package/libs/Sculpt/index.js
CHANGED
|
@@ -76,7 +76,7 @@ const h = class extends S {
|
|
|
76
76
|
this.five = e, this.theme = t, this.group = new k(), this.group.name = "Sculpt", e.scene.add(this.group), h.modules.init(e), B("ctrl+z", this.undo), B("ctrl+shift+z", this.redo), h.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: n, origDomEvent: l }) => {
|
|
77
77
|
var s;
|
|
78
78
|
const o = M((s = n == null ? void 0 : n[0]) == null ? void 0 : s.object, (c) => c.isSculptObject);
|
|
79
|
-
return o ? this.emit("click", l, o) : !1;
|
|
79
|
+
return o && !o.editing ? this.emit("click", l, o) : !1;
|
|
80
80
|
}), window.__SCULPT_DEBUG__ = this, window.__SCULPT_MODULES_DEBUG__ = h.modules;
|
|
81
81
|
}
|
|
82
82
|
get data() {
|
|
@@ -57,4 +57,10 @@ export type OcclusionStyle = {
|
|
|
57
57
|
*/
|
|
58
58
|
occlusionMode: 'translucence' | 'depthTest';
|
|
59
59
|
};
|
|
60
|
+
export type lengthConfig = {
|
|
61
|
+
lengthEnable: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type DisplayInfoConfig = {
|
|
64
|
+
tip: string;
|
|
65
|
+
};
|
|
60
66
|
export type LineStyle = LineColorStyle & LineWidthStyle & OpacityStyle;
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.49.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.49.11",
|
|
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",
|
|
@@ -16,11 +16,11 @@ import { isTouchDevice as v } from "../../isTouchDevice.js";
|
|
|
16
16
|
import M from "hammerjs";
|
|
17
17
|
import * as d from "three";
|
|
18
18
|
import { Subscribe as N } from "../../Subscribe.js";
|
|
19
|
-
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as
|
|
20
|
-
import { getRaycasterByNdcPosition as
|
|
19
|
+
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as L } from "../../five/getPosition.js";
|
|
20
|
+
import { getRaycasterByNdcPosition as U } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
21
|
import { CURSOR_NOT_ALLOW_URL as P } from "./utils/contents.js";
|
|
22
|
-
const
|
|
23
|
-
class
|
|
22
|
+
const C = new d.Vector3(), u = () => !1;
|
|
23
|
+
class k extends N {
|
|
24
24
|
constructor(e, t) {
|
|
25
25
|
var a, o, c;
|
|
26
26
|
super();
|
|
@@ -73,11 +73,8 @@ class G extends N {
|
|
|
73
73
|
i(this, "onLeave", () => {
|
|
74
74
|
this.pointSelectorHelper.hide(), this.outOfFive = !0, this.emit("intersectionUpdate", null);
|
|
75
75
|
});
|
|
76
|
-
i(this, "
|
|
77
|
-
|
|
78
|
-
clientX: e.center.x,
|
|
79
|
-
clientY: e.center.y
|
|
80
|
-
}), this.select();
|
|
76
|
+
i(this, "onClick", () => {
|
|
77
|
+
this.select();
|
|
81
78
|
});
|
|
82
79
|
/**
|
|
83
80
|
* 1. 如果之前没有长按行为「即没有长按点时」-> 滑动全景
|
|
@@ -117,11 +114,11 @@ class G extends N {
|
|
|
117
114
|
*/
|
|
118
115
|
i(this, "updateByNdcPosition", (e) => {
|
|
119
116
|
var h, a;
|
|
120
|
-
const t =
|
|
117
|
+
const t = U(this.five, e), r = F(this.five, t);
|
|
121
118
|
if (r)
|
|
122
119
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
123
120
|
if (this.plane) {
|
|
124
|
-
const o = t.ray.intersectPlane(this.plane,
|
|
121
|
+
const o = t.ray.intersectPlane(this.plane, C);
|
|
125
122
|
if (o) {
|
|
126
123
|
const c = {
|
|
127
124
|
distance: this.five.camera.position.distanceTo(o),
|
|
@@ -137,7 +134,7 @@ class G extends N {
|
|
|
137
134
|
if (this.actionIfNoModelUnderMouse === "lastPoint")
|
|
138
135
|
return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
|
|
139
136
|
if (this.actionIfNoModelUnderMouse === "virtualPoint") {
|
|
140
|
-
const o =
|
|
137
|
+
const o = L(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
|
|
141
138
|
return o.face = new d.Face3(0, 0, 0, (a = this.lastIntersection) == null ? void 0 : a.face.normal), o.isVirtual = !0, this.lastIntersection = o, this.updatePointSelectorHelperIntersect(o), !0;
|
|
142
139
|
} else if (this.actionIfNoModelUnderMouse === "disable")
|
|
143
140
|
return this.updatePointSelectorHelperIntersect(null), !1;
|
|
@@ -227,14 +224,14 @@ class G extends N {
|
|
|
227
224
|
const e = this.five.getElement();
|
|
228
225
|
if (!e)
|
|
229
226
|
throw new Error("five element not found");
|
|
230
|
-
this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("
|
|
227
|
+
this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), v || e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("click", this.onClick), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
|
|
231
228
|
}
|
|
232
229
|
disable() {
|
|
233
230
|
if (!this.enabled)
|
|
234
231
|
return;
|
|
235
232
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
236
233
|
const e = this.five.getElement();
|
|
237
|
-
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave),
|
|
234
|
+
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), e == null || e.removeEventListener("click", this.onClick), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
|
|
238
235
|
}
|
|
239
236
|
dispose() {
|
|
240
237
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -244,5 +241,5 @@ class G extends N {
|
|
|
244
241
|
}
|
|
245
242
|
}
|
|
246
243
|
export {
|
|
247
|
-
|
|
244
|
+
k as PointSelector
|
|
248
245
|
};
|