@realsee/dnalogel 3.50.14 → 3.50.15-alpha.1
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/README.md +116 -0
- package/dist/Sculpt/Objects/Base/index.d.ts +1 -1
- package/dist/Sculpt/index.d.ts +4 -4
- package/dist/index.cjs.js +262 -262
- package/dist/index.js +4235 -4231
- package/dist/index.umd.js +263 -263
- package/dist/shared-utils/five/index.d.ts +2 -0
- package/dist/shared-utils/tag.d.ts +1 -1
- package/dist/shared-utils/three/index.d.ts +1 -0
- package/libs/AreaMakerPlugin/Controller.js +104 -74
- package/libs/AreaMakerPlugin/index.js +33 -3
- package/libs/AreaMakerPlugin/utils/Item.js +66 -36
- package/libs/CSS3DRenderPlugin/Controller.js +39 -19
- package/libs/CSS3DRenderPlugin/index.js +34 -14
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +60 -35
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +98 -78
- package/libs/CruisePlugin/BaseController.js +59 -29
- package/libs/CruisePlugin/Move.js +33 -14
- package/libs/CruisePlugin/Work.js +66 -47
- package/libs/CruisePlugin/index.js +38 -19
- package/libs/CurrentPanoImagePlugin/Controller.js +68 -38
- package/libs/CurrentPanoImagePlugin/index.js +34 -4
- package/libs/GuideLinePlugin/Controller.js +69 -50
- package/libs/GuideLinePlugin/GuideLineItem.js +34 -15
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +34 -15
- package/libs/GuideLinePlugin/index.js +38 -19
- package/libs/ModelMakerPlugin/Controller.js +60 -42
- package/libs/ModelMakerPlugin/index.js +34 -16
- package/libs/ModelTVVideoPlugin/Plugin.js +48 -28
- package/libs/ModelTVVideoPlugin/index.js +24 -4
- package/libs/Object3DHelperPlugin/Controller.js +49 -30
- package/libs/Object3DHelperPlugin/index.js +36 -17
- package/libs/PanoCompassPlugin/Controller.js +33 -13
- package/libs/PanoCompassPlugin/index.js +34 -14
- package/libs/PanoDoorLabelPlugin/BaseController.js +55 -25
- package/libs/PanoDoorLabelPlugin/Controller.js +99 -69
- package/libs/PanoDoorLabelPlugin/index.js +34 -4
- package/libs/PanoMeasurePlugin/Components/Controller0.js +8 -8
- package/libs/PanoMeasurePlugin/Components/Controller1.js +8 -8
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +75 -49
- package/libs/PanoMeasurePlugin/Controller/index.js +16 -16
- package/libs/PanoMeasurePlugin/Model/area.js +41 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +29 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +8 -8
- package/libs/PanoMeasurePlugin/index.js +3 -3
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +43 -15
- package/libs/PanoRulerProPlugin/Controller.js +60 -30
- package/libs/PanoRulerProPlugin/RulerItems.js +85 -55
- package/libs/PanoRulerProPlugin/index.js +33 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +54 -34
- package/libs/PanoSpatialTagPlugin/index.js +22 -2
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +79 -49
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +235 -206
- package/libs/PanoTagPlugin/Components/Tag/index.js +152 -125
- package/libs/PanoTagPlugin/Components/TagContainer.js +97 -70
- package/libs/PanoTagPlugin/Components/TagItem.js +31 -4
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +29 -2
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +55 -28
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +53 -26
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +54 -27
- package/libs/PanoTagPlugin/controller/TagRender.js +48 -29
- package/libs/PanoTagPlugin/controller/TagUtil.js +33 -14
- package/libs/PanoTagPlugin/controller/index.js +49 -30
- package/libs/PanoTagPlugin/index.js +41 -22
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +59 -29
- package/libs/PanoVideoPlugin/Controller.js +91 -61
- package/libs/PanoVideoPlugin/VideoMeshController.js +56 -26
- package/libs/PanoVideoPlugin/index.js +36 -6
- package/libs/PipelinePlugin/Controller.js +80 -51
- package/libs/PipelinePlugin/index.js +34 -5
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +44 -14
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +43 -13
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +61 -31
- package/libs/Sculpt/Meshes/Box.js +3 -2
- package/libs/Sculpt/Meshes/Cylinder.js +3 -2
- package/libs/Sculpt/Meshes/Line.js +9 -8
- package/libs/Sculpt/Meshes/LineWithDots.js +8 -7
- package/libs/Sculpt/Meshes/Point.js +3 -2
- package/libs/Sculpt/Meshes/Polygon.js +3 -2
- package/libs/Sculpt/Meshes/Prism.js +9 -8
- package/libs/Sculpt/Meshes/Rectangle.js +3 -2
- package/libs/Sculpt/Objects/Base/index.d.ts +1 -1
- package/libs/Sculpt/Objects/Line/Editor.js +7 -6
- package/libs/Sculpt/index.d.ts +4 -4
- package/libs/Sculpt/index.js +3 -2
- package/libs/Sculpt/utils/three/ColoredMesh.js +6 -5
- package/libs/base/BasePlugin.js +4 -3
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +89 -60
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +34 -5
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +79 -50
- package/libs/floorplan/ModelFloorplanPlugin/index.js +34 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +68 -38
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +34 -4
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +104 -75
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +34 -5
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +28 -28
- package/libs/shared-utils/five/fiveModelLoad.js +1 -0
- package/libs/shared-utils/five/index.d.ts +2 -0
- package/libs/shared-utils/five/index.js +3 -2
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/index.js +42 -35
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +1 -1
- package/libs/shared-utils/tag.js +41 -41
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +3 -2
- package/libs/shared-utils/three/index.d.ts +1 -0
- package/libs/shared-utils/three/index.js +1 -0
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ export declare class LightTag {
|
|
|
47
47
|
disable(): void;
|
|
48
48
|
destroy(): void;
|
|
49
49
|
setTransformMatrix(matrix: THREE.Matrix4): void;
|
|
50
|
-
setPosition(position:
|
|
50
|
+
setPosition(position: AnyPosition, positionsForRotate?: AnyPosition[]): void;
|
|
51
51
|
updateScreenPosition(): void;
|
|
52
52
|
private onCameraUpdate;
|
|
53
53
|
private onFiveEveryReady;
|
|
@@ -2,35 +2,36 @@ var M = Object.defineProperty, C = Object.defineProperties;
|
|
|
2
2
|
var S = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var f = Object.getOwnPropertySymbols;
|
|
4
4
|
var A = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
6
|
-
for (var t in
|
|
7
|
-
A.call(
|
|
5
|
+
var p = (h, n, t) => n in h ? M(h, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[n] = t, d = (h, n) => {
|
|
6
|
+
for (var t in n || (n = {}))
|
|
7
|
+
A.call(n, t) && p(h, t, n[t]);
|
|
8
8
|
if (f)
|
|
9
|
-
for (var t of f(
|
|
10
|
-
_.call(
|
|
9
|
+
for (var t of f(n))
|
|
10
|
+
_.call(n, t) && p(h, t, n[t]);
|
|
11
11
|
return h;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
}, u = (h, n) => C(h, S(n));
|
|
13
|
+
var a = (h, n, t) => (p(h, typeof n != "symbol" ? n + "" : n, t), t);
|
|
14
|
+
var l = (h, n, t) => new Promise((i, e) => {
|
|
15
|
+
var o = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
e(
|
|
17
|
+
m(t.next(s));
|
|
18
|
+
} catch (c) {
|
|
19
|
+
e(c);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, r = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
e(
|
|
23
|
+
m(t.throw(s));
|
|
24
|
+
} catch (c) {
|
|
25
|
+
e(c);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, m = (s) => s.done ? i(s.value) : Promise.resolve(s.value).then(o, r);
|
|
28
|
+
m((t = t.apply(h, n)).next());
|
|
29
29
|
});
|
|
30
30
|
import * as g from "three";
|
|
31
31
|
import { Controller as k } from "../base/BasePluginWithData.js";
|
|
32
32
|
import "../shared-utils/tag.js";
|
|
33
33
|
import "hammerjs";
|
|
34
|
+
import "../shared-utils/three/PointSelector/index.js";
|
|
34
35
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
35
36
|
import "@realsee/five/line";
|
|
36
37
|
import "../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
@@ -51,6 +52,35 @@ import "../shared-utils/positionToVector3.js";
|
|
|
51
52
|
import "../shared-utils/five/vector3ToScreen.js";
|
|
52
53
|
import "../shared-utils/three/temp.js";
|
|
53
54
|
import "../shared-utils/dom/resizeObserver.js";
|
|
55
|
+
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
56
|
+
import "../shared-utils/three/Magnifier.js";
|
|
57
|
+
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
58
|
+
import "../shared-utils/three/Assets/index.js";
|
|
59
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
60
|
+
import "../CSS3DRenderPlugin/utils/even.js";
|
|
61
|
+
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
62
|
+
import "../shared-utils/three/centerPoint.js";
|
|
63
|
+
import "../shared-utils/three/getObjectVisible.js";
|
|
64
|
+
import "../shared-utils/isNil.js";
|
|
65
|
+
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
66
|
+
import "../shared-utils/five/initialCSS3DRender.js";
|
|
67
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
68
|
+
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
69
|
+
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
70
|
+
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
71
|
+
import "../Sculpt/Meshes/Line.js";
|
|
72
|
+
import "../Sculpt/typings/style.js";
|
|
73
|
+
import "../shared-utils/five/FiveLine.js";
|
|
74
|
+
import "../shared-utils/three/IObject3D.js";
|
|
75
|
+
import "../Sculpt/utils/removeAllTag.js";
|
|
76
|
+
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
77
|
+
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
78
|
+
import "../shared-utils/util.js";
|
|
79
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
80
|
+
import "../shared-utils/isTouchDevice.js";
|
|
81
|
+
import "../shared-utils/five/getPosition.js";
|
|
82
|
+
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
83
|
+
import "../shared-utils/three/PointSelector/utils/contents.js";
|
|
54
84
|
import "../vendor/three/examples/jsm/lines/LineSegmentsGeometry.js";
|
|
55
85
|
import "../vendor/three/build/three.module.js";
|
|
56
86
|
import "../shared-utils/isTruelyObject.js";
|
|
@@ -62,7 +92,7 @@ import "../components/AreaLabel/LabelItem.js";
|
|
|
62
92
|
import "../vendor/svelte/internal/index.js";
|
|
63
93
|
import "../components/AreaLabel/Assets/roomLabelBg.js";
|
|
64
94
|
import "../shared-utils/math/planimetry.js";
|
|
65
|
-
class
|
|
95
|
+
class Ot extends k {
|
|
66
96
|
/** AreaMakerPlugin
|
|
67
97
|
* @param `five` `<Five>` Five 实例
|
|
68
98
|
* @param `params` `<PluginType.Params> | <undefined>` 插件初始化参数
|
|
@@ -72,68 +102,68 @@ class ht extends k {
|
|
|
72
102
|
super(t);
|
|
73
103
|
// ==================== public properties ====================
|
|
74
104
|
/** 插件当前状态 */
|
|
75
|
-
|
|
105
|
+
a(this, "state");
|
|
76
106
|
/** 标注模型 { id: item } 的映射表 */
|
|
77
|
-
|
|
107
|
+
a(this, "itemMap");
|
|
78
108
|
/** 自定义 DOM */
|
|
79
|
-
|
|
109
|
+
a(this, "itemRenderer");
|
|
80
110
|
/** 标注模型容器 */
|
|
81
|
-
|
|
111
|
+
a(this, "modelGroup");
|
|
82
112
|
/** 当前使用的数据 */
|
|
83
|
-
|
|
113
|
+
a(this, "data");
|
|
84
114
|
/** tag 容器 */
|
|
85
|
-
|
|
115
|
+
a(this, "tagDomContainer");
|
|
86
116
|
/** 查询问题使用的调试对象 */
|
|
87
|
-
|
|
117
|
+
a(this, "checkMsg", {
|
|
88
118
|
childrenMountedState: ""
|
|
89
119
|
});
|
|
90
120
|
// ==================== private properties ====================
|
|
91
121
|
/** 是否在 Five Change Mode 动画中 */
|
|
92
|
-
|
|
122
|
+
a(this, "isInFiveChangeModeAnime", !1);
|
|
93
123
|
/** 子组件是否挂载 */
|
|
94
|
-
|
|
124
|
+
a(this, "childrenMountedState", !1);
|
|
95
125
|
/** config 的原始值 */
|
|
96
|
-
|
|
126
|
+
a(this, "_config");
|
|
97
127
|
/** disposed 的原始值 */
|
|
98
|
-
|
|
128
|
+
a(this, "_disposed", !1);
|
|
99
129
|
/** 销毁插件,移除所有副作用,销毁后将不响应任何 API */
|
|
100
|
-
|
|
130
|
+
a(this, "dispose", () => {
|
|
101
131
|
this.five.scene.remove(this.modelGroup);
|
|
102
132
|
});
|
|
103
|
-
|
|
133
|
+
a(this, "onFiveInitAnimationWillStart", () => {
|
|
104
134
|
this.isInFiveChangeModeAnime = !0, this.updateChildrenMountedState();
|
|
105
135
|
});
|
|
106
|
-
|
|
136
|
+
a(this, "onFiveInitAnimationEnded", () => {
|
|
107
137
|
this.isInFiveChangeModeAnime = !1, this.updateChildrenMountedState();
|
|
108
138
|
});
|
|
109
|
-
|
|
139
|
+
a(this, "onFiveCameraUpdate", () => {
|
|
110
140
|
const t = this.five.camera;
|
|
111
|
-
[...this.itemMap.values()].sort((e,
|
|
112
|
-
const
|
|
113
|
-
return
|
|
114
|
-
}).forEach((e,
|
|
115
|
-
var
|
|
116
|
-
(
|
|
141
|
+
[...this.itemMap.values()].sort((e, o) => {
|
|
142
|
+
const r = e.tagPosition.distanceTo(t.position);
|
|
143
|
+
return o.tagPosition.distanceTo(t.position) - r;
|
|
144
|
+
}).forEach((e, o) => {
|
|
145
|
+
var r;
|
|
146
|
+
(r = this.getMaskItemByID(e.id)) == null || r.setTagZIndex(o * 10);
|
|
117
147
|
});
|
|
118
148
|
});
|
|
119
|
-
|
|
149
|
+
a(this, "onFiveModeChange", () => {
|
|
120
150
|
this.updateChildrenMountedState();
|
|
121
151
|
});
|
|
122
|
-
|
|
152
|
+
a(this, "onMakerTagClick", (t) => {
|
|
123
153
|
this.hooks.emit("wantsTap", { target: t.target, intersectObjects: [] });
|
|
124
154
|
});
|
|
125
|
-
|
|
126
|
-
const i = Array.from(this.itemMap.values()).filter((
|
|
127
|
-
makerItem:
|
|
128
|
-
intersects:
|
|
129
|
-
})).filter(({ intersects:
|
|
155
|
+
a(this, "onWantsFiveTapGesture", (t) => {
|
|
156
|
+
const i = Array.from(this.itemMap.values()).filter((s) => s.mounted && s.visible).map((s) => ({
|
|
157
|
+
makerItem: s,
|
|
158
|
+
intersects: s.modelGroup.getRaycastIntersects(t)
|
|
159
|
+
})).filter(({ intersects: s }) => s.length > 0);
|
|
130
160
|
if (i.length === 0)
|
|
131
161
|
return;
|
|
132
|
-
const e = i.reduce((
|
|
133
|
-
const v =
|
|
134
|
-
return v < b ?
|
|
135
|
-
}),
|
|
136
|
-
if (this.config.modelDepthTest &&
|
|
162
|
+
const e = i.reduce((s, c) => {
|
|
163
|
+
const v = s.intersects[0].distance, b = c.intersects[0].distance;
|
|
164
|
+
return v < b ? s : c;
|
|
165
|
+
}), o = this.fiveUtil.model.intersectRaycaster(t)[0];
|
|
166
|
+
if (this.config.modelDepthTest && o && o.distance < e.intersects[0].distance)
|
|
137
167
|
return;
|
|
138
168
|
if (this.hooks.emit("wantsTap", {
|
|
139
169
|
target: e.makerItem,
|
|
@@ -147,10 +177,10 @@ class ht extends k {
|
|
|
147
177
|
visible: !0
|
|
148
178
|
};
|
|
149
179
|
this.state = Object.assign(e, i == null ? void 0 : i.initialState);
|
|
150
|
-
const
|
|
180
|
+
const o = d({
|
|
151
181
|
modelDepthTest: !0
|
|
152
182
|
}, i == null ? void 0 : i.config);
|
|
153
|
-
this._config =
|
|
183
|
+
this._config = o, this.modelGroup = new g.Group(), this.modelGroup.name = "ModelMakerPluginGroup", this.itemMap = /* @__PURE__ */ new Map(), this.state.enabled && this._enable({ userAction: !1 });
|
|
154
184
|
}
|
|
155
185
|
/** 插件配置项 */
|
|
156
186
|
get config() {
|
|
@@ -162,11 +192,11 @@ class ht extends k {
|
|
|
162
192
|
}
|
|
163
193
|
/** 加载数据,重复调用会使用新数据覆盖旧数据 */
|
|
164
194
|
load(t) {
|
|
165
|
-
return
|
|
195
|
+
return l(this, null, function* () {
|
|
166
196
|
const i = this.data;
|
|
167
197
|
this.data = this.formatData(t), this.hooks.emit("dataChange", this.data, i), this.modelGroup.remove(...this.modelGroup.children), this.itemMap.forEach((e) => e.unmount()), this.itemMap.clear(), this.childrenMountedState = !1, this.checkMsg.childrenMountedState = "", this.data.list.forEach((e) => {
|
|
168
|
-
const
|
|
169
|
-
|
|
198
|
+
const o = new D(this, e);
|
|
199
|
+
o.itemRenderer = this.itemRenderer, this.modelGroup.add(o.modelGroup), this.itemMap.set(e.id, o), o.hooks.on("tagClick", this.onMakerTagClick);
|
|
170
200
|
}), this.updateChildrenMountedState();
|
|
171
201
|
});
|
|
172
202
|
}
|
|
@@ -201,7 +231,7 @@ class ht extends k {
|
|
|
201
231
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
202
232
|
*/
|
|
203
233
|
show(t) {
|
|
204
|
-
return
|
|
234
|
+
return l(this, null, function* () {
|
|
205
235
|
if (this.state.visible)
|
|
206
236
|
return Promise.resolve();
|
|
207
237
|
if (this.disposed)
|
|
@@ -215,7 +245,7 @@ class ht extends k {
|
|
|
215
245
|
* @param `options.userAction` `<boolean> | <undefined>` 是否是用户操作。默认是 true。
|
|
216
246
|
*/
|
|
217
247
|
hide(t) {
|
|
218
|
-
return
|
|
248
|
+
return l(this, null, function* () {
|
|
219
249
|
if (this.state.visible === !1)
|
|
220
250
|
return;
|
|
221
251
|
const i = d({ userAction: !0 }, t);
|
|
@@ -265,10 +295,10 @@ class ht extends k {
|
|
|
265
295
|
const e = this.state;
|
|
266
296
|
if (I(t, e, { deep: !0 }))
|
|
267
297
|
return;
|
|
268
|
-
const
|
|
269
|
-
if (this.updateState(t,
|
|
270
|
-
const
|
|
271
|
-
t.visible ? this._show(
|
|
298
|
+
const o = i.userAction !== void 0 ? i.userAction : !0;
|
|
299
|
+
if (this.updateState(t, o), t.enabled !== void 0 && e.enabled !== t.enabled && (t.enabled ? this._enable({ userAction: o }) : this._disable({ userAction: o })), t.visible !== void 0 && e.visible !== t.visible) {
|
|
300
|
+
const r = { userAction: o, anime: { duration: 500 } };
|
|
301
|
+
t.visible ? this._show(r) : this._hide(r);
|
|
272
302
|
}
|
|
273
303
|
}
|
|
274
304
|
/** 更改插件 Config
|
|
@@ -276,9 +306,9 @@ class ht extends k {
|
|
|
276
306
|
* @param `options` `<Option> | <undefined>`
|
|
277
307
|
*/
|
|
278
308
|
updateConfig(t, i = {}) {
|
|
279
|
-
var
|
|
280
|
-
const e = this.config,
|
|
281
|
-
this._config =
|
|
309
|
+
var r;
|
|
310
|
+
const e = this.config, o = d(d({}, e), t);
|
|
311
|
+
this._config = o, this.hooks.emit("configChange", { prevConfig: e, config: o, userAction: (r = i.userAction) != null ? r : !0 });
|
|
282
312
|
}
|
|
283
313
|
/** 根据 ID 获取标注 */
|
|
284
314
|
getMaskItemByID(t) {
|
|
@@ -290,12 +320,12 @@ class ht extends k {
|
|
|
290
320
|
}
|
|
291
321
|
return i(t) ? {
|
|
292
322
|
list: t.list.filter((e) => e.object_data.points.length >= 3).map((e) => {
|
|
293
|
-
const
|
|
294
|
-
return
|
|
323
|
+
const o = new g.Shape(), r = e.object_data.points[0];
|
|
324
|
+
return o.moveTo(r[0], r[2]), e.object_data.points.slice(1).forEach((s) => o.lineTo(s[0], s[2])), o.lineTo(r[0], r[2]), u(d({}, e), {
|
|
295
325
|
floor_index: e.object_data.floorIndex,
|
|
296
|
-
object_data:
|
|
297
|
-
bottom_y:
|
|
298
|
-
shape:
|
|
326
|
+
object_data: u(d({}, e.object_data), {
|
|
327
|
+
bottom_y: r[1] + e.object_data.fixedY,
|
|
328
|
+
shape: o.toJSON(),
|
|
299
329
|
height: e.object_data.height + e.object_data.fixedHeight
|
|
300
330
|
})
|
|
301
331
|
});
|
|
@@ -326,16 +356,16 @@ class ht extends k {
|
|
|
326
356
|
this.hooks.emit("disable", { userAction: t.userAction }), this.five.scene.remove(this.modelGroup), this.updateChildrenMountedState(), this.five.needsRender = !0, this.five.off("wantsTapGesture", this.onWantsFiveTapGesture), this.five.off("initAnimationWillStart", this.onFiveInitAnimationWillStart), this.five.off("initAnimationEnded", this.onFiveInitAnimationEnded), this.five.off("modeChange", this.onFiveModeChange), this.five.off("cameraUpdate", this.onFiveCameraUpdate);
|
|
327
357
|
}
|
|
328
358
|
_show(t) {
|
|
329
|
-
return
|
|
359
|
+
return l(this, null, function* () {
|
|
330
360
|
this.hooks.emit("show", t), this.five.needsRender = !0;
|
|
331
361
|
});
|
|
332
362
|
}
|
|
333
363
|
_hide(t) {
|
|
334
|
-
return
|
|
364
|
+
return l(this, null, function* () {
|
|
335
365
|
this.hooks.emit("hide", t), this.five.needsRender = !0;
|
|
336
366
|
});
|
|
337
367
|
}
|
|
338
368
|
}
|
|
339
369
|
export {
|
|
340
|
-
|
|
370
|
+
Ot as Controller
|
|
341
371
|
};
|
|
@@ -14,15 +14,45 @@ import "../shared-utils/five/transformPosition.js";
|
|
|
14
14
|
import "../shared-utils/three/temp.js";
|
|
15
15
|
import "../shared-utils/dom/resizeObserver.js";
|
|
16
16
|
import "hammerjs";
|
|
17
|
+
import "../shared-utils/three/PointSelector/index.js";
|
|
18
|
+
import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
19
|
+
import "../shared-utils/three/Magnifier.js";
|
|
20
|
+
import "../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
21
|
+
import "../shared-utils/three/Assets/index.js";
|
|
22
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
17
23
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
24
|
+
import "../CSS3DRenderPlugin/utils/even.js";
|
|
25
|
+
import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
26
|
+
import "../shared-utils/three/centerPoint.js";
|
|
27
|
+
import "../shared-utils/three/getObjectVisible.js";
|
|
18
28
|
import "@realsee/five/line";
|
|
19
29
|
import "../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
20
30
|
import "../vendor/three/examples/jsm/lines/LineSegmentsGeometry.js";
|
|
21
31
|
import "../vendor/three/build/three.module.js";
|
|
22
32
|
import "../shared-utils/three/core/Sphere.js";
|
|
23
33
|
import "animejs";
|
|
24
|
-
import "../shared-utils/
|
|
34
|
+
import "../shared-utils/isNil.js";
|
|
25
35
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
36
|
+
import "../shared-utils/three/PointSelector/utils/html.js";
|
|
37
|
+
import "../shared-utils/five/initialCSS3DRender.js";
|
|
38
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
39
|
+
import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
40
|
+
import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
41
|
+
import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
42
|
+
import "../Sculpt/Meshes/Line.js";
|
|
43
|
+
import "../Sculpt/typings/style.js";
|
|
44
|
+
import "../shared-utils/five/FiveLine.js";
|
|
45
|
+
import "../shared-utils/three/IObject3D.js";
|
|
46
|
+
import "../Sculpt/utils/removeAllTag.js";
|
|
47
|
+
import "../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
48
|
+
import "../shared-utils/three/applyObjectMatrixWorld.js";
|
|
49
|
+
import "../shared-utils/util.js";
|
|
50
|
+
import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
51
|
+
import "../shared-utils/isTouchDevice.js";
|
|
52
|
+
import "../shared-utils/five/getPosition.js";
|
|
53
|
+
import "../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
54
|
+
import "../shared-utils/three/PointSelector/utils/contents.js";
|
|
55
|
+
import "../shared-utils/url/absoluteUrl.js";
|
|
26
56
|
import "../shared-utils/equal.js";
|
|
27
57
|
import "../shared-utils/isTruelyObject.js";
|
|
28
58
|
import "./utils/Item.js";
|
|
@@ -34,7 +64,7 @@ import "../components/AreaLabel/LabelItem.js";
|
|
|
34
64
|
import "../vendor/svelte/internal/index.js";
|
|
35
65
|
import "../components/AreaLabel/Assets/roomLabelBg.js";
|
|
36
66
|
import "../shared-utils/math/planimetry.js";
|
|
37
|
-
const
|
|
67
|
+
const ur = (r, o) => new t(r, o);
|
|
38
68
|
export {
|
|
39
|
-
|
|
69
|
+
ur as AreaMakerPlugin
|
|
40
70
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
var b = Object.defineProperty;
|
|
2
|
-
var k = (
|
|
3
|
-
var i = (
|
|
4
|
-
import * as
|
|
2
|
+
var k = (a, e, t) => e in a ? b(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var i = (a, e, t) => (k(a, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import * as r from "three";
|
|
5
5
|
import "../../shared-utils/tag.js";
|
|
6
6
|
import "hammerjs";
|
|
7
7
|
import { Subscribe as y } from "../../shared-utils/Subscribe.js";
|
|
8
|
+
import "../../shared-utils/three/PointSelector/index.js";
|
|
8
9
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
9
10
|
import "@realsee/five/line";
|
|
10
11
|
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
@@ -24,9 +25,38 @@ import "../../shared-utils/Utils/FiveUtil.js";
|
|
|
24
25
|
import "../../shared-utils/Utils/BaseUtil.js";
|
|
25
26
|
import "../../shared-utils/Utils/WorkUtil.js";
|
|
26
27
|
import "../../shared-utils/five/transformPosition.js";
|
|
28
|
+
import "../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
29
|
+
import "../../shared-utils/three/Magnifier.js";
|
|
30
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
31
|
+
import "../../shared-utils/three/Assets/index.js";
|
|
32
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
33
|
+
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
34
|
+
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
35
|
+
import "../../shared-utils/three/centerPoint.js";
|
|
36
|
+
import "../../shared-utils/three/getObjectVisible.js";
|
|
37
|
+
import "../../shared-utils/isNil.js";
|
|
38
|
+
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
39
|
+
import "../../shared-utils/three/PointSelector/utils/html.js";
|
|
40
|
+
import "../../shared-utils/five/initialCSS3DRender.js";
|
|
41
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
|
|
42
|
+
import "../../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
|
|
43
|
+
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
44
|
+
import "../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
45
|
+
import "../../Sculpt/Meshes/Line.js";
|
|
46
|
+
import "../../Sculpt/typings/style.js";
|
|
47
|
+
import "../../shared-utils/five/FiveLine.js";
|
|
48
|
+
import "../../shared-utils/three/IObject3D.js";
|
|
49
|
+
import "../../Sculpt/utils/removeAllTag.js";
|
|
50
|
+
import "../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
51
|
+
import "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
52
|
+
import "../../shared-utils/util.js";
|
|
53
|
+
import "../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
54
|
+
import "../../shared-utils/isTouchDevice.js";
|
|
55
|
+
import "../../shared-utils/five/getPosition.js";
|
|
56
|
+
import "../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
57
|
+
import "../../shared-utils/three/PointSelector/utils/contents.js";
|
|
27
58
|
import "../../vendor/three/examples/jsm/lines/LineSegmentsGeometry.js";
|
|
28
59
|
import "../../vendor/three/build/three.module.js";
|
|
29
|
-
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
30
60
|
import "../../shared-utils/animationFrame/index.js";
|
|
31
61
|
import "../../vendor/svelte/internal/index.js";
|
|
32
62
|
import "../../components/AreaLabel/Assets/roomLabelBg.js";
|
|
@@ -40,7 +70,7 @@ class P extends T {
|
|
|
40
70
|
this.areaMakerItem.makerObject.raycast(t, s);
|
|
41
71
|
}
|
|
42
72
|
}
|
|
43
|
-
class
|
|
73
|
+
class At {
|
|
44
74
|
constructor(e, t) {
|
|
45
75
|
i(this, "id");
|
|
46
76
|
/** 标注名称 */
|
|
@@ -78,9 +108,9 @@ class st {
|
|
|
78
108
|
/** 标注标签是否可见 */
|
|
79
109
|
i(this, "tagVisible", null);
|
|
80
110
|
/** 标注标签的世界坐标 */
|
|
81
|
-
i(this, "tagPosition", new
|
|
111
|
+
i(this, "tagPosition", new r.Vector3());
|
|
82
112
|
/** 标注标签的 NDC 坐标 */
|
|
83
|
-
i(this, "tagNDCPosition", new
|
|
113
|
+
i(this, "tagNDCPosition", new r.Vector3());
|
|
84
114
|
/** 标注标签的 transform */
|
|
85
115
|
i(this, "tagTransform", { left: 0, top: 0 });
|
|
86
116
|
/** 标注标签的显示层级 */
|
|
@@ -120,21 +150,21 @@ class st {
|
|
|
120
150
|
// }
|
|
121
151
|
/** 透明度动画 */
|
|
122
152
|
i(this, "doOpacityAnime", (e) => {
|
|
123
|
-
var
|
|
124
|
-
(
|
|
125
|
-
const t = e.duration, [s, o] = e.makerObjectOpacity, [h,
|
|
153
|
+
var m;
|
|
154
|
+
(m = this.opacityAnime) == null || m.dispose();
|
|
155
|
+
const t = e.duration, [s, o] = e.makerObjectOpacity, [h, n] = e.outlineOpacity;
|
|
126
156
|
if (t === 0) {
|
|
127
|
-
this.makerObject.material.opacity = o, this.outline.material.opacity =
|
|
157
|
+
this.makerObject.material.opacity = o, this.outline.material.opacity = n;
|
|
128
158
|
return;
|
|
129
159
|
}
|
|
130
|
-
return new Promise((
|
|
160
|
+
return new Promise((p) => {
|
|
131
161
|
this.opacityAnime = new O({ makerObjectOpacity: s, outlineOpacity: h }).to({
|
|
132
162
|
makerObjectOpacity: o,
|
|
133
|
-
outlineOpacity:
|
|
134
|
-
}).onUpdate(({ makerObjectOpacity:
|
|
135
|
-
this.makerObject.material.opacity =
|
|
136
|
-
}).onComplete(() =>
|
|
137
|
-
this.makerObject.material.opacity = o, this.outline.material.opacity =
|
|
163
|
+
outlineOpacity: n
|
|
164
|
+
}).onUpdate(({ makerObjectOpacity: l, outlineOpacity: c }) => {
|
|
165
|
+
this.makerObject.material.opacity = l, this.outline.material.opacity = c, this.plugin.five.needsRender = !0;
|
|
166
|
+
}).onComplete(() => p(!0)).onDispose(() => {
|
|
167
|
+
this.makerObject.material.opacity = o, this.outline.material.opacity = n, this.plugin.five.needsRender = !0, p(!1);
|
|
138
168
|
}).play();
|
|
139
169
|
});
|
|
140
170
|
});
|
|
@@ -195,8 +225,8 @@ class st {
|
|
|
195
225
|
const [o] = this.plugin.fiveUtil.model.intersectRaycaster(d), h = this.tagPosition.distanceTo(t.camera.position);
|
|
196
226
|
if (o && o.distance + 0.1 < h)
|
|
197
227
|
return { result: !1, msg: "标注标签被 Five 模型遮挡" };
|
|
198
|
-
const
|
|
199
|
-
return Math.abs(
|
|
228
|
+
const n = this.tagNDCPosition;
|
|
229
|
+
return Math.abs(n.x) > 1.2 || Math.abs(n.y) > 1.2 || Math.abs(n.z) > 1 ? { result: !1, msg: "标注标签不在屏幕内" } : { result: !0, msg: "" };
|
|
200
230
|
});
|
|
201
231
|
/** 相机位姿发生变化时,更新标签 */
|
|
202
232
|
i(this, "onFiveCameraUpdate", () => {
|
|
@@ -210,11 +240,11 @@ class st {
|
|
|
210
240
|
};
|
|
211
241
|
this.containerResizeTimeoutID && clearTimeout(this.containerResizeTimeoutID), this.containerResizeTimeoutID = setTimeout(t, 100);
|
|
212
242
|
});
|
|
213
|
-
var
|
|
214
|
-
const s = t.object_data, o = s.bottom_y, h = s.height,
|
|
215
|
-
this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = h, this.bottomY = o, this.opacity =
|
|
216
|
-
new
|
|
217
|
-
new
|
|
243
|
+
var p, l, c, g;
|
|
244
|
+
const s = t.object_data, o = s.bottom_y, h = s.height, n = new r.Color((p = s.color) != null ? p : "#FFFFFF"), m = (l = s.opacity) != null ? l : 0.4;
|
|
245
|
+
this.data = t, this.id = t.id, this.name = (c = t.name) != null ? c : "", this.plugin = e, this.height = h, this.bottomY = o, this.opacity = m, this.shape = new r.Shape().fromJSON(s.shape), this.floorIndex = t.floor_index, this.makerObject = new r.Mesh(f(this.shape, h), j(n, m)), u(this.makerObject, o), this.makerObject.material.depthTest = this.plugin.config.modelDepthTest, this.outline = new C(
|
|
246
|
+
new r.EdgesGeometry(this.makerObject.geometry),
|
|
247
|
+
new r.LineBasicMaterial({ color: n, transparent: !0 })
|
|
218
248
|
), u(this.outline, o), this.outline.material.depthTest = this.plugin.config.modelDepthTest, this.setHeight(h), this.modelGroup = new P(this), this.modelGroup.visible = (g = s.visible) != null ? g : !0;
|
|
219
249
|
}
|
|
220
250
|
/** 挂载标注 */
|
|
@@ -252,7 +282,7 @@ class st {
|
|
|
252
282
|
* @example setColor('#FF0000')
|
|
253
283
|
*/
|
|
254
284
|
setColor(e) {
|
|
255
|
-
const t = new
|
|
285
|
+
const t = new r.Color(e);
|
|
256
286
|
this.makerObject.material.color = t, this.outline.material.color = t, this.plugin.five.needsRender = !0;
|
|
257
287
|
}
|
|
258
288
|
/** 更改标注高度
|
|
@@ -261,8 +291,8 @@ class st {
|
|
|
261
291
|
setHeight(e) {
|
|
262
292
|
if (e <= 0)
|
|
263
293
|
throw new Error("高度必须大于 0");
|
|
264
|
-
this.height = e, this.makerObject.geometry = f(this.shape, e), this.outline.geometry = new
|
|
265
|
-
const t = this.shape.extractPoints(10).shape.slice(0, -1), s = M(t), o = new
|
|
294
|
+
this.height = e, this.makerObject.geometry = f(this.shape, e), this.outline.geometry = new r.EdgesGeometry(this.makerObject.geometry);
|
|
295
|
+
const t = this.shape.extractPoints(10).shape.slice(0, -1), s = M(t), o = new r.Vector3(s.x, s.y, e);
|
|
266
296
|
u(o, this.bottomY), this.tagPosition.copy(o), this.updateTag(), this.plugin.five.needsRender = !0;
|
|
267
297
|
}
|
|
268
298
|
/** 更改标注标签的显示层级
|
|
@@ -278,23 +308,23 @@ class st {
|
|
|
278
308
|
this.tagZIndex !== e && ((t = this.tagApp) == null || t.$set({ zIndex: e }));
|
|
279
309
|
}
|
|
280
310
|
}
|
|
281
|
-
function f(
|
|
282
|
-
return new
|
|
311
|
+
function f(a, e) {
|
|
312
|
+
return new r.ExtrudeBufferGeometry(a, {
|
|
283
313
|
depth: e,
|
|
284
314
|
bevelEnabled: !1
|
|
285
315
|
});
|
|
286
316
|
}
|
|
287
|
-
function j(
|
|
288
|
-
return new
|
|
289
|
-
color:
|
|
317
|
+
function j(a, e) {
|
|
318
|
+
return new r.MeshBasicMaterial({
|
|
319
|
+
color: a,
|
|
290
320
|
opacity: e,
|
|
291
321
|
transparent: !0
|
|
292
322
|
});
|
|
293
323
|
}
|
|
294
|
-
function u(
|
|
295
|
-
const t = new
|
|
296
|
-
t.multiply(s), t.multiply(o), t.multiply(h),
|
|
324
|
+
function u(a, e) {
|
|
325
|
+
const t = new r.Matrix4(), s = new r.Matrix4().makeRotationX(Math.PI / 2), o = new r.Matrix4().makeTranslation(0, 0, -e), h = new r.Matrix4().makeScale(1, 1, -1);
|
|
326
|
+
t.multiply(s), t.multiply(o), t.multiply(h), a.applyMatrix4(t);
|
|
297
327
|
}
|
|
298
328
|
export {
|
|
299
|
-
|
|
329
|
+
At as AreaMakerItem
|
|
300
330
|
};
|