@realsee/dnalogel 3.77.4 → 3.77.6
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 +20 -11
- package/dist/DigitalPerformancePlugin/controller/index.d.ts +224 -0
- package/dist/DigitalPerformancePlugin/core/DigitalHuman.d.ts +55 -0
- package/dist/DigitalPerformancePlugin/core/DigitalPlayground.d.ts +40 -0
- package/dist/DigitalPerformancePlugin/core/DigitalStateMachine.d.ts +150 -0
- package/dist/DigitalPerformancePlugin/core/Trace.d.ts +9 -0
- package/dist/DigitalPerformancePlugin/index.d.ts +11 -0
- package/dist/DigitalPerformancePlugin/mock.d.ts +76 -0
- package/dist/DigitalPerformancePlugin/typings/index.d.ts +79 -0
- package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/dist/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/dist/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/controller/index.d.ts +55 -2
- package/dist/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/dist/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/dist/index.cjs.js +188 -92
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17508 -14249
- package/dist/index.umd.js +184 -88
- package/libs/CruisePlugin/Move.js +7 -2
- package/libs/CruisePlugin/Work.js +7 -2
- package/libs/CruisePlugin/index.js +11 -6
- package/libs/DigitalPerformancePlugin/controller/index.d.ts +2 -2
- package/libs/DigitalPerformancePlugin/controller/index.js +164 -173
- package/libs/DigitalPerformancePlugin/core/DigitalHuman.d.ts +16 -6
- package/libs/DigitalPerformancePlugin/core/DigitalHuman.js +128 -102
- package/libs/DigitalPerformancePlugin/core/DigitalPlayground.d.ts +11 -5
- package/libs/DigitalPerformancePlugin/core/DigitalPlayground.js +84 -74
- package/libs/DigitalPerformancePlugin/core/DigitalStateMachine.d.ts +7 -0
- package/libs/DigitalPerformancePlugin/mock.d.ts +6 -0
- package/libs/DigitalPerformancePlugin/mock.js +272 -274
- package/libs/GuideLinePlugin/Controller.js +9 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +7 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +7 -2
- package/libs/GuideLinePlugin/index.js +11 -6
- package/libs/PanoTagPlugin/Components/TagItem.js +122 -122
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +320 -289
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.js +515 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.js +815 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.js +94 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.js +478 -0
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagUtil.js +19 -17
- package/libs/PanoTagPlugin/controller/index.d.ts +55 -2
- package/libs/PanoTagPlugin/controller/index.js +261 -148
- package/libs/PanoTagPlugin/index.js +16 -11
- package/libs/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -13
- package/libs/PanoTagPlugin/utils/index.js +29 -26
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.js +18 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.js +26 -14
- package/libs/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/libs/PanoTagPlugin/utils/tagPosition.js +49 -16
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.d.ts +1 -0
- package/libs/index.js +166 -150
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var y = Object.getOwnPropertySymbols;
|
|
3
|
+
var S = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var g = (s, r, t) => r in s ? f(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t, d = (s, r) => {
|
|
5
|
+
for (var t in r || (r = {}))
|
|
6
|
+
S.call(r, t) && g(s, t, r[t]);
|
|
7
|
+
if (y)
|
|
8
|
+
for (var t of y(r))
|
|
9
|
+
P.call(r, t) && g(s, t, r[t]);
|
|
10
|
+
return s;
|
|
11
|
+
};
|
|
12
|
+
var h = (s, r, t) => (g(s, typeof r != "symbol" ? r + "" : r, t), t);
|
|
13
|
+
var u = (s, r, t) => new Promise((o, i) => {
|
|
14
|
+
var e = (l) => {
|
|
15
|
+
try {
|
|
16
|
+
n(t.next(l));
|
|
17
|
+
} catch (c) {
|
|
18
|
+
i(c);
|
|
19
|
+
}
|
|
20
|
+
}, p = (l) => {
|
|
21
|
+
try {
|
|
22
|
+
n(t.throw(l));
|
|
23
|
+
} catch (c) {
|
|
24
|
+
i(c);
|
|
25
|
+
}
|
|
26
|
+
}, n = (l) => l.done ? o(l.value) : Promise.resolve(l.value).then(e, p);
|
|
27
|
+
n((t = t.apply(s, r)).next());
|
|
28
|
+
});
|
|
29
|
+
import { BaseTag as v } from "./BaseTag.js";
|
|
30
|
+
import * as a from "three";
|
|
31
|
+
import { Sculpt as b } from "../../../Sculpt/index.js";
|
|
32
|
+
import { Polygon as k } from "../../../Sculpt/Objects/Polygon/index.js";
|
|
33
|
+
import "../../../shared-utils/tag.js";
|
|
34
|
+
import "../../../vendor/hammerjs/hammer.js";
|
|
35
|
+
import "../../../shared-utils/three/PointSelector/index.js";
|
|
36
|
+
import "../../../shared-utils/three/CSS3DRenderer/index.js";
|
|
37
|
+
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
38
|
+
import { anyPositionToVector3 as m } from "../../../shared-utils/positionToVector3.js";
|
|
39
|
+
import "@realsee/five/line";
|
|
40
|
+
import "../../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
41
|
+
import "../../../shared-utils/three/core/Sphere.js";
|
|
42
|
+
import "../../../shared-utils/three/blink.js";
|
|
43
|
+
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
44
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
45
|
+
import "../../../vendor/earcut/src/earcut.js";
|
|
46
|
+
import { uuid as C } from "../../../shared-utils/uuid.js";
|
|
47
|
+
import "../../../shared-utils/five/FivePuppet.js";
|
|
48
|
+
import "../../../shared-utils/Subscribe.js";
|
|
49
|
+
import "../../utils/tag/calculateTagConfig.js";
|
|
50
|
+
import "../../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
51
|
+
import "../../../shared-utils/typescript/entries.js";
|
|
52
|
+
import "../../utils/tag/adaptConfig.js";
|
|
53
|
+
import "../../typings/tag/TagConfig.js";
|
|
54
|
+
import "@realsee/five";
|
|
55
|
+
import "../../../shared-utils/five/mode.js";
|
|
56
|
+
import "../../utils/tag/format.js";
|
|
57
|
+
import "../../../shared-utils/url/defaultUrls.js";
|
|
58
|
+
import "../../../shared-utils/three/centerPoint.js";
|
|
59
|
+
import "../../../shared-utils/util.js";
|
|
60
|
+
import "../../../shared-utils/isNil.js";
|
|
61
|
+
import "../../../shared-utils/vectorToCoordinate.js";
|
|
62
|
+
import "../../../shared-utils/formatRad.js";
|
|
63
|
+
import "../../../shared-utils/five/transformPosition.js";
|
|
64
|
+
import "../../../shared-utils/five/lookPoint.js";
|
|
65
|
+
import "../../../shared-utils/Utils/FiveUtil.js";
|
|
66
|
+
import "../../../shared-utils/Utils/BaseUtil.js";
|
|
67
|
+
import "../../../shared-utils/Utils/WorkUtil.js";
|
|
68
|
+
import "../../../shared-utils/five/getFiveModel.js";
|
|
69
|
+
import "../../utils/tagPosition.js";
|
|
70
|
+
import "../../utils/tag/tagCheck.js";
|
|
71
|
+
import "../../utils/checkRange.js";
|
|
72
|
+
import "../../../shared-utils/url/getUrl.js";
|
|
73
|
+
import "../../../shared-utils/five/getFloorIndex.js";
|
|
74
|
+
import "../../../shared-utils/safeObj.js";
|
|
75
|
+
import "../../utils/Cache.js";
|
|
76
|
+
import "../../../shared-utils/three/temp.js";
|
|
77
|
+
import "../../../shared-utils/three/core/Raycaster.js";
|
|
78
|
+
import "../../../shared-utils/promise/withResolvers.js";
|
|
79
|
+
import "../../../shared-utils/five/vector3ToScreen.js";
|
|
80
|
+
import "../../../shared-utils/dom/resizeObserver.js";
|
|
81
|
+
import "../../../shared-utils/five/fiveEveryReadyListener.js";
|
|
82
|
+
import "../../../shared-utils/throttle.js";
|
|
83
|
+
import "../../../shared-utils/five/fiveModelLoad.js";
|
|
84
|
+
import "../../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
85
|
+
import "../../../shared-utils/three/Magnifier.js";
|
|
86
|
+
import "../../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
87
|
+
import "../../../shared-utils/three/Assets/index.js";
|
|
88
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
89
|
+
import "../../../shared-utils/even.js";
|
|
90
|
+
import "../../../shared-utils/CSS3DRender/OpacityMesh.js";
|
|
91
|
+
import "../../../shared-utils/three/getObjectVisible.js";
|
|
92
|
+
import "../../../shared-utils/three/PointSelector/utils/html.js";
|
|
93
|
+
import "../../../shared-utils/CSS3DRender/index.js";
|
|
94
|
+
import "../../../shared-utils/CSS3DRender/CSS3DRenderer.js";
|
|
95
|
+
import "../../../shared-utils/createResizeObserver.js";
|
|
96
|
+
import "../../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
97
|
+
import "../../../Sculpt/Meshes/Line.js";
|
|
98
|
+
import "../../../Sculpt/typings/style.js";
|
|
99
|
+
import "../../../shared-utils/three/IObject3D.js";
|
|
100
|
+
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
101
|
+
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
102
|
+
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
103
|
+
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
104
|
+
import "../../../shared-utils/three/core/Line2.js";
|
|
105
|
+
import "../../../shared-utils/three/core/LineMaterial2.js";
|
|
106
|
+
import "../../../Sculpt/utils/unit.js";
|
|
107
|
+
import "../../../Sculpt/utils/renderDom.js";
|
|
108
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
109
|
+
import "../../../shared-utils/isTouchDevice.js";
|
|
110
|
+
import "../../../shared-utils/five/getPosition.js";
|
|
111
|
+
import "../../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
112
|
+
import "../../../shared-utils/three/PointSelector/utils/contents.js";
|
|
113
|
+
import "../../../Sculpt/utils/three/rayOnLine.js";
|
|
114
|
+
import "../../../vendor/animejs/lib/anime.es.js";
|
|
115
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
116
|
+
import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
117
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
118
|
+
import "../../../Sculpt/utils/Modules/Global.js";
|
|
119
|
+
import "../../../Sculpt/utils/Modules/Cursor.js";
|
|
120
|
+
import "../../../Sculpt/utils/Modules/DeleteButtonBgBorder.js";
|
|
121
|
+
import "../../../Sculpt/utils/Modules/DeleteIconSVG.js";
|
|
122
|
+
import "../../../Object3DHelperPlugin/Controller.js";
|
|
123
|
+
import "../../../base/BasePlugin.js";
|
|
124
|
+
import "../../../shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
125
|
+
import "../../../shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
126
|
+
import "../../../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
|
|
127
|
+
import "../../../shared-utils/three/boundingBox.js";
|
|
128
|
+
import "../../../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
|
|
129
|
+
import "../../../shared-utils/Object3DHelper/utils/direction.js";
|
|
130
|
+
import "../../../shared-utils/Object3DHelper/Constants/RenderOrder.js";
|
|
131
|
+
import "../../../shared-utils/Object3DHelper/Helper/Objects/CenterHandle.js";
|
|
132
|
+
import "../../../shared-utils/Object3DHelper/Constants/color.js";
|
|
133
|
+
import "../../../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
|
|
134
|
+
import "../../../shared-utils/Object3DHelper/utils/getPoseFromCamera.js";
|
|
135
|
+
import "../../../shared-utils/clamp.js";
|
|
136
|
+
import "../../../shared-utils/Object3DHelper/utils/getOrthographicCameraDirection.js";
|
|
137
|
+
import "../../../shared-utils/Object3DHelper/Helper/RotateHelper.js";
|
|
138
|
+
import "../../../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
|
|
139
|
+
import "../../../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
|
|
140
|
+
import "../../../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
|
|
141
|
+
import "../../../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
|
|
142
|
+
import "../../../shared-utils/Object3DHelper/utils/cameraHooks.js";
|
|
143
|
+
import "../../../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
|
|
144
|
+
import "../../../shared-utils/Object3DHelper/Controller/MoveController.js";
|
|
145
|
+
import "../../../shared-utils/Object3DHelper/Base/BaseController.js";
|
|
146
|
+
import "../../../shared-utils/Object3DHelper/utils/solidGuide.js";
|
|
147
|
+
import "../../../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
|
|
148
|
+
import "../../../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
|
|
149
|
+
import "../../../Object3DHelperPlugin/FiveControllerWrapper.js";
|
|
150
|
+
import "../../../shared-utils/Object3DHelper/index.js";
|
|
151
|
+
import "../../../shared-utils/Object3DHelper/Controller/RotateController.js";
|
|
152
|
+
import "../../../shared-utils/math/rad2Deg.js";
|
|
153
|
+
import "../../../shared-utils/math/deg2Rad.js";
|
|
154
|
+
import "../../../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
|
|
155
|
+
import "../../../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
|
|
156
|
+
import "../../../shared-utils/three/vectorIsEqual.js";
|
|
157
|
+
import "../../../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
|
|
158
|
+
import "../../../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
|
|
159
|
+
import "../../../shared-utils/Object3DHelper/Controller/ScaleController.js";
|
|
160
|
+
import "../../../shared-utils/three/getNormal.js";
|
|
161
|
+
import "../../../shared-utils/threex/domevents/index.js";
|
|
162
|
+
import "../../../shared-utils/five/FiveDomEvents.js";
|
|
163
|
+
import "../../../shared-utils/five/calculateThreeMouse.js";
|
|
164
|
+
import "../../../shared-utils/three/recurveFindObject.js";
|
|
165
|
+
import "../../../Sculpt/Objects/Polyline/index.js";
|
|
166
|
+
import "../../../Sculpt/Meshes/Polyline.js";
|
|
167
|
+
import "../../../Sculpt/Meshes/LineWithDots.js";
|
|
168
|
+
import "../../../Sculpt/Meshes/Point.js";
|
|
169
|
+
import "../../../shared-utils/three/closeVectors.js";
|
|
170
|
+
import "../../../Sculpt/Objects/Base/index.js";
|
|
171
|
+
import "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
172
|
+
import "../../../Sculpt/Objects/Polyline/Editor.js";
|
|
173
|
+
import "../../../Sculpt/Objects/Line/Editor.js";
|
|
174
|
+
import "../../../Sculpt/Objects/Base/Editor.js";
|
|
175
|
+
import "../../../shared-utils/three/vector3ToArray.js";
|
|
176
|
+
import "../../../Sculpt/Objects/Point/index.js";
|
|
177
|
+
import "../../../Sculpt/Objects/Point/Editor.js";
|
|
178
|
+
import "../../../Sculpt/Objects/Prism/index.js";
|
|
179
|
+
import "../../../Sculpt/Meshes/Prism.js";
|
|
180
|
+
import "../../../Sculpt/utils/three/ColoredMesh.js";
|
|
181
|
+
import "../../../shared-utils/three/core/PrismGeometry.js";
|
|
182
|
+
import "../../../shared-utils/three/core/polygonVertex.js";
|
|
183
|
+
import "../../../shared-utils/three/earcut3D.js";
|
|
184
|
+
import "../../../shared-utils/three/core/PrismAnimationGeometry.js";
|
|
185
|
+
import "../../../shared-utils/three/geometryUtil.js";
|
|
186
|
+
import "../../../Sculpt/Editors/PrismMeshEditor.js";
|
|
187
|
+
import "../../../Sculpt/Meshes/Area.js";
|
|
188
|
+
import "../../../Sculpt/Meshes/PolygonWithEdge.js";
|
|
189
|
+
import "../../../Sculpt/Meshes/Polygon.js";
|
|
190
|
+
import "../../../shared-utils/three/generatePolygonGeometry.js";
|
|
191
|
+
import "../../../PanoMeasurePlugin/utils/isIntersecting.js";
|
|
192
|
+
import "../../../Sculpt/Objects/Rectangle/index.js";
|
|
193
|
+
import "../../../Sculpt/Editors/RectangleMeshEditor.js";
|
|
194
|
+
import "../../../Sculpt/Meshes/Rectangle.js";
|
|
195
|
+
import "../../../Sculpt/utils/three/RectangleGeometry.js";
|
|
196
|
+
import "../../../Sculpt/Meshes/RectangleWithEdge.js";
|
|
197
|
+
import "../../../Sculpt/utils/sortPositionsByCameraPosition.js";
|
|
198
|
+
import "../../../Sculpt/Objects/Circle/index.js";
|
|
199
|
+
import "../../../Sculpt/Editors/CircleMeshEditor.js";
|
|
200
|
+
import "../../../Sculpt/Meshes/CircleWithEdge.js";
|
|
201
|
+
import "../../../Sculpt/Meshes/Circle.js";
|
|
202
|
+
import "../../../Sculpt/utils/radiusToSegments.js";
|
|
203
|
+
import "../../../Sculpt/Objects/Cylinder/index.js";
|
|
204
|
+
import "../../../Sculpt/Meshes/Cylinder.js";
|
|
205
|
+
import "../../../Sculpt/Editors/CylinderMeshEditor.js";
|
|
206
|
+
import "../../../Sculpt/Objects/Box/index.js";
|
|
207
|
+
import "../../../Sculpt/Editors/BoxMeshEditor.js";
|
|
208
|
+
import "../../../Sculpt/Meshes/Box.js";
|
|
209
|
+
import "../../../shared-utils/forReverseEach.js";
|
|
210
|
+
import "../../../Sculpt/Objects/Line/index.js";
|
|
211
|
+
import "../../../Sculpt/Objects/Polygon/Editor.js";
|
|
212
|
+
class Ii extends v {
|
|
213
|
+
constructor(t, o) {
|
|
214
|
+
super(t, o);
|
|
215
|
+
h(this, "tagStyle");
|
|
216
|
+
h(this, "clickEventDispose");
|
|
217
|
+
h(this, "domClickDispose");
|
|
218
|
+
h(this, "screenPosition", null);
|
|
219
|
+
this.tagStyle = o.style, this.initializeSculptPolygon(), this.updateVisible();
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 获取 Polygon 样式配置(合并用户配置和默认值)
|
|
223
|
+
*/
|
|
224
|
+
getPolygonStyle() {
|
|
225
|
+
var o, i, e, p, n, l;
|
|
226
|
+
const t = ((o = this.tagStyle) == null ? void 0 : o.boxOrPolygon) || {};
|
|
227
|
+
return {
|
|
228
|
+
color: (i = t.color) != null ? i : 16777215,
|
|
229
|
+
opacity: (e = t.opacity) != null ? e : 0.4,
|
|
230
|
+
lineColor: (n = (p = t.lineColor) != null ? p : t.color) != null ? n : 16777215,
|
|
231
|
+
lineWidth: (l = t.lineWidth) != null ? l : 1
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* 更新 Polygon 样式
|
|
236
|
+
*/
|
|
237
|
+
updatePolygonStyle() {
|
|
238
|
+
if (!this.polygonShape || !this.polygonShape.areaMesh)
|
|
239
|
+
return;
|
|
240
|
+
const t = this.getPolygonStyle();
|
|
241
|
+
this.polygonShape.areaMesh.setStyle(t);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* 更新标签数据
|
|
245
|
+
*/
|
|
246
|
+
set(t, o = !0) {
|
|
247
|
+
super.set(t, o), t.style && (this.tagStyle = d(d({}, this.tagStyle), t.style)), t.position && (this.polygonShape ? this.updateSculptPolygon() : this.initializeSculptPolygon()), t.style && this.polygonShape && this.updatePolygonStyle();
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* 获取多边形的所有角点(世界坐标)
|
|
251
|
+
*/
|
|
252
|
+
getCorners() {
|
|
253
|
+
return this.polygonShape ? this.polygonShape.areaMesh.points.map((t) => t.clone()) : [];
|
|
254
|
+
}
|
|
255
|
+
getCenter() {
|
|
256
|
+
const t = this.originPosition;
|
|
257
|
+
if (!t || t.length === 0)
|
|
258
|
+
return [0, 0, 0];
|
|
259
|
+
const o = new a.Vector3();
|
|
260
|
+
return t.forEach((i) => {
|
|
261
|
+
o.add(m(i));
|
|
262
|
+
}), o.divideScalar(t.length), o.toArray();
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* 计算多边形的法向量
|
|
266
|
+
* 使用前三个点来计算平面的法向量
|
|
267
|
+
*/
|
|
268
|
+
computeNormal() {
|
|
269
|
+
const t = this.position;
|
|
270
|
+
if (!t || t.length < 3)
|
|
271
|
+
return new a.Vector3(0, 1, 0);
|
|
272
|
+
const o = m(t[0]), i = m(t[1]), e = m(t[2]), p = new a.Vector3().subVectors(i, o), n = new a.Vector3().subVectors(e, o);
|
|
273
|
+
return new a.Vector3().crossVectors(p, n).normalize();
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* 初始化 Sculpt Polygon
|
|
277
|
+
*/
|
|
278
|
+
initializeSculptPolygon() {
|
|
279
|
+
if (this.polygonShape)
|
|
280
|
+
return;
|
|
281
|
+
const t = this.position;
|
|
282
|
+
if (!t || t.length < 3)
|
|
283
|
+
return;
|
|
284
|
+
const o = new b(this.five, void 0, {
|
|
285
|
+
magnifier: null
|
|
286
|
+
});
|
|
287
|
+
o.clear(), o.group.removeFromParent();
|
|
288
|
+
const i = t.map((n) => m(n)), e = this.getPolygonStyle(), p = new k(
|
|
289
|
+
{
|
|
290
|
+
id: C(),
|
|
291
|
+
type: "Polygon",
|
|
292
|
+
points: i,
|
|
293
|
+
style: e
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
defaultAction: !1,
|
|
297
|
+
occlusionVisibility: !0,
|
|
298
|
+
occlusionMode: "depthTest"
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
p.visible = this.visible, this.plugin.imagePlaneGroup.add(p), this.polygonShape = p, p.editor.hooks.on("objectUpdate", () => {
|
|
302
|
+
this.syncPolygonPositionFromSculpt();
|
|
303
|
+
}), p.editor.disable(), this.setupClickEvents();
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* 设置点击事件
|
|
307
|
+
*/
|
|
308
|
+
setupClickEvents() {
|
|
309
|
+
if (!this.polygonShape || this.config.clickable === !1) {
|
|
310
|
+
console.warn(
|
|
311
|
+
`[PolygonTag ${this.id}] Cannot setup click events: polygonShape=${!!this.polygonShape}, clickable=${this.config.clickable}`
|
|
312
|
+
);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
this.cleanupClickEvents();
|
|
316
|
+
const t = (o) => {
|
|
317
|
+
this.plugin.hooks.emit("click", { event: o, target: "TagPolygonModel", tag: this });
|
|
318
|
+
};
|
|
319
|
+
requestAnimationFrame(() => {
|
|
320
|
+
if (!this.polygonShape || !this.plugin.domEvents) {
|
|
321
|
+
console.warn(`[PolygonTag ${this.id}] Cannot bind click events: polygonShape or domEvents not available`);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this.clickEventDispose = this.addObjectClickHandler(this, this.polygonShape, t);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* 清理点击事件
|
|
329
|
+
*/
|
|
330
|
+
cleanupClickEvents() {
|
|
331
|
+
this.clickEventDispose && (this.clickEventDispose(), this.clickEventDispose = void 0);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* 更新 Sculpt Polygon 的数据
|
|
335
|
+
*/
|
|
336
|
+
updateSculptPolygon() {
|
|
337
|
+
if (!this.polygonShape)
|
|
338
|
+
return;
|
|
339
|
+
const t = this.position;
|
|
340
|
+
if (!t || t.length < 3)
|
|
341
|
+
return;
|
|
342
|
+
const o = t.map((i) => m(i));
|
|
343
|
+
this.polygonShape.setData({
|
|
344
|
+
points: o.map((i) => i.toArray()),
|
|
345
|
+
style: this.getPolygonStyle()
|
|
346
|
+
}), this.setupClickEvents();
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* 启用编辑器
|
|
350
|
+
* 用于编辑已存在的 Polygon
|
|
351
|
+
*/
|
|
352
|
+
editorEnable() {
|
|
353
|
+
return u(this, null, function* () {
|
|
354
|
+
if (!this.position) {
|
|
355
|
+
console.warn("[PolygonTag] Cannot enable editor without position. Call startDrawing() first.");
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
this.polygonShape || this.initializeSculptPolygon(), this.polygonShape && (this.polygonShape.visible = !0, this.polygonShape.editor.enable());
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* 禁用编辑器
|
|
363
|
+
*/
|
|
364
|
+
editorDisable() {
|
|
365
|
+
this.polygonShape && this.polygonShape.editor.disable();
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* 同步 Sculpt Polygon 的数据到 PolygonPosition
|
|
369
|
+
*/
|
|
370
|
+
syncPolygonPositionFromSculpt() {
|
|
371
|
+
if (!this.polygonShape)
|
|
372
|
+
return;
|
|
373
|
+
const i = this.polygonShape.data.points.map((e) => m(e)).map((e) => e.toArray());
|
|
374
|
+
this.position = i, this.hooks.emit("positionChanged", i);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* @description 点击事件处理
|
|
378
|
+
*/
|
|
379
|
+
onClick(t) {
|
|
380
|
+
t.target === "TagPolygonModel" && this.unfoldAndFoldOthers();
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* @description 展开自己,收起其他标签
|
|
384
|
+
*/
|
|
385
|
+
unfoldAndFoldOthers() {
|
|
386
|
+
if (this.isPopoverConfigEnabled())
|
|
387
|
+
return;
|
|
388
|
+
const t = this.can("fold"), o = this.can("unfold");
|
|
389
|
+
t && o && (this.state.unfolded = !this.state.unfolded, this.manuallyOperated = !0, this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), this.state.unfolded && this.plugin.tags.forEach((i) => {
|
|
390
|
+
i.id !== this.id && i.fold();
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* 展开标签详情
|
|
395
|
+
*/
|
|
396
|
+
unfold() {
|
|
397
|
+
this.isPopoverConfigEnabled() || this.setUnfold(!0);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* 折叠标签详情
|
|
401
|
+
*/
|
|
402
|
+
fold() {
|
|
403
|
+
this.isPopoverConfigEnabled() || this.setUnfold(!1);
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* 设置展开/折叠状态
|
|
407
|
+
*/
|
|
408
|
+
setUnfold(t) {
|
|
409
|
+
if (this.isPopoverConfigEnabled())
|
|
410
|
+
return;
|
|
411
|
+
const o = this.can("fold"), i = this.can("unfold");
|
|
412
|
+
o && i && (this.state.unfolded = t, this.hooks.emit(t ? "unfolded" : "folded"), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }));
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* 获取多边形的中心点
|
|
416
|
+
*/
|
|
417
|
+
getPolygonCenter() {
|
|
418
|
+
const t = this.position;
|
|
419
|
+
if (!t || t.length === 0)
|
|
420
|
+
return new a.Vector3();
|
|
421
|
+
const o = new a.Vector3();
|
|
422
|
+
return t.forEach((i) => {
|
|
423
|
+
const e = m(i);
|
|
424
|
+
o.add(e);
|
|
425
|
+
}), o.divideScalar(t.length), o;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* 更新屏幕位置(用于在 2D UI 中显示内容)
|
|
429
|
+
* 显示在 Polygon 最右侧的顶点位置
|
|
430
|
+
*/
|
|
431
|
+
updateScreenPosition() {
|
|
432
|
+
if (!this.currentVisible) {
|
|
433
|
+
this.screenPosition = null, this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const o = this.position;
|
|
437
|
+
if (!o || o.length === 0) {
|
|
438
|
+
this.screenPosition = null, this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
let i = m(o[0]);
|
|
442
|
+
o.forEach((p) => {
|
|
443
|
+
const n = m(p);
|
|
444
|
+
n.x > i.x && (i = n);
|
|
445
|
+
});
|
|
446
|
+
const e = i.clone().project(this.five.camera);
|
|
447
|
+
if (e.x < -1 || e.x > 1 || e.y < -1 || e.y > 1 || e.z < 0 || e.z > 1)
|
|
448
|
+
this.screenPosition = null;
|
|
449
|
+
else if (this.five.renderer) {
|
|
450
|
+
const p = this.five.renderer.getSize(new a.Vector2());
|
|
451
|
+
this.screenPosition = {
|
|
452
|
+
leftPx: (e.x + 1) / 2 * p.x,
|
|
453
|
+
topPx: (-e.y + 1) / 2 * p.y,
|
|
454
|
+
scale: 1
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* 应用可见性变化
|
|
461
|
+
*/
|
|
462
|
+
applyVisible() {
|
|
463
|
+
var t;
|
|
464
|
+
this.polygonShape && (this.plugin.imagePlaneGroup.children.includes(this.polygonShape) || (console.warn(`[PolygonTag ${this.id}] applyVisible: polygonShape not in imagePlaneGroup, re-adding...`, {
|
|
465
|
+
polygonShapeParent: ((t = this.polygonShape.parent) == null ? void 0 : t.name) || "null",
|
|
466
|
+
imagePlaneGroupChildren: this.plugin.imagePlaneGroup.children.length
|
|
467
|
+
}), this.polygonShape.parent && this.polygonShape.parent.remove(this.polygonShape), this.plugin.imagePlaneGroup.add(this.polygonShape)), this.polygonShape.visible = this.visible), this.updateScreenPosition();
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* 销毁标签
|
|
471
|
+
*/
|
|
472
|
+
dispose() {
|
|
473
|
+
this.cleanupClickEvents(), this.domClickDispose && (this.domClickDispose(), this.domClickDispose = void 0), this.polygonShape && (this.polygonShape.removeFromParent(), this.polygonShape = void 0);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
export {
|
|
477
|
+
Ii as PolygonTag
|
|
478
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TagObjectGroup, TagGLTFObjectGroup, ImagePlaneGroup, TagContentType, ElementRenderer, TagRendererMap, TagContentTypeMapping } from '../typings';
|
|
2
2
|
import type { TemporaryState } from '../typings';
|
|
3
|
-
import TagContainerSvelte from '../Components/TagContainer.svelte';
|
|
3
|
+
import type TagContainerSvelte from '../Components/TagContainer.svelte';
|
|
4
4
|
import type { Five } from '@realsee/five';
|
|
5
5
|
import { TagUtil } from './TagUtil';
|
|
6
6
|
export declare abstract class TagRender extends TagUtil {
|
|
@@ -2,19 +2,19 @@ var $ = Object.defineProperty, q = Object.defineProperties;
|
|
|
2
2
|
var z = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var S = Object.getOwnPropertySymbols;
|
|
4
4
|
var G = Object.prototype.hasOwnProperty, X = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var C = (a, n, e) => n in a ? $(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e, W = (a, n) => {
|
|
6
6
|
for (var e in n || (n = {}))
|
|
7
|
-
G.call(n, e) &&
|
|
7
|
+
G.call(n, e) && C(a, e, n[e]);
|
|
8
8
|
if (S)
|
|
9
9
|
for (var e of S(n))
|
|
10
|
-
X.call(n, e) &&
|
|
10
|
+
X.call(n, e) && C(a, e, n[e]);
|
|
11
11
|
return a;
|
|
12
12
|
}, Q = (a, n) => q(a, z(n));
|
|
13
|
-
var s = (a, n, e) => (
|
|
13
|
+
var s = (a, n, e) => (C(a, typeof n != "symbol" ? n + "" : n, e), e);
|
|
14
14
|
import { defaultGlobalConfig as J } from "../typings/tag/TagConfig.js";
|
|
15
15
|
import { DefaultConfig as K } from "../tag.config.js";
|
|
16
16
|
import "three";
|
|
17
|
-
import { anyPositionToVector3 as
|
|
17
|
+
import { anyPositionToVector3 as x } from "../../shared-utils/positionToVector3.js";
|
|
18
18
|
import { isPlaneTag as N, isMediaModelTag as U, isPoint3DTag as Y } from "../utils/tag/tagCheck.js";
|
|
19
19
|
import { normalPositionToPositions as Z } from "../utils/normalPositionToPositions.js";
|
|
20
20
|
import { writable as ee } from "../../vendor/svelte/store/index.js";
|
|
@@ -34,7 +34,7 @@ import "../../shared-utils/three/blink.js";
|
|
|
34
34
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
35
35
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
36
36
|
import "../../vendor/earcut/src/earcut.js";
|
|
37
|
-
import { FiveDomEvents as
|
|
37
|
+
import { FiveDomEvents as V } from "../../shared-utils/five/FiveDomEvents.js";
|
|
38
38
|
import "../../shared-utils/five/FivePuppet.js";
|
|
39
39
|
import { Cache as se } from "../utils/Cache.js";
|
|
40
40
|
import { Controller as ce } from "../../base/BasePlugin.js";
|
|
@@ -123,7 +123,7 @@ class Xt extends ce {
|
|
|
123
123
|
css3DRenderDisposer: /* @__PURE__ */ new Map()
|
|
124
124
|
});
|
|
125
125
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
126
|
-
s(this, "domEvents", new
|
|
126
|
+
s(this, "domEvents", new V(this.five));
|
|
127
127
|
s(this, "_cache_pointTag");
|
|
128
128
|
s(this, "_cache_2DPointTag");
|
|
129
129
|
s(this, "_cache_css3DTag");
|
|
@@ -180,7 +180,9 @@ class Xt extends ce {
|
|
|
180
180
|
}
|
|
181
181
|
// eslint-disable-next-line accessor-pairs
|
|
182
182
|
set tagsLengthWillUpdate(e) {
|
|
183
|
-
e && (this._cache_pointTag = this.tags.filter(
|
|
183
|
+
e && (this._cache_pointTag = this.tags.filter(
|
|
184
|
+
(t) => t.stickType === "2DPoint" || t.stickType === "3DPoint" || t.stickType === "3DBox" || t.stickType === "Polygon" || t.stickType === "Mask"
|
|
185
|
+
).filter((t) => t.position), this._cache_2DPointTag = this.tags.filter((t) => t.stickType === "2DPoint").filter((t) => t.position), this._cache_css3DTag = this.tags.filter(
|
|
184
186
|
(t) => t.stickType === "3DPoint" || t.stickType === "Plane" || t.stickType === "Model" && t.contentType === "MediaModel"
|
|
185
187
|
).filter((t) => {
|
|
186
188
|
const i = t.computeRenderType();
|
|
@@ -200,7 +202,7 @@ class Xt extends ce {
|
|
|
200
202
|
return (e = this._cache_css3DTag) != null ? e : [];
|
|
201
203
|
}
|
|
202
204
|
updateFive(e) {
|
|
203
|
-
super.updateFive(e), this.domEvents.dispose(), this.domEvents = new
|
|
205
|
+
super.updateFive(e), this.domEvents.dispose(), this.domEvents = new V(e);
|
|
204
206
|
}
|
|
205
207
|
addRenderQueue(e) {
|
|
206
208
|
var c, p;
|
|
@@ -236,7 +238,7 @@ class Xt extends ce {
|
|
|
236
238
|
if (U(e))
|
|
237
239
|
return e.data.mediaPosition;
|
|
238
240
|
if (Y(e))
|
|
239
|
-
return Z(this.five.camera.position,
|
|
241
|
+
return Z(this.five.camera.position, x(e.position), x(e.normal));
|
|
240
242
|
}
|
|
241
243
|
addObjectClickHandler(e, t, i) {
|
|
242
244
|
if (!t || !this.domEvents)
|
|
@@ -276,19 +278,19 @@ class Xt extends ce {
|
|
|
276
278
|
const o = {}, c = {}, p = {};
|
|
277
279
|
this.config.contentTypeConfig && Object.entries(this.config.contentTypeConfig).forEach(([u, h]) => {
|
|
278
280
|
var w, L;
|
|
279
|
-
const m = u,
|
|
281
|
+
const m = u, D = m.split("-"), j = u.startsWith("["), v = j ? D[0].slice(1, -1) : void 0, y = j ? D.slice(1) : D, M = v ? ["PanoramaLike", "ModelLike"].includes(v) ? (w = c[v]) != null ? w : c[v] = {} : (L = p[v]) != null ? L : p[v] = {} : o;
|
|
280
282
|
if (!M[m]) {
|
|
281
283
|
if (y.length === 0 && (M[m] = h), y.length === 1) {
|
|
282
284
|
const [g] = y;
|
|
283
285
|
(e.contentType === g || g === "Any") && (M[m] = h);
|
|
284
286
|
}
|
|
285
287
|
if (y.length === 2) {
|
|
286
|
-
const [g = "Any",
|
|
287
|
-
g === "Mixin" && e.contentType ===
|
|
288
|
+
const [g = "Any", k = "Any"] = y;
|
|
289
|
+
g === "Mixin" && e.contentType === k && (M[m] = h), (e.stickType === g || g === "Any") && (e.contentType === k || k === "Any") && (M[m] = h);
|
|
288
290
|
}
|
|
289
291
|
if (y.length === 3) {
|
|
290
|
-
const [g = "Any",
|
|
291
|
-
if (
|
|
292
|
+
const [g = "Any", k, R] = y;
|
|
293
|
+
if (k === "Audio" && e.contentType === "Audio") {
|
|
292
294
|
const O = e;
|
|
293
295
|
(O.stickType === g || g === "Any") && O.data.appearance === R && (M[m] = h);
|
|
294
296
|
}
|
|
@@ -304,8 +306,8 @@ class Xt extends ce {
|
|
|
304
306
|
const m = T[u];
|
|
305
307
|
T[u] = P({}, r, m, ...Object.values(h), l, { _isMerged: !0 });
|
|
306
308
|
});
|
|
307
|
-
const
|
|
308
|
-
return H(
|
|
309
|
+
const _ = Q(W({}, f), { configWithFiveMode: T });
|
|
310
|
+
return H(_), Object.values(T).forEach((u) => H(u)), _._isMerged = !0, _;
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
export {
|