@realsee/dnalogel 3.47.10 → 3.47.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 +3 -1
- package/dist/Sculpt/Meshes/Polygon.d.ts +16 -7
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -0
- package/dist/Sculpt/Meshes/Polyline.d.ts +1 -0
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -0
- package/dist/index.cjs.js +57 -57
- package/dist/index.js +3263 -3227
- package/dist/index.umd.js +50 -50
- package/libs/AreaMakerPlugin/Controller.js +14 -13
- package/libs/AreaMakerPlugin/index.js +15 -14
- package/libs/AreaMakerPlugin/utils/Item.js +15 -14
- package/libs/CSS3DRenderPlugin/Controller.js +12 -11
- package/libs/CSS3DRenderPlugin/index.js +18 -17
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +12 -11
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +26 -25
- package/libs/CruisePlugin/BaseController.js +17 -16
- package/libs/CruisePlugin/Move.js +20 -19
- package/libs/CruisePlugin/Work.js +15 -14
- package/libs/CruisePlugin/index.js +19 -18
- package/libs/CurrentPanoImagePlugin/Controller.js +14 -13
- package/libs/CurrentPanoImagePlugin/index.js +16 -15
- package/libs/GuideLinePlugin/Controller.js +17 -16
- package/libs/GuideLinePlugin/GuideLineItem.js +15 -14
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +5 -3
- package/libs/GuideLinePlugin/GuideLineModeItem.js +15 -14
- package/libs/GuideLinePlugin/index.js +19 -18
- package/libs/ModelMakerPlugin/Controller.js +13 -12
- package/libs/ModelMakerPlugin/index.js +15 -14
- package/libs/ModelTVVideoPlugin/Plugin.js +37 -36
- package/libs/ModelTVVideoPlugin/index.js +13 -12
- package/libs/Object3DHelperPlugin/Controller.js +14 -13
- package/libs/Object3DHelperPlugin/index.js +18 -17
- package/libs/PanoCompassPlugin/Controller.js +15 -14
- package/libs/PanoCompassPlugin/index.js +16 -15
- package/libs/PanoDoorLabelPlugin/BaseController.js +15 -14
- package/libs/PanoDoorLabelPlugin/Controller.js +15 -14
- package/libs/PanoDoorLabelPlugin/index.js +16 -15
- package/libs/PanoMeasurePlugin/Components/Controller0.js +12 -11
- package/libs/PanoMeasurePlugin/Components/Controller1.js +12 -11
- package/libs/PanoMeasurePlugin/Controller/EditController.js +12 -11
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +13 -12
- package/libs/PanoMeasurePlugin/Controller/index.js +10 -9
- package/libs/PanoMeasurePlugin/Model/area.js +12 -11
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +12 -11
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +12 -11
- package/libs/PanoMeasurePlugin/index.js +21 -20
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +12 -11
- package/libs/PanoSpatialTagPlugin/Plugin.js +14 -13
- package/libs/PanoSpatialTagPlugin/index.js +11 -10
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +14 -13
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +13 -12
- package/libs/PanoTagPlugin/Components/Tag/index.js +13 -12
- package/libs/PanoTagPlugin/Components/TagContainer.js +13 -12
- package/libs/PanoTagPlugin/Components/TagItem.js +13 -12
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +34 -33
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +13 -12
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +13 -12
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +15 -14
- package/libs/PanoTagPlugin/controller/TagRender.js +12 -11
- package/libs/PanoTagPlugin/controller/TagUtil.js +13 -12
- package/libs/PanoTagPlugin/controller/index.js +16 -15
- package/libs/PanoTagPlugin/index.js +21 -20
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +14 -13
- package/libs/PanoVideoPlugin/Controller.js +15 -14
- package/libs/PanoVideoPlugin/VideoMeshController.js +30 -29
- package/libs/PanoVideoPlugin/index.js +18 -17
- package/libs/PipelinePlugin/Controller.js +14 -13
- package/libs/PipelinePlugin/index.js +16 -15
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +21 -20
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +15 -14
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +13 -12
- package/libs/Sculpt/Meshes/Box.js +10 -8
- package/libs/Sculpt/Meshes/Cylinder.js +17 -15
- package/libs/Sculpt/Meshes/Line.d.ts +3 -1
- package/libs/Sculpt/Meshes/Line.js +89 -78
- package/libs/Sculpt/Meshes/Point.js +14 -12
- package/libs/Sculpt/Meshes/Polygon.d.ts +16 -7
- package/libs/Sculpt/Meshes/Polygon.js +71 -33
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -0
- package/libs/Sculpt/Meshes/Polyline.d.ts +1 -0
- package/libs/Sculpt/Meshes/Polyline.js +69 -74
- package/libs/Sculpt/Meshes/Rectangle.js +7 -5
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -0
- package/libs/Sculpt/Objects/Base/index.js +5 -5
- package/libs/Sculpt/Objects/Line/Editor.js +17 -15
- package/libs/Sculpt/Objects/Polygon/index.js +22 -22
- package/libs/Sculpt/Objects/Rectangle/Editor.js +2 -2
- package/libs/Sculpt/Objects/Rectangle/index.js +79 -69
- package/libs/Sculpt/index.js +15 -14
- package/libs/Sculpt/utils/three/ColoredMesh.js +6 -4
- package/libs/base/BasePlugin.js +16 -14
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +13 -12
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +16 -15
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +13 -12
- package/libs/floorplan/ModelFloorplanPlugin/index.js +16 -15
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +15 -14
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +16 -15
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +13 -12
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +16 -15
- package/libs/floorplan/index.js +3 -1
- package/libs/index.js +12 -12
- package/libs/shared-utils/five/index.js +5 -3
- package/libs/shared-utils/five/lookObject.js +20 -18
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/applyObjectMatrixWorld.js +4 -6
- package/libs/shared-utils/three/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var m = Object.getOwnPropertySymbols;
|
|
3
3
|
var k = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var
|
|
5
|
-
for (var e in
|
|
6
|
-
k.call(
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
S.call(
|
|
10
|
-
return
|
|
4
|
+
var u = (o, s, e) => s in o ? M(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, f = (o, s) => {
|
|
5
|
+
for (var e in s || (s = {}))
|
|
6
|
+
k.call(s, e) && u(o, e, s[e]);
|
|
7
|
+
if (m)
|
|
8
|
+
for (var e of m(s))
|
|
9
|
+
S.call(s, e) && u(o, e, s[e]);
|
|
10
|
+
return o;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
import * as
|
|
14
|
-
import { DEFAULT_LINE_COLOR as
|
|
15
|
-
import { LineGeometry as
|
|
16
|
-
import { anyPositionToVector3 as
|
|
17
|
-
import { IObject3D as
|
|
12
|
+
var l = (o, s, e) => (u(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
13
|
+
import * as g from "three";
|
|
14
|
+
import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as p, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
|
|
15
|
+
import { LineGeometry as y, LineMaterial as I, THREE_Line2 as w } from "../../shared-utils/five/FiveLine.js";
|
|
16
|
+
import { anyPositionToVector3 as H } from "../../shared-utils/positionToVector3.js";
|
|
17
|
+
import { IObject3D as R } from "../../shared-utils/three/IObject3D.js";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
20
|
-
import { centerPoint as
|
|
20
|
+
import { centerPoint as C } from "../../shared-utils/three/centerPoint.js";
|
|
21
|
+
import { LightTag as x } from "../../shared-utils/tag.js";
|
|
22
|
+
import { globalModules as W } from "../utils/Modules/Global.js";
|
|
23
|
+
import { removeAllTag as A } from "../utils/removeAllTag.js";
|
|
24
|
+
import { getLengthHTML as O } from "../utils/Meshes/getLengthHTML.js";
|
|
25
|
+
import { applyObjectMatrixWorld as T } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
21
26
|
import "../../shared-utils/three/THREESphere.js";
|
|
22
27
|
import "animejs";
|
|
23
28
|
import { notNil as c } from "../../shared-utils/isNil.js";
|
|
24
29
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
25
|
-
|
|
26
|
-
import { globalModules as x } from "../utils/Modules/Global.js";
|
|
27
|
-
import { removeAllTag as P } from "../utils/removeAllTag.js";
|
|
28
|
-
import { getLengthHTML as V } from "../utils/Meshes/getLengthHTML.js";
|
|
29
|
-
new d.Vector2();
|
|
30
|
-
class E extends w {
|
|
30
|
+
class E extends I {
|
|
31
31
|
constructor(e) {
|
|
32
|
-
var
|
|
32
|
+
var i, t;
|
|
33
33
|
super(e);
|
|
34
|
-
|
|
35
|
-
c(e == null ? void 0 : e.color) && (this.three_color = (
|
|
36
|
-
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(
|
|
34
|
+
l(this, "_three_color");
|
|
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((n) => {
|
|
36
|
+
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(n) || n in this && (this[n] = e[n]);
|
|
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 E 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
|
|
50
|
-
constructor(e,
|
|
51
|
-
super(e,
|
|
52
|
-
|
|
49
|
+
class _ extends w {
|
|
50
|
+
constructor(e, i) {
|
|
51
|
+
super(e, i);
|
|
52
|
+
l(this, "name", "Line3");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class $ extends R {
|
|
56
56
|
constructor(e) {
|
|
57
|
-
var
|
|
57
|
+
var h, r, d, a, L;
|
|
58
58
|
super();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
l(this, "name", "LineMesh");
|
|
60
|
+
l(this, "points");
|
|
61
|
+
l(this, "lengthDoms", []);
|
|
62
|
+
l(this, "highlighted", !1);
|
|
63
|
+
l(this, "line");
|
|
64
|
+
l(this, "backLine");
|
|
65
|
+
l(this, "opacityBeforeHighlight");
|
|
66
|
+
l(this, "paramsStyle", {});
|
|
67
|
+
l(this, "lastRenderLengthItem");
|
|
67
68
|
this.paramsStyle = e != null ? e : {};
|
|
68
|
-
const
|
|
69
|
-
color: new
|
|
70
|
-
linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r :
|
|
69
|
+
const i = new y(), t = new E({
|
|
70
|
+
color: new g.Color((h = e == null ? void 0 : e.lineColor) != null ? h : b),
|
|
71
|
+
linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : p,
|
|
71
72
|
dashScale: 40,
|
|
72
|
-
opacity: (
|
|
73
|
+
opacity: (d = e == null ? void 0 : e.opacity) != null ? d : 1,
|
|
73
74
|
transparent: !0,
|
|
74
75
|
dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
|
|
75
|
-
}),
|
|
76
|
-
color: new
|
|
76
|
+
}), n = new E({
|
|
77
|
+
color: new g.Color((L = e == null ? void 0 : e.lineColor) != null ? L : b),
|
|
77
78
|
linewidth: t.linewidth * 0.9,
|
|
78
79
|
dashScale: t.dashScale,
|
|
79
80
|
opacity: t.opacity * 0.8,
|
|
@@ -82,8 +83,8 @@ class X extends I {
|
|
|
82
83
|
transparent: !0,
|
|
83
84
|
resolution: t.resolution
|
|
84
85
|
});
|
|
85
|
-
this.line = new
|
|
86
|
-
|
|
86
|
+
this.line = new _(i, t), this.backLine = new _(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", () => {
|
|
87
|
+
A(this);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
get style() {
|
|
@@ -100,7 +101,7 @@ class X extends I {
|
|
|
100
101
|
return this.line.material.linewidth;
|
|
101
102
|
}
|
|
102
103
|
get color() {
|
|
103
|
-
return new
|
|
104
|
+
return new g.Color(this.line.material.three_color);
|
|
104
105
|
}
|
|
105
106
|
get dashed() {
|
|
106
107
|
return this.line.material.dashed;
|
|
@@ -111,27 +112,33 @@ class X extends I {
|
|
|
111
112
|
get occlusionMode() {
|
|
112
113
|
return this.line.material.depthTest === !1 ? "depthTest" : "translucence";
|
|
113
114
|
}
|
|
115
|
+
updateMatrixWorld(e) {
|
|
116
|
+
var t;
|
|
117
|
+
super.updateMatrixWorld(e);
|
|
118
|
+
const i = (t = this.points) == null ? void 0 : t.map((n) => n.toArray().join(",")).join(",");
|
|
119
|
+
i !== this.lastRenderLengthItem && (this.updateLengthItems(), this.lastRenderLengthItem = i);
|
|
120
|
+
}
|
|
114
121
|
setPoints(e) {
|
|
115
|
-
const
|
|
116
|
-
if (this.points =
|
|
117
|
-
this.line.geometry = new
|
|
122
|
+
const i = e.map(H).filter(c);
|
|
123
|
+
if (this.points = i, i.length < 2) {
|
|
124
|
+
this.line.geometry = new y(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
|
|
118
125
|
return;
|
|
119
126
|
}
|
|
120
127
|
this.addIfNotExists(this.line, this.backLine);
|
|
121
|
-
const t =
|
|
122
|
-
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new
|
|
128
|
+
const t = i.flatMap((n) => [n.x, n.y, n.z]);
|
|
129
|
+
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new y(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
|
|
123
130
|
}
|
|
124
|
-
setResolution(e,
|
|
131
|
+
setResolution(e, i) {
|
|
125
132
|
const t = this.line.material.resolution;
|
|
126
|
-
(t.x !== e || t.y !==
|
|
127
|
-
const
|
|
128
|
-
(
|
|
133
|
+
(t.x !== e || t.y !== i) && (t.set(e, i), this.needsRender = !0);
|
|
134
|
+
const n = this.backLine.material.resolution;
|
|
135
|
+
(n.x !== e || n.y !== i) && (n.set(e, i), this.needsRender = !0);
|
|
129
136
|
}
|
|
130
137
|
setStyle(e) {
|
|
131
|
-
var
|
|
132
|
-
this.paramsStyle =
|
|
133
|
-
const
|
|
134
|
-
|
|
138
|
+
var n, h, r;
|
|
139
|
+
this.paramsStyle = f(f({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new g.Color(e.lineColor), this.backLine.material.three_color = new g.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.2), this.updateLengthItems();
|
|
140
|
+
const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (h = e.occlusionMode) != null ? h : this.paramsStyle.occlusionMode) != null ? r : "translucence";
|
|
141
|
+
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;
|
|
135
142
|
}
|
|
136
143
|
highlight() {
|
|
137
144
|
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
|
|
@@ -140,24 +147,28 @@ class X extends I {
|
|
|
140
147
|
this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
|
|
141
148
|
}
|
|
142
149
|
updateLengthItems() {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
const e = () => {
|
|
151
|
+
this.lengthDoms.forEach((i) => i.destroy()), this.lengthDoms = [];
|
|
152
|
+
};
|
|
153
|
+
if (!this.points || this.points.length < 2)
|
|
154
|
+
return e();
|
|
155
|
+
if (this.paramsStyle.lengthEnable) {
|
|
156
|
+
const i = T(this, this.points).map((t, n) => {
|
|
157
|
+
if (n !== 0)
|
|
158
|
+
return [T(this, this.points[n - 1]), t];
|
|
159
|
+
}).filter(c);
|
|
160
|
+
i.forEach(([t, n], h) => {
|
|
161
|
+
var d;
|
|
162
|
+
const r = C(t, n);
|
|
163
|
+
this.lengthDoms[h] = (d = this.lengthDoms[h]) != null ? d : (() => {
|
|
164
|
+
const a = new x(W.five);
|
|
165
|
+
return a.intersectCheck = !1, a;
|
|
166
|
+
})(), this.lengthDoms[h].setPosition(r, [t, n]), this.lengthDoms[h].container.innerHTML = O(t.distanceTo(n).toFixed(2) + "m");
|
|
167
|
+
}), this.lengthDoms.length > i.length && (this.lengthDoms.slice(i.length).forEach((t) => t.destroy()), this.lengthDoms.length = i.length);
|
|
157
168
|
} else
|
|
158
|
-
|
|
169
|
+
e();
|
|
159
170
|
}
|
|
160
171
|
}
|
|
161
172
|
export {
|
|
162
|
-
|
|
173
|
+
$ as LineMesh
|
|
163
174
|
};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
var C = Object.defineProperty, N = Object.defineProperties;
|
|
2
2
|
var P = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var M = Object.getOwnPropertySymbols;
|
|
4
|
-
var k = Object.prototype.hasOwnProperty,
|
|
4
|
+
var k = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
5
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
6
|
for (var t in e || (e = {}))
|
|
7
7
|
k.call(e, t) && n(i, t, e[t]);
|
|
8
8
|
if (M)
|
|
9
9
|
for (var t of M(e))
|
|
10
|
-
|
|
10
|
+
m.call(e, t) && n(i, t, e[t]);
|
|
11
11
|
return i;
|
|
12
12
|
}, g = (i, e) => N(i, P(e));
|
|
13
13
|
var A = (i, e, t) => (n(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
14
|
import * as o from "three";
|
|
15
|
-
import { DEFAULT_HIGHLIGHT_OPACITY as
|
|
16
|
-
import { IObject3D as
|
|
17
|
-
import { anyPositionToVector3 as
|
|
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";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
20
|
-
import "
|
|
20
|
+
import "@realsee/five/line";
|
|
21
|
+
import "../../shared-utils/tag.js";
|
|
22
|
+
import "../utils/Modules/Global.js";
|
|
21
23
|
import "../../shared-utils/three/THREESphere.js";
|
|
22
24
|
import "animejs";
|
|
23
25
|
import { notNil as u } from "../../shared-utils/isNil.js";
|
|
24
26
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
25
|
-
const
|
|
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==";
|
|
26
28
|
let w = null;
|
|
27
|
-
class
|
|
29
|
+
class Q extends b {
|
|
28
30
|
constructor(t) {
|
|
29
31
|
var f, a;
|
|
30
32
|
super();
|
|
@@ -39,7 +41,7 @@ class O extends E {
|
|
|
39
41
|
transparent: !0,
|
|
40
42
|
side: o.DoubleSide,
|
|
41
43
|
size: (f = t == null ? void 0 : t.size) != null ? f : 8,
|
|
42
|
-
map: w || (w = new o.TextureLoader().load(
|
|
44
|
+
map: w || (w = new o.TextureLoader().load(p)),
|
|
43
45
|
sizeAttenuation: !1
|
|
44
46
|
}, r = new o.PointsMaterial(g(c({}, d), {
|
|
45
47
|
color: (a = t == null ? void 0 : t.color) != null ? a : 16777215,
|
|
@@ -52,7 +54,7 @@ class O extends E {
|
|
|
52
54
|
depthTest: !1,
|
|
53
55
|
opacity: 0.5
|
|
54
56
|
})), s = new o.Points(l, r), h = new o.Points(l, V);
|
|
55
|
-
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(
|
|
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);
|
|
56
58
|
}
|
|
57
59
|
get color() {
|
|
58
60
|
return this.fontMesh.material.color;
|
|
@@ -64,12 +66,12 @@ class O extends E {
|
|
|
64
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));
|
|
65
67
|
}
|
|
66
68
|
highlight() {
|
|
67
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.material.opacity, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight *
|
|
69
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.material.opacity, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight * B }));
|
|
68
70
|
}
|
|
69
71
|
unhighlight() {
|
|
70
72
|
this.highlighted && (this.highlighted = !1, this.fontMesh.material.setValues({ opacity: this.opacityBeforeHighlight }));
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
export {
|
|
74
|
-
|
|
76
|
+
Q as PointMesh
|
|
75
77
|
};
|
|
@@ -5,11 +5,14 @@ import type { PointsData } from '../utils/data';
|
|
|
5
5
|
export declare const blankGeometry: THREE.BufferGeometry & {
|
|
6
6
|
isBlank: true;
|
|
7
7
|
};
|
|
8
|
-
export type PolygonStyle = ColoredMeshStyle
|
|
8
|
+
export type PolygonStyle = ColoredMeshStyle & {
|
|
9
|
+
lengthEnable: boolean;
|
|
10
|
+
};
|
|
9
11
|
export type PolygonData = PointsData;
|
|
10
12
|
export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
11
13
|
name: string;
|
|
12
14
|
get style(): {
|
|
15
|
+
lengthEnable: boolean;
|
|
13
16
|
color: THREE.Color;
|
|
14
17
|
opacity: number;
|
|
15
18
|
occlusionVisibility: boolean;
|
|
@@ -17,19 +20,24 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
|
17
20
|
};
|
|
18
21
|
get isBlank(): boolean;
|
|
19
22
|
get center(): THREE.Vector3;
|
|
23
|
+
get geometryInfo(): {
|
|
24
|
+
area: number;
|
|
25
|
+
center: THREE.Vector3;
|
|
26
|
+
};
|
|
20
27
|
points: THREE.Vector3[];
|
|
21
28
|
planeHelperNeedUpdate: boolean;
|
|
22
|
-
|
|
29
|
+
geometryInfoNeedUpdate: boolean;
|
|
30
|
+
_paramsStyle: Partial<PolygonStyle>;
|
|
23
31
|
private planeHelper;
|
|
24
|
-
private
|
|
32
|
+
private _geometryInfo;
|
|
25
33
|
private opacityBeforeHighlight;
|
|
26
34
|
private highlighted;
|
|
35
|
+
private lastRenderLengthItem;
|
|
36
|
+
private areaDom?;
|
|
27
37
|
constructor(params?: Partial<PolygonStyle & PolygonData>);
|
|
38
|
+
updateMatrixWorld(force?: boolean): void;
|
|
39
|
+
setStyle(params: Partial<ColoredMeshStyle>): void;
|
|
28
40
|
setPoints(points: AnyPositions): void;
|
|
29
|
-
getGeometryInfo(): {
|
|
30
|
-
center: THREE.Vector3;
|
|
31
|
-
area: number;
|
|
32
|
-
};
|
|
33
41
|
/**
|
|
34
42
|
* @description: 获取一个点投影在当前平面上的点
|
|
35
43
|
*/
|
|
@@ -37,4 +45,5 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
|
37
45
|
highlight(): void;
|
|
38
46
|
unhighlight(): void;
|
|
39
47
|
private updatePlaneHelper;
|
|
48
|
+
private updateAreaItems;
|
|
40
49
|
}
|
|
@@ -1,61 +1,99 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var d = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
+
var f = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var u = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, n = (i, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
u.call(t, e) && h(i, e, t[e]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var e of p(t))
|
|
10
|
+
c.call(t, e) && h(i, e, t[e]);
|
|
11
|
+
return i;
|
|
12
|
+
}, g = (i, t) => y(i, f(t));
|
|
13
|
+
var r = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
import * as l from "three";
|
|
15
|
+
import { generatePolygonGeometry as I } from "../../shared-utils/three/generatePolygonGeometry.js";
|
|
16
|
+
import { DEFAULT_HIGHLIGHT_OPACITY as H } from "../typings/style.js";
|
|
17
|
+
import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.js";
|
|
18
|
+
import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
|
|
19
|
+
import { getGeometryInfo as S } from "../../shared-utils/three/geometryUtil.js";
|
|
20
|
+
import { LightTag as L } from "../../shared-utils/tag.js";
|
|
21
|
+
import { globalModules as U } from "../utils/Modules/Global.js";
|
|
22
|
+
import { getLengthHTML as A } from "../utils/Meshes/getLengthHTML.js";
|
|
23
|
+
const a = new l.BufferGeometry();
|
|
24
|
+
a.name = "blankGeometry";
|
|
25
|
+
a.isBlank = !0;
|
|
26
|
+
class E extends _ {
|
|
14
27
|
constructor(e) {
|
|
15
28
|
super(e);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
r(this, "name", "PolygonMesh");
|
|
30
|
+
r(this, "points", []);
|
|
31
|
+
r(this, "planeHelperNeedUpdate", !0);
|
|
32
|
+
r(this, "geometryInfoNeedUpdate", !0);
|
|
33
|
+
r(this, "_paramsStyle");
|
|
34
|
+
r(this, "planeHelper", null);
|
|
35
|
+
r(this, "_geometryInfo", null);
|
|
36
|
+
r(this, "opacityBeforeHighlight");
|
|
37
|
+
r(this, "highlighted", !1);
|
|
38
|
+
r(this, "lastRenderLengthItem");
|
|
39
|
+
r(this, "areaDom");
|
|
40
|
+
e != null && e.points && this.setPoints(e.points), this._paramsStyle = e != null ? e : {}, this.updateAreaItems();
|
|
25
41
|
}
|
|
26
42
|
get style() {
|
|
27
|
-
return super.style;
|
|
43
|
+
return g(n({}, super.style), { lengthEnable: this._paramsStyle.lengthEnable });
|
|
28
44
|
}
|
|
29
45
|
get isBlank() {
|
|
30
46
|
return !!this.geometry.isBlank;
|
|
31
47
|
}
|
|
32
48
|
get center() {
|
|
33
|
-
return this.
|
|
49
|
+
return this.geometryInfo.center;
|
|
34
50
|
}
|
|
35
|
-
|
|
51
|
+
get geometryInfo() {
|
|
52
|
+
return this.geometryInfoNeedUpdate && (this._geometryInfo = S(this.geometry), this.geometryInfoNeedUpdate = !1), this._geometryInfo;
|
|
53
|
+
}
|
|
54
|
+
updateMatrixWorld(e) {
|
|
36
55
|
var s;
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
super.updateMatrixWorld(e);
|
|
57
|
+
const o = (s = this.points) == null ? void 0 : s.map((m) => m.toArray().join(",")).join(",");
|
|
58
|
+
o !== this.lastRenderLengthItem && (this.updateAreaItems(), this.lastRenderLengthItem = o);
|
|
59
|
+
}
|
|
60
|
+
setStyle(e) {
|
|
61
|
+
this._paramsStyle = n(n({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
|
|
39
62
|
}
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
setPoints(e) {
|
|
64
|
+
var s;
|
|
65
|
+
const o = e.map(P);
|
|
66
|
+
this.points = o, this.geometry = (s = I(this.points)) != null ? s : a, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
|
|
42
67
|
}
|
|
43
68
|
/**
|
|
44
69
|
* @description: 获取一个点投影在当前平面上的点
|
|
45
70
|
*/
|
|
46
71
|
projectPoint(e) {
|
|
47
|
-
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new
|
|
72
|
+
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new l.Vector3()) : e);
|
|
48
73
|
}
|
|
49
74
|
highlight() {
|
|
50
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity *
|
|
75
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity * H }), this.needsRender = !0);
|
|
51
76
|
}
|
|
52
77
|
unhighlight() {
|
|
53
78
|
this.highlighted && (this.highlighted = !1, this.setStyle({ opacity: this.opacityBeforeHighlight }), this.needsRender = !0);
|
|
54
79
|
}
|
|
55
80
|
updatePlaneHelper() {
|
|
56
|
-
this.points.length >= 3 ? this.planeHelper = new
|
|
81
|
+
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;
|
|
82
|
+
}
|
|
83
|
+
updateAreaItems() {
|
|
84
|
+
var o;
|
|
85
|
+
const e = () => {
|
|
86
|
+
var s;
|
|
87
|
+
(s = this.areaDom) == null || s.destroy(), this.areaDom = void 0;
|
|
88
|
+
};
|
|
89
|
+
if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
|
|
90
|
+
return e();
|
|
91
|
+
this.areaDom = (o = this.areaDom) != null ? o : (() => {
|
|
92
|
+
const s = new L(U.five);
|
|
93
|
+
return s.intersectCheck = !1, s;
|
|
94
|
+
})(), this.areaDom.setPosition(this.center), this.areaDom.container.innerHTML = A(this.geometryInfo.area.toFixed(2) + "m²");
|
|
57
95
|
}
|
|
58
96
|
}
|
|
59
97
|
export {
|
|
60
|
-
|
|
98
|
+
E as PolygonMesh
|
|
61
99
|
};
|