@realsee/dnalogel 3.50.0 → 3.50.2
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/Meshes/Line.d.ts +1 -0
- package/dist/Sculpt/Meshes/Point.d.ts +1 -0
- package/dist/index.cjs.js +206 -206
- package/dist/index.js +4318 -4310
- package/dist/index.umd.js +196 -196
- package/libs/Sculpt/Meshes/Line.d.ts +1 -0
- package/libs/Sculpt/Meshes/Line.js +64 -58
- package/libs/Sculpt/Meshes/Point.d.ts +1 -0
- package/libs/Sculpt/Meshes/Point.js +33 -27
- package/libs/Sculpt/Objects/Line/index.js +38 -39
- package/libs/Sculpt/Objects/Point/index.js +18 -18
- package/libs/Sculpt/Objects/Polygon/index.js +21 -22
- package/libs/Sculpt/Objects/Polyline/index.js +27 -28
- package/libs/Sculpt/Objects/Rectangle/index.js +48 -49
- package/libs/Sculpt/utils/Meshes/getLengthHTML.js +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ export declare class LineMesh extends IObject3D {
|
|
|
45
45
|
private opacityBeforeHighlight;
|
|
46
46
|
private paramsStyle;
|
|
47
47
|
private lastRenderDomItem;
|
|
48
|
+
private _visible;
|
|
48
49
|
constructor(params?: Partial<LineMeshStyle & LineData>);
|
|
49
50
|
updateMatrixWorld(force?: boolean): void;
|
|
50
51
|
setPoints(points: AnyPositions): void;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
2
|
var L = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var y = (
|
|
5
|
-
for (var e in
|
|
6
|
-
|
|
3
|
+
var k = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var y = (r, o, e) => o in r ? T(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, m = (r, o) => {
|
|
5
|
+
for (var e in o || (o = {}))
|
|
6
|
+
k.call(o, e) && y(r, e, o[e]);
|
|
7
7
|
if (L)
|
|
8
|
-
for (var e of L(
|
|
9
|
-
|
|
10
|
-
return
|
|
8
|
+
for (var e of L(o))
|
|
9
|
+
w.call(o, e) && y(r, e, o[e]);
|
|
10
|
+
return r;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var h = (r, o, e) => (y(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
13
13
|
import * as f from "three";
|
|
14
|
-
import { DEFAULT_LINE_COLOR as p, DEFAULT_LINE_WIDTH as
|
|
15
|
-
import { LineMaterial as
|
|
14
|
+
import { DEFAULT_LINE_COLOR as p, DEFAULT_LINE_WIDTH as I, DEFAULT_HIGHLIGHT_OPACITY as S } from "../typings/style.js";
|
|
15
|
+
import { LineMaterial as H, THREE_Line2 as v } from "../../shared-utils/five/FiveLine.js";
|
|
16
16
|
import { LineGeometry as g } from "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
17
|
-
import { anyPositionToVector3 as
|
|
18
|
-
import { IObject3D as
|
|
17
|
+
import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
|
|
18
|
+
import { IObject3D as R } from "../../shared-utils/three/IObject3D.js";
|
|
19
19
|
import "hammerjs";
|
|
20
20
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
21
|
-
import { centerPoint as
|
|
22
|
-
import { LightTag as
|
|
23
|
-
import { removeAllTag as
|
|
24
|
-
import { getLengthHTML as
|
|
25
|
-
import { applyObjectMatrixWorld as
|
|
21
|
+
import { centerPoint as x } from "../../shared-utils/three/centerPoint.js";
|
|
22
|
+
import { LightTag as W } from "../../shared-utils/tag.js";
|
|
23
|
+
import { removeAllTag as O } from "../utils/removeAllTag.js";
|
|
24
|
+
import { getLengthHTML as P } from "../utils/Meshes/getLengthHTML.js";
|
|
25
|
+
import { applyObjectMatrixWorld as _ } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
26
26
|
import "../../shared-utils/three/core/Sphere.js";
|
|
27
27
|
import "animejs";
|
|
28
28
|
import { notNil as d } from "../../shared-utils/isNil.js";
|
|
29
29
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
30
|
-
class
|
|
30
|
+
class D extends H {
|
|
31
31
|
constructor(e) {
|
|
32
32
|
var i, t;
|
|
33
33
|
super(e);
|
|
34
|
-
|
|
35
|
-
d(e == null ? void 0 : e.color) && (this.three_color = (i = e == null ? void 0 : e.color) != null ? i : 16777215), Object.keys(e).forEach((
|
|
36
|
-
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(
|
|
34
|
+
h(this, "_three_color");
|
|
35
|
+
d(e == null ? void 0 : e.color) && (this.three_color = (i = e == null ? void 0 : e.color) != null ? i : 16777215), Object.keys(e).forEach((s) => {
|
|
36
|
+
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(s) || s in this && (this[s] = e[s]);
|
|
37
37
|
}), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
|
|
38
38
|
}
|
|
39
39
|
get three_color() {
|
|
@@ -46,34 +46,35 @@ class _ extends w {
|
|
|
46
46
|
this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
class
|
|
49
|
+
class E extends v {
|
|
50
50
|
constructor(e, i) {
|
|
51
51
|
super(e, i);
|
|
52
|
-
|
|
52
|
+
h(this, "name", "Line3");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class ee extends R {
|
|
56
56
|
constructor(e) {
|
|
57
57
|
var l, c, a, u, n;
|
|
58
58
|
super();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
h(this, "name", "LineMesh");
|
|
60
|
+
h(this, "points");
|
|
61
|
+
h(this, "doms", []);
|
|
62
|
+
h(this, "highlighted", !1);
|
|
63
|
+
h(this, "line");
|
|
64
|
+
h(this, "backLine");
|
|
65
|
+
h(this, "opacityBeforeHighlight");
|
|
66
|
+
h(this, "paramsStyle", {});
|
|
67
|
+
h(this, "lastRenderDomItem");
|
|
68
|
+
h(this, "_visible", !0);
|
|
68
69
|
this.paramsStyle = e != null ? e : {};
|
|
69
|
-
const i = new g(), t = new
|
|
70
|
+
const i = new g(), t = new D({
|
|
70
71
|
color: new f.Color((l = e == null ? void 0 : e.lineColor) != null ? l : p),
|
|
71
|
-
linewidth: (c = e == null ? void 0 : e.lineWidth) != null ? c :
|
|
72
|
+
linewidth: (c = e == null ? void 0 : e.lineWidth) != null ? c : I,
|
|
72
73
|
dashScale: 40,
|
|
73
74
|
opacity: (a = e == null ? void 0 : e.opacity) != null ? a : 1,
|
|
74
75
|
transparent: !0,
|
|
75
76
|
dashed: (u = e == null ? void 0 : e.dashed) != null ? u : !1
|
|
76
|
-
}),
|
|
77
|
+
}), s = new D({
|
|
77
78
|
color: new f.Color((n = e == null ? void 0 : e.lineColor) != null ? n : p),
|
|
78
79
|
linewidth: t.linewidth * 0.9,
|
|
79
80
|
dashScale: t.dashScale,
|
|
@@ -83,8 +84,13 @@ class X extends C {
|
|
|
83
84
|
transparent: !0,
|
|
84
85
|
resolution: t.resolution
|
|
85
86
|
});
|
|
86
|
-
this.line = new
|
|
87
|
-
|
|
87
|
+
this.line = new E(i, t), this.backLine = new E(i, s), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
|
|
88
|
+
O(this);
|
|
89
|
+
}), Object.defineProperty(this, "visible", {
|
|
90
|
+
set: (b) => {
|
|
91
|
+
this.doms && this.doms.forEach((M) => M.container.style.visibility = b ? "visible" : "hidden"), this._visible = b;
|
|
92
|
+
},
|
|
93
|
+
get: () => this._visible
|
|
88
94
|
});
|
|
89
95
|
}
|
|
90
96
|
get style() {
|
|
@@ -128,34 +134,34 @@ class X extends C {
|
|
|
128
134
|
updateMatrixWorld(e) {
|
|
129
135
|
var i;
|
|
130
136
|
if (super.updateMatrixWorld(e), this.points) {
|
|
131
|
-
const t = (i =
|
|
137
|
+
const t = (i = _(this, this.points)) == null ? void 0 : i.map((s) => s.toArray().join(",")).join(",");
|
|
132
138
|
t !== this.lastRenderDomItem && (this.updateDomItems(), this.lastRenderDomItem = t);
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
setPoints(e) {
|
|
136
|
-
const i = e.map(
|
|
142
|
+
const i = e.map(C).filter(d);
|
|
137
143
|
if (this.points = i, i.length < 2) {
|
|
138
144
|
this.line.geometry = new g(), this.backLine.geometry = this.line.geometry, this.updateDomItems();
|
|
139
145
|
return;
|
|
140
146
|
}
|
|
141
147
|
this.addIfNotExists(this.line, this.backLine);
|
|
142
|
-
const t = i.flatMap((
|
|
148
|
+
const t = i.flatMap((s) => [s.x, s.y, s.z]);
|
|
143
149
|
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new g(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateDomItems(), this.needsRender = !0;
|
|
144
150
|
}
|
|
145
151
|
setResolution(e, i) {
|
|
146
152
|
const t = this.line.material.resolution;
|
|
147
153
|
(t.x !== e || t.y !== i) && (t.set(e, i), this.needsRender = !0);
|
|
148
|
-
const
|
|
149
|
-
(
|
|
154
|
+
const s = this.backLine.material.resolution;
|
|
155
|
+
(s.x !== e || s.y !== i) && (s.set(e, i), this.needsRender = !0);
|
|
150
156
|
}
|
|
151
157
|
setStyle(e) {
|
|
152
|
-
var
|
|
158
|
+
var s, l, c;
|
|
153
159
|
this.paramsStyle = m(m({}, this.paramsStyle), e), d(e.lineColor) && (this.line.material.three_color = new f.Color(e.lineColor), this.backLine.material.three_color = new f.Color(e.lineColor)), d(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), d(e.dashed) && this.line.material.setDashed(e.dashed), d(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.7), this.updateDomItems();
|
|
154
|
-
const i = (
|
|
160
|
+
const i = (s = e.occlusionVisibility) != null ? s : this.paramsStyle.occlusionVisibility, t = (c = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? c : "translucence";
|
|
155
161
|
i ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
|
|
156
162
|
}
|
|
157
163
|
highlight() {
|
|
158
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight *
|
|
164
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * S, this.backLine.material.opacity = this.backLine.material.opacity * S, this.needsRender = !0);
|
|
159
165
|
}
|
|
160
166
|
unhighlight() {
|
|
161
167
|
this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
|
|
@@ -168,29 +174,29 @@ class X extends C {
|
|
|
168
174
|
return e();
|
|
169
175
|
if (!this.five)
|
|
170
176
|
return console.error("Five not found");
|
|
171
|
-
const i = this.points.map((t,
|
|
172
|
-
if (
|
|
173
|
-
return [this.points[
|
|
174
|
-
}).filter(d).map((t) =>
|
|
175
|
-
i.forEach(([t,
|
|
177
|
+
const i = this.points.map((t, s) => {
|
|
178
|
+
if (s !== 0)
|
|
179
|
+
return [this.points[s - 1], t];
|
|
180
|
+
}).filter(d).map((t) => _(this, t));
|
|
181
|
+
i.forEach(([t, s], l) => {
|
|
176
182
|
var u;
|
|
177
|
-
const c =
|
|
183
|
+
const c = x(t, s);
|
|
178
184
|
this.doms[l] = (u = this.doms[l]) != null ? u : (() => {
|
|
179
|
-
const n = new
|
|
185
|
+
const n = new W(this.five);
|
|
180
186
|
return n.intersectCheck = !1, n.simulate3D = !0, n;
|
|
181
|
-
})(), this.doms[l].setPosition(c, [t,
|
|
187
|
+
})(), this.doms[l].setPosition(c, [t, s]);
|
|
182
188
|
const a = (n) => {
|
|
183
|
-
this.doms[l].__text !== n && (this.doms[l].__text = n, n ? this.doms[l].container.innerHTML =
|
|
189
|
+
this.doms[l].__text !== n && (this.doms[l].__text = n, n ? this.doms[l].container.innerHTML = P(n) : this.doms[l].container.innerHTML = "");
|
|
184
190
|
};
|
|
185
191
|
if (this.paramsStyle.tip)
|
|
186
192
|
a(this.paramsStyle.tip);
|
|
187
193
|
else {
|
|
188
|
-
const n = t.distanceTo(
|
|
194
|
+
const n = t.distanceTo(s).toFixed(2);
|
|
189
195
|
a(n === "0.00" ? null : n + "m");
|
|
190
196
|
}
|
|
191
197
|
}), this.doms.length > i.length && (this.doms.slice(i.length).forEach((t) => t.destroy()), this.doms.length = i.length);
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
export {
|
|
195
|
-
|
|
201
|
+
ee as LineMesh
|
|
196
202
|
};
|
|
@@ -19,6 +19,7 @@ export declare class PointMesh extends IObject3D {
|
|
|
19
19
|
private backgroundMesh;
|
|
20
20
|
private lastRenderDomItem;
|
|
21
21
|
private paramsStyle;
|
|
22
|
+
private _visible;
|
|
22
23
|
private get five();
|
|
23
24
|
constructor(params?: Partial<PointStyle & PointData>);
|
|
24
25
|
setStyle(params: Partial<PointStyle>): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
1
|
+
var N = Object.defineProperty, k = Object.defineProperties;
|
|
2
2
|
var D = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var u = (e, i, t) => i in e ?
|
|
3
|
+
var A = Object.getOwnPropertySymbols;
|
|
4
|
+
var v = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (e, i, t) => i in e ? N(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, f = (e, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
v.call(i, t) && u(e, t, i[t]);
|
|
8
|
+
if (A)
|
|
9
|
+
for (var t of A(i))
|
|
10
|
+
V.call(i, t) && u(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
12
|
}, g = (e, i) => k(e, D(i));
|
|
13
|
-
var
|
|
13
|
+
var C = (e, i) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var o in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var o of
|
|
19
|
-
i.indexOf(o) < 0 &&
|
|
16
|
+
v.call(e, o) && i.indexOf(o) < 0 && (t[o] = e[o]);
|
|
17
|
+
if (e != null && A)
|
|
18
|
+
for (var o of A(e))
|
|
19
|
+
i.indexOf(o) < 0 && V.call(e, o) && (t[o] = e[o]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
var s = (e, i, t) => (u(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
@@ -30,15 +30,15 @@ import "@realsee/five/line";
|
|
|
30
30
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
31
31
|
import { LightTag as W } from "../../shared-utils/tag.js";
|
|
32
32
|
import { removeAllTag as x } from "../utils/removeAllTag.js";
|
|
33
|
-
import { getLengthHTML as
|
|
34
|
-
import { applyObjectMatrixWorld as
|
|
33
|
+
import { getLengthHTML as S } from "../utils/Meshes/getLengthHTML.js";
|
|
34
|
+
import { applyObjectMatrixWorld as F } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
35
35
|
import "../../shared-utils/three/core/Sphere.js";
|
|
36
36
|
import "animejs";
|
|
37
37
|
import { notNil as a } from "../../shared-utils/isNil.js";
|
|
38
38
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
class
|
|
39
|
+
const H = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==";
|
|
40
|
+
let P = null;
|
|
41
|
+
class $ extends B {
|
|
42
42
|
constructor(t) {
|
|
43
43
|
var w, p;
|
|
44
44
|
super();
|
|
@@ -50,7 +50,8 @@ class _ extends B {
|
|
|
50
50
|
s(this, "backgroundMesh");
|
|
51
51
|
s(this, "lastRenderDomItem");
|
|
52
52
|
s(this, "paramsStyle");
|
|
53
|
-
|
|
53
|
+
s(this, "_visible", !0);
|
|
54
|
+
const M = t != null ? t : {}, { point: o } = M, h = C(M, ["point"]);
|
|
54
55
|
this.paramsStyle = h != null ? h : {};
|
|
55
56
|
const d = new r.BufferGeometry();
|
|
56
57
|
d.setAttribute("position", new r.Float32BufferAttribute([0, 0, 0], 3));
|
|
@@ -58,21 +59,26 @@ class _ extends B {
|
|
|
58
59
|
transparent: !0,
|
|
59
60
|
side: r.DoubleSide,
|
|
60
61
|
size: (w = t == null ? void 0 : t.size) != null ? w : 8,
|
|
61
|
-
map:
|
|
62
|
+
map: P || (P = new r.TextureLoader().load(H)),
|
|
62
63
|
sizeAttenuation: !1
|
|
63
64
|
}, c = new r.PointsMaterial(g(f({}, m), {
|
|
64
65
|
color: (p = t == null ? void 0 : t.color) != null ? p : 16777215,
|
|
65
66
|
depthTest: !0,
|
|
66
67
|
opacity: 1
|
|
67
|
-
})),
|
|
68
|
+
})), y = new r.PointsMaterial(g(f({}, m), {
|
|
68
69
|
size: c.size,
|
|
69
70
|
color: c.color,
|
|
70
71
|
depthWrite: !1,
|
|
71
72
|
depthTest: !1,
|
|
72
73
|
opacity: 0.5
|
|
73
|
-
})),
|
|
74
|
-
this.fontMesh =
|
|
74
|
+
})), n = new r.Points(d, c), l = new r.Points(d, y);
|
|
75
|
+
this.fontMesh = n, this.backgroundMesh = l, n.name = "FontMesh", l.name = "BackgroundMesh", n.renderOrder = 10, l.renderOrder = 0, this.add(n, l), t != null && t.point && this.position.copy(E(t.point)), t && this.setStyle(t), this.addEventListener("removed", () => {
|
|
75
76
|
x(this);
|
|
77
|
+
}), Object.defineProperty(this, "visible", {
|
|
78
|
+
set: (b) => {
|
|
79
|
+
this.dom && (this.dom.container.style.visibility = b ? "visible" : "hidden"), this._visible = b;
|
|
80
|
+
},
|
|
81
|
+
get: () => this._visible
|
|
76
82
|
});
|
|
77
83
|
}
|
|
78
84
|
get color() {
|
|
@@ -96,18 +102,18 @@ class _ extends B {
|
|
|
96
102
|
}
|
|
97
103
|
updateMatrixWorld(t) {
|
|
98
104
|
super.updateMatrixWorld(t);
|
|
99
|
-
const o =
|
|
105
|
+
const o = F(this, this.position).toArray().join(",");
|
|
100
106
|
o !== this.lastRenderDomItem && (this.updateDom(), this.lastRenderDomItem = o);
|
|
101
107
|
}
|
|
102
108
|
updateDom() {
|
|
103
109
|
const t = this.paramsStyle.tip;
|
|
104
|
-
t && !this.dom && (this.dom = new W(this.five), this.dom.intersectCheck = !1, this.dom.simulate3D = !0);
|
|
110
|
+
t && !this.dom && (this.dom = new W(this.five), this.dom.intersectCheck = !1, this.dom.simulate3D = !0, this.dom.container.style.visibility = "hidden");
|
|
105
111
|
const o = (h) => {
|
|
106
|
-
this.dom && this.dom.__text !== h && (this.dom.__text = h, h ? this.dom.container.innerHTML =
|
|
112
|
+
this.dom && this.dom.__text !== h && (this.dom.__text = h, h ? this.dom.container.innerHTML = S(h) : this.dom.container.innerHTML = "");
|
|
107
113
|
};
|
|
108
114
|
t ? (o(t), this.dom.setPosition(this.position.clone())) : o(null);
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
117
|
export {
|
|
112
|
-
|
|
118
|
+
$ as PointMesh
|
|
113
119
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var D = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var z = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var R = Object.getOwnPropertySymbols;
|
|
4
|
+
var B = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var j = (n, t, e) => t in n ? D(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, f = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
B.call(t, e) && j(n, e, t[e]);
|
|
8
|
+
if (R)
|
|
9
|
+
for (var e of R(t))
|
|
10
|
+
F.call(t, e) && j(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
var w = (n, t, e) => (
|
|
14
|
-
var
|
|
12
|
+
}, v = (n, t) => k(n, z(t));
|
|
13
|
+
var w = (n, t, e) => (j(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var U = (n, t, e) => new Promise((s, p) => {
|
|
15
15
|
var P = (o) => {
|
|
16
16
|
try {
|
|
17
17
|
c(e.next(o));
|
|
@@ -28,24 +28,23 @@ var V = (n, t, e) => new Promise((s, p) => {
|
|
|
28
28
|
c((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
30
|
import { LineMesh as H } from "../../Meshes/Line.js";
|
|
31
|
-
import { BaseObject as
|
|
31
|
+
import { BaseObject as I } from "../Base/index.js";
|
|
32
32
|
import * as a from "three";
|
|
33
|
-
import { LineEditor as
|
|
33
|
+
import { LineEditor as N } from "./Editor.js";
|
|
34
34
|
import { vector3ToArray as q } from "../../../shared-utils/three/vector3ToArray.js";
|
|
35
35
|
import { LineWithDotsMesh as T } from "../../Meshes/LineWithDots.js";
|
|
36
36
|
import { rayOnLine as G } from "../../utils/three/rayOnLine.js";
|
|
37
37
|
import { withResolvers as J } from "../../../shared-utils/promise/withResolvers.js";
|
|
38
|
-
|
|
39
|
-
class ie extends N {
|
|
38
|
+
class ne extends I {
|
|
40
39
|
constructor(e, s) {
|
|
41
40
|
super(e, s);
|
|
42
41
|
w(this, "type", "Line");
|
|
43
42
|
w(this, "lineMesh");
|
|
44
43
|
w(this, "creatingObject");
|
|
45
|
-
e && (this.lineMesh = new T(f(f({}, e.style), e)), this.add(this.lineMesh)), this.editor = new
|
|
44
|
+
e && (this.lineMesh = new T(f(f({}, e.style), e)), this.add(this.lineMesh)), this.editor = new N(this);
|
|
46
45
|
}
|
|
47
46
|
get data() {
|
|
48
|
-
return
|
|
47
|
+
return v(f({}, this.baseData), {
|
|
49
48
|
points: q(this.applyObjectMatrixWorld(this.lineMesh.points)),
|
|
50
49
|
style: {
|
|
51
50
|
lineColor: new a.Color(this.lineMesh.color).getHex(),
|
|
@@ -79,7 +78,7 @@ class ie extends N {
|
|
|
79
78
|
(e = this.creatingObject) == null || e.redo();
|
|
80
79
|
}
|
|
81
80
|
create(e) {
|
|
82
|
-
return
|
|
81
|
+
return U(this, null, function* () {
|
|
83
82
|
this.removeChildren();
|
|
84
83
|
const s = new T(e);
|
|
85
84
|
this.lineMesh = s, this.add(this.lineMesh), this.creatingObject = K(s, this.pointSelector, e), yield this.creatingObject.finished, this.editor.enable();
|
|
@@ -87,53 +86,53 @@ class ie extends N {
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
function K(n, t, e) {
|
|
90
|
-
var
|
|
89
|
+
var C;
|
|
91
90
|
const s = n.parent;
|
|
92
91
|
if (!s)
|
|
93
92
|
return;
|
|
94
|
-
const { promise: p, resolve: P, reject: b } = J(), c = (
|
|
93
|
+
const { promise: p, resolve: P, reject: b } = J(), c = (C = e == null ? void 0 : e.limit) != null ? C : "none", o = new H(n.style);
|
|
95
94
|
s.add(o);
|
|
96
|
-
const l = new H(
|
|
95
|
+
const l = new H(v(f({}, n.style), { dashed: !0, lengthEnable: !1 }));
|
|
97
96
|
s.add(l), t.enable();
|
|
98
97
|
const i = [];
|
|
99
|
-
let h, d,
|
|
100
|
-
const m = [], O = () => i.length > 0, M = () => m.length > 0,
|
|
101
|
-
O() && (m.push(i.pop()), n.setPoints(i), g(
|
|
102
|
-
},
|
|
103
|
-
M() && (i.push(m.pop()), n.setPoints(i), g(
|
|
98
|
+
let h, d, y;
|
|
99
|
+
const m = [], O = () => i.length > 0, M = () => m.length > 0, W = () => {
|
|
100
|
+
O() && (m.push(i.pop()), n.setPoints(i), g(y), t.pointSelectorHelper.magnifier.render());
|
|
101
|
+
}, A = () => {
|
|
102
|
+
M() && (i.push(m.pop()), n.setPoints(i), g(y), t.pointSelectorHelper.magnifier.render());
|
|
104
103
|
}, E = (r) => {
|
|
105
104
|
if (!r)
|
|
106
105
|
return;
|
|
107
106
|
m.length = 0;
|
|
108
107
|
const u = i.length === 0 ? r.point : h.clone();
|
|
109
|
-
i.push(u), n.setPoints(i), i.length === 2 && (
|
|
108
|
+
i.push(u), n.setPoints(i), i.length === 2 && (V(), P());
|
|
110
109
|
}, g = (r) => {
|
|
111
110
|
const u = () => {
|
|
112
111
|
o.setPoints([]), l.setPoints([]), t.pointSelectorHelper.magnifier.render();
|
|
113
112
|
};
|
|
114
113
|
if (!(i != null && i.length) || !r)
|
|
115
114
|
return u();
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
c === "none" ? (h = r.point, o.setPoints([
|
|
115
|
+
y = r;
|
|
116
|
+
const L = i.at(-1).clone();
|
|
117
|
+
c === "none" ? (h = r.point, o.setPoints([L, h])) : c === "xoz" ? (t.plane = d, d = d != null ? d : new a.Plane().setFromNormalAndCoplanarPoint(new a.Vector3(0, 1, 0), i[0]), h = d.projectPoint(r.point, new a.Vector3()), o.setPoints([L, h]), l.setPoints([h, r.point])) : c === "y" && (r.isVirtual ? (h = G({
|
|
119
118
|
raycaster: r.raycaster,
|
|
120
119
|
line: new a.Line3(i[0].clone(), new a.Vector3(0, 1, 0).add(i[0])),
|
|
121
120
|
clampToLine: !1
|
|
122
|
-
}), l.setPoints([])) : (h = new a.Line3(i[0].clone(), new a.Vector3(0, 1, 0).add(i[0])).closestPointToPoint(r.point, !1,
|
|
121
|
+
}), l.setPoints([])) : (h = new a.Line3(i[0].clone(), new a.Vector3(0, 1, 0).add(i[0])).closestPointToPoint(r.point, !1, new a.Vector3()), l.setPoints([h, r.point])), o.setPoints([L, h]));
|
|
122
|
+
}, V = () => {
|
|
123
|
+
t.off("select", E), t.off("intersectionUpdate", g), t.off("disable", x), t.plane = null, t.disable(), s == null || s.remove(o, l);
|
|
123
124
|
}, x = () => {
|
|
124
|
-
|
|
125
|
-
}, C = () => {
|
|
126
|
-
x(), i.length !== 2 && (s == null || s.remove(n)), b(new Error("Cancelled"));
|
|
125
|
+
V(), i.length !== 2 && (s == null || s.remove(n)), b(new Error("Cancelled"));
|
|
127
126
|
};
|
|
128
|
-
return t.on("select", E), t.on("intersectionUpdate", g), t.on("disable",
|
|
127
|
+
return t.on("select", E), t.on("intersectionUpdate", g), t.on("disable", x), {
|
|
129
128
|
finished: p,
|
|
130
129
|
canUndo: O,
|
|
131
130
|
canRedo: M,
|
|
132
|
-
undo:
|
|
133
|
-
redo:
|
|
131
|
+
undo: W,
|
|
132
|
+
redo: A
|
|
134
133
|
};
|
|
135
134
|
}
|
|
136
135
|
export {
|
|
137
|
-
|
|
136
|
+
ne as Line,
|
|
138
137
|
K as createLine
|
|
139
138
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var g = Object.defineProperty,
|
|
2
|
-
var
|
|
1
|
+
var g = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
+
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var d = Object.getOwnPropertySymbols;
|
|
4
|
-
var P = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
4
|
+
var P = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var c = (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
|
-
P.call(i, t) &&
|
|
7
|
+
P.call(i, t) && c(e, t, i[t]);
|
|
8
8
|
if (d)
|
|
9
9
|
for (var t of d(i))
|
|
10
|
-
|
|
10
|
+
v.call(i, t) && c(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
|
-
}, m = (e, i) =>
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, m = (e, i) => y(e, M(i));
|
|
13
|
+
var p = (e, i, t) => (c(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
17
|
o(t.next(s));
|
|
@@ -27,16 +27,16 @@ var M = (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
|
|
31
|
-
import { BaseObject as
|
|
30
|
+
import { PointMesh as u } from "../../Meshes/Point.js";
|
|
31
|
+
import { BaseObject as w } 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";
|
|
34
|
-
class C extends
|
|
34
|
+
class C extends w {
|
|
35
35
|
constructor(t, h) {
|
|
36
36
|
super(t, h);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.editor = new x(this), t && (this.pointMesh = new
|
|
37
|
+
p(this, "type", "Point");
|
|
38
|
+
p(this, "pointMesh");
|
|
39
|
+
this.editor = new x(this), t && (this.pointMesh = new u(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 b(this, null, function* () {
|
|
71
|
+
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new u(t)), yield U(this.pointMesh, this.pointSelector);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -78,7 +78,7 @@ function U(e, i) {
|
|
|
78
78
|
const n = (s) => {
|
|
79
79
|
s && (e.visible = !0, e.position.copy(s.point));
|
|
80
80
|
}, r = (s) => {
|
|
81
|
-
s && (e.position.copy(s.point), f());
|
|
81
|
+
s && (e.visible = !0, e.position.copy(s.point), f());
|
|
82
82
|
}, f = () => {
|
|
83
83
|
i.off("select", r), i.off("disable", o), i.off("intersectionUpdate", n), i.disable(), t();
|
|
84
84
|
}, o = () => {
|