@realsee/dnalogel 3.49.7-alpha.0 → 3.49.8
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 +7 -0
- package/dist/Sculpt/index.d.ts +10 -6
- package/dist/index.cjs.js +195 -195
- package/dist/index.js +26 -7
- package/dist/index.umd.js +188 -188
- package/dist/shared-utils/tag.d.ts +5 -0
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +15 -12
- package/libs/Sculpt/Meshes/Line.js +7 -7
- package/libs/Sculpt/Meshes/Polygon.js +12 -12
- package/libs/Sculpt/Objects/Box/index.js +2 -1
- package/libs/Sculpt/Objects/Cylinder/index.js +2 -1
- package/libs/Sculpt/Objects/Line/index.js +2 -1
- package/libs/Sculpt/Objects/Point/index.js +2 -1
- package/libs/Sculpt/Objects/Polyline/index.js +7 -6
- package/libs/Sculpt/Objects/Prism/index.js +2 -1
- package/libs/Sculpt/index.d.ts +10 -6
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +168 -159
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +5 -0
- package/libs/shared-utils/tag.js +7 -0
- package/package.json +1 -1
- package/README.md +0 -116
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var m = (n, o, t) => o in n ? h(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
|
|
3
|
+
var l = (n, o, t) => (m(n, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
4
|
import { BaseTag as g } from "./BaseTag.js";
|
|
5
5
|
import * as c from "three";
|
|
6
6
|
import "../../../shared-utils/Subscribe.js";
|
|
@@ -46,11 +46,11 @@ import "../../../shared-utils/five/getFloorIndex.js";
|
|
|
46
46
|
import "../../../shared-utils/safeObj.js";
|
|
47
47
|
import "../../utils/Cache.js";
|
|
48
48
|
const b = new c.Vector2();
|
|
49
|
-
class
|
|
49
|
+
class at extends g {
|
|
50
50
|
constructor(t, e) {
|
|
51
51
|
super(t, e);
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
l(this, "__Object__");
|
|
53
|
+
l(this, "requestIdleCallbackId");
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* @description 展开自己,收起其他标签
|
|
@@ -65,18 +65,21 @@ class lt extends g {
|
|
|
65
65
|
t.target === "TagPoint" && this.unfoldAndFoldOthers();
|
|
66
66
|
}
|
|
67
67
|
updateVisible() {
|
|
68
|
+
if (typeof window.requestIdleCallback == "undefined") {
|
|
69
|
+
super.updateVisible();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
68
72
|
const t = () => {
|
|
69
73
|
this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), this.requestIdleCallbackId = requestIdleCallback(() => {
|
|
70
74
|
super.updateVisible();
|
|
71
75
|
});
|
|
72
76
|
};
|
|
73
|
-
typeof window.requestIdleCallback == "undefined" && super.updateVisible();
|
|
74
77
|
let e = !1;
|
|
75
78
|
requestIdleCallback(() => {
|
|
76
79
|
e = !0;
|
|
77
80
|
}), t(), setTimeout(() => {
|
|
78
|
-
e || super.updateVisible();
|
|
79
|
-
},
|
|
81
|
+
e || (this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), super.updateVisible());
|
|
82
|
+
}, 200);
|
|
80
83
|
}
|
|
81
84
|
applyVisible() {
|
|
82
85
|
var t, e, s, i;
|
|
@@ -103,10 +106,10 @@ class lt extends g {
|
|
|
103
106
|
this.originPosition = t, this.position = t, this.cache.clear(), this.updateVisible(), this.updateScreenPosition(), this.updateZIndex(), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
104
107
|
}
|
|
105
108
|
updateScreenPosition(t) {
|
|
106
|
-
var
|
|
109
|
+
var a;
|
|
107
110
|
if (this.stickType !== "2DPoint" && this.stickType !== "3DPoint")
|
|
108
111
|
return;
|
|
109
|
-
const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (
|
|
112
|
+
const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (a = this.__Object__) != null ? a : {
|
|
110
113
|
timeoutId: void 0,
|
|
111
114
|
inAnimation: !1
|
|
112
115
|
};
|
|
@@ -145,5 +148,5 @@ class lt extends g {
|
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
150
|
export {
|
|
148
|
-
|
|
151
|
+
at as PointTag
|
|
149
152
|
};
|
|
@@ -54,7 +54,7 @@ class M extends I {
|
|
|
54
54
|
}
|
|
55
55
|
class X extends C {
|
|
56
56
|
constructor(e) {
|
|
57
|
-
var s, r, c,
|
|
57
|
+
var s, r, c, g, a;
|
|
58
58
|
super();
|
|
59
59
|
h(this, "name", "LineMesh");
|
|
60
60
|
h(this, "points");
|
|
@@ -72,9 +72,9 @@ class X extends C {
|
|
|
72
72
|
dashScale: 40,
|
|
73
73
|
opacity: (c = e == null ? void 0 : e.opacity) != null ? c : 1,
|
|
74
74
|
transparent: !0,
|
|
75
|
-
dashed: (
|
|
75
|
+
dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
|
|
76
76
|
}), n = new S({
|
|
77
|
-
color: new u.Color((
|
|
77
|
+
color: new u.Color((a = e == null ? void 0 : e.lineColor) != null ? a : b),
|
|
78
78
|
linewidth: t.linewidth * 0.9,
|
|
79
79
|
dashScale: t.dashScale,
|
|
80
80
|
opacity: t.opacity * 0.7,
|
|
@@ -172,11 +172,11 @@ class X extends C {
|
|
|
172
172
|
return [this.points[n - 1], t];
|
|
173
173
|
}).filter(d).map((t) => D(this, t));
|
|
174
174
|
i.forEach(([t, n], s) => {
|
|
175
|
-
var
|
|
175
|
+
var g;
|
|
176
176
|
const r = R(t, n);
|
|
177
|
-
this.lengthDoms[s] = (
|
|
178
|
-
const
|
|
179
|
-
return
|
|
177
|
+
this.lengthDoms[s] = (g = this.lengthDoms[s]) != null ? g : (() => {
|
|
178
|
+
const a = new x(this.five);
|
|
179
|
+
return a.intersectCheck = !1, a.simulate3D = !0, a;
|
|
180
180
|
})(), this.lengthDoms[s].setPosition(r, [t, n]);
|
|
181
181
|
const c = t.distanceTo(n).toFixed(2);
|
|
182
182
|
this.lengthDoms[s].lengthDom !== c && (this.lengthDoms[s].lengthDom = c, c === "0.00" ? this.lengthDoms[s].container.innerHTML = "" : this.lengthDoms[s].container.innerHTML = v(c + "m"));
|
|
@@ -18,8 +18,8 @@ import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.
|
|
|
18
18
|
import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
|
|
19
19
|
import { getGeometryInfo as A } from "../../shared-utils/three/geometryUtil.js";
|
|
20
20
|
import { LightTag as S } from "../../shared-utils/tag.js";
|
|
21
|
-
import { getLengthHTML as
|
|
22
|
-
import { applyObjectMatrixWorld as
|
|
21
|
+
import { getLengthHTML as D } from "../utils/Meshes/getLengthHTML.js";
|
|
22
|
+
import { applyObjectMatrixWorld as M } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
23
23
|
const p = new l.BufferGeometry();
|
|
24
24
|
p.name = "blankGeometry";
|
|
25
25
|
p.isBlank = !0;
|
|
@@ -58,7 +58,7 @@ class G extends _ {
|
|
|
58
58
|
}
|
|
59
59
|
updateMatrixWorld(e) {
|
|
60
60
|
if (super.updateMatrixWorld(e), this.center) {
|
|
61
|
-
const s =
|
|
61
|
+
const s = M(this, this.center).toArray().join(",");
|
|
62
62
|
s !== this.lastRenderAreaItem && (this.updateAreaItems(), this.lastRenderAreaItem = s);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -66,9 +66,9 @@ class G extends _ {
|
|
|
66
66
|
this._paramsStyle = h(h({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
|
|
67
67
|
}
|
|
68
68
|
setPoints(e) {
|
|
69
|
-
var
|
|
69
|
+
var n;
|
|
70
70
|
const s = e.map(P);
|
|
71
|
-
this.points = s, this.geometry = (
|
|
71
|
+
this.points = s, this.geometry = (n = I(this.points, { checkLinesIntersect: !0 })) != null ? n : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* @description: 获取一个点投影在当前平面上的点
|
|
@@ -86,21 +86,21 @@ class G extends _ {
|
|
|
86
86
|
this.points.length >= 3 ? this.planeHelper = new l.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
|
|
87
87
|
}
|
|
88
88
|
updateAreaItems() {
|
|
89
|
-
var
|
|
89
|
+
var n;
|
|
90
90
|
const e = () => {
|
|
91
|
-
var
|
|
92
|
-
(
|
|
91
|
+
var o;
|
|
92
|
+
(o = this.areaDom) == null || o.destroy(), this.areaDom = void 0;
|
|
93
93
|
};
|
|
94
94
|
if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
|
|
95
95
|
return e();
|
|
96
96
|
if (!this.five)
|
|
97
97
|
return console.error("Five not found");
|
|
98
|
-
this.areaDom = (
|
|
99
|
-
const
|
|
100
|
-
return
|
|
98
|
+
this.areaDom = (n = this.areaDom) != null ? n : (() => {
|
|
99
|
+
const o = new S(this.five);
|
|
100
|
+
return o.intersectCheck = !1, o.simulate3D = !0, o;
|
|
101
101
|
})(), this.areaDom.setPosition(this.center);
|
|
102
102
|
const s = this.geometryInfo.area.toFixed(2);
|
|
103
|
-
s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML =
|
|
103
|
+
s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = D(s + "m²");
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
export {
|
|
@@ -27,7 +27,7 @@ var R = (n, t, e) => new Promise((s, P) => {
|
|
|
27
27
|
}, c = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(w, b);
|
|
28
28
|
c((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import {
|
|
30
|
+
import { PolylineMesh as U, PolylineWithDotsMesh as W } from "../../Meshes/Polyline.js";
|
|
31
31
|
import { BaseObject as H } from "../Base/index.js";
|
|
32
32
|
import * as d from "three";
|
|
33
33
|
import { PolylineEditor as I } from "./Editor.js";
|
|
@@ -40,7 +40,7 @@ class Z extends H {
|
|
|
40
40
|
y(this, "type", "Polyline");
|
|
41
41
|
y(this, "polyLineMesh");
|
|
42
42
|
y(this, "creatingObject");
|
|
43
|
-
e && (this.polyLineMesh = new
|
|
43
|
+
e && (this.polyLineMesh = new W(p(p({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new I(this);
|
|
44
44
|
}
|
|
45
45
|
get data() {
|
|
46
46
|
return M(p({}, this.baseData), {
|
|
@@ -79,7 +79,7 @@ class Z extends H {
|
|
|
79
79
|
create(e) {
|
|
80
80
|
return R(this, null, function* () {
|
|
81
81
|
this.removeChildren();
|
|
82
|
-
const s = new
|
|
82
|
+
const s = new W(e);
|
|
83
83
|
this.polyLineMesh = s, this.add(this.polyLineMesh), this.creatingObject = q(s, this.pointSelector, e), yield this.creatingObject.finished, this.editor.enable();
|
|
84
84
|
});
|
|
85
85
|
}
|
|
@@ -89,9 +89,9 @@ function q(n, t, e) {
|
|
|
89
89
|
const s = n.parent;
|
|
90
90
|
if (!s)
|
|
91
91
|
return;
|
|
92
|
-
const { promise: P, resolve: w, reject: b } = _(), c = (x = e == null ? void 0 : e.limit) != null ? x : "none", o = new
|
|
92
|
+
const { promise: P, resolve: w, reject: b } = _(), c = (x = e == null ? void 0 : e.limit) != null ? x : "none", o = new U(n.style);
|
|
93
93
|
s.add(o);
|
|
94
|
-
const a = new
|
|
94
|
+
const a = new U(M(p({}, n.style), { dashed: !0, lengthEnable: !1 }));
|
|
95
95
|
s.add(a), t.enable();
|
|
96
96
|
const i = [];
|
|
97
97
|
let r, l, v;
|
|
@@ -125,5 +125,6 @@ function q(n, t, e) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
export {
|
|
128
|
-
Z as Polyline
|
|
128
|
+
Z as Polyline,
|
|
129
|
+
q as createPolyline
|
|
129
130
|
};
|
package/libs/Sculpt/index.d.ts
CHANGED
|
@@ -14,6 +14,15 @@ import { Box } from './Objects/Box';
|
|
|
14
14
|
import type { BuiltInData, BuiltInItem, Theme } from './typings';
|
|
15
15
|
import { Line } from './Objects/Line';
|
|
16
16
|
export type { SculptData } from './typings';
|
|
17
|
+
export { createPoint } from './Objects/Point';
|
|
18
|
+
export { createLine } from './Objects/Line';
|
|
19
|
+
export { createPolyline } from './Objects/Polyline';
|
|
20
|
+
export { createPolygon } from './Objects/Polygon';
|
|
21
|
+
export { createPrism } from './Objects/Prism';
|
|
22
|
+
export { createRectangle } from './Objects/Rectangle';
|
|
23
|
+
export { createCircle } from './Objects/Circle';
|
|
24
|
+
export { createCylinder } from './Objects/Cylinder';
|
|
25
|
+
export { createBox } from './Objects/Box';
|
|
17
26
|
interface Data {
|
|
18
27
|
items: Array<BuiltInData>;
|
|
19
28
|
}
|
|
@@ -68,12 +77,7 @@ export declare class Sculpt extends Subscribe<Event> {
|
|
|
68
77
|
id: string;
|
|
69
78
|
type: string;
|
|
70
79
|
} | {
|
|
71
|
-
readonly points: [number, number, number][];
|
|
72
|
-
* @description: 点击事件
|
|
73
|
-
* @param {MouseEvent} e 鼠标事件
|
|
74
|
-
* @param {BuiltInItem} item 点击的物体
|
|
75
|
-
* 返回 false 来禁用 Five 默认行为
|
|
76
|
-
*/
|
|
80
|
+
readonly points: [number, number, number][];
|
|
77
81
|
readonly heightPoint: [number, number, number];
|
|
78
82
|
readonly style: {
|
|
79
83
|
readonly color: number;
|