@realsee/dnalogel 3.50.17-alpha.0 → 3.51.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/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 +34866 -34775
- 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 +40 -1
- 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 +40 -1
- 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
- package/README.md +0 -116
|
@@ -10,7 +10,7 @@ var w = (d, a, e) => a in d ? x(d, a, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
O.call(a, e) && w(d, e, a[e]);
|
|
11
11
|
return d;
|
|
12
12
|
}, M = (d, a) => j(d, G(a));
|
|
13
|
-
var
|
|
13
|
+
var o = (d, a, e) => (w(d, typeof a != "symbol" ? a + "" : a, e), e);
|
|
14
14
|
import $ from "../Model/line.js";
|
|
15
15
|
import I from "../Model/point.js";
|
|
16
16
|
import { throttle as q } from "../../shared-utils/throttle.js";
|
|
@@ -52,7 +52,9 @@ import "../../shared-utils/Subscribe.js";
|
|
|
52
52
|
import "../../shared-utils/Utils/WorkUtil.js";
|
|
53
53
|
import "../../shared-utils/five/transformPosition.js";
|
|
54
54
|
import "../../shared-utils/three/temp.js";
|
|
55
|
+
import "../../shared-utils/three/core/Raycaster.js";
|
|
55
56
|
import "../../shared-utils/dom/resizeObserver.js";
|
|
57
|
+
import "../../shared-utils/five/fiveEveryReadyListener.js";
|
|
56
58
|
import "hammerjs";
|
|
57
59
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
58
60
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
@@ -62,22 +64,40 @@ import "../../shared-utils/three/core/Sphere.js";
|
|
|
62
64
|
import "animejs";
|
|
63
65
|
import "../../shared-utils/isNil.js";
|
|
64
66
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
67
|
+
import "../../Sculpt/Meshes/Polygon.js";
|
|
68
|
+
import "../../Sculpt/typings/style.js";
|
|
69
|
+
import "../../Sculpt/utils/three/ColoredMesh.js";
|
|
70
|
+
import "../../Sculpt/utils/Modules/Global.js";
|
|
71
|
+
import "../../Sculpt/utils/Modules/Cursor.js";
|
|
72
|
+
import "../../Object3DHelperPlugin/Controller.js";
|
|
73
|
+
import "../../base/BasePlugin.js";
|
|
74
|
+
import "../../shared-utils/url/absoluteUrl.js";
|
|
75
|
+
import "../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
76
|
+
import "../../Sculpt/utils/three/rayOnLine.js";
|
|
77
|
+
import "../../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
78
|
+
import "../../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
79
|
+
import "../../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
80
|
+
import "../../shared-utils/three/boundingBox.js";
|
|
81
|
+
import "../../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
82
|
+
import "../../shared-utils/Object3DHelper/utils/direction.js";
|
|
83
|
+
import "../../shared-utils/Object3DHelper/Constants/color.js";
|
|
84
|
+
import "../../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
85
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
86
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
87
|
+
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
88
|
+
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
89
|
+
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
90
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
91
|
+
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
92
|
+
import "../../shared-utils/three/getObjectVisible.js";
|
|
65
93
|
import "../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
66
94
|
import "../../shared-utils/three/Magnifier.js";
|
|
67
95
|
import "../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
68
96
|
import "../../shared-utils/three/Assets/index.js";
|
|
69
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
70
|
-
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
71
|
-
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
72
|
-
import "../../shared-utils/three/getObjectVisible.js";
|
|
73
97
|
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
74
98
|
import "../../shared-utils/five/initialCSS3DRender.js";
|
|
75
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
76
|
-
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
77
|
-
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
78
99
|
import "../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
79
100
|
import "../../Sculpt/Meshes/Line.js";
|
|
80
|
-
import "../../Sculpt/typings/style.js";
|
|
81
101
|
import "../../Sculpt/utils/removeAllTag.js";
|
|
82
102
|
import "../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
83
103
|
import "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
@@ -87,35 +107,64 @@ import "../../shared-utils/isTouchDevice.js";
|
|
|
87
107
|
import "../../shared-utils/five/getPosition.js";
|
|
88
108
|
import "../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
89
109
|
import "../../shared-utils/three/PointSelector/utils/contents.js";
|
|
110
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
111
|
+
import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
112
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
113
|
+
import "../../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
114
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
115
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
116
|
+
import "../../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
117
|
+
import "../../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
118
|
+
import "../../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
119
|
+
import "../../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
120
|
+
import "../../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
121
|
+
import "../../shared-utils/threex/domevents/index.js";
|
|
122
|
+
import "../../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
123
|
+
import "../../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
124
|
+
import "../../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
125
|
+
import "../../shared-utils/Object3DHelper/index.js";
|
|
126
|
+
import "../../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
127
|
+
import "../../shared-utils/math/rad2Deg.js";
|
|
128
|
+
import "../../shared-utils/math/deg2Rad.js";
|
|
129
|
+
import "../../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
130
|
+
import "../../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
131
|
+
import "../../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
|
|
132
|
+
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
133
|
+
import "../../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
134
|
+
import "../../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
135
|
+
import "../../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
136
|
+
import "../../shared-utils/five/fiveModelLoad.js";
|
|
137
|
+
import "../../shared-utils/five/FiveDomEvents.js";
|
|
138
|
+
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
90
139
|
import "../Modules/DeleteDom/_Assets/delete.svg.js";
|
|
91
140
|
import "../Modules/DeleteDom/_Assets/delete_bg.png.js";
|
|
92
141
|
import "../Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
|
|
93
142
|
const b = () => !1;
|
|
94
|
-
class
|
|
143
|
+
class ui extends z {
|
|
95
144
|
constructor(e) {
|
|
96
145
|
super(e);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
146
|
+
o(this, "type", "edit");
|
|
147
|
+
o(this, "polyline");
|
|
148
|
+
o(this, "area");
|
|
149
|
+
o(this, "hasAppendDashed", !1);
|
|
101
150
|
// private deleteDom: DeleteDom
|
|
102
|
-
|
|
151
|
+
o(this, "fiveElement");
|
|
103
152
|
/** 上一个端点位置 */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
153
|
+
o(this, "lastPoint", null);
|
|
154
|
+
o(this, "pointSelector");
|
|
155
|
+
o(this, "deleteDom");
|
|
107
156
|
/** 根据 intersection 更新放大镜和吸附点 */
|
|
108
|
-
|
|
157
|
+
o(this, "onIntersectionUpdate", q((e, t) => {
|
|
109
158
|
this.currentMeasureType === "area" && typeof t == "boolean" && (t ? this.hook.emit("readyComplete") : this.hook.emit("notReadyComplete")), this.updateDashed();
|
|
110
159
|
}, 20));
|
|
111
160
|
/** 撤销编辑 */
|
|
112
|
-
|
|
161
|
+
o(this, "revoke", () => {
|
|
113
162
|
this.currentMeasureType === "area" ? this.revokeArea() : this.currentMeasureType === "line" && this.revokeLine();
|
|
114
163
|
});
|
|
115
164
|
/**
|
|
116
165
|
* @description: 测面积的撤销功能
|
|
117
166
|
*/
|
|
118
|
-
|
|
167
|
+
o(this, "revokeArea", () => {
|
|
119
168
|
if (this.area.points.length !== 0) {
|
|
120
169
|
if (this.area.popPoint(), this.hook.emit("pointsChange", this.area.points), this.area.points.length === 0) {
|
|
121
170
|
this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.remove(), this.five.needsRender = !0, this.hook.emit("revoke", { isEmpty: !0 });
|
|
@@ -128,7 +177,7 @@ class Lt extends z {
|
|
|
128
177
|
/**
|
|
129
178
|
* @description: 测距的撤销功能
|
|
130
179
|
*/
|
|
131
|
-
|
|
180
|
+
o(this, "revokeLine", (e) => {
|
|
132
181
|
const t = e || this.polyline;
|
|
133
182
|
if (t.lines.length === 0 && this.lastPoint) {
|
|
134
183
|
this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.remove(), this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.needsRender = !0, this.hook.emit("pointsChange", []);
|
|
@@ -139,21 +188,21 @@ class Lt extends z {
|
|
|
139
188
|
const i = t.lines[t.lines.length - 1], n = i.findAnotherPoint(this.lastPoint);
|
|
140
189
|
n && (this.lastPoint = n, this.hook.emit("anchorChange", n.position), this.group.remove(i.mesh), t.removeLine(i), i.distanceItem.remove(), this.updateDashed(), this.five.needsRender = !0);
|
|
141
190
|
});
|
|
142
|
-
|
|
191
|
+
o(this, "checkMouseLeave", (e) => {
|
|
143
192
|
e || (this.dashed.hide(), this.perpendicularDashed.hide(), this.area.hideArea());
|
|
144
193
|
});
|
|
145
194
|
/** 编辑线条发生改变时通知外部 */
|
|
146
|
-
|
|
195
|
+
o(this, "onLineChanged", () => {
|
|
147
196
|
this.hook.emit("editedPolylineChange", this.polyline);
|
|
148
197
|
});
|
|
149
|
-
|
|
198
|
+
o(this, "onWantsSelect", () => {
|
|
150
199
|
if (this.currentMeasureType === "area") {
|
|
151
200
|
const e = this.area.polygon.isBlank || this.area.polygon.visible === !1;
|
|
152
201
|
if (this.area.points.length >= 3 && e)
|
|
153
202
|
return !1;
|
|
154
203
|
}
|
|
155
204
|
});
|
|
156
|
-
|
|
205
|
+
o(this, "wantsMoveToPano", () => {
|
|
157
206
|
if (this.lastPoint)
|
|
158
207
|
return !1;
|
|
159
208
|
});
|
|
@@ -162,13 +211,13 @@ class Lt extends z {
|
|
|
162
211
|
* 2. 把上一个点的位置更新为当前点的位置
|
|
163
212
|
* 3. 清除 pointSelector
|
|
164
213
|
*/
|
|
165
|
-
|
|
166
|
-
var
|
|
214
|
+
o(this, "onSelect", () => {
|
|
215
|
+
var p, m, u, y;
|
|
167
216
|
this.hasAppendDashed || (this.dashed.distanceItem.appendTo(this.container), this.group.add(this.dashed.mesh), this.currentMeasureType === "area" && this.group.add(this.perpendicularDashed.mesh)), this.hasAppendDashed = !0;
|
|
168
217
|
const e = (() => {
|
|
169
|
-
var
|
|
218
|
+
var s, h;
|
|
170
219
|
if (this.currentMeasureType === "area")
|
|
171
|
-
return this.area.projectPoint((
|
|
220
|
+
return this.area.projectPoint((s = this.pointSelector.position) == null ? void 0 : s.point);
|
|
172
221
|
if (this.currentMeasureType === "line")
|
|
173
222
|
return (h = this.pointSelector.position) == null ? void 0 : h.point;
|
|
174
223
|
})();
|
|
@@ -178,20 +227,20 @@ class Lt extends z {
|
|
|
178
227
|
if (i != null && i.position && t.position.equals(i == null ? void 0 : i.position))
|
|
179
228
|
return;
|
|
180
229
|
this.lastPoint = t;
|
|
181
|
-
const n = (
|
|
230
|
+
const n = (s) => {
|
|
182
231
|
if (!this.lastPoint)
|
|
183
232
|
return [];
|
|
184
|
-
const { intersection: h, pointSelectorInstance: L } =
|
|
185
|
-
if (
|
|
233
|
+
const { intersection: h, pointSelectorInstance: L } = s, g = L.pointSelectorHelper.pointHelper, c = new f.Vector3(0, 0, 1).applyQuaternion(g.quaternion);
|
|
234
|
+
if (c.x > 0.9999 || c.y > 0.9999 || c.z > 0.9999 || c.x < -0.9999 || c.y < -0.9999 || c.z < -0.9999) {
|
|
186
235
|
const S = h.point, v = this.lastPoint.position.clone().sub(S);
|
|
187
236
|
L.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 });
|
|
188
237
|
const r = new f.Line3(
|
|
189
238
|
g.localToWorld(new f.Vector3(1, 0, 0)).add(v),
|
|
190
239
|
g.localToWorld(new f.Vector3(-1, 0, 0)).add(v)
|
|
191
|
-
),
|
|
240
|
+
), l = new f.Line3(
|
|
192
241
|
g.localToWorld(new f.Vector3(0, 1, 0)).add(v),
|
|
193
242
|
g.localToWorld(new f.Vector3(0, -1, 0)).add(v)
|
|
194
|
-
), A = r.closestPointToPoint(S, !1, new f.Vector3()), P =
|
|
243
|
+
), A = r.closestPointToPoint(S, !1, new f.Vector3()), P = l.closestPointToPoint(S, !1, new f.Vector3());
|
|
195
244
|
return [A, P];
|
|
196
245
|
}
|
|
197
246
|
return [];
|
|
@@ -201,8 +250,8 @@ class Lt extends z {
|
|
|
201
250
|
const h = new $(i, t, this.model);
|
|
202
251
|
h.distanceItem.setCanSelect(!1), h.distanceItem.appendTo(this.container), this.polyline.addLine(h), this.group.add(h.mesh), h.distanceItem.update(this.five);
|
|
203
252
|
}
|
|
204
|
-
const
|
|
205
|
-
typeof
|
|
253
|
+
const s = (m = (p = this.editParams) == null ? void 0 : p.autoEndConfig) == null ? void 0 : m.line;
|
|
254
|
+
typeof s == "number" && (this.polyline.getPointLength() >= s ? this.complete() : this.polyline.getPointLength() === s - 1 && this.hook.emit("readyComplete")), this.hook.emit("pointsChange", this.polyline.points);
|
|
206
255
|
} else if (this.currentMeasureType === "area") {
|
|
207
256
|
if (this.area.addPoints(t.position), this.area.isClosed) {
|
|
208
257
|
this.complete();
|
|
@@ -212,26 +261,26 @@ class Lt extends z {
|
|
|
212
261
|
var L;
|
|
213
262
|
return [this.area.points[0], ...(L = n(...h)) != null ? L : []];
|
|
214
263
|
});
|
|
215
|
-
const
|
|
216
|
-
typeof
|
|
264
|
+
const s = (y = (u = this.editParams) == null ? void 0 : u.autoEndConfig) == null ? void 0 : y.area;
|
|
265
|
+
typeof s == "number" && (this.area.points.length >= s ? this.complete() : this.area.points.length === s - 1 && this.hook.emit("readyComplete")), this.hook.emit("pointsChange", this.area.points);
|
|
217
266
|
}
|
|
218
267
|
this.updateDashed(), this.five.needsRender = !0, this.hook.emit("anchorChange", t.position);
|
|
219
268
|
});
|
|
220
269
|
/** 移动全景时更新 distanceItem 在屏幕上的位置 */
|
|
221
|
-
|
|
270
|
+
o(this, "onCameraUpdate", () => {
|
|
222
271
|
this.updateDistanceUI();
|
|
223
272
|
});
|
|
224
273
|
/** 更新虚线 */
|
|
225
|
-
|
|
274
|
+
o(this, "updateDashed", () => {
|
|
226
275
|
var i;
|
|
227
276
|
if (!this.lastPoint)
|
|
228
277
|
return;
|
|
229
278
|
const e = this.lastPoint.position, t = (() => {
|
|
230
|
-
var n,
|
|
279
|
+
var n, p;
|
|
231
280
|
if (this.currentMeasureType === "area")
|
|
232
281
|
return this.area.projectPoint((n = this.pointSelector.position) == null ? void 0 : n.point);
|
|
233
282
|
if (this.currentMeasureType === "line")
|
|
234
|
-
return (
|
|
283
|
+
return (p = this.pointSelector.position) == null ? void 0 : p.point;
|
|
235
284
|
})();
|
|
236
285
|
if (!t) {
|
|
237
286
|
this.dashed.hide();
|
|
@@ -241,17 +290,17 @@ class Lt extends z {
|
|
|
241
290
|
if (this.area.areaItem.setCanSelect(!1), this.area.points.length >= 2) {
|
|
242
291
|
const n = (i = this.pointSelector.position) == null ? void 0 : i.point;
|
|
243
292
|
if (n) {
|
|
244
|
-
const
|
|
245
|
-
this.perpendicularDashed.setPoints(
|
|
293
|
+
const s = n, h = t;
|
|
294
|
+
this.perpendicularDashed.setPoints(s, h), this.perpendicularDashed.show();
|
|
246
295
|
} else
|
|
247
296
|
this.perpendicularDashed.hide();
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
297
|
+
const p = this.area.polyline.lines.map((s) => ({ start: s.points[0].position, end: s.points[1].position })), m = H({ start: e, end: t }, p), u = H({ start: t, end: this.area.points[0] }, p);
|
|
298
|
+
if (m || u)
|
|
250
299
|
this.area.hideArea(), this.hook.emit("allowAddPointStateChange", "forbid");
|
|
251
300
|
else {
|
|
252
301
|
this.area.showArea();
|
|
253
|
-
const
|
|
254
|
-
this.area.polygon.updatePoints(
|
|
302
|
+
const s = [...this.area.points, t];
|
|
303
|
+
this.area.polygon.updatePoints(s), this.area.areaItem.updateArea(this.five), this.hook.emit("allowAddPointStateChange", "allow");
|
|
255
304
|
}
|
|
256
305
|
} else
|
|
257
306
|
this.area.hideArea(), this.perpendicularDashed.hide();
|
|
@@ -259,23 +308,23 @@ class Lt extends z {
|
|
|
259
308
|
});
|
|
260
309
|
// ====================================================================================================================================
|
|
261
310
|
// 下面一堆高亮相关
|
|
262
|
-
|
|
311
|
+
o(this, "wantsTapGesture", (e) => {
|
|
263
312
|
var S, v;
|
|
264
313
|
if (this.editParams.pointSelectorMode === "cursor" || this.lastPoint)
|
|
265
314
|
return !1;
|
|
266
|
-
const t = this.model.areas.map((r) => e.intersectObject(r.polygon, !0)[0]).sort((r,
|
|
315
|
+
const t = this.model.areas.map((r) => e.intersectObject(r.polygon, !0)[0]).sort((r, l) => r.distance - l.distance), i = (v = (S = t[0]) == null ? void 0 : S.object) == null ? void 0 : v.parent;
|
|
267
316
|
if (i != null && i.isPolygonMesh) {
|
|
268
|
-
const r = this.model.areas.find((
|
|
317
|
+
const r = this.model.areas.find((l) => l.polygon === i);
|
|
269
318
|
if (r) {
|
|
270
|
-
const { x:
|
|
319
|
+
const { x: l, y: A } = t[0].point.clone().project(this.five.camera), P = `${(l + 1) / 2 * 100}%`, C = `${(-A + 1) / 2 * 100}%`;
|
|
271
320
|
return this.chooseArea(r, { left: P, top: C }), !1;
|
|
272
321
|
}
|
|
273
322
|
}
|
|
274
323
|
const [n] = X(this.five).intersectRaycaster(e);
|
|
275
324
|
if (!n)
|
|
276
325
|
return;
|
|
277
|
-
const
|
|
278
|
-
const [
|
|
326
|
+
const p = this.five.camera, m = n.point.clone().project(p), u = this.container.clientWidth, y = this.container.clientHeight, s = new T(m.x * u, m.y * y), h = this.model.getAllLines().map((r) => {
|
|
327
|
+
const [l, A] = r.points, P = l.position.clone().project(p), C = A.position.clone().project(p);
|
|
279
328
|
if (!U(P) && !U(C))
|
|
280
329
|
return null;
|
|
281
330
|
const V = new T(P.x * u, P.y * y), W = new T(C.x * u, C.y * y);
|
|
@@ -284,40 +333,40 @@ class Lt extends z {
|
|
|
284
333
|
if (h.length === 0)
|
|
285
334
|
return;
|
|
286
335
|
const g = h.map((r) => {
|
|
287
|
-
const
|
|
288
|
-
return { id: r.id, distance:
|
|
289
|
-
}).sort((r,
|
|
336
|
+
const l = Q(s, r.points);
|
|
337
|
+
return { id: r.id, distance: l.distanceTo(s) };
|
|
338
|
+
}).sort((r, l) => r.distance - l.distance)[0];
|
|
290
339
|
if (g.distance > 20)
|
|
291
340
|
return;
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
return this.chooseLine(
|
|
341
|
+
const c = this.model.getAllLines().find(({ id: r }) => r === g.id);
|
|
342
|
+
if (c)
|
|
343
|
+
return this.chooseLine(c), !1;
|
|
295
344
|
});
|
|
296
|
-
|
|
345
|
+
o(this, "chooseLine", (e) => {
|
|
297
346
|
const t = e.getPolyline().lines;
|
|
298
347
|
this.deleteDom.setTarget(t).setLines(t).updatePosition().show(), this.highlightLines(t), this.hook.emit("selectedChange", t);
|
|
299
348
|
});
|
|
300
|
-
|
|
349
|
+
o(this, "chooseArea", (e, t) => {
|
|
301
350
|
this.deleteDom.setTarget(e).updatePosition(t.left, `calc(${t.top} - 1.5rem)`).show(), this.highlightArea(e);
|
|
302
351
|
});
|
|
303
|
-
|
|
352
|
+
o(this, "deleteArea", (e) => {
|
|
304
353
|
this.unHighlightArea(e), e.dispose(), this.deleteDom.hide();
|
|
305
354
|
});
|
|
306
|
-
|
|
355
|
+
o(this, "deleteLine", (e) => {
|
|
307
356
|
const t = e[0], i = this.model.getPolylineByLine(t);
|
|
308
357
|
i && (this.model.removePolyline(i), i.lines.forEach((n) => this.removeLine(n)), this.deleteDom.setLines([]).hide());
|
|
309
358
|
});
|
|
310
359
|
this.fiveElement = this.five.getElement(), this.deleteDom = new N(this.five, {
|
|
311
360
|
i18n: this.config.i18n,
|
|
312
361
|
onClick: (t, i) => {
|
|
313
|
-
var
|
|
314
|
-
const n = i.type === "area",
|
|
315
|
-
n && this.deleteArea(i),
|
|
362
|
+
var m;
|
|
363
|
+
const n = i.type === "area", p = Array.isArray(i) && ((m = i[0]) == null ? void 0 : m.type) === "line";
|
|
364
|
+
n && this.deleteArea(i), p && this.deleteLine(i);
|
|
316
365
|
},
|
|
317
366
|
cancel: (t) => {
|
|
318
|
-
var
|
|
367
|
+
var p;
|
|
319
368
|
this.deleteDom.hide();
|
|
320
|
-
const i = t.type === "area", n = Array.isArray(t) && ((
|
|
369
|
+
const i = t.type === "area", n = Array.isArray(t) && ((p = t[0]) == null ? void 0 : p.type) === "line";
|
|
321
370
|
i && this.unHighlightArea(t), n && this.unHighlightLines(t);
|
|
322
371
|
}
|
|
323
372
|
}).appendTo(this.container), this.pointSelector = new F(this.five, M(k({}, this.pointSelectorConfig), {
|
|
@@ -371,5 +420,5 @@ class Lt extends z {
|
|
|
371
420
|
}
|
|
372
421
|
}
|
|
373
422
|
export {
|
|
374
|
-
|
|
423
|
+
ui as default
|
|
375
424
|
};
|