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