@realsee/dnalogel 3.50.4 → 3.50.6
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/Point.d.ts +6 -0
- package/dist/Sculpt/utils/Meshes/getLengthHTML.d.ts +3 -1
- package/dist/index.cjs.js +24 -24
- package/dist/index.js +919 -903
- package/dist/index.umd.js +14 -14
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/Sculpt/Meshes/Line.js +33 -30
- package/libs/Sculpt/Meshes/Point.d.ts +6 -0
- package/libs/Sculpt/Meshes/Point.js +49 -38
- package/libs/Sculpt/Meshes/Polygon.js +46 -36
- package/libs/Sculpt/utils/Meshes/getLengthHTML.d.ts +3 -1
- package/libs/Sculpt/utils/Meshes/getLengthHTML.js +3 -3
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -187,7 +187,7 @@ class Ye extends H {
|
|
|
187
187
|
this.five = t, this.hook = this.hooks, this.params = e, this.config = G(e, ["openParams", "magnifierParams"]), this.model = new L(this.config), this.isMobile = (u = (l = e == null ? void 0 : e.openParams) == null ? void 0 : l.isMobile) != null ? u : !1, this.magnifier = new V(
|
|
188
188
|
t,
|
|
189
189
|
(y = (g = e.magnifierParams) != null ? g : (f = (d = e.pointSelectorConfig) == null ? void 0 : d.helper) == null ? void 0 : f.magnifierParams) != null ? y : { width: 190, height: 190, scale: 2 }
|
|
190
|
-
), this.allowMeasureType = Array.from(new Set((M = (C = e.editParams) == null ? void 0 : C.allowMeasureType) != null ? M : ["line"])), this.currentMeasureType = (w = this.allowMeasureType[0]) != null ? w : "line", this.group = new S(), this.group.name = "plugin-measure-group", this.container.classList.add("five-plugin-measure-container"), this.container.style.position = "absolute", this.container.style.left = "0", this.container.style.top = "0", this.container.style.visibility = "hidden", this.container.style.width = "100%", this.container.style.height = "100%", this.container.style.opacity = "0";
|
|
190
|
+
), this.allowMeasureType = Array.from(new Set((M = (C = e.editParams) == null ? void 0 : C.allowMeasureType) != null ? M : ["line"])), this.currentMeasureType = (w = this.allowMeasureType[0]) != null ? w : "line", this.group = new S(), this.group.name = "plugin-measure-group", this.container.classList.add("five-plugin-measure-container"), this.container.style.position = "absolute", this.container.style.left = "0", this.container.style.top = "0", this.container.style.visibility = "hidden", this.container.style.width = "100%", this.container.style.height = "100%", this.container.style.opacity = "0", this.container.style.zIndex = "1";
|
|
191
191
|
const i = (b = (P = e.editParams) == null ? void 0 : P.pointSelectorMode) != null ? b : K ? "fixed" : "cursor", o = (v = this.params.openParams) != null ? v : {};
|
|
192
192
|
if (this.params.useUIController !== !1) {
|
|
193
193
|
const p = m({
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
2
|
var L = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var w = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var m = (r, o, e) => o in r ? T(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e, g = (r, o) => {
|
|
5
5
|
for (var e in o || (o = {}))
|
|
6
|
-
|
|
6
|
+
w.call(o, e) && m(r, e, o[e]);
|
|
7
7
|
if (L)
|
|
8
8
|
for (var e of L(o))
|
|
9
|
-
|
|
9
|
+
k.call(o, e) && m(r, e, o[e]);
|
|
10
10
|
return r;
|
|
11
11
|
};
|
|
12
|
-
var h = (r, o, e) => (
|
|
12
|
+
var h = (r, o, e) => (m(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 H, THREE_Line2 as
|
|
16
|
-
import { LineGeometry as
|
|
17
|
-
import { anyPositionToVector3 as
|
|
18
|
-
import { IObject3D as
|
|
14
|
+
import { DEFAULT_LINE_COLOR as p, DEFAULT_LINE_WIDTH as C, DEFAULT_HIGHLIGHT_OPACITY as S } from "../typings/style.js";
|
|
15
|
+
import { LineMaterial as H, THREE_Line2 as I } from "../../shared-utils/five/FiveLine.js";
|
|
16
|
+
import { LineGeometry as b } from "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
17
|
+
import { anyPositionToVector3 as v } from "../../shared-utils/positionToVector3.js";
|
|
18
|
+
import { IObject3D as x } from "../../shared-utils/three/IObject3D.js";
|
|
19
19
|
import "hammerjs";
|
|
20
20
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
21
|
-
import { centerPoint as
|
|
21
|
+
import { centerPoint as R } from "../../shared-utils/three/centerPoint.js";
|
|
22
22
|
import { LightTag as W } from "../../shared-utils/tag.js";
|
|
23
23
|
import { removeAllTag as O } from "../utils/removeAllTag.js";
|
|
24
24
|
import { getLengthHTML as P } from "../utils/Meshes/getLengthHTML.js";
|
|
25
25
|
import { applyObjectMatrixWorld as _ } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
26
26
|
import "../../shared-utils/three/core/Sphere.js";
|
|
27
27
|
import "animejs";
|
|
28
|
-
import { notNil as
|
|
28
|
+
import { notNil as c } from "../../shared-utils/isNil.js";
|
|
29
29
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
30
30
|
class D extends H {
|
|
31
31
|
constructor(e) {
|
|
32
32
|
var i, t;
|
|
33
33
|
super(e);
|
|
34
34
|
h(this, "_three_color");
|
|
35
|
-
|
|
35
|
+
c(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
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
|
}
|
|
@@ -46,15 +46,15 @@ class D extends H {
|
|
|
46
46
|
this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
class E extends
|
|
49
|
+
class E extends I {
|
|
50
50
|
constructor(e, i) {
|
|
51
51
|
super(e, i);
|
|
52
52
|
h(this, "name", "Line3");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class ee extends
|
|
55
|
+
class ee extends x {
|
|
56
56
|
constructor(e) {
|
|
57
|
-
var l,
|
|
57
|
+
var l, d, a, u, n;
|
|
58
58
|
super();
|
|
59
59
|
h(this, "name", "LineMesh");
|
|
60
60
|
h(this, "points");
|
|
@@ -67,9 +67,9 @@ class ee extends R {
|
|
|
67
67
|
h(this, "lastRenderDomItem");
|
|
68
68
|
h(this, "_visible", !0);
|
|
69
69
|
this.paramsStyle = e != null ? e : {};
|
|
70
|
-
const i = new
|
|
70
|
+
const i = new b(), t = new D({
|
|
71
71
|
color: new f.Color((l = e == null ? void 0 : e.lineColor) != null ? l : p),
|
|
72
|
-
linewidth: (
|
|
72
|
+
linewidth: (d = e == null ? void 0 : e.lineWidth) != null ? d : C,
|
|
73
73
|
dashScale: 40,
|
|
74
74
|
opacity: (a = e == null ? void 0 : e.opacity) != null ? a : 1,
|
|
75
75
|
transparent: !0,
|
|
@@ -87,8 +87,8 @@ class ee extends R {
|
|
|
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
88
|
O(this);
|
|
89
89
|
}), Object.defineProperty(this, "visible", {
|
|
90
|
-
set: (
|
|
91
|
-
this.doms && this.doms.forEach((M) => M.container.style.visibility =
|
|
90
|
+
set: (y) => {
|
|
91
|
+
this.doms && this.doms.forEach((M) => M.container.style.visibility = y ? "visible" : "hidden"), this._visible = y;
|
|
92
92
|
},
|
|
93
93
|
get: () => this._visible
|
|
94
94
|
});
|
|
@@ -139,14 +139,14 @@ class ee extends R {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
setPoints(e) {
|
|
142
|
-
const i = e.map(
|
|
142
|
+
const i = e.map(v).filter(c);
|
|
143
143
|
if (this.points = i, i.length < 2) {
|
|
144
|
-
this.line.geometry = new
|
|
144
|
+
this.line.geometry = new b(), this.backLine.geometry = this.line.geometry, this.updateDomItems();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
this.addIfNotExists(this.line, this.backLine);
|
|
148
148
|
const t = i.flatMap((s) => [s.x, s.y, s.z]);
|
|
149
|
-
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new
|
|
149
|
+
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new b(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateDomItems(), this.needsRender = !0;
|
|
150
150
|
}
|
|
151
151
|
setResolution(e, i) {
|
|
152
152
|
const t = this.line.material.resolution;
|
|
@@ -155,9 +155,9 @@ class ee extends R {
|
|
|
155
155
|
(s.x !== e || s.y !== i) && (s.set(e, i), this.needsRender = !0);
|
|
156
156
|
}
|
|
157
157
|
setStyle(e) {
|
|
158
|
-
var s, l,
|
|
159
|
-
this.paramsStyle =
|
|
160
|
-
const i = (s = e.occlusionVisibility) != null ? s : this.paramsStyle.occlusionVisibility, t = (
|
|
158
|
+
var s, l, d;
|
|
159
|
+
this.paramsStyle = g(g({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new f.Color(e.lineColor), this.backLine.material.three_color = new f.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.7), this.updateDomItems();
|
|
160
|
+
const i = (s = e.occlusionVisibility) != null ? s : this.paramsStyle.occlusionVisibility, t = (d = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? d : "translucence";
|
|
161
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;
|
|
162
162
|
}
|
|
163
163
|
highlight() {
|
|
@@ -177,16 +177,19 @@ class ee extends R {
|
|
|
177
177
|
const i = this.points.map((t, s) => {
|
|
178
178
|
if (s !== 0)
|
|
179
179
|
return [this.points[s - 1], t];
|
|
180
|
-
}).filter(
|
|
180
|
+
}).filter(c).map((t) => _(this, t));
|
|
181
181
|
i.forEach(([t, s], l) => {
|
|
182
182
|
var u;
|
|
183
|
-
const
|
|
183
|
+
const d = R(t, s);
|
|
184
184
|
this.doms[l] = (u = this.doms[l]) != null ? u : (() => {
|
|
185
185
|
const n = new W(this.five);
|
|
186
186
|
return n.intersectCheck = !1, n.simulate3D = !0, n;
|
|
187
|
-
})(), this.doms[l].setPosition(
|
|
187
|
+
})(), this.doms[l].setPosition(d, [t, s]);
|
|
188
188
|
const a = (n) => {
|
|
189
|
-
|
|
189
|
+
var y;
|
|
190
|
+
this.doms[l].__text !== n && (this.doms[l].__text = n, n ? this.doms[l].container.innerHTML = P(n, {
|
|
191
|
+
style: `color: #${c((y = this.style) == null ? void 0 : y.lineColor) ? new f.Color(this.style.lineColor).getHexString() : "ffffff"}`
|
|
192
|
+
}) : this.doms[l].container.innerHTML = "");
|
|
190
193
|
};
|
|
191
194
|
if (this.paramsStyle.tip)
|
|
192
195
|
a(this.paramsStyle.tip);
|
|
@@ -12,6 +12,12 @@ export declare class PointMesh extends IObject3D {
|
|
|
12
12
|
name: string;
|
|
13
13
|
get color(): THREE.Color;
|
|
14
14
|
get size(): number;
|
|
15
|
+
get style(): {
|
|
16
|
+
color: THREE.Color;
|
|
17
|
+
size: number;
|
|
18
|
+
occlusionVisibility: boolean;
|
|
19
|
+
occlusionMode: string;
|
|
20
|
+
};
|
|
15
21
|
dom: LightTag;
|
|
16
22
|
private opacityBeforeHighlight;
|
|
17
23
|
private highlighted;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
var N = Object.defineProperty, k = Object.defineProperties;
|
|
2
2
|
var D = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
4
|
var v = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var f = (e, i, t) => i in e ? N(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, g = (e, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
v.call(i, t) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
V.call(i, t) &&
|
|
7
|
+
v.call(i, t) && f(e, t, i[t]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var t of d(i))
|
|
10
|
+
V.call(i, t) && f(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, a = (e, i) => k(e, D(i));
|
|
13
|
+
var y = (e, i) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var o in e)
|
|
16
16
|
v.call(e, o) && i.indexOf(o) < 0 && (t[o] = e[o]);
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var o of
|
|
17
|
+
if (e != null && d)
|
|
18
|
+
for (var o of d(e))
|
|
19
19
|
i.indexOf(o) < 0 && V.call(e, o) && (t[o] = e[o]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var s = (e, i, t) => (
|
|
23
|
-
import * as
|
|
22
|
+
var s = (e, i, t) => (f(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
23
|
+
import * as h from "three";
|
|
24
24
|
import { DEFAULT_HIGHLIGHT_OPACITY as I } from "../typings/style.js";
|
|
25
|
-
import { IObject3D as
|
|
26
|
-
import { anyPositionToVector3 as
|
|
25
|
+
import { IObject3D as W } from "../../shared-utils/three/IObject3D.js";
|
|
26
|
+
import { anyPositionToVector3 as x } from "../../shared-utils/positionToVector3.js";
|
|
27
27
|
import "hammerjs";
|
|
28
28
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
29
29
|
import "@realsee/five/line";
|
|
30
30
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
31
|
-
import { LightTag as
|
|
32
|
-
import { removeAllTag as
|
|
31
|
+
import { LightTag as B } from "../../shared-utils/tag.js";
|
|
32
|
+
import { removeAllTag as E } from "../utils/removeAllTag.js";
|
|
33
33
|
import { getLengthHTML as S } from "../utils/Meshes/getLengthHTML.js";
|
|
34
|
-
import { applyObjectMatrixWorld as
|
|
34
|
+
import { applyObjectMatrixWorld as T } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
35
35
|
import "../../shared-utils/three/core/Sphere.js";
|
|
36
36
|
import "animejs";
|
|
37
|
-
import { notNil as
|
|
37
|
+
import { notNil as c } from "../../shared-utils/isNil.js";
|
|
38
38
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
39
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
|
|
41
|
-
class $ extends
|
|
40
|
+
let C = null;
|
|
41
|
+
class $ extends W {
|
|
42
42
|
constructor(t) {
|
|
43
43
|
var w, p;
|
|
44
44
|
super();
|
|
@@ -51,29 +51,29 @@ class $ extends B {
|
|
|
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,
|
|
55
|
-
this.paramsStyle =
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
const M = t != null ? t : {}, { point: o } = M, r = y(M, ["point"]);
|
|
55
|
+
this.paramsStyle = r != null ? r : {};
|
|
56
|
+
const l = new h.BufferGeometry();
|
|
57
|
+
l.setAttribute("position", new h.Float32BufferAttribute([0, 0, 0], 3));
|
|
58
58
|
const m = {
|
|
59
59
|
transparent: !0,
|
|
60
|
-
side:
|
|
60
|
+
side: h.DoubleSide,
|
|
61
61
|
size: (w = t == null ? void 0 : t.size) != null ? w : 8,
|
|
62
|
-
map:
|
|
62
|
+
map: C || (C = new h.TextureLoader().load(H)),
|
|
63
63
|
sizeAttenuation: !1
|
|
64
|
-
},
|
|
64
|
+
}, u = new h.PointsMaterial(a(g({}, m), {
|
|
65
65
|
color: (p = t == null ? void 0 : t.color) != null ? p : 16777215,
|
|
66
66
|
depthTest: !0,
|
|
67
67
|
opacity: 1
|
|
68
|
-
})),
|
|
69
|
-
size:
|
|
70
|
-
color:
|
|
68
|
+
})), P = new h.PointsMaterial(a(g({}, m), {
|
|
69
|
+
size: u.size,
|
|
70
|
+
color: u.color,
|
|
71
71
|
depthWrite: !1,
|
|
72
72
|
depthTest: !1,
|
|
73
73
|
opacity: 0.5
|
|
74
|
-
})), n = new
|
|
75
|
-
this.fontMesh = n, this.backgroundMesh =
|
|
76
|
-
|
|
74
|
+
})), n = new h.Points(l, u), A = new h.Points(l, P);
|
|
75
|
+
this.fontMesh = n, this.backgroundMesh = A, n.name = "FontMesh", A.name = "BackgroundMesh", n.renderOrder = 10, A.renderOrder = 0, this.add(n, A), t != null && t.point && this.position.copy(x(t.point)), t && this.setStyle(t), this.addEventListener("removed", () => {
|
|
76
|
+
E(this);
|
|
77
77
|
}), Object.defineProperty(this, "visible", {
|
|
78
78
|
set: (b) => {
|
|
79
79
|
this.dom && (this.dom.container.style.visibility = b ? "visible" : "hidden"), this._visible = b;
|
|
@@ -87,12 +87,20 @@ class $ extends B {
|
|
|
87
87
|
get size() {
|
|
88
88
|
return this.fontMesh.material.size;
|
|
89
89
|
}
|
|
90
|
+
get style() {
|
|
91
|
+
return {
|
|
92
|
+
color: this.color,
|
|
93
|
+
size: this.size,
|
|
94
|
+
occlusionVisibility: this.fontMesh.material.depthTest,
|
|
95
|
+
occlusionMode: this.backgroundMesh.visible ? "depthWrite" : "depthTest"
|
|
96
|
+
};
|
|
97
|
+
}
|
|
90
98
|
get five() {
|
|
91
99
|
var t, o;
|
|
92
100
|
return (o = (t = window.globalModules) == null ? void 0 : t.five) != null ? o : window.$five;
|
|
93
101
|
}
|
|
94
102
|
setStyle(t) {
|
|
95
|
-
|
|
103
|
+
c(t.color) && (this.fontMesh.material.setValues({ color: t.color }), this.backgroundMesh.material.setValues({ color: t.color })), c(t.size) && (this.fontMesh.material.setValues({ side: t.size }), this.backgroundMesh.material.setValues({ side: t.size })), c(t.occlusionVisibility) && (t.occlusionVisibility ? t.occlusionMode === "depthTest" ? (this.fontMesh.material.depthTest = !1, this.backgroundMesh.visible = !1) : (this.fontMesh.material.depthTest = !0, this.backgroundMesh.visible = !0) : (this.fontMesh.material.depthTest = !0, this.backgroundMesh.visible = !1));
|
|
96
104
|
}
|
|
97
105
|
highlight() {
|
|
98
106
|
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.material.opacity, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight * I }));
|
|
@@ -102,14 +110,17 @@ class $ extends B {
|
|
|
102
110
|
}
|
|
103
111
|
updateMatrixWorld(t) {
|
|
104
112
|
super.updateMatrixWorld(t);
|
|
105
|
-
const o =
|
|
113
|
+
const o = T(this, this.position).toArray().join(",");
|
|
106
114
|
o !== this.lastRenderDomItem && (this.updateDom(), this.lastRenderDomItem = o);
|
|
107
115
|
}
|
|
108
116
|
updateDom() {
|
|
109
117
|
const t = this.paramsStyle.tip;
|
|
110
|
-
t && !this.dom && (this.dom = new
|
|
111
|
-
const o = (
|
|
112
|
-
|
|
118
|
+
t && !this.dom && (this.dom = new B(this.five), this.dom.intersectCheck = !1, this.dom.simulate3D = !0, this.dom.container.style.visibility = "hidden");
|
|
119
|
+
const o = (r) => {
|
|
120
|
+
var l;
|
|
121
|
+
this.dom && this.dom.__text !== r && (this.dom.__text = r, r ? this.dom.container.innerHTML = S(r, {
|
|
122
|
+
style: `color: #${c((l = this.style) == null ? void 0 : l.color) ? new h.Color(this.style.color).getHexString() : "ffffff"}`
|
|
123
|
+
}) : this.dom.container.innerHTML = "");
|
|
113
124
|
};
|
|
114
125
|
t ? (o(t), this.dom.setPosition(this.position.clone())) : o(null);
|
|
115
126
|
}
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var a = (i, t, e) => t in i ?
|
|
1
|
+
var d = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
+
var u = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var g = Object.getOwnPropertySymbols;
|
|
4
|
+
var c = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var a = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, h = (i, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
c.call(t, e) && a(i, e, t[e]);
|
|
8
|
+
if (g)
|
|
9
|
+
for (var e of g(t))
|
|
10
|
+
I.call(t, e) && a(i, e, t[e]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
12
|
+
}, f = (i, t) => y(i, u(t));
|
|
13
13
|
var r = (i, t, e) => (a(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
14
|
import * as l from "three";
|
|
15
|
-
import { generatePolygonGeometry as
|
|
16
|
-
import { DEFAULT_HIGHLIGHT_OPACITY as
|
|
17
|
-
import { anyPositionToVector3 as
|
|
18
|
-
import { ColoredMesh as
|
|
19
|
-
import { getGeometryInfo as
|
|
20
|
-
import { LightTag as
|
|
21
|
-
import { getLengthHTML as
|
|
22
|
-
import { applyObjectMatrixWorld as
|
|
15
|
+
import { generatePolygonGeometry as H } from "../../shared-utils/three/generatePolygonGeometry.js";
|
|
16
|
+
import { DEFAULT_HIGHLIGHT_OPACITY as P } from "../typings/style.js";
|
|
17
|
+
import { anyPositionToVector3 as _ } from "../../shared-utils/positionToVector3.js";
|
|
18
|
+
import { ColoredMesh as A } from "../utils/three/ColoredMesh.js";
|
|
19
|
+
import { getGeometryInfo as S } from "../../shared-utils/three/geometryUtil.js";
|
|
20
|
+
import { LightTag as D } from "../../shared-utils/tag.js";
|
|
21
|
+
import { getLengthHTML as M } from "../utils/Meshes/getLengthHTML.js";
|
|
22
|
+
import { applyObjectMatrixWorld as w } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
23
|
+
import "hammerjs";
|
|
24
|
+
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
25
|
+
import "@realsee/five/line";
|
|
26
|
+
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
27
|
+
import "../../shared-utils/three/core/Sphere.js";
|
|
28
|
+
import "animejs";
|
|
29
|
+
import { notNil as B } from "../../shared-utils/isNil.js";
|
|
30
|
+
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
23
31
|
const p = new l.BufferGeometry();
|
|
24
32
|
p.name = "blankGeometry";
|
|
25
33
|
p.isBlank = !0;
|
|
26
|
-
class
|
|
34
|
+
class $ extends A {
|
|
27
35
|
constructor(e) {
|
|
28
36
|
super(e);
|
|
29
37
|
r(this, "name", "PolygonMesh");
|
|
@@ -40,7 +48,7 @@ class G extends _ {
|
|
|
40
48
|
e != null && e.points && this.setPoints(e.points), this._paramsStyle = e != null ? e : {}, this.updateAreaItems();
|
|
41
49
|
}
|
|
42
50
|
get style() {
|
|
43
|
-
return
|
|
51
|
+
return f(h({}, super.style), { lengthEnable: this._paramsStyle.lengthEnable });
|
|
44
52
|
}
|
|
45
53
|
get isBlank() {
|
|
46
54
|
return !!this.geometry.isBlank;
|
|
@@ -50,16 +58,16 @@ class G extends _ {
|
|
|
50
58
|
return (e = this.geometryInfo) == null ? void 0 : e.center;
|
|
51
59
|
}
|
|
52
60
|
get geometryInfo() {
|
|
53
|
-
return this.geometryInfoNeedUpdate && (this.isBlank ? this._geometryInfo = null : this._geometryInfo =
|
|
61
|
+
return this.geometryInfoNeedUpdate && (this.isBlank ? this._geometryInfo = null : this._geometryInfo = S(this.geometry), this.geometryInfoNeedUpdate = !1), this._geometryInfo;
|
|
54
62
|
}
|
|
55
63
|
get five() {
|
|
56
|
-
var e,
|
|
57
|
-
return (
|
|
64
|
+
var e, o;
|
|
65
|
+
return (o = (e = window.globalModules) == null ? void 0 : e.five) != null ? o : window.$five;
|
|
58
66
|
}
|
|
59
67
|
updateMatrixWorld(e) {
|
|
60
68
|
if (super.updateMatrixWorld(e), this.center) {
|
|
61
|
-
const
|
|
62
|
-
|
|
69
|
+
const o = w(this, this.center).toArray().join(",");
|
|
70
|
+
o !== this.lastRenderAreaItem && (this.updateAreaItems(), this.lastRenderAreaItem = o);
|
|
63
71
|
}
|
|
64
72
|
}
|
|
65
73
|
setStyle(e) {
|
|
@@ -67,8 +75,8 @@ class G extends _ {
|
|
|
67
75
|
}
|
|
68
76
|
setPoints(e) {
|
|
69
77
|
var n;
|
|
70
|
-
const
|
|
71
|
-
this.points =
|
|
78
|
+
const o = e.map(_);
|
|
79
|
+
this.points = o, this.geometry = (n = H(this.points, { checkLinesIntersect: !0 })) != null ? n : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
|
|
72
80
|
}
|
|
73
81
|
/**
|
|
74
82
|
* @description: 获取一个点投影在当前平面上的点
|
|
@@ -77,7 +85,7 @@ class G extends _ {
|
|
|
77
85
|
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new l.Vector3()) : e);
|
|
78
86
|
}
|
|
79
87
|
highlight() {
|
|
80
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity *
|
|
88
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity * P }), this.needsRender = !0);
|
|
81
89
|
}
|
|
82
90
|
unhighlight() {
|
|
83
91
|
this.highlighted && (this.highlighted = !1, this.setStyle({ opacity: this.opacityBeforeHighlight }), this.needsRender = !0);
|
|
@@ -86,23 +94,25 @@ class G extends _ {
|
|
|
86
94
|
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
95
|
}
|
|
88
96
|
updateAreaItems() {
|
|
89
|
-
var n;
|
|
97
|
+
var n, m;
|
|
90
98
|
const e = () => {
|
|
91
|
-
var
|
|
92
|
-
(
|
|
99
|
+
var s;
|
|
100
|
+
(s = this.areaDom) == null || s.destroy(), this.areaDom = void 0;
|
|
93
101
|
};
|
|
94
102
|
if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
|
|
95
103
|
return e();
|
|
96
104
|
if (!this.five)
|
|
97
105
|
return console.error("Five not found");
|
|
98
106
|
this.areaDom = (n = this.areaDom) != null ? n : (() => {
|
|
99
|
-
const
|
|
100
|
-
return
|
|
107
|
+
const s = new D(this.five);
|
|
108
|
+
return s.intersectCheck = !1, s.simulate3D = !0, s;
|
|
101
109
|
})(), this.areaDom.setPosition(this.center);
|
|
102
|
-
const
|
|
103
|
-
|
|
110
|
+
const o = this.geometryInfo.area.toFixed(2);
|
|
111
|
+
o === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = M(o + "m²", {
|
|
112
|
+
style: `color: #${B((m = this.style) == null ? void 0 : m.color) ? new l.Color(this.style.color).getHexString() : "000000"}`
|
|
113
|
+
});
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
116
|
export {
|
|
107
|
-
|
|
117
|
+
$ as PolygonMesh
|
|
108
118
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function l(t, n) {
|
|
2
2
|
if (!document.getElementById("LineLengthTagStyle")) {
|
|
3
3
|
const e = document.createElement("style");
|
|
4
4
|
e.id = "LineLengthTagStyle", document.head.appendChild(e), e.innerHTML = `
|
|
@@ -24,12 +24,12 @@ function i(t) {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
return `
|
|
27
|
-
<div class="LineLengthTag">
|
|
27
|
+
<div class="LineLengthTag" style="${n.style}">
|
|
28
28
|
<div>${t}</div>
|
|
29
29
|
<div>${t}</div>
|
|
30
30
|
</div>
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
l as getLengthHTML
|
|
35
35
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.50.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.50.6",
|
|
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",
|