@realsee/dnalogel 3.45.0 → 3.46.0
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 +3 -0
- package/dist/Sculpt/Meshes/Line.d.ts +6 -1
- package/dist/index.cjs.js +53 -53
- package/dist/index.js +29609 -29576
- package/dist/index.umd.js +49 -49
- package/dist/shared-utils/tag.d.ts +6 -3
- package/libs/AreaMakerPlugin/Controller.js +150 -78
- package/libs/AreaMakerPlugin/index.js +76 -4
- package/libs/AreaMakerPlugin/utils/Item.js +190 -111
- package/libs/CSS3DRenderPlugin/Controller.js +89 -29
- package/libs/CSS3DRenderPlugin/index.js +75 -15
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +132 -58
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +181 -116
- package/libs/CruisePlugin/BaseController.js +121 -49
- package/libs/CruisePlugin/Move.js +73 -21
- package/libs/CruisePlugin/Work.js +98 -46
- package/libs/CruisePlugin/index.js +79 -27
- package/libs/CurrentPanoImagePlugin/Controller.js +176 -104
- package/libs/CurrentPanoImagePlugin/index.js +76 -4
- package/libs/GuideLinePlugin/Controller.js +82 -30
- package/libs/GuideLinePlugin/GuideLineItem.js +82 -30
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +81 -29
- package/libs/GuideLinePlugin/index.js +79 -27
- package/libs/ModelMakerPlugin/Controller.js +139 -82
- package/libs/ModelMakerPlugin/index.js +75 -18
- package/libs/ModelTVVideoPlugin/Plugin.js +117 -57
- package/libs/ModelTVVideoPlugin/index.js +68 -8
- package/libs/Object3DHelperPlugin/Controller.js +54 -31
- package/libs/Object3DHelperPlugin/index.js +35 -13
- package/libs/PanoCompassPlugin/Controller.js +97 -42
- package/libs/PanoCompassPlugin/index.js +71 -16
- package/libs/PanoDoorLabelPlugin/BaseController.js +98 -26
- package/libs/PanoDoorLabelPlugin/Controller.js +187 -115
- package/libs/PanoDoorLabelPlugin/index.js +76 -4
- package/libs/PanoMeasurePlugin/Components/Controller0.js +140 -88
- package/libs/PanoMeasurePlugin/Components/Controller1.js +178 -126
- package/libs/PanoMeasurePlugin/Controller/EditController.js +124 -72
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +167 -92
- package/libs/PanoMeasurePlugin/Controller/index.js +109 -64
- package/libs/PanoMeasurePlugin/Model/area.js +114 -38
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +78 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +97 -45
- package/libs/PanoMeasurePlugin/index.js +76 -31
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +98 -20
- package/libs/PanoSpatialTagPlugin/Plugin.js +210 -150
- package/libs/PanoSpatialTagPlugin/index.js +66 -6
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +133 -53
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +295 -216
- package/libs/PanoTagPlugin/Components/Tag/index.js +257 -187
- package/libs/PanoTagPlugin/Components/TagContainer.js +157 -87
- package/libs/PanoTagPlugin/Components/TagItem.js +144 -74
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +73 -3
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +109 -39
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +105 -35
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +113 -43
- package/libs/PanoTagPlugin/controller/TagRender.js +132 -80
- package/libs/PanoTagPlugin/controller/TagUtil.js +136 -84
- package/libs/PanoTagPlugin/controller/index.js +113 -61
- package/libs/PanoTagPlugin/index.js +89 -37
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +121 -41
- package/libs/PanoVideoPlugin/Controller.js +137 -65
- package/libs/PanoVideoPlugin/VideoMeshController.js +149 -69
- package/libs/PanoVideoPlugin/index.js +82 -10
- package/libs/PipelinePlugin/Controller.js +199 -128
- package/libs/PipelinePlugin/index.js +76 -5
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +102 -22
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +95 -15
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +136 -56
- package/libs/Sculpt/Meshes/Box.js +6 -5
- package/libs/Sculpt/Meshes/Cylinder.js +7 -6
- package/libs/Sculpt/Meshes/Line.d.ts +6 -1
- package/libs/Sculpt/Meshes/Line.js +76 -56
- package/libs/Sculpt/Meshes/Point.js +6 -5
- package/libs/Sculpt/Meshes/Polyline.js +5 -4
- package/libs/Sculpt/Meshes/Rectangle.js +3 -2
- package/libs/Sculpt/Objects/Line/Editor.js +11 -10
- package/libs/Sculpt/utils/three/ColoredMesh.js +14 -13
- package/libs/base/BasePlugin.js +14 -13
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +128 -59
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +75 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +129 -59
- package/libs/floorplan/ModelFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +158 -86
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +76 -4
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +151 -81
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +75 -5
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +67 -67
- package/libs/shared-utils/five/index.js +3 -2
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +6 -3
- package/libs/shared-utils/tag.js +38 -24
- package/libs/shared-utils/three/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
|
-
var R = (
|
|
3
|
-
var
|
|
2
|
+
var R = (p, h, t) => h in p ? I(p, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[h] = t;
|
|
3
|
+
var o = (p, h, t) => (R(p, typeof h != "symbol" ? h + "" : h, t), t);
|
|
4
4
|
import G from "hammerjs";
|
|
5
5
|
import T from "../Modules/DeleteDom/index.js";
|
|
6
6
|
import w from "../utils/isNDCPointInScreen.js";
|
|
@@ -32,137 +32,212 @@ import "../Model/polyline.js";
|
|
|
32
32
|
import "../utils/dom/areaDom.js";
|
|
33
33
|
import "../../shared-utils/three/geometryUtil.js";
|
|
34
34
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
35
|
+
import "../../Sculpt/utils/Modules/Global.js";
|
|
36
|
+
import "../../Sculpt/utils/Modules/Cursor.js";
|
|
37
|
+
import "../../Object3DHelperPlugin/Controller.js";
|
|
38
|
+
import "../../base/BasePlugin.js";
|
|
39
|
+
import "../../shared-utils/Subscribe.js";
|
|
35
40
|
import "../../shared-utils/three/THREESphere.js";
|
|
36
41
|
import "animejs";
|
|
37
|
-
import "../../shared-utils/
|
|
42
|
+
import "../../shared-utils/Utils/FiveUtil.js";
|
|
43
|
+
import "../../shared-utils/Utils/BaseUtil.js";
|
|
44
|
+
import "../../shared-utils/Utils/WorkUtil.js";
|
|
45
|
+
import "../../shared-utils/five/transformPosition.js";
|
|
46
|
+
import "../../shared-utils/url/absoluteUrl.js";
|
|
38
47
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
48
|
+
import "../../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
49
|
+
import "../../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
50
|
+
import "../../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
39
51
|
import "../../shared-utils/three/IObject3D.js";
|
|
52
|
+
import "../../shared-utils/three/boundingBox.js";
|
|
53
|
+
import "../../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
54
|
+
import "../../shared-utils/Object3DHelper/utils/direction.js";
|
|
55
|
+
import "../../shared-utils/Object3DHelper/Constants/color.js";
|
|
56
|
+
import "../../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
57
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
58
|
+
import "../../shared-utils/positionToVector3.js";
|
|
59
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
60
|
+
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
61
|
+
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
62
|
+
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
63
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
64
|
+
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
65
|
+
import "../../shared-utils/three/getObjectVisible.js";
|
|
66
|
+
import "../../shared-utils/isNil.js";
|
|
67
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
68
|
+
import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
69
|
+
import "../../shared-utils/util.js";
|
|
70
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
71
|
+
import "../../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
72
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
73
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
74
|
+
import "../../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
75
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
76
|
+
import "../../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
77
|
+
import "../../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
78
|
+
import "../../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
79
|
+
import "../../shared-utils/threex/domevents/index.js";
|
|
80
|
+
import "../../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
81
|
+
import "../../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
82
|
+
import "../../Sculpt/utils/three/rayOnLine.js";
|
|
83
|
+
import "../../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
84
|
+
import "../../shared-utils/Object3DHelper/index.js";
|
|
85
|
+
import "../../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
86
|
+
import "../../shared-utils/math/rad2Deg.js";
|
|
87
|
+
import "../../shared-utils/math/deg2Rad.js";
|
|
88
|
+
import "../../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
89
|
+
import "../../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
90
|
+
import "../../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
91
|
+
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
92
|
+
import "../../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
93
|
+
import "../../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
94
|
+
import "../../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
95
|
+
import "../../shared-utils/five/fiveModelLoad.js";
|
|
96
|
+
import "../../shared-utils/five/FiveDomEvents.js";
|
|
97
|
+
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
98
|
+
import "../../shared-utils/three/THREERaycaster.js";
|
|
99
|
+
import "../../shared-utils/three/PointSelector/index.js";
|
|
100
|
+
import "../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
101
|
+
import "../../shared-utils/three/Magnifier.js";
|
|
102
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
103
|
+
import "../../shared-utils/three/Assets/index.js";
|
|
104
|
+
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
105
|
+
import "../../shared-utils/five/initialCSS3DRender.js";
|
|
106
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
107
|
+
import "../../Sculpt/Meshes/Line.js";
|
|
108
|
+
import "../../Sculpt/typings/style.js";
|
|
109
|
+
import "../../shared-utils/tag.js";
|
|
110
|
+
import "../../shared-utils/five/vector3ToScreen.js";
|
|
111
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
112
|
+
import "../../shared-utils/isTouchDevice.js";
|
|
113
|
+
import "../../shared-utils/five/getPosition.js";
|
|
114
|
+
import "../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
40
115
|
import "../../shared-utils/three/generatePolygonGeometry.js";
|
|
41
116
|
import "../../shared-utils/three/earcut3D.js";
|
|
42
117
|
import "earcut";
|
|
43
118
|
import "../../shared-utils/three/getNormal.js";
|
|
44
119
|
const E = () => !1;
|
|
45
|
-
class
|
|
46
|
-
constructor(
|
|
47
|
-
super(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
120
|
+
class Ke extends U {
|
|
121
|
+
constructor(t) {
|
|
122
|
+
super(t);
|
|
123
|
+
o(this, "type", "watch");
|
|
124
|
+
o(this, "deleteDom");
|
|
125
|
+
o(this, "choose");
|
|
51
126
|
// tmd 真没时间改了,先这样吧,理解万岁
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var
|
|
127
|
+
o(this, "highlightedLines", []);
|
|
128
|
+
o(this, "highlightedArea");
|
|
129
|
+
o(this, "fiveElement");
|
|
130
|
+
o(this, "editPointState");
|
|
131
|
+
o(this, "hammer");
|
|
132
|
+
o(this, "onPanStart", (t) => {
|
|
133
|
+
var l;
|
|
59
134
|
if (this.model.getAllLines().length === 0 || !this.fiveElement)
|
|
60
135
|
return;
|
|
61
|
-
const i = C(
|
|
62
|
-
if (!
|
|
136
|
+
const i = C(t).point, e = (l = j(this.five, this.model.getAllPoints(), i, 20)) == null ? void 0 : l.point;
|
|
137
|
+
if (!e) {
|
|
63
138
|
this.editPointState = void 0;
|
|
64
139
|
return;
|
|
65
140
|
}
|
|
66
|
-
const n = this.model.polylines.find((a) => a.includes(
|
|
67
|
-
point:
|
|
141
|
+
const n = this.model.polylines.find((a) => a.includes(e)), m = {
|
|
142
|
+
point: e,
|
|
68
143
|
associatedLines: n.lines
|
|
69
144
|
};
|
|
70
145
|
this.hook.emit("wantsDragLine", {
|
|
71
|
-
point:
|
|
72
|
-
lines:
|
|
73
|
-
}) || (this.editPointState =
|
|
146
|
+
point: e.id,
|
|
147
|
+
lines: m.associatedLines.map(({ id: a }) => a)
|
|
148
|
+
}) || (this.editPointState = m, this.magnifier.appendTo(this.container), this.magnifier.enable(), this.group.add(this.mouseGroup));
|
|
74
149
|
});
|
|
75
|
-
|
|
76
|
-
this.editPointState && (this.editPointState.associatedLines.forEach((
|
|
150
|
+
o(this, "onPanEnd", () => {
|
|
151
|
+
this.editPointState && (this.editPointState.associatedLines.forEach((t) => t.mesh.setMaterial({ dashed: !1 })), this.highlightLines(this.editPointState.associatedLines), this.editPointState = void 0, this.magnifier.disable(), this.group.remove(this.mouseGroup));
|
|
77
152
|
});
|
|
78
|
-
|
|
153
|
+
o(this, "onPan", (t) => {
|
|
79
154
|
if (!this.editPointState || !this.fiveElement)
|
|
80
155
|
return;
|
|
81
|
-
const i = C(
|
|
82
|
-
|
|
83
|
-
const [n] = D(this.five).intersectRaycaster(
|
|
156
|
+
const i = C(t).ndcPoint, e = new M();
|
|
157
|
+
e.setFromCamera(i, this.five.camera);
|
|
158
|
+
const [n] = D(this.five).intersectRaycaster(e);
|
|
84
159
|
n && this.onIntersectionUpdate(n);
|
|
85
160
|
});
|
|
86
|
-
|
|
161
|
+
o(this, "onIntersectionUpdate", (t, i) => {
|
|
87
162
|
if (this.editPointState) {
|
|
88
|
-
if (this.clearHighlightLines(), this.editPointState.point.position.copy(
|
|
89
|
-
|
|
90
|
-
}), this.updateDistanceUI(), this.magnifier.renderWithPoint(
|
|
163
|
+
if (this.clearHighlightLines(), this.editPointState.point.position.copy(t.point), this.editPointState.associatedLines.forEach((e) => {
|
|
164
|
+
e.mesh.setPoints(e.points[0].position.clone(), e.points[1].position.clone()), e.lightMesh.setPoints(e.points[0].position.clone(), e.points[1].position.clone()), e.mesh.setMaterial({ dashed: !0 });
|
|
165
|
+
}), this.updateDistanceUI(), this.magnifier.renderWithPoint(t.point), this.mouseGroup.position.copy(t.point), i)
|
|
91
166
|
this.mouseGroup.quaternion.copy(i.quaternion);
|
|
92
|
-
else if (
|
|
93
|
-
const n =
|
|
94
|
-
this.mouseGroup.lookAt(
|
|
167
|
+
else if (t.face) {
|
|
168
|
+
const n = t.face.normal.clone().multiplyScalar(0.05), c = t.point.clone().add(n).clone().add(n);
|
|
169
|
+
this.mouseGroup.lookAt(c);
|
|
95
170
|
}
|
|
96
171
|
this.five.needsRender = !0, this.hook.emit(
|
|
97
172
|
"selectedChange",
|
|
98
|
-
this.editPointState.associatedLines.map((
|
|
173
|
+
this.editPointState.associatedLines.map((e) => e)
|
|
99
174
|
);
|
|
100
175
|
}
|
|
101
176
|
});
|
|
102
|
-
|
|
177
|
+
o(this, "wantsPanGesture", () => {
|
|
103
178
|
if (this.editPointState)
|
|
104
179
|
return !1;
|
|
105
180
|
});
|
|
106
|
-
|
|
181
|
+
o(this, "wantsTapGesture", (t) => {
|
|
107
182
|
var S;
|
|
108
|
-
const i = this.model.areas.map((
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const { x:
|
|
113
|
-
return this.chooseArea(
|
|
183
|
+
const i = this.model.areas.map((s) => t.intersectObject(s.polygon, !0)[0]).sort((s, r) => s.distance - r.distance), e = (S = i[0]) == null ? void 0 : S.object.parent;
|
|
184
|
+
if (e instanceof F) {
|
|
185
|
+
const s = this.model.areas.find((r) => r.polygon === e);
|
|
186
|
+
if (s) {
|
|
187
|
+
const { x: r, y: u } = i[0].point.clone().project(this.five.camera), d = `${(r + 1) / 2 * 100}%`, g = `${(-u + 1) / 2 * 100}%`;
|
|
188
|
+
return this.chooseArea(s, { left: d, top: g }), !1;
|
|
114
189
|
}
|
|
115
190
|
}
|
|
116
|
-
const n = D(this.five), [
|
|
117
|
-
if (!
|
|
191
|
+
const n = D(this.five), [m] = n.intersectRaycaster(t);
|
|
192
|
+
if (!m)
|
|
118
193
|
return;
|
|
119
|
-
const
|
|
120
|
-
const [
|
|
121
|
-
if (!w(
|
|
194
|
+
const c = this.five.camera, l = m.point.clone().project(c), a = this.container.clientWidth, f = this.container.clientHeight, P = new L(l.x * a, l.y * f), v = this.model.getAllLines().map((s) => {
|
|
195
|
+
const [r, u] = s.points, d = r.position.clone().project(c), g = u.position.clone().project(c);
|
|
196
|
+
if (!w(d) && !w(g))
|
|
122
197
|
return null;
|
|
123
|
-
const H = new L(
|
|
124
|
-
return { id:
|
|
125
|
-
}).filter((
|
|
198
|
+
const H = new L(d.x * a, d.y * f), k = new L(g.x * a, g.y * f);
|
|
199
|
+
return { id: s.id, points: [H, k] };
|
|
200
|
+
}).filter((s) => !!s);
|
|
126
201
|
if (v.length === 0)
|
|
127
202
|
return;
|
|
128
|
-
const y = v.map((
|
|
129
|
-
const
|
|
130
|
-
return { id:
|
|
131
|
-
}).sort((
|
|
203
|
+
const y = v.map((s) => {
|
|
204
|
+
const r = b(P, s.points);
|
|
205
|
+
return { id: s.id, distance: r.distanceTo(P) };
|
|
206
|
+
}).sort((s, r) => s.distance - r.distance)[0];
|
|
132
207
|
if (y.distance > 20)
|
|
133
208
|
return;
|
|
134
|
-
const A = this.model.getAllLines().find(({ id:
|
|
209
|
+
const A = this.model.getAllLines().find(({ id: s }) => s === y.id);
|
|
135
210
|
if (A)
|
|
136
211
|
return this.chooseLine(A), !1;
|
|
137
212
|
});
|
|
138
|
-
|
|
213
|
+
o(this, "chooseLine", (t) => {
|
|
139
214
|
this.choose = "line";
|
|
140
|
-
const i =
|
|
215
|
+
const i = t.getPolyline().lines;
|
|
141
216
|
this.deleteDom.setLines(i).updatePosition().show(), this.highlightLines(i), this.five.needsRender = !0, this.hook.emit(
|
|
142
217
|
"selectedChange",
|
|
143
|
-
i.map((
|
|
218
|
+
i.map((e) => e)
|
|
144
219
|
);
|
|
145
220
|
});
|
|
146
|
-
|
|
147
|
-
this.choose =
|
|
221
|
+
o(this, "chooseArea", (t, i) => {
|
|
222
|
+
this.choose = t, this.deleteDom.updatePosition(i.left, `calc(${i.top} - 20px)`).show(), this.highlightArea(t);
|
|
148
223
|
});
|
|
149
|
-
|
|
150
|
-
|
|
224
|
+
o(this, "polylineRemoved", (t) => {
|
|
225
|
+
t.lines.forEach((i) => this.removeLine(i)), this.hook.emit(
|
|
151
226
|
"selectedChange",
|
|
152
227
|
this.model.getAllLines().filter((i) => i.selected).map((i) => i)
|
|
153
228
|
);
|
|
154
229
|
});
|
|
155
|
-
|
|
230
|
+
o(this, "onCameraUpdate", () => {
|
|
156
231
|
this.updateDistanceUI(), this.highlightedLines.length > 0 && this.deleteDom.updatePosition();
|
|
157
232
|
});
|
|
158
|
-
|
|
159
|
-
this.unHighlightArea(
|
|
233
|
+
o(this, "deleteArea", (t) => {
|
|
234
|
+
this.unHighlightArea(t), t.dispose(), this.deleteDom.hide();
|
|
160
235
|
});
|
|
161
|
-
|
|
162
|
-
const
|
|
236
|
+
o(this, "deleteLine", () => {
|
|
237
|
+
const t = this.highlightedLines[0], i = this.model.getPolylineByLine(t);
|
|
163
238
|
i && (this.model.removePolyline(i), this.highlightedLines = [], this.deleteDom.setLines([]).hide());
|
|
164
239
|
});
|
|
165
|
-
|
|
240
|
+
o(this, "cancelDeleteClickCallback", () => {
|
|
166
241
|
this.deleteDom.hide(), this.clearHighlightLines(), this.unHighlightArea();
|
|
167
242
|
});
|
|
168
243
|
this.deleteDom = new T(this.five, {
|
|
@@ -171,49 +246,49 @@ class He extends U {
|
|
|
171
246
|
this.choose === "line" ? this.deleteLine() : this.choose instanceof x && this.deleteArea(this.choose);
|
|
172
247
|
},
|
|
173
248
|
cancel: this.cancelDeleteClickCallback
|
|
174
|
-
}).appendTo(this.container), this.model.getAllLines().forEach((
|
|
175
|
-
|
|
176
|
-
}), this.model.getAllAreas().forEach((
|
|
177
|
-
|
|
249
|
+
}).appendTo(this.container), this.model.getAllLines().forEach((e) => {
|
|
250
|
+
e.distanceItem.appendTo(this.container), e.distanceItem.update(this.five), e.hook.on("selected", this.chooseLine), e.distanceItem.setCanSelect(!0), this.group.add(e.mesh);
|
|
251
|
+
}), this.model.getAllAreas().forEach((e) => {
|
|
252
|
+
e.areaItem.appendTo(this.container), e.areaItem.updateArea(this.five), e.hook.on("selected", this.chooseArea), e.areaItem.setCanSelect(!0), this.group.add(e.polygon), e.polyline.lines.forEach((n) => {
|
|
178
253
|
n.distanceItem.appendTo(this.container), n.distanceItem.update(this.five), this.group.add(n.mesh);
|
|
179
254
|
});
|
|
180
255
|
});
|
|
181
256
|
const i = this.five.getElement();
|
|
182
257
|
if (i) {
|
|
183
258
|
this.fiveElement = i;
|
|
184
|
-
const
|
|
185
|
-
this.hammer =
|
|
259
|
+
const e = new G(i);
|
|
260
|
+
this.hammer = e, e.on("pan", this.onPan), e.on("panstart", this.onPanStart), e.on("panend", this.onPanEnd);
|
|
186
261
|
}
|
|
187
262
|
this.updateDistanceUI(), this.five.needsRender = !0, this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.on("wantsPanGesture", this.wantsPanGesture), this.five.on("wantsChangeMode", E), this.model.hook.on("polylineRemoved", this.polylineRemoved);
|
|
188
263
|
}
|
|
189
264
|
dispose() {
|
|
190
|
-
var
|
|
191
|
-
super.dispose(), this.deleteDom.dispose(), this.model.hook.off("polylineRemoved", this.polylineRemoved), this.model.getAllLines().forEach((i) => i.hook.off("selected", this.chooseLine)), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.wantsPanGesture), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.off("wantsChangeMode", E), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (
|
|
265
|
+
var t;
|
|
266
|
+
super.dispose(), this.deleteDom.dispose(), this.model.hook.off("polylineRemoved", this.polylineRemoved), this.model.getAllLines().forEach((i) => i.hook.off("selected", this.chooseLine)), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.wantsPanGesture), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.off("wantsChangeMode", E), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (t = this.hammer) == null || t.destroy();
|
|
192
267
|
}
|
|
193
|
-
highlightLine(
|
|
194
|
-
|
|
268
|
+
highlightLine(t) {
|
|
269
|
+
t.selected || (t.selected = !0, this.group.add(t.lightMesh), t.distanceItem.highlight(), this.five.needsRender = !0);
|
|
195
270
|
}
|
|
196
271
|
clearHighlightLines() {
|
|
197
272
|
this.group.children.length !== 0 && (this.unHighlightLines(this.highlightedLines), this.highlightedLines = []);
|
|
198
273
|
}
|
|
199
|
-
highlightArea(
|
|
200
|
-
this.unHighlightLines(), this.unHighlightArea(), this.highlightLines(
|
|
274
|
+
highlightArea(t) {
|
|
275
|
+
this.unHighlightLines(), this.unHighlightArea(), this.highlightLines(t.polyline.lines), this.five.needsRender = !0;
|
|
201
276
|
}
|
|
202
|
-
unHighlightArea(
|
|
203
|
-
const i =
|
|
277
|
+
unHighlightArea(t) {
|
|
278
|
+
const i = t != null ? t : this.highlightedArea;
|
|
204
279
|
i && (this.unHighlightLines(i.polyline.lines), this.five.needsRender = !0);
|
|
205
280
|
}
|
|
206
|
-
highlightLines(
|
|
207
|
-
this.unHighlightLines(), this.highlightedLines =
|
|
281
|
+
highlightLines(t) {
|
|
282
|
+
this.unHighlightLines(), this.highlightedLines = t, t.forEach((i) => this.highlightLine(i));
|
|
208
283
|
}
|
|
209
|
-
unHighlightLines(
|
|
284
|
+
unHighlightLines(t) {
|
|
210
285
|
this.unHighlightArea();
|
|
211
|
-
const i =
|
|
212
|
-
i && i.forEach((
|
|
213
|
-
|
|
286
|
+
const i = t != null ? t : this.highlightedLines;
|
|
287
|
+
i && i.forEach((e) => {
|
|
288
|
+
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh), this.five.needsRender = !0;
|
|
214
289
|
});
|
|
215
290
|
}
|
|
216
291
|
}
|
|
217
292
|
export {
|
|
218
|
-
|
|
293
|
+
Ke as default
|
|
219
294
|
};
|