@realsee/dnalogel 3.49.10 → 3.49.12
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/Line.d.ts +5 -7
- package/dist/Sculpt/Meshes/Point.d.ts +9 -2
- package/dist/Sculpt/Objects/Base/index.d.ts +1 -0
- package/dist/Sculpt/typings/style.d.ts +6 -0
- package/dist/index.cjs.js +58 -57
- package/dist/index.js +2682 -2642
- package/dist/index.umd.js +52 -51
- package/libs/Sculpt/Meshes/Line.d.ts +5 -7
- package/libs/Sculpt/Meshes/Line.js +75 -67
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -5
- package/libs/Sculpt/Meshes/Point.d.ts +9 -2
- package/libs/Sculpt/Meshes/Point.js +77 -44
- package/libs/Sculpt/Objects/Base/index.d.ts +1 -0
- package/libs/Sculpt/Objects/Base/index.js +5 -2
- package/libs/Sculpt/Objects/Point/index.js +46 -43
- package/libs/Sculpt/index.js +1 -1
- package/libs/Sculpt/typings/style.d.ts +6 -0
- package/libs/Sculpt/utils/Meshes/getLengthHTML.js +1 -0
- package/libs/Sculpt/utils/removeAllTag.js +8 -5
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { type Color, type OcclusionStyle, type LineStyle } from '../typings/style';
|
|
2
|
+
import { type Color, type OcclusionStyle, type LineStyle, type lengthConfig, type DisplayInfoConfig } from '../typings/style';
|
|
3
3
|
import { LineMaterial, THREE_Line2 } from '../../shared-utils/five/FiveLine';
|
|
4
4
|
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry';
|
|
5
5
|
import { type AnyPositions } from '../../shared-utils/positionToVector3';
|
|
@@ -9,9 +9,7 @@ import type { PointsData } from '../utils/data';
|
|
|
9
9
|
import { LightTag } from '../../shared-utils/tag';
|
|
10
10
|
export type LineMeshStyle = LineStyle & {
|
|
11
11
|
dashed?: boolean;
|
|
12
|
-
} & OcclusionStyle &
|
|
13
|
-
lengthEnable?: boolean;
|
|
14
|
-
};
|
|
12
|
+
} & OcclusionStyle & Partial<lengthConfig> & Partial<DisplayInfoConfig>;
|
|
15
13
|
export type LineData = PointsData;
|
|
16
14
|
export declare class LineMaterial2 extends LineMaterial {
|
|
17
15
|
get three_color(): Color;
|
|
@@ -32,7 +30,7 @@ export declare class THREE_Line3 extends THREE_Line2 {
|
|
|
32
30
|
export declare class LineMesh extends IObject3D {
|
|
33
31
|
name: string;
|
|
34
32
|
points: THREE.Vector3[];
|
|
35
|
-
|
|
33
|
+
doms: LightTag[];
|
|
36
34
|
get style(): LineMeshStyle;
|
|
37
35
|
get opacity(): number;
|
|
38
36
|
get lineWidth(): number;
|
|
@@ -46,7 +44,7 @@ export declare class LineMesh extends IObject3D {
|
|
|
46
44
|
private backLine;
|
|
47
45
|
private opacityBeforeHighlight;
|
|
48
46
|
private paramsStyle;
|
|
49
|
-
private
|
|
47
|
+
private lastRenderDomItem;
|
|
50
48
|
constructor(params?: Partial<LineMeshStyle & LineData>);
|
|
51
49
|
updateMatrixWorld(force?: boolean): void;
|
|
52
50
|
setPoints(points: AnyPositions): void;
|
|
@@ -54,5 +52,5 @@ export declare class LineMesh extends IObject3D {
|
|
|
54
52
|
setStyle(params: Partial<LineMeshStyle>): void;
|
|
55
53
|
highlight(): void;
|
|
56
54
|
unhighlight(): void;
|
|
57
|
-
private
|
|
55
|
+
private updateDomItems;
|
|
58
56
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
2
|
var L = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var e in
|
|
6
|
-
|
|
3
|
+
var E = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var y = (h, s, e) => s in h ? M(h, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[s] = e, m = (h, s) => {
|
|
5
|
+
for (var e in s || (s = {}))
|
|
6
|
+
E.call(s, e) && y(h, e, s[e]);
|
|
7
7
|
if (L)
|
|
8
|
-
for (var e of L(
|
|
9
|
-
T.call(
|
|
10
|
-
return
|
|
8
|
+
for (var e of L(s))
|
|
9
|
+
T.call(s, e) && y(h, e, s[e]);
|
|
10
|
+
return h;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
import * as
|
|
14
|
-
import { DEFAULT_LINE_COLOR as
|
|
12
|
+
var r = (h, s, e) => (y(h, typeof s != "symbol" ? s + "" : s, e), e);
|
|
13
|
+
import * as f from "three";
|
|
14
|
+
import { DEFAULT_LINE_COLOR as p, DEFAULT_LINE_WIDTH as k, DEFAULT_HIGHLIGHT_OPACITY as b } from "../typings/style.js";
|
|
15
15
|
import { LineMaterial as w, THREE_Line2 as I } from "../../shared-utils/five/FiveLine.js";
|
|
16
|
-
import { LineGeometry as
|
|
16
|
+
import { LineGeometry as g } from "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
17
17
|
import { anyPositionToVector3 as H } from "../../shared-utils/positionToVector3.js";
|
|
18
18
|
import { IObject3D as C } from "../../shared-utils/three/IObject3D.js";
|
|
19
19
|
import "hammerjs";
|
|
@@ -22,18 +22,18 @@ import { centerPoint as R } from "../../shared-utils/three/centerPoint.js";
|
|
|
22
22
|
import { LightTag as x } from "../../shared-utils/tag.js";
|
|
23
23
|
import { removeAllTag as W } from "../utils/removeAllTag.js";
|
|
24
24
|
import { getLengthHTML as v } from "../utils/Meshes/getLengthHTML.js";
|
|
25
|
-
import { applyObjectMatrixWorld as
|
|
25
|
+
import { applyObjectMatrixWorld as S } 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 _ extends w {
|
|
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
|
+
r(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((o) => {
|
|
36
|
+
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(o) || o in this && (this[o] = e[o]);
|
|
37
37
|
}), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
|
|
38
38
|
}
|
|
39
39
|
get three_color() {
|
|
@@ -46,35 +46,35 @@ class S 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 D extends I {
|
|
50
50
|
constructor(e, i) {
|
|
51
51
|
super(e, i);
|
|
52
|
-
|
|
52
|
+
r(this, "name", "Line3");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
class X extends C {
|
|
56
56
|
constructor(e) {
|
|
57
|
-
var
|
|
57
|
+
var l, c, a, u, n;
|
|
58
58
|
super();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
r(this, "name", "LineMesh");
|
|
60
|
+
r(this, "points");
|
|
61
|
+
r(this, "doms", []);
|
|
62
|
+
r(this, "highlighted", !1);
|
|
63
|
+
r(this, "line");
|
|
64
|
+
r(this, "backLine");
|
|
65
|
+
r(this, "opacityBeforeHighlight");
|
|
66
|
+
r(this, "paramsStyle", {});
|
|
67
|
+
r(this, "lastRenderDomItem");
|
|
68
68
|
this.paramsStyle = e != null ? e : {};
|
|
69
|
-
const i = new
|
|
70
|
-
color: new
|
|
71
|
-
linewidth: (
|
|
69
|
+
const i = new g(), t = new _({
|
|
70
|
+
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 : k,
|
|
72
72
|
dashScale: 40,
|
|
73
|
-
opacity: (
|
|
73
|
+
opacity: (a = e == null ? void 0 : e.opacity) != null ? a : 1,
|
|
74
74
|
transparent: !0,
|
|
75
|
-
dashed: (
|
|
76
|
-
}),
|
|
77
|
-
color: new
|
|
75
|
+
dashed: (u = e == null ? void 0 : e.dashed) != null ? u : !1
|
|
76
|
+
}), o = new _({
|
|
77
|
+
color: new f.Color((n = e == null ? void 0 : e.lineColor) != null ? n : p),
|
|
78
78
|
linewidth: t.linewidth * 0.9,
|
|
79
79
|
dashScale: t.dashScale,
|
|
80
80
|
opacity: t.opacity * 0.7,
|
|
@@ -83,7 +83,7 @@ class X extends C {
|
|
|
83
83
|
transparent: !0,
|
|
84
84
|
resolution: t.resolution
|
|
85
85
|
});
|
|
86
|
-
this.line = new
|
|
86
|
+
this.line = new D(i, t), this.backLine = new D(i, o), 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", () => {
|
|
87
87
|
W(this);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -95,7 +95,8 @@ class X extends C {
|
|
|
95
95
|
dashed: this.dashed,
|
|
96
96
|
occlusionVisibility: this.occlusionVisibility,
|
|
97
97
|
occlusionMode: this.occlusionMode,
|
|
98
|
-
lengthEnable: this.paramsStyle.lengthEnable
|
|
98
|
+
lengthEnable: this.paramsStyle.lengthEnable,
|
|
99
|
+
tip: this.paramsStyle.tip
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
get opacity() {
|
|
@@ -108,7 +109,7 @@ class X extends C {
|
|
|
108
109
|
}
|
|
109
110
|
get color() {
|
|
110
111
|
var e;
|
|
111
|
-
return new
|
|
112
|
+
return new f.Color((e = this.line.material.three_color) != null ? e : this.paramsStyle.lineColor);
|
|
112
113
|
}
|
|
113
114
|
get dashed() {
|
|
114
115
|
var e;
|
|
@@ -127,60 +128,67 @@ class X extends C {
|
|
|
127
128
|
updateMatrixWorld(e) {
|
|
128
129
|
var i;
|
|
129
130
|
if (super.updateMatrixWorld(e), this.points) {
|
|
130
|
-
const t = (i =
|
|
131
|
-
t !== this.
|
|
131
|
+
const t = (i = S(this, this.points)) == null ? void 0 : i.map((o) => o.toArray().join(",")).join(",");
|
|
132
|
+
t !== this.lastRenderDomItem && (this.updateDomItems(), this.lastRenderDomItem = t);
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
setPoints(e) {
|
|
135
136
|
const i = e.map(H).filter(d);
|
|
136
137
|
if (this.points = i, i.length < 2) {
|
|
137
|
-
this.line.geometry = new
|
|
138
|
+
this.line.geometry = new g(), this.backLine.geometry = this.line.geometry, this.updateDomItems();
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
141
|
this.addIfNotExists(this.line, this.backLine);
|
|
141
|
-
const t = i.flatMap((
|
|
142
|
-
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new
|
|
142
|
+
const t = i.flatMap((o) => [o.x, o.y, o.z]);
|
|
143
|
+
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;
|
|
143
144
|
}
|
|
144
145
|
setResolution(e, i) {
|
|
145
146
|
const t = this.line.material.resolution;
|
|
146
147
|
(t.x !== e || t.y !== i) && (t.set(e, i), this.needsRender = !0);
|
|
147
|
-
const
|
|
148
|
-
(
|
|
148
|
+
const o = this.backLine.material.resolution;
|
|
149
|
+
(o.x !== e || o.y !== i) && (o.set(e, i), this.needsRender = !0);
|
|
149
150
|
}
|
|
150
151
|
setStyle(e) {
|
|
151
|
-
var
|
|
152
|
-
this.paramsStyle =
|
|
153
|
-
const i = (
|
|
152
|
+
var o, l, c;
|
|
153
|
+
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 = (o = e.occlusionVisibility) != null ? o : this.paramsStyle.occlusionVisibility, t = (c = (l = e.occlusionMode) != null ? l : this.paramsStyle.occlusionMode) != null ? c : "translucence";
|
|
154
155
|
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;
|
|
155
156
|
}
|
|
156
157
|
highlight() {
|
|
157
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight *
|
|
158
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * b, this.backLine.material.opacity = this.backLine.material.opacity * b, this.needsRender = !0);
|
|
158
159
|
}
|
|
159
160
|
unhighlight() {
|
|
160
161
|
this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
|
|
161
162
|
}
|
|
162
|
-
|
|
163
|
+
updateDomItems() {
|
|
163
164
|
const e = () => {
|
|
164
|
-
this.
|
|
165
|
+
this.doms.forEach((t) => t.destroy()), this.doms = [];
|
|
165
166
|
};
|
|
166
|
-
if (!this.points || this.points.length < 2 || !this.paramsStyle.lengthEnable)
|
|
167
|
+
if (!this.points || this.points.length < 2 || !this.paramsStyle.lengthEnable && !this.paramsStyle.tip)
|
|
167
168
|
return e();
|
|
168
169
|
if (!this.five)
|
|
169
170
|
return console.error("Five not found");
|
|
170
|
-
const i = this.points.map((t,
|
|
171
|
-
if (
|
|
172
|
-
return [this.points[
|
|
173
|
-
}).filter(d).map((t) =>
|
|
174
|
-
i.forEach(([t,
|
|
175
|
-
var
|
|
176
|
-
const
|
|
177
|
-
this.
|
|
178
|
-
const
|
|
179
|
-
return
|
|
180
|
-
})(), this.
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
const i = this.points.map((t, o) => {
|
|
172
|
+
if (o !== 0)
|
|
173
|
+
return [this.points[o - 1], t];
|
|
174
|
+
}).filter(d).map((t) => S(this, t));
|
|
175
|
+
i.forEach(([t, o], l) => {
|
|
176
|
+
var u;
|
|
177
|
+
const c = R(t, o);
|
|
178
|
+
this.doms[l] = (u = this.doms[l]) != null ? u : (() => {
|
|
179
|
+
const n = new x(this.five);
|
|
180
|
+
return n.intersectCheck = !1, n.simulate3D = !0, n;
|
|
181
|
+
})(), this.doms[l].setPosition(c, [t, o]);
|
|
182
|
+
const a = (n) => {
|
|
183
|
+
this.doms[l].__text !== n && (this.doms[l].__text = n, n ? this.doms[l].container.innerHTML = v(n) : this.doms[l].container.innerHTML = "");
|
|
184
|
+
};
|
|
185
|
+
if (this.paramsStyle.tip)
|
|
186
|
+
a(this.paramsStyle.tip);
|
|
187
|
+
else {
|
|
188
|
+
const n = t.distanceTo(o).toFixed(2);
|
|
189
|
+
a(n === "0.00" ? null : n + "m");
|
|
190
|
+
}
|
|
191
|
+
}), this.doms.length > i.length && (this.doms.slice(i.length).forEach((t) => t.destroy()), this.doms.length = i.length);
|
|
184
192
|
}
|
|
185
193
|
}
|
|
186
194
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d = Object.defineProperty, m = Object.defineProperties;
|
|
2
2
|
var f = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var a = Object.getOwnPropertySymbols;
|
|
4
4
|
var g = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var n = (s, i, t) => i in s ?
|
|
5
|
+
var n = (s, i, t) => i in s ? d(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, o = (s, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
7
|
g.call(i, t) && n(s, t, i[t]);
|
|
8
8
|
if (a)
|
|
9
9
|
for (var t of a(i))
|
|
10
10
|
c.call(i, t) && n(s, t, i[t]);
|
|
11
11
|
return s;
|
|
12
|
-
}, r = (s, i) =>
|
|
12
|
+
}, r = (s, i) => m(s, f(i));
|
|
13
13
|
var e = (s, i, t) => (n(s, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
14
|
import { anyPositionToVector3 as b } from "../../shared-utils/positionToVector3.js";
|
|
15
15
|
import { PointMesh as P } from "./Point.js";
|
|
@@ -29,7 +29,7 @@ class N extends S {
|
|
|
29
29
|
e(this, "pointGroup", new M());
|
|
30
30
|
e(this, "_paramsStyle");
|
|
31
31
|
e(this, "setStyle", (t) => {
|
|
32
|
-
super.setStyle(t), this._paramsStyle = o(o({}, this._paramsStyle), t), this.pointMeshes.forEach((h) => h.setStyle(r(o({}, this._paramsStyle), { color: t.lineColor }))), this.updateEdgePointsVisibility(), this.needsRender = !0;
|
|
32
|
+
super.setStyle(t), this._paramsStyle = o(o({}, this._paramsStyle), t), this.pointMeshes.forEach((h) => h.setStyle(r(o({}, this._paramsStyle), { color: t.lineColor, tip: void 0 }))), this.updateEdgePointsVisibility(), this.needsRender = !0;
|
|
33
33
|
});
|
|
34
34
|
e(this, "highlight", () => {
|
|
35
35
|
super.highlight(), this.pointMeshes.forEach((t) => t.highlight());
|
|
@@ -60,7 +60,7 @@ class N extends S {
|
|
|
60
60
|
const h = t.map(b).filter(y);
|
|
61
61
|
this.pointGroup.removeChildren(), this.addIfNotExists(this.pointGroup), h.forEach((u) => {
|
|
62
62
|
var l;
|
|
63
|
-
const p = new P(r(o({}, this.style), { color: (l = this._paramsStyle) == null ? void 0 : l.lineColor }));
|
|
63
|
+
const p = new P(r(o({}, this.style), { color: (l = this._paramsStyle) == null ? void 0 : l.lineColor, tip: void 0 }));
|
|
64
64
|
p.position.copy(u), this.pointGroup.add(p);
|
|
65
65
|
}), this.updateEdgePointsVisibility(), this.needsRender = !0;
|
|
66
66
|
}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { type ColorStyle, type OcclusionStyle } from '../typings/style';
|
|
2
|
+
import { type ColorStyle, type DisplayInfoConfig, type OcclusionStyle } from '../typings/style';
|
|
3
3
|
import { IObject3D } from '../../shared-utils/three/IObject3D';
|
|
4
4
|
import type { PointData } from '../utils/data';
|
|
5
|
+
import { LightTag } from '../../shared-utils/tag';
|
|
5
6
|
export type { PointData } from '../utils/data';
|
|
6
7
|
export declare const circleImageURL: string;
|
|
7
8
|
export type PointStyle = ColorStyle & {
|
|
8
9
|
size: number;
|
|
9
|
-
} & OcclusionStyle
|
|
10
|
+
} & OcclusionStyle & Partial<DisplayInfoConfig>;
|
|
10
11
|
export declare class PointMesh extends IObject3D {
|
|
11
12
|
name: string;
|
|
12
13
|
get color(): THREE.Color;
|
|
13
14
|
get size(): number;
|
|
15
|
+
dom: LightTag;
|
|
14
16
|
private opacityBeforeHighlight;
|
|
15
17
|
private highlighted;
|
|
16
18
|
private fontMesh;
|
|
17
19
|
private backgroundMesh;
|
|
20
|
+
private lastRenderDomItem;
|
|
21
|
+
private paramsStyle;
|
|
22
|
+
private get five();
|
|
18
23
|
constructor(params?: Partial<PointStyle & PointData>);
|
|
19
24
|
setStyle(params: Partial<PointStyle>): void;
|
|
20
25
|
highlight(): void;
|
|
21
26
|
unhighlight(): void;
|
|
27
|
+
updateMatrixWorld(force?: boolean): void;
|
|
28
|
+
private updateDom;
|
|
22
29
|
}
|
|
@@ -1,60 +1,76 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var t in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, g = (
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
var k = Object.defineProperty, D = Object.defineProperties;
|
|
2
|
+
var I = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var l = Object.getOwnPropertySymbols;
|
|
4
|
+
var p = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (e, i, t) => i in e ? k(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, f = (e, i) => {
|
|
6
|
+
for (var t in i || (i = {}))
|
|
7
|
+
p.call(i, t) && u(e, t, i[t]);
|
|
8
|
+
if (l)
|
|
9
|
+
for (var t of l(i))
|
|
10
|
+
C.call(i, t) && u(e, t, i[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, g = (e, i) => D(e, I(i));
|
|
13
|
+
var N = (e, i) => {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var o in e)
|
|
16
|
+
p.call(e, o) && i.indexOf(o) < 0 && (t[o] = e[o]);
|
|
17
|
+
if (e != null && l)
|
|
18
|
+
for (var o of l(e))
|
|
19
|
+
i.indexOf(o) < 0 && C.call(e, o) && (t[o] = e[o]);
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var s = (e, i, t) => (u(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
23
|
+
import * as A from "three";
|
|
24
|
+
import { DEFAULT_HIGHLIGHT_OPACITY as v } from "../typings/style.js";
|
|
25
|
+
import { IObject3D as B } from "../../shared-utils/three/IObject3D.js";
|
|
26
|
+
import { anyPositionToVector3 as W } from "../../shared-utils/positionToVector3.js";
|
|
18
27
|
import "hammerjs";
|
|
19
28
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
20
29
|
import "@realsee/five/line";
|
|
21
30
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
22
|
-
import "../../shared-utils/tag.js";
|
|
31
|
+
import { LightTag as x } from "../../shared-utils/tag.js";
|
|
32
|
+
import { getLengthHTML as E } from "../utils/Meshes/getLengthHTML.js";
|
|
33
|
+
import { applyObjectMatrixWorld as y } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
23
34
|
import "../../shared-utils/three/core/Sphere.js";
|
|
24
35
|
import "animejs";
|
|
25
|
-
import { notNil as
|
|
36
|
+
import { notNil as a } from "../../shared-utils/isNil.js";
|
|
26
37
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
class
|
|
38
|
+
const S = "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==";
|
|
39
|
+
let P = null;
|
|
40
|
+
class K extends B {
|
|
30
41
|
constructor(t) {
|
|
31
|
-
var
|
|
42
|
+
var w, V;
|
|
32
43
|
super();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
s(this, "name", "PointMesh");
|
|
45
|
+
s(this, "dom");
|
|
46
|
+
s(this, "opacityBeforeHighlight");
|
|
47
|
+
s(this, "highlighted", !1);
|
|
48
|
+
s(this, "fontMesh");
|
|
49
|
+
s(this, "backgroundMesh");
|
|
50
|
+
s(this, "lastRenderDomItem");
|
|
51
|
+
s(this, "paramsStyle");
|
|
52
|
+
const M = t != null ? t : {}, { point: o } = M, h = N(M, ["point"]);
|
|
53
|
+
this.paramsStyle = h != null ? h : {};
|
|
54
|
+
const d = new A.BufferGeometry();
|
|
55
|
+
d.setAttribute("position", new A.Float32BufferAttribute([0, 0, 0], 3));
|
|
56
|
+
const m = {
|
|
41
57
|
transparent: !0,
|
|
42
|
-
side:
|
|
43
|
-
size: (
|
|
44
|
-
map:
|
|
58
|
+
side: A.DoubleSide,
|
|
59
|
+
size: (w = t == null ? void 0 : t.size) != null ? w : 8,
|
|
60
|
+
map: P || (P = new A.TextureLoader().load(S)),
|
|
45
61
|
sizeAttenuation: !1
|
|
46
|
-
},
|
|
47
|
-
color: (
|
|
62
|
+
}, c = new A.PointsMaterial(g(f({}, m), {
|
|
63
|
+
color: (V = t == null ? void 0 : t.color) != null ? V : 16777215,
|
|
48
64
|
depthTest: !0,
|
|
49
65
|
opacity: 1
|
|
50
|
-
})),
|
|
51
|
-
size:
|
|
52
|
-
color:
|
|
66
|
+
})), b = new A.PointsMaterial(g(f({}, m), {
|
|
67
|
+
size: c.size,
|
|
68
|
+
color: c.color,
|
|
53
69
|
depthWrite: !1,
|
|
54
70
|
depthTest: !1,
|
|
55
71
|
opacity: 0.5
|
|
56
|
-
})),
|
|
57
|
-
this.fontMesh =
|
|
72
|
+
})), r = new A.Points(d, c), n = new A.Points(d, b);
|
|
73
|
+
this.fontMesh = r, this.backgroundMesh = n, r.name = "FontMesh", n.name = "BackgroundMesh", r.renderOrder = 10, n.renderOrder = 0, this.add(r, n), t != null && t.point && this.position.copy(W(t.point)), t && this.setStyle(t);
|
|
58
74
|
}
|
|
59
75
|
get color() {
|
|
60
76
|
return this.fontMesh.material.color;
|
|
@@ -62,16 +78,33 @@ class Q extends b {
|
|
|
62
78
|
get size() {
|
|
63
79
|
return this.fontMesh.material.size;
|
|
64
80
|
}
|
|
81
|
+
get five() {
|
|
82
|
+
var t, o;
|
|
83
|
+
return (o = (t = window.globalModules) == null ? void 0 : t.five) != null ? o : window.$five;
|
|
84
|
+
}
|
|
65
85
|
setStyle(t) {
|
|
66
|
-
|
|
86
|
+
a(t.color) && (this.fontMesh.material.setValues({ color: t.color }), this.backgroundMesh.material.setValues({ color: t.color })), a(t.size) && (this.fontMesh.material.setValues({ side: t.size }), this.backgroundMesh.material.setValues({ side: t.size })), a(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));
|
|
67
87
|
}
|
|
68
88
|
highlight() {
|
|
69
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.material.opacity, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight *
|
|
89
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.material.opacity, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight * v }));
|
|
70
90
|
}
|
|
71
91
|
unhighlight() {
|
|
72
92
|
this.highlighted && (this.highlighted = !1, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight }));
|
|
73
93
|
}
|
|
94
|
+
updateMatrixWorld(t) {
|
|
95
|
+
super.updateMatrixWorld(t);
|
|
96
|
+
const o = y(this, this.position).toArray().join(",");
|
|
97
|
+
o !== this.lastRenderDomItem && (this.updateDom(), this.lastRenderDomItem = o);
|
|
98
|
+
}
|
|
99
|
+
updateDom() {
|
|
100
|
+
const t = this.paramsStyle.tip;
|
|
101
|
+
t && !this.dom && (this.dom = new x(this.five), this.dom.intersectCheck = !1, this.dom.simulate3D = !0);
|
|
102
|
+
const o = (h) => {
|
|
103
|
+
this.dom && this.dom.__text !== h && (this.dom.__text = h, h ? this.dom.container.innerHTML = E(h) : this.dom.container.innerHTML = "");
|
|
104
|
+
};
|
|
105
|
+
t ? (o(t), this.dom.setPosition(this.position.clone())) : o(null);
|
|
106
|
+
}
|
|
74
107
|
}
|
|
75
108
|
export {
|
|
76
|
-
|
|
109
|
+
K as PointMesh
|
|
77
110
|
};
|
|
@@ -16,7 +16,7 @@ import { IObject3D as g } from "../../../shared-utils/three/IObject3D.js";
|
|
|
16
16
|
import { applyObjectMatrixWorld as b } from "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
17
17
|
import { removeAllTag as y } from "../../utils/removeAllTag.js";
|
|
18
18
|
const p = /* @__PURE__ */ new Map();
|
|
19
|
-
class
|
|
19
|
+
class O extends g {
|
|
20
20
|
constructor(e, s) {
|
|
21
21
|
super();
|
|
22
22
|
r(this, "name", "Sculpt");
|
|
@@ -50,6 +50,9 @@ class S extends g {
|
|
|
50
50
|
this.selected = !1, this.unhighlight(), !this.pointSelector.enabled && ((i = this.editor) == null || i.disable());
|
|
51
51
|
}));
|
|
52
52
|
}
|
|
53
|
+
get editing() {
|
|
54
|
+
return this.pointSelector.enabled;
|
|
55
|
+
}
|
|
53
56
|
get baseData() {
|
|
54
57
|
return {
|
|
55
58
|
id: this.uuid,
|
|
@@ -123,5 +126,5 @@ class S extends g {
|
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
export {
|
|
126
|
-
|
|
129
|
+
O as BaseObject
|
|
127
130
|
};
|