@realsee/dnalogel 3.49.14-alpha.0 → 3.49.14-alpha.1
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/dist/index.cjs.js +31 -31
- package/dist/index.js +688 -687
- package/dist/index.umd.js +31 -31
- package/dist/shared-utils/three/PointSelector/index.d.ts +5 -14
- package/libs/Sculpt/Objects/Point/index.js +5 -5
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +5 -14
- package/libs/shared-utils/three/PointSelector/index.js +48 -48
- package/package.json +1 -1
|
@@ -72,7 +72,6 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
72
72
|
private _outOfFive;
|
|
73
73
|
private set enabled(value);
|
|
74
74
|
private _enabled;
|
|
75
|
-
private hammer?;
|
|
76
75
|
private mode;
|
|
77
76
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
78
77
|
private pressDown;
|
|
@@ -80,6 +79,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
80
79
|
private adherePoints;
|
|
81
80
|
/** 吸附点的半径 */
|
|
82
81
|
private adherePointsRadius;
|
|
82
|
+
/** 有值时表明处于按压检查阶段 */
|
|
83
|
+
private setPressDown?;
|
|
83
84
|
private lastFiveHelperVisible?;
|
|
84
85
|
private lastIntersection?;
|
|
85
86
|
private mousePosition;
|
|
@@ -108,19 +109,9 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
108
109
|
*/
|
|
109
110
|
private onLeave;
|
|
110
111
|
private onClick;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*/
|
|
115
|
-
private onPan;
|
|
116
|
-
/**
|
|
117
|
-
* @description: 长按屏幕后,更新长按点的位置
|
|
118
|
-
*/
|
|
119
|
-
private onPress;
|
|
120
|
-
/**
|
|
121
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
122
|
-
*/
|
|
123
|
-
private onPanEnd;
|
|
112
|
+
private onTouchStart;
|
|
113
|
+
private onTouchMove;
|
|
114
|
+
private onTouchEnd;
|
|
124
115
|
private updateByMousePosition;
|
|
125
116
|
/**
|
|
126
117
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
@@ -11,7 +11,7 @@ var p = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return e;
|
|
12
12
|
}, m = (e, i) => u(e, y(i));
|
|
13
13
|
var c = (e, i, t) => (p(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
|
-
var
|
|
14
|
+
var M = (e, i, t) => new Promise((h, n) => {
|
|
15
15
|
var r = (s) => {
|
|
16
16
|
try {
|
|
17
17
|
o(t.next(s));
|
|
@@ -27,7 +27,7 @@ var b = (e, i, t) => new Promise((h, n) => {
|
|
|
27
27
|
}, o = (s) => s.done ? h(s.value) : Promise.resolve(s.value).then(r, f);
|
|
28
28
|
o((t = t.apply(e, i)).next());
|
|
29
29
|
});
|
|
30
|
-
import { PointMesh as
|
|
30
|
+
import { PointMesh as b } from "../../Meshes/Point.js";
|
|
31
31
|
import { BaseObject as v } from "../Base/index.js";
|
|
32
32
|
import { PointEditor as x } from "./Editor.js";
|
|
33
33
|
import { vector3ToArray as E } from "../../../shared-utils/three/vector3ToArray.js";
|
|
@@ -36,7 +36,7 @@ class C extends v {
|
|
|
36
36
|
super(t, h);
|
|
37
37
|
c(this, "type", "Point");
|
|
38
38
|
c(this, "pointMesh");
|
|
39
|
-
this.editor = new x(this), t && (this.pointMesh = new
|
|
39
|
+
this.editor = new x(this), t && (this.pointMesh = new b(a(a({}, t.style), t)), this.add(this.pointMesh));
|
|
40
40
|
}
|
|
41
41
|
get data() {
|
|
42
42
|
return m(a({}, this.baseData), {
|
|
@@ -67,8 +67,8 @@ class C extends v {
|
|
|
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 M(this, null, function* () {
|
|
71
|
+
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new b(t)), yield U(this.pointMesh, this.pointSelector);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
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.14-alpha.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.49.14-alpha.1",
|
|
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",
|
|
@@ -72,7 +72,6 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
72
72
|
private _outOfFive;
|
|
73
73
|
private set enabled(value);
|
|
74
74
|
private _enabled;
|
|
75
|
-
private hammer?;
|
|
76
75
|
private mode;
|
|
77
76
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
78
77
|
private pressDown;
|
|
@@ -80,6 +79,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
80
79
|
private adherePoints;
|
|
81
80
|
/** 吸附点的半径 */
|
|
82
81
|
private adherePointsRadius;
|
|
82
|
+
/** 有值时表明处于按压检查阶段 */
|
|
83
|
+
private setPressDown?;
|
|
83
84
|
private lastFiveHelperVisible?;
|
|
84
85
|
private lastIntersection?;
|
|
85
86
|
private mousePosition;
|
|
@@ -108,19 +109,9 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
108
109
|
*/
|
|
109
110
|
private onLeave;
|
|
110
111
|
private onClick;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*/
|
|
115
|
-
private onPan;
|
|
116
|
-
/**
|
|
117
|
-
* @description: 长按屏幕后,更新长按点的位置
|
|
118
|
-
*/
|
|
119
|
-
private onPress;
|
|
120
|
-
/**
|
|
121
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
122
|
-
*/
|
|
123
|
-
private onPanEnd;
|
|
112
|
+
private onTouchStart;
|
|
113
|
+
private onTouchMove;
|
|
114
|
+
private onTouchEnd;
|
|
124
115
|
private updateByMousePosition;
|
|
125
116
|
/**
|
|
126
117
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w = Object.defineProperty, b = Object.defineProperties;
|
|
2
2
|
var E = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var I = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
3
|
+
var f = Object.getOwnPropertySymbols;
|
|
4
|
+
var I = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var p = (n, s, e) => s in n ? w(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e, l = (n, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
I.call(s, e) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
I.call(s, e) && p(n, e, s[e]);
|
|
8
|
+
if (f)
|
|
9
|
+
for (var e of f(s))
|
|
10
|
+
y.call(s, e) && p(n, e, s[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
var i = (n, s, e) => (
|
|
12
|
+
}, v = (n, s) => b(n, E(s));
|
|
13
|
+
var i = (n, s, e) => (p(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
14
|
import { PointSelectorHelper as H } from "./utils/PointSelectorHelper.js";
|
|
15
|
-
import { isTouchDevice as
|
|
16
|
-
import M from "hammerjs";
|
|
15
|
+
import { isTouchDevice as m } from "../../isTouchDevice.js";
|
|
17
16
|
import * as d from "three";
|
|
18
|
-
import { Subscribe as
|
|
19
|
-
import { getIntersectByRaycaster as
|
|
20
|
-
import { getRaycasterByNdcPosition as
|
|
17
|
+
import { Subscribe as M } from "../../Subscribe.js";
|
|
18
|
+
import { getIntersectByRaycaster as T, getVirtualIntersectByRaycaster as L } from "../../five/getPosition.js";
|
|
19
|
+
import { getRaycasterByNdcPosition as N } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
20
|
import { CURSOR_NOT_ALLOW_URL as P } from "./utils/contents.js";
|
|
22
|
-
const
|
|
23
|
-
class
|
|
21
|
+
const F = new d.Vector3(), u = () => !1;
|
|
22
|
+
class g extends M {
|
|
24
23
|
constructor(e, t) {
|
|
25
24
|
var a, o, c;
|
|
26
25
|
super();
|
|
@@ -33,7 +32,6 @@ class k extends N {
|
|
|
33
32
|
i(this, "five");
|
|
34
33
|
i(this, "_outOfFive", !1);
|
|
35
34
|
i(this, "_enabled", !1);
|
|
36
|
-
i(this, "hammer");
|
|
37
35
|
i(this, "mode");
|
|
38
36
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
39
37
|
i(this, "pressDown", !1);
|
|
@@ -41,6 +39,8 @@ class k extends N {
|
|
|
41
39
|
i(this, "adherePoints");
|
|
42
40
|
/** 吸附点的半径 */
|
|
43
41
|
i(this, "adherePointsRadius", 0.1);
|
|
42
|
+
/** 有值时表明处于按压检查阶段 */
|
|
43
|
+
i(this, "setPressDown");
|
|
44
44
|
i(this, "lastFiveHelperVisible");
|
|
45
45
|
i(this, "lastIntersection");
|
|
46
46
|
i(this, "mousePosition");
|
|
@@ -76,32 +76,32 @@ class k extends N {
|
|
|
76
76
|
i(this, "onClick", () => {
|
|
77
77
|
this.select();
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
i(this, "onTouchStart", (e) => {
|
|
80
|
+
console.log("touchstart"), this.setPressDown = setTimeout(() => {
|
|
81
|
+
if (this.setPressDown = void 0, this.mousePosition = {
|
|
82
|
+
clientX: e.touches[0].clientX,
|
|
83
|
+
clientY: e.touches[0].clientY
|
|
84
|
+
}, !this.mouseNdcPosition)
|
|
85
|
+
return;
|
|
86
|
+
const t = this.updateByNdcPosition(this.mouseNdcPosition);
|
|
87
|
+
this.pressDown = t;
|
|
88
|
+
}, 300);
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
i(this, "onPress", (e) => {
|
|
93
|
-
if (e != null && e.center && (this.mousePosition = {
|
|
94
|
-
clientX: e.center.x,
|
|
95
|
-
clientY: e.center.y
|
|
96
|
-
}), !this.mouseNdcPosition)
|
|
90
|
+
i(this, "onTouchMove", (e) => {
|
|
91
|
+
if (console.log("touchmove"), this.setPressDown) {
|
|
92
|
+
clearTimeout(this.setPressDown), this.setPressDown = void 0;
|
|
97
93
|
return;
|
|
98
|
-
|
|
99
|
-
this.pressDown
|
|
94
|
+
}
|
|
95
|
+
if (this.pressDown) {
|
|
96
|
+
if (this.mousePosition = {
|
|
97
|
+
clientX: e.touches[0].clientX,
|
|
98
|
+
clientY: e.touches[0].clientY
|
|
99
|
+
}, !this.mouseNdcPosition)
|
|
100
|
+
return;
|
|
101
|
+
this.updateByNdcPosition(this.mouseNdcPosition);
|
|
102
|
+
}
|
|
100
103
|
});
|
|
101
|
-
|
|
102
|
-
* @description: 手指抬起后,重置pressDown状态
|
|
103
|
-
*/
|
|
104
|
-
i(this, "onPanEnd", () => {
|
|
104
|
+
i(this, "onTouchEnd", (e) => {
|
|
105
105
|
this.pressDown && (setTimeout(() => {
|
|
106
106
|
this.pressDown = !1;
|
|
107
107
|
}, 100), this.select());
|
|
@@ -114,11 +114,11 @@ class k extends N {
|
|
|
114
114
|
*/
|
|
115
115
|
i(this, "updateByNdcPosition", (e) => {
|
|
116
116
|
var h, a;
|
|
117
|
-
const t =
|
|
117
|
+
const t = N(this.five, e), r = T(this.five, t);
|
|
118
118
|
if (r)
|
|
119
119
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
120
120
|
if (this.plane) {
|
|
121
|
-
const o = t.ray.intersectPlane(this.plane,
|
|
121
|
+
const o = t.ray.intersectPlane(this.plane, F);
|
|
122
122
|
if (o) {
|
|
123
123
|
const c = {
|
|
124
124
|
distance: this.five.camera.position.distanceTo(o),
|
|
@@ -181,12 +181,12 @@ class k extends N {
|
|
|
181
181
|
});
|
|
182
182
|
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (a = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? a : "virtualPoint";
|
|
183
183
|
const r = (o = t == null ? void 0 : t.mode) != null ? o : "auto";
|
|
184
|
-
r === "auto" ? this.mode =
|
|
184
|
+
r === "auto" ? this.mode = m ? "fixed" : "cursor" : this.mode = r;
|
|
185
185
|
const h = {
|
|
186
186
|
autoFixPCPosition: this.mode === "cursor",
|
|
187
187
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
188
188
|
};
|
|
189
|
-
this.pointSelectorHelper = new H(this.five,
|
|
189
|
+
this.pointSelectorHelper = new H(this.five, v(l({}, t == null ? void 0 : t.helper), {
|
|
190
190
|
magnifierParams: l(l({}, h), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
|
|
191
191
|
})), this.pointSelectorHelper.hide();
|
|
192
192
|
}
|
|
@@ -224,14 +224,14 @@ class k extends N {
|
|
|
224
224
|
const e = this.five.getElement();
|
|
225
225
|
if (!e)
|
|
226
226
|
throw new Error("five element not found");
|
|
227
|
-
this.
|
|
227
|
+
this.mode === "cursor" ? (this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), m ? (e.addEventListener("touchstart", this.onTouchStart, { passive: !0 }), e.addEventListener("touchmove", this.onTouchMove), e.addEventListener("touchend", this.onTouchEnd)) : (e.addEventListener("click", this.onClick), e.addEventListener("mousemove", this.updateByMousePosition), e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave)), this.five.on("wantsPanGesture", this.onFiveWantsPanGesture)) : 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");
|
|
228
228
|
}
|
|
229
229
|
disable() {
|
|
230
230
|
if (!this.enabled)
|
|
231
231
|
return;
|
|
232
232
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
233
233
|
const e = this.five.getElement();
|
|
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("
|
|
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("touchstart", this.onTouchStart), e == null || e.removeEventListener("touchmove", this.onTouchMove), e == null || e.removeEventListener("touchend", this.onTouchEnd), e == null || e.removeEventListener("click", this.onClick), 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), 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");
|
|
235
235
|
}
|
|
236
236
|
dispose() {
|
|
237
237
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -241,5 +241,5 @@ class k extends N {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
export {
|
|
244
|
-
|
|
244
|
+
g as PointSelector
|
|
245
245
|
};
|