@realsee/dnalogel 3.43.0 → 3.44.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 +4 -0
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +4 -2
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +2 -1
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +6 -1
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +2 -0
- package/dist/Sculpt/Meshes/Line.d.ts +19 -1
- package/dist/Sculpt/utils/color.d.ts +1 -1
- package/dist/index.cjs.js +102 -68
- package/dist/index.js +7374 -7116
- package/dist/index.umd.js +106 -72
- package/dist/shared-utils/five/getPosition.d.ts +12 -4
- package/dist/shared-utils/five/initialCSS3DRender.d.ts +2 -0
- package/dist/shared-utils/math/deg2Rad.d.ts +1 -1
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -1
- package/dist/shared-utils/positionToVector3.d.ts +6 -6
- package/{libs/shared-utils/three/PointSelector.d.ts → dist/shared-utils/three/PointSelector/index.d.ts} +23 -7
- package/dist/shared-utils/three/{PointHelper.d.ts → PointSelector/utils/PointHelper.d.ts} +11 -3
- package/dist/shared-utils/three/PointSelector/utils/PointHelper2.d.ts +30 -0
- package/dist/shared-utils/three/{PointSelectorHelper.d.ts → PointSelector/utils/PointSelectorHelper.d.ts} +9 -10
- package/dist/shared-utils/three/PointSelector/utils/typing.d.ts +8 -0
- package/dist/shared-utils/three/index.d.ts +2 -3
- package/libs/AreaMakerPlugin/Controller.js +5 -18
- package/libs/AreaMakerPlugin/index.js +4 -17
- package/libs/AreaMakerPlugin/utils/Item.js +13 -26
- package/libs/CSS3DRenderPlugin/Controller.js +9 -6
- package/libs/CSS3DRenderPlugin/index.js +12 -9
- package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.js +6 -6
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +4 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +73 -56
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +11 -4
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +2 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +14 -14
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +4 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.js +13 -0
- package/libs/CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js +85 -0
- package/libs/CruisePlugin/BaseController.js +20 -33
- package/libs/CruisePlugin/Move.js +25 -23
- package/libs/CruisePlugin/Work.js +10 -8
- package/libs/CruisePlugin/index.js +23 -21
- package/libs/CurrentPanoImagePlugin/Controller.js +30 -43
- package/libs/CurrentPanoImagePlugin/index.js +5 -18
- package/libs/GuideLinePlugin/Controller.js +15 -13
- package/libs/GuideLinePlugin/GuideLineItem.js +19 -17
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +4 -5
- package/libs/GuideLinePlugin/GuideLineModeItem.js +21 -19
- package/libs/GuideLinePlugin/index.js +23 -21
- package/libs/ModelMakerPlugin/Controller.js +19 -30
- package/libs/ModelMakerPlugin/index.js +11 -22
- package/libs/ModelTVVideoPlugin/Plugin.js +13 -10
- package/libs/ModelTVVideoPlugin/index.js +12 -9
- package/libs/Object3DHelperPlugin/Controller.js +7 -5
- package/libs/Object3DHelperPlugin/index.js +23 -21
- package/libs/PanoCompassPlugin/Controller.js +18 -15
- package/libs/PanoCompassPlugin/index.js +21 -18
- package/libs/PanoDoorLabelPlugin/BaseController.js +24 -37
- package/libs/PanoDoorLabelPlugin/Controller.js +56 -69
- package/libs/PanoDoorLabelPlugin/index.js +5 -18
- package/libs/PanoMeasurePlugin/Components/Controller0.js +40 -47
- package/libs/PanoMeasurePlugin/Components/Controller1.js +72 -79
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +6 -1
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +53 -39
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +177 -153
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +60 -74
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +59 -60
- package/libs/PanoMeasurePlugin/Model/area.js +30 -44
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +3 -16
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +42 -49
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -1
- package/libs/PanoMeasurePlugin/index.js +35 -40
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +23 -36
- package/libs/PanoSpatialTagPlugin/Plugin.js +41 -38
- package/libs/PanoSpatialTagPlugin/index.js +10 -7
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +29 -43
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +55 -69
- package/libs/PanoTagPlugin/Components/Tag/index.js +9 -19
- package/libs/PanoTagPlugin/Components/TagContainer.js +42 -52
- package/libs/PanoTagPlugin/Components/TagItem.js +9 -19
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +23 -33
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +29 -39
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +11 -21
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +18 -28
- package/libs/PanoTagPlugin/controller/TagRender.js +18 -16
- package/libs/PanoTagPlugin/controller/TagUtil.js +12 -9
- package/libs/PanoTagPlugin/controller/index.js +27 -25
- package/libs/PanoTagPlugin/index.js +28 -26
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +43 -57
- package/libs/PanoVideoPlugin/Controller.js +52 -65
- package/libs/PanoVideoPlugin/VideoMeshController.js +11 -25
- package/libs/PanoVideoPlugin/index.js +8 -21
- package/libs/PipelinePlugin/Controller.js +44 -57
- package/libs/PipelinePlugin/index.js +5 -18
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +20 -34
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +16 -30
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +39 -53
- package/libs/Sculpt/Meshes/Box.js +3 -3
- package/libs/Sculpt/Meshes/Cylinder.js +14 -14
- package/libs/Sculpt/Meshes/Line.d.ts +19 -1
- package/libs/Sculpt/Meshes/Line.js +40 -41
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -6
- package/libs/Sculpt/Meshes/Point.js +3 -3
- package/libs/Sculpt/Meshes/Polyline.js +3 -3
- package/libs/Sculpt/Meshes/Prism.js +11 -12
- package/libs/Sculpt/Meshes/Rectangle.js +3 -3
- package/libs/Sculpt/Objects/Point/Editor.js +10 -10
- package/libs/Sculpt/Objects/Polygon/Editor.js +6 -6
- package/libs/Sculpt/Objects/Polyline/Editor.js +4 -4
- package/libs/Sculpt/index.js +3 -3
- package/libs/Sculpt/utils/Modules/Global.js +1 -1
- package/libs/Sculpt/utils/color.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -3
- package/libs/base/BasePlugin.js +4 -4
- package/libs/floorplan/Components/Compass.js +29 -31
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +9 -22
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +6 -19
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +5 -18
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +48 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -18
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +28 -41
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -18
- package/libs/floorplan/index.js +3 -3
- package/libs/index.js +140 -137
- package/libs/shared-utils/five/getPosition.d.ts +12 -4
- package/libs/shared-utils/five/getPosition.js +23 -23
- package/libs/shared-utils/five/index.js +2 -2
- package/libs/shared-utils/five/initialCSS3DRender.d.ts +2 -0
- package/libs/shared-utils/five/initialCSS3DRender.js +17 -0
- package/libs/shared-utils/five/lookObject.js +3 -3
- package/libs/shared-utils/index.js +38 -40
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/math/deg2Rad.d.ts +1 -1
- package/libs/shared-utils/math/rad2Deg.d.ts +1 -1
- package/libs/shared-utils/positionToVector3.d.ts +6 -6
- package/{dist/shared-utils/three/PointSelector.d.ts → libs/shared-utils/three/PointSelector/index.d.ts} +23 -7
- package/libs/shared-utils/three/{PointSelector.js → PointSelector/index.js} +54 -45
- package/libs/shared-utils/three/{PointHelper.d.ts → PointSelector/utils/PointHelper.d.ts} +11 -3
- package/libs/shared-utils/three/PointSelector/utils/PointHelper.js +95 -0
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.d.ts +30 -0
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.js +153 -0
- package/libs/shared-utils/three/{PointSelectorHelper.d.ts → PointSelector/utils/PointSelectorHelper.d.ts} +9 -10
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +60 -0
- package/libs/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.js +3 -4
- package/libs/shared-utils/three/PointSelector/utils/typing.d.ts +8 -0
- package/libs/shared-utils/three/index.d.ts +2 -3
- package/libs/shared-utils/three/index.js +3 -3
- package/package.json +3 -3
- package/dist/shared-utils/three/PointDomHelper.d.ts +0 -18
- package/libs/shared-utils/three/PointDomHelper.d.ts +0 -18
- package/libs/shared-utils/three/PointDomHelper.js +0 -62
- package/libs/shared-utils/three/PointHelper.js +0 -73
- package/libs/shared-utils/three/PointSelectorHelper.js +0 -52
- /package/dist/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.d.ts +0 -0
- /package/libs/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.d.ts +0 -0
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
1
|
+
var x = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var G = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var D = Object.getOwnPropertySymbols;
|
|
4
|
+
var B = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (p, a, e) => a in p ? x(p, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : p[a] = e, k = (p, a) => {
|
|
6
|
+
for (var e in a || (a = {}))
|
|
7
|
+
B.call(a, e) && w(p, e, a[e]);
|
|
8
|
+
if (D)
|
|
9
|
+
for (var e of D(a))
|
|
10
|
+
O.call(a, e) && w(p, e, a[e]);
|
|
11
|
+
return p;
|
|
12
|
+
}, M = (p, a) => j(p, G(a));
|
|
13
|
+
var s = (p, a, e) => (w(p, typeof a != "symbol" ? a + "" : a, e), e);
|
|
14
|
+
import $ from "../Model/line.js";
|
|
15
|
+
import I from "../Model/point.js";
|
|
16
|
+
import { throttle as q } from "../../shared-utils/throttle.js";
|
|
17
|
+
import z from "./BaseController.js";
|
|
18
|
+
import { Polyline as E } from "../Model/polyline.js";
|
|
19
|
+
import R from "../Model/area.js";
|
|
20
|
+
import H from "../utils/isIntersecting.js";
|
|
21
|
+
import { PointSelector as F } from "../../shared-utils/three/PointSelector/index.js";
|
|
22
|
+
import N from "../Modules/DeleteDom/index.js";
|
|
23
|
+
import * as f from "three";
|
|
24
|
+
import { Vector2 as T } from "three";
|
|
25
|
+
import U from "../utils/isNDCPointInScreen.js";
|
|
26
|
+
import { closestPointOnLine as Q } from "../utils/math.js";
|
|
27
|
+
import { getFiveModel as X } from "../../shared-utils/five/getFiveModel.js";
|
|
17
28
|
import "../../shared-utils/uuid.js";
|
|
18
29
|
import "../utils/line.js";
|
|
19
30
|
import "../../shared-utils/five/FiveLine.js";
|
|
@@ -33,83 +44,75 @@ import "../../shared-utils/three/getNormal.js";
|
|
|
33
44
|
import "../utils/dom/areaDom.js";
|
|
34
45
|
import "../../shared-utils/three/geometryUtil.js";
|
|
35
46
|
import "hammerjs";
|
|
36
|
-
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
37
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
38
|
-
import "../../shared-utils/positionToVector3.js";
|
|
39
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
40
47
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
41
|
-
import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
42
|
-
import "../../shared-utils/util.js";
|
|
43
|
-
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
44
|
-
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
45
|
-
import "../../shared-utils/Subscribe.js";
|
|
46
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
47
|
-
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
48
|
-
import "../../shared-utils/three/getObjectVisible.js";
|
|
49
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
50
|
-
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
51
|
-
import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
52
48
|
import "../../shared-utils/three/THREESphere.js";
|
|
53
49
|
import "animejs";
|
|
54
50
|
import "../../shared-utils/isNil.js";
|
|
55
|
-
import "../../
|
|
51
|
+
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
52
|
+
import "../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
56
53
|
import "../../shared-utils/three/Magnifier.js";
|
|
57
|
-
import "../../shared-utils/
|
|
54
|
+
import "../../shared-utils/Subscribe.js";
|
|
55
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
58
56
|
import "../../shared-utils/three/Assets/index.js";
|
|
59
|
-
import "../../
|
|
60
|
-
import "
|
|
61
|
-
import "../../CSS3DRenderPlugin/
|
|
62
|
-
import "../../
|
|
63
|
-
import "../../shared-utils/
|
|
64
|
-
import "../../shared-utils/five/
|
|
65
|
-
import "../../
|
|
66
|
-
import "../../
|
|
57
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
58
|
+
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
59
|
+
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
60
|
+
import "../../shared-utils/three/getObjectVisible.js";
|
|
61
|
+
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
62
|
+
import "../../shared-utils/five/initialCSS3DRender.js";
|
|
63
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
64
|
+
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
65
|
+
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
66
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
67
|
+
import "../../Sculpt/Meshes/Line.js";
|
|
68
|
+
import "../../Sculpt/utils/color.js";
|
|
69
|
+
import "../../shared-utils/positionToVector3.js";
|
|
70
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
67
71
|
import "../../shared-utils/isTouchDevice.js";
|
|
68
72
|
import "../../shared-utils/five/getPosition.js";
|
|
69
73
|
import "../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
70
74
|
import "../Modules/DeleteDom/_Assets/delete.svg.js";
|
|
71
75
|
import "../Modules/DeleteDom/_Assets/delete_bg.png.js";
|
|
72
76
|
import "../Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
|
|
73
|
-
const
|
|
74
|
-
class
|
|
77
|
+
const b = () => !1;
|
|
78
|
+
class ot extends z {
|
|
75
79
|
constructor(e) {
|
|
76
|
-
var t;
|
|
77
80
|
super(e);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
s(this, "type", "edit");
|
|
82
|
+
s(this, "polyline");
|
|
83
|
+
s(this, "area");
|
|
84
|
+
s(this, "hasAppendDashed", !1);
|
|
82
85
|
// private deleteDom: DeleteDom
|
|
83
|
-
|
|
86
|
+
s(this, "fiveElement");
|
|
84
87
|
/** 上一个端点位置 */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
s(this, "lastPoint", null);
|
|
89
|
+
s(this, "pointSelector");
|
|
90
|
+
s(this, "deleteDom");
|
|
88
91
|
/** 根据 intersection 更新放大镜和吸附点 */
|
|
89
|
-
|
|
92
|
+
s(this, "onIntersectionUpdate", q((e, t) => {
|
|
90
93
|
this.currentMeasureType === "area" && typeof t == "boolean" && (t ? this.hook.emit("readyComplete") : this.hook.emit("notReadyComplete")), this.updateDashed();
|
|
91
94
|
}, 20));
|
|
92
95
|
/** 撤销编辑 */
|
|
93
|
-
|
|
96
|
+
s(this, "revoke", () => {
|
|
94
97
|
this.currentMeasureType === "area" ? this.revokeArea() : this.currentMeasureType === "line" && this.revokeLine();
|
|
95
98
|
});
|
|
96
99
|
/**
|
|
97
100
|
* @description: 测面积的撤销功能
|
|
98
101
|
*/
|
|
99
|
-
|
|
102
|
+
s(this, "revokeArea", () => {
|
|
100
103
|
if (this.area.points.length !== 0) {
|
|
101
104
|
if (this.area.popPoint(), this.hook.emit("pointsChange", this.area.points), this.area.points.length === 0) {
|
|
102
105
|
this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.remove(), this.five.needsRender = !0, this.hook.emit("revoke", { isEmpty: !0 });
|
|
103
106
|
return;
|
|
104
107
|
} else
|
|
105
|
-
this.lastPoint = new
|
|
108
|
+
this.lastPoint = new I(this.area.points[this.area.points.length - 1]), this.updateDashed();
|
|
106
109
|
this.five.needsRender = !0;
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
112
|
/**
|
|
110
113
|
* @description: 测距的撤销功能
|
|
111
114
|
*/
|
|
112
|
-
|
|
115
|
+
s(this, "revokeLine", (e) => {
|
|
113
116
|
const t = e || this.polyline;
|
|
114
117
|
if (t.lines.length === 0 && this.lastPoint) {
|
|
115
118
|
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", []);
|
|
@@ -117,24 +120,24 @@ class st extends j {
|
|
|
117
120
|
}
|
|
118
121
|
if (t.lines.length === 0 && !this.lastPoint || !this.lastPoint)
|
|
119
122
|
return;
|
|
120
|
-
const i = t.lines[t.lines.length - 1],
|
|
121
|
-
|
|
123
|
+
const i = t.lines[t.lines.length - 1], n = i.findAnotherPoint(this.lastPoint);
|
|
124
|
+
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);
|
|
122
125
|
});
|
|
123
|
-
|
|
124
|
-
this.dashed.hide(), this.perpendicularDashed.hide(), this.area.hideArea();
|
|
126
|
+
s(this, "checkMouseLeave", (e) => {
|
|
127
|
+
e || (this.dashed.hide(), this.perpendicularDashed.hide(), this.area.hideArea());
|
|
125
128
|
});
|
|
126
129
|
/** 编辑线条发生改变时通知外部 */
|
|
127
|
-
|
|
130
|
+
s(this, "onLineChanged", () => {
|
|
128
131
|
this.hook.emit("editedPolylineChange", this.polyline);
|
|
129
132
|
});
|
|
130
|
-
|
|
133
|
+
s(this, "onWantsSelect", () => {
|
|
131
134
|
if (this.currentMeasureType === "area") {
|
|
132
135
|
const e = this.area.polygon.isBlank || this.area.polygon.visible === !1;
|
|
133
136
|
if (this.area.points.length >= 3 && e)
|
|
134
137
|
return !1;
|
|
135
138
|
}
|
|
136
139
|
});
|
|
137
|
-
|
|
140
|
+
s(this, "wantsMoveToPano", () => {
|
|
138
141
|
if (this.lastPoint)
|
|
139
142
|
return !1;
|
|
140
143
|
});
|
|
@@ -143,54 +146,76 @@ class st extends j {
|
|
|
143
146
|
* 2. 把上一个点的位置更新为当前点的位置
|
|
144
147
|
* 3. 清除 pointSelector
|
|
145
148
|
*/
|
|
146
|
-
|
|
147
|
-
var
|
|
149
|
+
s(this, "onSelect", () => {
|
|
150
|
+
var l, c, u, y;
|
|
148
151
|
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;
|
|
149
152
|
const e = (() => {
|
|
150
|
-
var
|
|
153
|
+
var o, h;
|
|
151
154
|
if (this.currentMeasureType === "area")
|
|
152
|
-
return this.area.projectPoint((
|
|
155
|
+
return this.area.projectPoint((o = this.pointSelector.position) == null ? void 0 : o.point);
|
|
153
156
|
if (this.currentMeasureType === "line")
|
|
154
|
-
return (
|
|
157
|
+
return (h = this.pointSelector.position) == null ? void 0 : h.point;
|
|
155
158
|
})();
|
|
156
159
|
if (!e)
|
|
157
160
|
return;
|
|
158
|
-
const t = new
|
|
159
|
-
if (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
161
|
+
const t = new I(e), i = this.lastPoint;
|
|
162
|
+
if (i != null && i.position && t.position.equals(i == null ? void 0 : i.position))
|
|
163
|
+
return;
|
|
164
|
+
this.lastPoint = t;
|
|
165
|
+
const n = (o) => {
|
|
166
|
+
if (!this.lastPoint)
|
|
167
|
+
return [];
|
|
168
|
+
const { intersection: h, pointSelectorInstance: L } = o, g = L.pointSelectorHelper.pointHelper, m = new f.Vector3(0, 0, 1).applyQuaternion(g.quaternion);
|
|
169
|
+
if (m.x > 0.9999 || m.y > 0.9999 || m.z > 0.9999 || m.x < -0.9999 || m.y < -0.9999 || m.z < -0.9999) {
|
|
170
|
+
const S = h.point, v = this.lastPoint.position.clone().sub(S);
|
|
171
|
+
L.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 });
|
|
172
|
+
const r = new f.Line3(
|
|
173
|
+
g.localToWorld(new f.Vector3(1, 0, 0)).add(v),
|
|
174
|
+
g.localToWorld(new f.Vector3(-1, 0, 0)).add(v)
|
|
175
|
+
), d = new f.Line3(
|
|
176
|
+
g.localToWorld(new f.Vector3(0, 1, 0)).add(v),
|
|
177
|
+
g.localToWorld(new f.Vector3(0, -1, 0)).add(v)
|
|
178
|
+
), A = r.closestPointToPoint(S, !1, new f.Vector3()), P = d.closestPointToPoint(S, !1, new f.Vector3());
|
|
179
|
+
return [A, P];
|
|
180
|
+
}
|
|
181
|
+
return [];
|
|
182
|
+
};
|
|
183
|
+
if (this.pointSelector.setAdherePoints(n), this.currentMeasureType === "line") {
|
|
184
|
+
if (t && i) {
|
|
185
|
+
const h = new $(i, t, this.model);
|
|
186
|
+
h.distanceItem.setCanSelect(!1), h.distanceItem.appendTo(this.container), this.polyline.addLine(h), this.group.add(h.mesh), h.distanceItem.update(this.five);
|
|
187
|
+
}
|
|
188
|
+
const o = (c = (l = this.editParams) == null ? void 0 : l.autoEndConfig) == null ? void 0 : c.line;
|
|
189
|
+
typeof o == "number" && (this.polyline.getPointLength() >= o ? this.complete() : this.polyline.getPointLength() === o - 1 && this.hook.emit("readyComplete")), this.hook.emit("pointsChange", this.polyline.points);
|
|
190
|
+
} else if (this.currentMeasureType === "area") {
|
|
191
|
+
if (this.area.addPoints(t.position), this.area.isClosed) {
|
|
192
|
+
this.complete();
|
|
193
|
+
return;
|
|
175
194
|
}
|
|
176
|
-
this.
|
|
195
|
+
this.area.points.length >= 3 && this.pointSelector.setAdherePoints((...h) => {
|
|
196
|
+
var L;
|
|
197
|
+
return [this.area.points[0], ...(L = n(...h)) != null ? L : []];
|
|
198
|
+
});
|
|
199
|
+
const o = (y = (u = this.editParams) == null ? void 0 : u.autoEndConfig) == null ? void 0 : y.area;
|
|
200
|
+
typeof o == "number" && (this.area.points.length >= o ? this.complete() : this.area.points.length === o - 1 && this.hook.emit("readyComplete")), this.hook.emit("pointsChange", this.area.points);
|
|
177
201
|
}
|
|
202
|
+
this.updateDashed(), this.five.needsRender = !0, this.hook.emit("anchorChange", t.position);
|
|
178
203
|
});
|
|
179
204
|
/** 移动全景时更新 distanceItem 在屏幕上的位置 */
|
|
180
|
-
|
|
205
|
+
s(this, "onCameraUpdate", () => {
|
|
181
206
|
this.updateDistanceUI();
|
|
182
207
|
});
|
|
183
208
|
/** 更新虚线 */
|
|
184
|
-
|
|
209
|
+
s(this, "updateDashed", () => {
|
|
185
210
|
var i;
|
|
186
211
|
if (!this.lastPoint)
|
|
187
212
|
return;
|
|
188
213
|
const e = this.lastPoint.position, t = (() => {
|
|
189
|
-
var
|
|
214
|
+
var n, l;
|
|
190
215
|
if (this.currentMeasureType === "area")
|
|
191
|
-
return this.area.projectPoint((
|
|
216
|
+
return this.area.projectPoint((n = this.pointSelector.position) == null ? void 0 : n.point);
|
|
192
217
|
if (this.currentMeasureType === "line")
|
|
193
|
-
return (
|
|
218
|
+
return (l = this.pointSelector.position) == null ? void 0 : l.point;
|
|
194
219
|
})();
|
|
195
220
|
if (!t) {
|
|
196
221
|
this.dashed.hide();
|
|
@@ -198,19 +223,19 @@ class st extends j {
|
|
|
198
223
|
}
|
|
199
224
|
if (this.dashed.show(), this.dashed.setPoints(e, t), this.dashed.distanceItem.update(this.five), this.hook.emit("editedDashedLineChange", this.dashed), this.currentMeasureType === "area")
|
|
200
225
|
if (this.area.areaItem.setCanSelect(!1), this.area.points.length >= 2) {
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
this.perpendicularDashed.setPoints(
|
|
226
|
+
const n = (i = this.pointSelector.position) == null ? void 0 : i.point;
|
|
227
|
+
if (n) {
|
|
228
|
+
const o = n, h = t;
|
|
229
|
+
this.perpendicularDashed.setPoints(o, h), this.perpendicularDashed.show();
|
|
205
230
|
} else
|
|
206
231
|
this.perpendicularDashed.hide();
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
232
|
+
const l = this.area.polyline.lines.map((o) => ({ start: o.points[0].position, end: o.points[1].position })), c = H({ start: e, end: t }, l), u = H({ start: t, end: this.area.points[0] }, l);
|
|
233
|
+
if (c || u)
|
|
209
234
|
this.area.hideArea(), this.hook.emit("allowAddPointStateChange", "forbid");
|
|
210
235
|
else {
|
|
211
236
|
this.area.showArea();
|
|
212
|
-
const
|
|
213
|
-
this.area.polygon.updatePoints(
|
|
237
|
+
const o = [...this.area.points, t];
|
|
238
|
+
this.area.polygon.updatePoints(o), this.area.areaItem.updateArea(this.five), this.hook.emit("allowAddPointStateChange", "allow");
|
|
214
239
|
}
|
|
215
240
|
} else
|
|
216
241
|
this.area.hideArea(), this.perpendicularDashed.hide();
|
|
@@ -218,88 +243,87 @@ class st extends j {
|
|
|
218
243
|
});
|
|
219
244
|
// ====================================================================================================================================
|
|
220
245
|
// 下面一堆高亮相关
|
|
221
|
-
|
|
222
|
-
var
|
|
246
|
+
s(this, "wantsTapGesture", (e) => {
|
|
247
|
+
var S, v;
|
|
223
248
|
if (this.editParams.pointSelectorMode === "cursor" || this.lastPoint)
|
|
224
249
|
return !1;
|
|
225
|
-
const t = this.model.areas.map((
|
|
250
|
+
const t = this.model.areas.map((r) => e.intersectObject(r.polygon, !0)[0]).sort((r, d) => r.distance - d.distance), i = (v = (S = t[0]) == null ? void 0 : S.object) == null ? void 0 : v.parent;
|
|
226
251
|
if (i != null && i.isPolygonMesh) {
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
const { x:
|
|
230
|
-
return this.chooseArea(
|
|
252
|
+
const r = this.model.areas.find((d) => d.polygon === i);
|
|
253
|
+
if (r) {
|
|
254
|
+
const { x: d, y: A } = t[0].point.clone().project(this.five.camera), P = `${(d + 1) / 2 * 100}%`, C = `${(-A + 1) / 2 * 100}%`;
|
|
255
|
+
return this.chooseArea(r, { left: P, top: C }), !1;
|
|
231
256
|
}
|
|
232
257
|
}
|
|
233
|
-
const [
|
|
234
|
-
if (!
|
|
258
|
+
const [n] = X(this.five).intersectRaycaster(e);
|
|
259
|
+
if (!n)
|
|
235
260
|
return;
|
|
236
|
-
const
|
|
237
|
-
const [
|
|
238
|
-
if (!
|
|
261
|
+
const l = this.five.camera, c = n.point.clone().project(l), u = this.container.clientWidth, y = this.container.clientHeight, o = new T(c.x * u, c.y * y), h = this.model.getAllLines().map((r) => {
|
|
262
|
+
const [d, A] = r.points, P = d.position.clone().project(l), C = A.position.clone().project(l);
|
|
263
|
+
if (!U(P) && !U(C))
|
|
239
264
|
return null;
|
|
240
|
-
const
|
|
241
|
-
return { id:
|
|
242
|
-
}).filter((
|
|
243
|
-
if (
|
|
265
|
+
const V = new T(P.x * u, P.y * y), W = new T(C.x * u, C.y * y);
|
|
266
|
+
return { id: r.id, points: [V, W] };
|
|
267
|
+
}).filter((r) => !!r);
|
|
268
|
+
if (h.length === 0)
|
|
244
269
|
return;
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
return { id:
|
|
248
|
-
}).sort((
|
|
249
|
-
if (
|
|
270
|
+
const g = h.map((r) => {
|
|
271
|
+
const d = Q(o, r.points);
|
|
272
|
+
return { id: r.id, distance: d.distanceTo(o) };
|
|
273
|
+
}).sort((r, d) => r.distance - d.distance)[0];
|
|
274
|
+
if (g.distance > 20)
|
|
250
275
|
return;
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
return this.chooseLine(
|
|
276
|
+
const m = this.model.getAllLines().find(({ id: r }) => r === g.id);
|
|
277
|
+
if (m)
|
|
278
|
+
return this.chooseLine(m), !1;
|
|
254
279
|
});
|
|
255
|
-
|
|
280
|
+
s(this, "chooseLine", (e) => {
|
|
256
281
|
const t = e.getPolyline().lines;
|
|
257
282
|
this.deleteDom.setTarget(t).setLines(t).updatePosition().show(), this.highlightLines(t), this.hook.emit("selectedChange", t);
|
|
258
283
|
});
|
|
259
|
-
|
|
284
|
+
s(this, "chooseArea", (e, t) => {
|
|
260
285
|
this.deleteDom.setTarget(e).updatePosition(t.left, `calc(${t.top} - 1.5rem)`).show(), this.highlightArea(e);
|
|
261
286
|
});
|
|
262
|
-
|
|
287
|
+
s(this, "deleteArea", (e) => {
|
|
263
288
|
this.unHighlightArea(e), e.dispose(), this.deleteDom.hide();
|
|
264
289
|
});
|
|
265
|
-
|
|
290
|
+
s(this, "deleteLine", (e) => {
|
|
266
291
|
const t = e[0], i = this.model.getPolylineByLine(t);
|
|
267
|
-
i && (this.model.removePolyline(i), i.lines.forEach((
|
|
292
|
+
i && (this.model.removePolyline(i), i.lines.forEach((n) => this.removeLine(n)), this.deleteDom.setLines([]).hide());
|
|
268
293
|
});
|
|
269
|
-
this.fiveElement = this.five.getElement(), this.deleteDom = new
|
|
294
|
+
this.fiveElement = this.five.getElement(), this.deleteDom = new N(this.five, {
|
|
270
295
|
i18n: this.config.i18n,
|
|
271
|
-
onClick: (
|
|
272
|
-
var
|
|
273
|
-
const
|
|
274
|
-
|
|
296
|
+
onClick: (t, i) => {
|
|
297
|
+
var c;
|
|
298
|
+
const n = i.type === "area", l = Array.isArray(i) && ((c = i[0]) == null ? void 0 : c.type) === "line";
|
|
299
|
+
n && this.deleteArea(i), l && this.deleteLine(i);
|
|
275
300
|
},
|
|
276
|
-
cancel: (
|
|
301
|
+
cancel: (t) => {
|
|
277
302
|
var l;
|
|
278
303
|
this.deleteDom.hide();
|
|
279
|
-
const
|
|
280
|
-
|
|
304
|
+
const i = t.type === "area", n = Array.isArray(t) && ((l = t[0]) == null ? void 0 : l.type) === "line";
|
|
305
|
+
i && this.unHighlightArea(t), n && this.unHighlightLines(t);
|
|
281
306
|
}
|
|
282
|
-
}).appendTo(this.container), this.pointSelector = new
|
|
307
|
+
}).appendTo(this.container), this.pointSelector = new F(this.five, M(k({}, this.pointSelectorConfig), {
|
|
283
308
|
mode: this.editParams.pointSelectorMode,
|
|
284
|
-
|
|
285
|
-
}), this.pointSelector.enable(), this.polyline = new
|
|
309
|
+
helper: k({ magnifierParams: this.magnifierParams, container: this.container }, this.pointSelectorConfig.helper)
|
|
310
|
+
})), this.pointSelector.enable(), this.polyline = new E({ model: this.model }), this.area = new R(void 0, {
|
|
286
311
|
five: this.five,
|
|
287
312
|
model: this.model,
|
|
288
313
|
meshContainer: this.group,
|
|
289
314
|
domContainer: this.container
|
|
290
|
-
}), this.model.addPolyline(this.polyline), this.model.addArea(this.area), this.model.getAllLines().forEach((
|
|
291
|
-
|
|
292
|
-
}), this.model.getAllAreas().forEach((
|
|
293
|
-
|
|
294
|
-
|
|
315
|
+
}), this.model.addPolyline(this.polyline), this.model.addArea(this.area), this.model.getAllLines().forEach((t) => {
|
|
316
|
+
t.distanceItem.appendTo(this.container), t.distanceItem.update(this.five), t.distanceItem.setCanSelect(!0), t.hook.on("selected", this.chooseLine), this.group.add(t.mesh);
|
|
317
|
+
}), this.model.getAllAreas().forEach((t) => {
|
|
318
|
+
t.areaItem.appendTo(this.container), t.areaItem.updateDomPosition(this.five), t.areaItem.setCanSelect(!0), t.hook.on("selected", this.chooseArea), this.group.add(t.polygon), t.polyline.lines.forEach((i) => {
|
|
319
|
+
i.distanceItem.appendTo(this.container), i.distanceItem.update(this.five), this.group.add(i.mesh);
|
|
295
320
|
});
|
|
296
|
-
}), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.on("wantsMoveToPano", this.wantsMoveToPano), this.five.on("wantsChangeMode",
|
|
321
|
+
}), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.on("wantsMoveToPano", this.wantsMoveToPano), this.five.on("wantsChangeMode", b), this.pointSelector.on("intersectionUpdate", this.onIntersectionUpdate), this.pointSelector.on("intersectionUpdate", this.checkMouseLeave), this.pointSelector.on("select", this.onSelect), this.pointSelector.on("wantsSelect", this.onWantsSelect), this.polyline.hook.on("lineAdded", this.onLineChanged), this.polyline.hook.on("lineRemoved", this.onLineChanged), this.five.helperVisible = !1, this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.refresh();
|
|
297
322
|
}
|
|
298
323
|
dispose() {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}), this.five.helperVisible = !0, this.pointSelector.disable(), this.dashed.remove(), this.perpendicularDashed.remove(), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.off("wantsMoveToPano", this.wantsMoveToPano), this.five.off("wantsChangeMode", M), this.pointSelector.hook.off("intersectionUpdate", this.onIntersectionUpdate), this.pointSelector.hook.off("select", this.onSelect), this.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.hook.off("lineRemoved", this.onLineChanged), (e = this.fiveElement) == null || e.removeEventListener("mouseleave", this.onMouseLeave), this.magnifier.dispose(), this.deleteDom.dispose(), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
|
|
324
|
+
super.dispose(), this.model.areas.forEach((e) => {
|
|
325
|
+
(e.points.length < 2 || e.polygon.isBlank) && this.model.removeArea(e);
|
|
326
|
+
}), this.five.helperVisible = !0, this.pointSelector.disable(), this.dashed.remove(), this.perpendicularDashed.remove(), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.off("wantsMoveToPano", this.wantsMoveToPano), this.five.off("wantsChangeMode", b), this.pointSelector.off("intersectionUpdate", this.onIntersectionUpdate), this.pointSelector.off("intersectionUpdate", this.checkMouseLeave), this.pointSelector.off("select", this.onSelect), this.pointSelector.off("wantsSelect", this.onWantsSelect), this.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.hook.off("lineRemoved", this.onLineChanged), this.magnifier.dispose(), this.deleteDom.dispose(), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
|
|
303
327
|
}
|
|
304
328
|
getEditingLines() {
|
|
305
329
|
return this.polyline.lines;
|
|
@@ -308,9 +332,9 @@ class st extends j {
|
|
|
308
332
|
this.onSelect();
|
|
309
333
|
}
|
|
310
334
|
complete() {
|
|
311
|
-
this.hook.emit("complete"), this.currentMeasureType === "area" ? (this.area.points.length < 3 ? this.deleteArea(this.area) : (this.area.showArea(), this.area.complete(), this.area.hook.on("selected", this.chooseArea)), this.area = new
|
|
335
|
+
this.hook.emit("complete"), this.currentMeasureType === "area" ? (this.area.points.length < 3 ? this.deleteArea(this.area) : (this.area.showArea(), this.area.complete(), this.area.hook.on("selected", this.chooseArea)), this.area = new R(void 0, { five: this.five, model: this.model, meshContainer: this.group, domContainer: this.container }), this.model.addArea(this.area)) : this.currentMeasureType === "line" && (this.polyline.lines.forEach((e) => {
|
|
312
336
|
e.hook.on("selected", this.chooseLine), e.distanceItem.setCanSelect(!0);
|
|
313
|
-
}), this.polyline = new
|
|
337
|
+
}), this.polyline = new E({ model: this.model }), this.model.addPolyline(this.polyline)), this.pointSelector.setAdherePoints(null), this.dashed.hide(), this.perpendicularDashed.hide(), this.lastPoint = void 0;
|
|
314
338
|
}
|
|
315
339
|
highlightArea(e) {
|
|
316
340
|
this.highlightLines(e.polyline.lines), this.five.needsRender = !0;
|
|
@@ -331,5 +355,5 @@ class st extends j {
|
|
|
331
355
|
}
|
|
332
356
|
}
|
|
333
357
|
export {
|
|
334
|
-
|
|
358
|
+
ot as default
|
|
335
359
|
};
|
|
@@ -27,7 +27,7 @@ import "../Modules/DeleteDom/_Assets/delete.svg.js";
|
|
|
27
27
|
import "../Modules/DeleteDom/_Assets/delete_bg.png.js";
|
|
28
28
|
import "../Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
|
|
29
29
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
30
|
-
import "
|
|
30
|
+
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
31
31
|
import "../../shared-utils/animationFrame/index.js";
|
|
32
32
|
import "../../shared-utils/noop.js";
|
|
33
33
|
import "../utils/mouseGroup.js";
|