@realsee/dnalogel 3.72.5-alpha.2 → 3.72.5-alpha.4
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/PanoTagPlugin/controller/Tag/PointTag.d.ts +1 -0
- package/dist/Sculpt/Objects/Polygon/index.d.ts +5 -0
- package/dist/index.cjs.js +31 -31
- package/dist/index.js +893 -882
- package/dist/index.umd.js +31 -31
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +39 -39
- package/libs/PanoTagPlugin/controller/Tag/PointTag.d.ts +1 -0
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +83 -76
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/Sculpt/Objects/Polygon/index.d.ts +5 -0
- package/libs/Sculpt/Objects/Polygon/index.js +59 -55
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -2,39 +2,39 @@ var pt = Object.defineProperty, Pt = Object.defineProperties;
|
|
|
2
2
|
var yt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var it = Object.getOwnPropertySymbols;
|
|
4
4
|
var mt = Object.prototype.hasOwnProperty, ft = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var M = Math.pow, A = (
|
|
6
|
-
for (var t in
|
|
7
|
-
mt.call(
|
|
5
|
+
var M = Math.pow, A = (e, s, t) => s in e ? pt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, H = (e, s) => {
|
|
6
|
+
for (var t in s || (s = {}))
|
|
7
|
+
mt.call(s, t) && A(e, t, s[t]);
|
|
8
8
|
if (it)
|
|
9
|
-
for (var t of it(
|
|
10
|
-
ft.call(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var C = (
|
|
14
|
-
var ot = (
|
|
9
|
+
for (var t of it(s))
|
|
10
|
+
ft.call(s, t) && A(e, t, s[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, I = (e, s) => Pt(e, yt(s));
|
|
13
|
+
var C = (e, s, t) => (A(e, typeof s != "symbol" ? s + "" : s, t), t);
|
|
14
|
+
var ot = (e, s, t) => new Promise((o, r) => {
|
|
15
15
|
var f = (u) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
w(t.next(u));
|
|
18
18
|
} catch (h) {
|
|
19
19
|
r(h);
|
|
20
20
|
}
|
|
21
21
|
}, a = (u) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
w(t.throw(u));
|
|
24
24
|
} catch (h) {
|
|
25
25
|
r(h);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, w = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(f, a);
|
|
28
|
+
w((t = t.apply(e, s)).next());
|
|
29
29
|
});
|
|
30
30
|
import { BaseObject as xt } from "../Base/index.js";
|
|
31
|
-
import * as
|
|
31
|
+
import * as v from "three";
|
|
32
32
|
import { PolylineMesh as nt } from "../../Meshes/Polyline.js";
|
|
33
33
|
import { AreaMesh as rt } from "../../Meshes/Area.js";
|
|
34
34
|
import { PolygonEditor as bt } from "./Editor.js";
|
|
35
35
|
import { vector3ToArray as Ct } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
|
-
import { withResolvers as
|
|
37
|
-
import { anyPositionToVector3 as
|
|
36
|
+
import { withResolvers as wt } from "../../../shared-utils/promise/withResolvers.js";
|
|
37
|
+
import { anyPositionToVector3 as Dt } from "../../../shared-utils/positionToVector3.js";
|
|
38
38
|
import { PointMesh as Ht } from "../../Meshes/Point.js";
|
|
39
39
|
class Rt extends xt {
|
|
40
40
|
constructor(t, o) {
|
|
@@ -48,7 +48,7 @@ class Rt extends xt {
|
|
|
48
48
|
C(this, "maxHistorySize", 50);
|
|
49
49
|
C(this, "_editor");
|
|
50
50
|
C(this, "creatingObject");
|
|
51
|
-
t && (this.areaMesh = new rt(
|
|
51
|
+
t && (this.areaMesh = new rt(H(H({}, t.style), t)), this.areaMesh.userData = (r = this.areaMesh.userData) != null ? r : {}, typeof this.areaMesh.userData.dragSelectPixelDistance != "number" && (this.areaMesh.userData.dragSelectPixelDistance = 10), this.add(this.areaMesh));
|
|
52
52
|
}
|
|
53
53
|
get editor() {
|
|
54
54
|
return this._editor || (this._editor = new bt(this)), this._editor;
|
|
@@ -59,7 +59,7 @@ class Rt extends xt {
|
|
|
59
59
|
typeof t == "function" && t(), this._editor && this._editor.updatePointMeshes();
|
|
60
60
|
}
|
|
61
61
|
get data() {
|
|
62
|
-
return this.updateMatrixWorld(),
|
|
62
|
+
return this.updateMatrixWorld(), I(H({}, this.baseData), {
|
|
63
63
|
points: Ct(this.applyObjectMatrixWorld(this.areaMesh.points)),
|
|
64
64
|
style: {
|
|
65
65
|
color: this.areaMesh.color.getHex(),
|
|
@@ -69,7 +69,7 @@ class Rt extends xt {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
setData(t) {
|
|
72
|
-
t.points && this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(t.points.map(
|
|
72
|
+
t.points && this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(t.points.map(Dt))), this.areaMesh.setStyle(t.style), this.updateCreationPointMeshes();
|
|
73
73
|
}
|
|
74
74
|
highlight() {
|
|
75
75
|
var t;
|
|
@@ -137,38 +137,38 @@ class Rt extends xt {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function vt(
|
|
140
|
+
function vt(e, s, t) {
|
|
141
141
|
var L, N, $, G, J, K, Q, X, Z;
|
|
142
|
-
const { promise: o, resolve: r, reject: f } =
|
|
142
|
+
const { promise: o, resolve: r, reject: f } = wt(), a = e.parent;
|
|
143
143
|
if (!a) {
|
|
144
144
|
f(new Error("No container"));
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
u && h && h.model && h.model.bounding && typeof ((Z = h.model.bounding.max) == null ? void 0 : Z.y) == "number" && (
|
|
151
|
-
const P = new nt(
|
|
147
|
+
const w = (L = t == null ? void 0 : t.limit) != null ? L : "none", u = t == null ? void 0 : t.simpleMode, h = (K = (J = ($ = e.five) != null ? $ : (N = e.get) == null ? void 0 : N.call(e, "five")) != null ? J : (G = window.globalModules) == null ? void 0 : G.five) != null ? K : window.$five, T = (Q = t == null ? void 0 : t.autoClosePixelDistance) != null ? Q : 10;
|
|
148
|
+
e.userData = (X = e.userData) != null ? X : {}, e.userData.dragSelectPixelDistance = T;
|
|
149
|
+
let E = 0;
|
|
150
|
+
u && h && h.model && h.model.bounding && typeof ((Z = h.model.bounding.max) == null ? void 0 : Z.y) == "number" && (E = h.model.bounding.max.y + 1);
|
|
151
|
+
const P = new nt(e.style);
|
|
152
152
|
a == null || a.add(P);
|
|
153
|
-
const y = new nt(
|
|
153
|
+
const y = new nt(I(H({}, e.style), { dashed: !0, lengthEnable: !1 }));
|
|
154
154
|
a == null || a.add(y);
|
|
155
|
-
let
|
|
155
|
+
let j = [];
|
|
156
156
|
const lt = (i = n) => {
|
|
157
|
-
|
|
157
|
+
j.forEach((d, c) => {
|
|
158
158
|
const p = i[c];
|
|
159
159
|
p && d.position.copy(p);
|
|
160
160
|
});
|
|
161
161
|
};
|
|
162
|
-
function
|
|
162
|
+
function D() {
|
|
163
163
|
var d, c;
|
|
164
|
-
|
|
164
|
+
j.forEach((p) => {
|
|
165
165
|
var b;
|
|
166
166
|
return (b = p.parent) == null ? void 0 : b.remove(p);
|
|
167
167
|
});
|
|
168
|
-
const i = (c = (d =
|
|
169
|
-
|
|
168
|
+
const i = (c = (d = e.line) == null ? void 0 : d.style) != null ? c : e.style;
|
|
169
|
+
j = n.map((p, b) => {
|
|
170
170
|
var S, k;
|
|
171
|
-
const x = new Ht(
|
|
171
|
+
const x = new Ht(I(H({}, i), {
|
|
172
172
|
color: (S = i.pointColor) != null ? S : i.lineColor,
|
|
173
173
|
tip: void 0,
|
|
174
174
|
point: p
|
|
@@ -177,38 +177,42 @@ function vt(s, e, t) {
|
|
|
177
177
|
}), lt();
|
|
178
178
|
}
|
|
179
179
|
function V() {
|
|
180
|
-
|
|
180
|
+
j.forEach((i) => {
|
|
181
181
|
var d;
|
|
182
182
|
return (d = i.parent) == null ? void 0 : d.remove(i);
|
|
183
|
-
}),
|
|
183
|
+
}), j = [], e.userData && (delete e.userData.creationPointMeshes, delete e.userData.syncCreationPointMeshes, delete e.userData.disposeCreationPointMeshes);
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
s.enable(), u && s.setAdherePoints([]);
|
|
186
186
|
const n = [];
|
|
187
187
|
let l, m, R = !1, U;
|
|
188
|
-
const
|
|
188
|
+
const O = [], Y = () => n.length > 0, z = () => O.length > 0, at = () => {
|
|
189
189
|
var i;
|
|
190
|
-
Y() && (
|
|
190
|
+
Y() && (O.push(n.pop()), g(U), D(), (i = t == null ? void 0 : t.onUndo) == null || i.call(t), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render());
|
|
191
191
|
}, ht = () => {
|
|
192
192
|
var i;
|
|
193
|
-
z() && (n.push(
|
|
194
|
-
},
|
|
193
|
+
z() && (n.push(O.pop()), g(U), D(), (i = t == null ? void 0 : t.onRedo) == null || i.call(t), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render());
|
|
194
|
+
}, B = (i) => {
|
|
195
195
|
var c;
|
|
196
|
-
|
|
196
|
+
O.length = 0;
|
|
197
197
|
let d = n.length === 0 ? i.point : l.clone();
|
|
198
|
-
u && (d = d.clone().setY(
|
|
199
|
-
|
|
198
|
+
if (u && (d = d.clone().setY(E)), n.push(d), e.setPoints(n, { closed: !1 }), t != null && t.experimental_self_intersect_check && n.length > 2 && e.isBlank) {
|
|
199
|
+
n.pop(), e.setPoints(n, { closed: !1 }), D(), console.warn("[Polygon] 检测到自相交,无法添加该点");
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
D(), (c = t == null ? void 0 : t.onPointPlaced) == null || c.call(t, n), R && (q(), r());
|
|
203
|
+
}, g = (i) => {
|
|
200
204
|
const d = () => {
|
|
201
|
-
P.setPoints([]), y.setPoints([]),
|
|
205
|
+
P.setPoints([]), y.setPoints([]), e.setPoints(n), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render();
|
|
202
206
|
};
|
|
203
207
|
if (!i) {
|
|
204
|
-
d(),
|
|
208
|
+
d(), D();
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
207
211
|
if (U = i, !(n != null && n.length))
|
|
208
212
|
return d();
|
|
209
213
|
const c = n.at(-1).clone();
|
|
210
|
-
if (n.length < 3 && (u ? (l = i.point.clone().setY(
|
|
211
|
-
u ? l = i.point.clone().setY(
|
|
214
|
+
if (n.length < 3 && (u ? (l = i.point.clone().setY(E), P.setPoints([c, l]), y.setPoints([])) : w === "none" ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : w === "xoz" ? (m = m != null ? m : new v.Plane().setFromNormalAndCoplanarPoint(new v.Vector3(0, 1, 0), n[0]), s.plane = m, l = m.projectPoint(i.point, new v.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])) : w === "y" && (n.length === 1 ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : (m = m != null ? m : new v.Plane().setFromCoplanarPoints(n[0], n[1], new v.Vector3(0, 1, 0).add(n[0])), s.plane = m, l = m.projectPoint(i.point, new v.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])))), n.length >= 3) {
|
|
215
|
+
u ? l = i.point.clone().setY(E) : l = e.projectPoint(i.point);
|
|
212
216
|
const p = n[0];
|
|
213
217
|
let b = !1;
|
|
214
218
|
if (typeof (t == null ? void 0 : t.autoClosePixelDistance) == "number") {
|
|
@@ -219,20 +223,20 @@ function vt(s, e, t) {
|
|
|
219
223
|
x: (st.x * 0.5 + 0.5) * S,
|
|
220
224
|
y: (1 - (st.y * 0.5 + 0.5)) * k
|
|
221
225
|
};
|
|
222
|
-
},
|
|
226
|
+
}, _ = W(p), tt = W(l), et = W(i.point), dt = Math.sqrt(M(_.x - tt.x, 2) + M(_.y - tt.y, 2)), ct = Math.sqrt(M(_.x - et.x, 2) + M(_.y - et.y, 2));
|
|
223
227
|
(dt < t.autoClosePixelDistance || ct < t.autoClosePixelDistance) && (b = !0);
|
|
224
228
|
}
|
|
225
229
|
} else
|
|
226
230
|
(p.distanceTo(l) < 0.2 || p.distanceTo(i.point) < 0.2) && (b = !0);
|
|
227
|
-
b ? (l = p, i.point.copy(p),
|
|
231
|
+
b ? (l = p, i.point.copy(p), s.pointSelectorHelper.updateWithIntersect(i, { emitEvent: !1 }), R = !0) : R = !1, P.setPoints([c, l]), y.setPoints([l, i.point]);
|
|
228
232
|
}
|
|
229
|
-
n.length >= 2 ? (
|
|
230
|
-
},
|
|
231
|
-
|
|
233
|
+
n.length >= 2 ? (e.setPoints([...n, l], { closed: !1 }), e.line.setPoints(e.points.slice(0, -1)), e.isBlank ? (s.cursorError = !0, P.setStyle({ lineColor: 16734553 }), y.setStyle({ lineColor: 16734553 })) : (s.cursorError = !1, P.setStyle({ lineColor: e.lineColor }), y.setStyle({ lineColor: e.lineColor }))) : e.setPoints([]), D();
|
|
234
|
+
}, q = () => {
|
|
235
|
+
s.off("select", B), s.off("intersectionUpdate", g), s.off("disable", F), s.plane = null, s.disable(), a == null || a.remove(P, y), V();
|
|
232
236
|
}, F = () => {
|
|
233
|
-
|
|
237
|
+
q(), a == null || a.remove(e, y, P), V(), f(new Error("Cancelled"));
|
|
234
238
|
};
|
|
235
|
-
return
|
|
239
|
+
return s.on("select", B), s.on("intersectionUpdate", g), s.on("disable", F), {
|
|
236
240
|
finished: o,
|
|
237
241
|
canUndo: Y,
|
|
238
242
|
canRedo: z,
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|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