@realsee/dnalogel 3.49.9 → 3.49.11

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.
@@ -107,7 +107,7 @@ export declare class PointSelector extends Subscribe<EventMap> {
107
107
  * @description: 鼠标离开five canvas时
108
108
  */
109
109
  private onLeave;
110
- private onTap;
110
+ private onClick;
111
111
  /**
112
112
  * 1. 如果之前没有长按行为「即没有长按点时」-> 滑动全景
113
113
  * 2. 如果有长按点,把长按点位置更新为当前位置
@@ -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
- lengthDoms: LightTag[];
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 lastRenderLengthItem;
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 updateLengthItems;
55
+ private updateDomItems;
58
56
  }
@@ -1,19 +1,19 @@
1
- var E = Object.defineProperty;
1
+ var M = Object.defineProperty;
2
2
  var L = Object.getOwnPropertySymbols;
3
- var _ = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
4
- var f = (l, o, e) => o in l ? E(l, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[o] = e, y = (l, o) => {
5
- for (var e in o || (o = {}))
6
- _.call(o, e) && f(l, e, o[e]);
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(o))
9
- T.call(o, e) && f(l, e, o[e]);
10
- return l;
8
+ for (var e of L(s))
9
+ T.call(s, e) && y(h, e, s[e]);
10
+ return h;
11
11
  };
12
- var h = (l, o, e) => (f(l, typeof o != "symbol" ? o + "" : o, e), e);
13
- import * as u from "three";
14
- import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as k, DEFAULT_HIGHLIGHT_OPACITY as p } from "../typings/style.js";
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 m } from "../../vendor/three/examples/jsm/lines/LineGeometry.js";
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 D } from "../../shared-utils/three/applyObjectMatrixWorld.js";
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 S extends w {
30
+ class _ extends w {
31
31
  constructor(e) {
32
32
  var i, t;
33
33
  super(e);
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((n) => {
36
- ["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(n) || n in this && (this[n] = e[n]);
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 M extends I {
49
+ class D extends I {
50
50
  constructor(e, i) {
51
51
  super(e, i);
52
- h(this, "name", "Line3");
52
+ r(this, "name", "Line3");
53
53
  }
54
54
  }
55
55
  class X extends C {
56
56
  constructor(e) {
57
- var s, r, c, g, a;
57
+ var l, c, a, u, n;
58
58
  super();
59
- h(this, "name", "LineMesh");
60
- h(this, "points");
61
- h(this, "lengthDoms", []);
62
- h(this, "highlighted", !1);
63
- h(this, "line");
64
- h(this, "backLine");
65
- h(this, "opacityBeforeHighlight");
66
- h(this, "paramsStyle", {});
67
- h(this, "lastRenderLengthItem");
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 m(), t = new S({
70
- color: new u.Color((s = e == null ? void 0 : e.lineColor) != null ? s : b),
71
- linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : k,
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: (c = e == null ? void 0 : e.opacity) != null ? c : 1,
73
+ opacity: (a = e == null ? void 0 : e.opacity) != null ? a : 1,
74
74
  transparent: !0,
75
- dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
76
- }), n = new S({
77
- color: new u.Color((a = e == null ? void 0 : e.lineColor) != null ? a : b),
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 M(i, t), this.backLine = new M(i, n), 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", () => {
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 u.Color((e = this.line.material.three_color) != null ? e : this.paramsStyle.lineColor);
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 = D(this, this.points)) == null ? void 0 : i.map((n) => n.toArray().join(",")).join(",");
131
- t !== this.lastRenderLengthItem && (this.updateLengthItems(), this.lastRenderLengthItem = t);
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 m(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
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((n) => [n.x, n.y, n.z]);
142
- t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new m(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
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 n = this.backLine.material.resolution;
148
- (n.x !== e || n.y !== i) && (n.set(e, i), this.needsRender = !0);
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 n, s, r;
152
- this.paramsStyle = y(y({}, this.paramsStyle), e), d(e.lineColor) && (this.line.material.three_color = new u.Color(e.lineColor), this.backLine.material.three_color = new u.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.updateLengthItems();
153
- const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (s = e.occlusionMode) != null ? s : this.paramsStyle.occlusionMode) != null ? r : "translucence";
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 * p, this.backLine.material.opacity = this.backLine.material.opacity * p, this.needsRender = !0);
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
- updateLengthItems() {
163
+ updateDomItems() {
163
164
  const e = () => {
164
- this.lengthDoms.forEach((t) => t.destroy()), this.lengthDoms = [];
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, n) => {
171
- if (n !== 0)
172
- return [this.points[n - 1], t];
173
- }).filter(d).map((t) => D(this, t));
174
- i.forEach(([t, n], s) => {
175
- var g;
176
- const r = R(t, n);
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
- })(), this.lengthDoms[s].setPosition(r, [t, n]);
181
- const c = t.distanceTo(n).toFixed(2);
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"));
183
- }), this.lengthDoms.length > i.length && (this.lengthDoms.slice(i.length).forEach((t) => t.destroy()), this.lengthDoms.length = i.length);
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 m = Object.defineProperty, d = Object.defineProperties;
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 ? m(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, o = (s, i) => {
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) => d(s, f(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,12 +1,12 @@
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
5
  export type { PointData } from '../utils/data';
6
6
  export declare const circleImageURL: string;
7
7
  export type PointStyle = ColorStyle & {
8
8
  size: number;
9
- } & OcclusionStyle;
9
+ } & OcclusionStyle & Partial<DisplayInfoConfig>;
10
10
  export declare class PointMesh extends IObject3D {
11
11
  name: string;
12
12
  get color(): THREE.Color;
@@ -15,8 +15,14 @@ export declare class PointMesh extends IObject3D {
15
15
  private highlighted;
16
16
  private fontMesh;
17
17
  private backgroundMesh;
18
+ private lastRenderDomItem;
19
+ private paramsStyle;
20
+ private dom;
21
+ private get five();
18
22
  constructor(params?: Partial<PointStyle & PointData>);
19
23
  setStyle(params: Partial<PointStyle>): void;
20
24
  highlight(): void;
21
25
  unhighlight(): void;
26
+ updateMatrixWorld(force?: boolean): void;
27
+ private updateDom;
22
28
  }
@@ -1,60 +1,76 @@
1
- var C = Object.defineProperty, N = Object.defineProperties;
2
- var P = Object.getOwnPropertyDescriptors;
3
- var M = Object.getOwnPropertySymbols;
4
- var k = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
5
- var n = (i, e, t) => e in i ? C(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, c = (i, e) => {
6
- for (var t in e || (e = {}))
7
- k.call(e, t) && n(i, t, e[t]);
8
- if (M)
9
- for (var t of M(e))
10
- m.call(e, t) && n(i, t, e[t]);
11
- return i;
12
- }, g = (i, e) => N(i, P(e));
13
- var A = (i, e, t) => (n(i, typeof e != "symbol" ? e + "" : e, t), t);
14
- import * as o from "three";
15
- import { DEFAULT_HIGHLIGHT_OPACITY as B } from "../typings/style.js";
16
- import { IObject3D as b } from "../../shared-utils/three/IObject3D.js";
17
- import { anyPositionToVector3 as E } from "../../shared-utils/positionToVector3.js";
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 u } from "../../shared-utils/isNil.js";
36
+ import { notNil as a } from "../../shared-utils/isNil.js";
26
37
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
27
- const p = "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==";
28
- let w = null;
29
- class Q extends b {
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 f, a;
42
+ var w, V;
32
43
  super();
33
- A(this, "name", "PointMesh");
34
- A(this, "opacityBeforeHighlight");
35
- A(this, "highlighted", !1);
36
- A(this, "fontMesh");
37
- A(this, "backgroundMesh");
38
- const l = new o.BufferGeometry();
39
- l.setAttribute("position", new o.Float32BufferAttribute([0, 0, 0], 3));
40
- const d = {
44
+ s(this, "name", "PointMesh");
45
+ s(this, "opacityBeforeHighlight");
46
+ s(this, "highlighted", !1);
47
+ s(this, "fontMesh");
48
+ s(this, "backgroundMesh");
49
+ s(this, "lastRenderDomItem");
50
+ s(this, "paramsStyle");
51
+ s(this, "dom");
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: o.DoubleSide,
43
- size: (f = t == null ? void 0 : t.size) != null ? f : 8,
44
- map: w || (w = new o.TextureLoader().load(p)),
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
- }, r = new o.PointsMaterial(g(c({}, d), {
47
- color: (a = t == null ? void 0 : t.color) != null ? a : 16777215,
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
- })), V = new o.PointsMaterial(g(c({}, d), {
51
- size: r.size,
52
- color: r.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
- })), s = new o.Points(l, r), h = new o.Points(l, V);
57
- this.fontMesh = s, this.backgroundMesh = h, s.name = "FontMesh", h.name = "BackgroundMesh", s.renderOrder = 10, h.renderOrder = 0, this.add(s, h), t != null && t.point && this.position.copy(E(t.point)), t && this.setStyle(t);
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
- u(t.color) && (this.fontMesh.material.setValues({ color: t.color }), this.backgroundMesh.material.setValues({ color: t.color })), u(t.size) && (this.fontMesh.material.setValues({ side: t.size }), this.backgroundMesh.material.setValues({ side: t.size })), u(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));
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 * B }));
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
- Q as PointMesh
109
+ K as PointMesh
77
110
  };
@@ -51,6 +51,7 @@ Config extends BaseObjectConfig = BaseObjectConfig> extends IObject3D {
51
51
  */
52
52
  config: Config;
53
53
  editor: BaseEditor;
54
+ get editing(): boolean;
54
55
  abstract type: string;
55
56
  /**
56
57
  * @description 物体导出数据
@@ -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 S extends g {
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
- S as BaseObject
129
+ O as BaseObject
127
130
  };
@@ -102,6 +102,8 @@ function K(n, t, e) {
102
102
  }, D = () => {
103
103
  M() && (i.push(m.pop()), n.setPoints(i), g(v), t.pointSelectorHelper.magnifier.render());
104
104
  }, E = (r) => {
105
+ if (!r)
106
+ return;
105
107
  m.length = 0;
106
108
  const u = i.length === 0 ? r.point : h.clone();
107
109
  i.push(u), n.setPoints(i), i.length === 2 && (x(), P());