@vsleem-realsee-viewer/bimsee-plugin 2.0.24 → 2.0.26
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.internal.md +14 -14
- package/dist/components/Bimsee.vue.d.ts +6 -6
- package/dist/components/Masker.vue.d.ts +1 -1
- package/dist/hooks/useMasker.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +177 -175
- package/dist/index.umd.js +1 -1
- package/dist/types/masker.d.ts +6 -7
- package/dist/types/store.d.ts +2 -2
- package/package.json +3 -3
package/README.internal.md
CHANGED
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
|
|
39
39
|
## 1.5 BimseeStore 类型说明
|
|
40
40
|
|
|
41
|
-
| 属性/方法 | 类型/签名
|
|
42
|
-
| ----------------------- |
|
|
43
|
-
| `ready` | `boolean`
|
|
44
|
-
| `coordinateTree?` | `Coordinate`
|
|
45
|
-
| `mappedCoordinateTree?` | `Coordinate`
|
|
46
|
-
| `currentModel?` | `Coordinate`
|
|
47
|
-
| `currentSpace?` | `Coordinate`
|
|
48
|
-
| `currentPoint?` | `Point`
|
|
49
|
-
| `reload` | `(searchInfo: SearchInfo) => Promise<void>`
|
|
50
|
-
| `selectModel` | `(coordinate: Partial<Coordinate>) => void`
|
|
51
|
-
| `selectPoint` | ` (point: Point) => void`
|
|
52
|
-
| `setReferPoint` | `(current: TrackPoint, options:
|
|
53
|
-
| `normalizeToModelPoint` | `(current: TrackPoint) => TrackPoint \| undefined`
|
|
41
|
+
| 属性/方法 | 类型/签名 | 说明 |
|
|
42
|
+
| ----------------------- | ----------------------------------------------------- | ------------------------------------ |
|
|
43
|
+
| `ready` | `boolean` | 是否加载完成 |
|
|
44
|
+
| `coordinateTree?` | `Coordinate` | 坐标树结构 |
|
|
45
|
+
| `mappedCoordinateTree?` | `Coordinate` | 映射后的坐标树结构 |
|
|
46
|
+
| `currentModel?` | `Coordinate` | 当前模型坐标系 |
|
|
47
|
+
| `currentSpace?` | `Coordinate` | 当前空间坐标系 |
|
|
48
|
+
| `currentPoint?` | `Point` | 当前模型的点 |
|
|
49
|
+
| `reload` | `(searchInfo: SearchInfo) => Promise<void>` | 重新加载数据 |
|
|
50
|
+
| `selectModel` | `(coordinate: Partial<Coordinate>) => void` | 选择模型(找不到对应模型时抛出错误) |
|
|
51
|
+
| `selectPoint` | ` (point: Point) => void` | 设置模型的坐标点 |
|
|
52
|
+
| `setReferPoint` | `(current: TrackPoint, options: PanoOptions) => void` | 设置参考点 |
|
|
53
|
+
| `normalizeToModelPoint` | `(current: TrackPoint) => TrackPoint \| undefined` | 设置模型的坐标点 |
|
|
54
54
|
|
|
55
55
|
## 1.6 BimseeElement 实例对象
|
|
56
56
|
|
|
@@ -130,7 +130,7 @@ type maskerSlot =slot & {
|
|
|
130
130
|
| `setMouseover` | `(mouseover: boolean) => void` | 设置鼠标悬停状态 |
|
|
131
131
|
| `setMinFov` | `(minFov: number) => void` | 设置最小视野 |
|
|
132
132
|
| `setMaxFov` | `(maxFov: number) => void` | 设置最大视野 |
|
|
133
|
-
| `setMaskerStatus` | `(options:
|
|
133
|
+
| `setMaskerStatus` | `(options: PanoOptions) => void` | 更新蒙层状态 |
|
|
134
134
|
| `zoom` | `(level: number) => void` | 缩放到指定级别 |
|
|
135
135
|
| `rotate` | `(position: Position) => void` | 旋转蒙层到指定位置 |
|
|
136
136
|
| `getState` | ` () => MaskerProps` | 获取当前蒙层状态 |
|
|
@@ -67,7 +67,7 @@ declare function __VLS_template(): {
|
|
|
67
67
|
setMouseover: (mouseover: boolean) => void;
|
|
68
68
|
setMinFov: (minFov: number) => void;
|
|
69
69
|
setMaxFov: (maxFov: number) => void;
|
|
70
|
-
setMaskerStatus: (options: import('..').
|
|
70
|
+
setMaskerStatus: (options: import('..').PanoOptions) => void;
|
|
71
71
|
zoom: (level: number) => void;
|
|
72
72
|
rotate: (position: import('packages/shared/dist').Position) => void;
|
|
73
73
|
getState: () => import('..').MaskerProps;
|
|
@@ -112,7 +112,7 @@ declare function __VLS_template(): {
|
|
|
112
112
|
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
113
113
|
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
114
114
|
onReady?: ((...args: any[]) => any) | undefined;
|
|
115
|
-
}>, "dataHelper" | "isMouseover" | "isMousedown" | "setState" | "setVisible" | "setMousedown" | "setMouseover" | "setMinFov" | "setMaxFov" | "setMaskerStatus" | "
|
|
115
|
+
}>, "zoom" | "dataHelper" | "isMouseover" | "isMousedown" | "setState" | "setVisible" | "setMousedown" | "setMouseover" | "setMinFov" | "setMaxFov" | "setMaskerStatus" | "rotate" | "getState" | "getPosition" | "getZoomLevel" | "getCameraPosition" | "getCameraTarget" | "getCameraHFov" | "getCameraStatus"> & import('vue').ShallowUnwrapRef<{
|
|
116
116
|
dataHelper: import('../types').DataHelper;
|
|
117
117
|
isMouseover: () => boolean;
|
|
118
118
|
isMousedown: () => boolean;
|
|
@@ -122,7 +122,7 @@ declare function __VLS_template(): {
|
|
|
122
122
|
setMouseover: (mouseover: boolean) => void;
|
|
123
123
|
setMinFov: (minFov: number) => void;
|
|
124
124
|
setMaxFov: (maxFov: number) => void;
|
|
125
|
-
setMaskerStatus: (options: import('..').
|
|
125
|
+
setMaskerStatus: (options: import('..').PanoOptions) => void;
|
|
126
126
|
zoom: (level: number) => void;
|
|
127
127
|
rotate: (position: import('packages/shared/dist').Position) => void;
|
|
128
128
|
getState: () => import('..').MaskerProps;
|
|
@@ -228,7 +228,7 @@ declare const __VLS_component: import('vue').DefineComponent<BimseeProps, {
|
|
|
228
228
|
setMouseover: (mouseover: boolean) => void;
|
|
229
229
|
setMinFov: (minFov: number) => void;
|
|
230
230
|
setMaxFov: (maxFov: number) => void;
|
|
231
|
-
setMaskerStatus: (options: import('..').
|
|
231
|
+
setMaskerStatus: (options: import('..').PanoOptions) => void;
|
|
232
232
|
zoom: (level: number) => void;
|
|
233
233
|
rotate: (position: import('packages/shared/dist').Position) => void;
|
|
234
234
|
getState: () => import('..').MaskerProps;
|
|
@@ -273,7 +273,7 @@ declare const __VLS_component: import('vue').DefineComponent<BimseeProps, {
|
|
|
273
273
|
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
274
274
|
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
275
275
|
onReady?: ((...args: any[]) => any) | undefined;
|
|
276
|
-
}>, "dataHelper" | "isMouseover" | "isMousedown" | "setState" | "setVisible" | "setMousedown" | "setMouseover" | "setMinFov" | "setMaxFov" | "setMaskerStatus" | "
|
|
276
|
+
}>, "zoom" | "dataHelper" | "isMouseover" | "isMousedown" | "setState" | "setVisible" | "setMousedown" | "setMouseover" | "setMinFov" | "setMaxFov" | "setMaskerStatus" | "rotate" | "getState" | "getPosition" | "getZoomLevel" | "getCameraPosition" | "getCameraTarget" | "getCameraHFov" | "getCameraStatus"> & import('vue').ShallowUnwrapRef<{
|
|
277
277
|
dataHelper: import('../types').DataHelper;
|
|
278
278
|
isMouseover: () => boolean;
|
|
279
279
|
isMousedown: () => boolean;
|
|
@@ -283,7 +283,7 @@ declare const __VLS_component: import('vue').DefineComponent<BimseeProps, {
|
|
|
283
283
|
setMouseover: (mouseover: boolean) => void;
|
|
284
284
|
setMinFov: (minFov: number) => void;
|
|
285
285
|
setMaxFov: (maxFov: number) => void;
|
|
286
|
-
setMaskerStatus: (options: import('..').
|
|
286
|
+
setMaskerStatus: (options: import('..').PanoOptions) => void;
|
|
287
287
|
zoom: (level: number) => void;
|
|
288
288
|
rotate: (position: import('packages/shared/dist').Position) => void;
|
|
289
289
|
getState: () => import('..').MaskerProps;
|
|
@@ -32,7 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
32
32
|
setMouseover: (mouseover: boolean) => void;
|
|
33
33
|
setMinFov: (minFov: number) => void;
|
|
34
34
|
setMaxFov: (maxFov: number) => void;
|
|
35
|
-
setMaskerStatus: (options: import('..').
|
|
35
|
+
setMaskerStatus: (options: import('..').PanoOptions) => void;
|
|
36
36
|
zoom: (level: number) => void;
|
|
37
37
|
rotate: (position: import('packages/shared/dist').Position) => void;
|
|
38
38
|
getState: () => import('..').MaskerProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Point } from '@vsleem-realsee-viewer/shared';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
3
|
import { BimseeProps, BimseeStore, CameraStatus, MaskerElement } from '../types';
|
|
4
4
|
export declare function useMasker(propsRef: ComputedRef<BimseeProps>, storeRef: ComputedRef<BimseeStore>, maskerElRef: Ref<HTMLDivElement | undefined>, emit: EmitType): {
|
|
5
5
|
getProps: ComputedRef<Required<Partial<import('..').MaskerProps>>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** 组件导出 */
|
|
2
2
|
export { Bimsee as BimseePlugin } from './components';
|
|
3
3
|
export { default as Bimsee } from './components/Bimsee.vue';
|
|
4
|
+
export type { BimseeErrorCode } from './enums';
|
|
4
5
|
/** 配置相关类型导出 */
|
|
5
|
-
export type { AppSetting /** 应用设置 */, BimseeSetting /** bim配置 */, CameraStatus /** 相机状态 */,
|
|
6
|
+
export type { AppSetting /** 应用设置 */, BimseeSetting /** bim配置 */, CameraStatus /** 相机状态 */, PanoOptions /** 视图选项 */, SearchInfo /** 搜索信息 */, } from './types';
|
|
6
7
|
/** 组件属性类型导出 */
|
|
7
8
|
export type { BimseeElement /** Bimsee 元素类型 */, BimseeProps /** Bimsee 组件属性 */, BimseeStore /** Bimsee 状态管理元素类型 */, MaskerElement /** 蒙层元素类型 */, MaskerProps /** 蒙层属性 */,
|
|
8
9
|
/** Bimsee 相关 */
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { APP_SETTING as Re, utils as
|
|
3
|
-
const
|
|
1
|
+
import { ref as g, computed as F, watch as $, unref as C, defineComponent as se, onBeforeUnmount as ie, createElementBlock as ue, openBlock as ce, withDirectives as ke, renderSlot as q, createElementVNode as Te, vShow as Ee, normalizeProps as K, guardReactiveProps as W, onMounted as Ce, nextTick as Le, createVNode as _e, mergeProps as Ie, toHandlers as Fe, withCtx as be } from "vue";
|
|
2
|
+
import { APP_SETTING as Re, utils as le, Position as j, Vector3 as ne, Point as ze, CoordinateModelType as xe, AppError as H, DataSource as Be, http as Ne } from "@vsleem-realsee-viewer/shared";
|
|
3
|
+
const J = {
|
|
4
4
|
visible: !0,
|
|
5
5
|
defaultYaw: 0,
|
|
6
6
|
defaultPitch: 0,
|
|
@@ -9,26 +9,26 @@ const W = {
|
|
|
9
9
|
maxFov: 120
|
|
10
10
|
}, De = {
|
|
11
11
|
appSetting: Re,
|
|
12
|
-
masker:
|
|
12
|
+
masker: J,
|
|
13
13
|
immediate: !0
|
|
14
|
-
}, { cloneDeep:
|
|
15
|
-
function Ve(r,
|
|
16
|
-
const a =
|
|
17
|
-
const { coordinateTree: e, mappedCoordinateTree: o, currentSpace:
|
|
14
|
+
}, { cloneDeep: ae, deepMergeProps: Ye, getDiffProps: $e } = le;
|
|
15
|
+
function Ve(r, v, n, d) {
|
|
16
|
+
const a = g(ae(J)), i = g(), f = g(), t = F(() => a.value), h = F(() => {
|
|
17
|
+
const { coordinateTree: e, mappedCoordinateTree: o, currentSpace: m, currentModel: M, currentPoint: w } = v.value || {};
|
|
18
18
|
return {
|
|
19
19
|
coordinateTree: e,
|
|
20
20
|
mappedCoordinateTree: o,
|
|
21
|
-
currentSpace:
|
|
21
|
+
currentSpace: m,
|
|
22
22
|
currentModel: M,
|
|
23
23
|
currentPoint: w,
|
|
24
|
-
cameraStatus:
|
|
24
|
+
cameraStatus: i.value,
|
|
25
25
|
state: t.value
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
|
-
$(() =>
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
c(
|
|
28
|
+
$(() => ae(r.value.masker), y, { immediate: !0, deep: !0 });
|
|
29
|
+
function y(e, o) {
|
|
30
|
+
const m = $e(e, o);
|
|
31
|
+
c(m);
|
|
32
32
|
}
|
|
33
33
|
function u() {
|
|
34
34
|
return C(t);
|
|
@@ -36,49 +36,49 @@ function Ve(r, m, n, d) {
|
|
|
36
36
|
function c(e) {
|
|
37
37
|
e && Ye(a.value, e);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function S() {
|
|
40
40
|
const e = C(n);
|
|
41
|
-
e && (e.addEventListener("mousedown", L), e.addEventListener("touchstart", L), e.addEventListener("click", I), window.addEventListener("mousemove",
|
|
41
|
+
e && (e.addEventListener("mousedown", L), e.addEventListener("touchstart", L), e.addEventListener("click", I), window.addEventListener("mousemove", T), window.addEventListener("touchmove", T), window.addEventListener("mouseup", p), window.addEventListener("touchend", p), e.addEventListener("mouseover", s), e.addEventListener("mouseout", l), e.addEventListener("wheel", E));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function k() {
|
|
44
44
|
const e = C(n);
|
|
45
|
-
e && (e.removeEventListener("mousedown", L), e.removeEventListener("touchstart", L), window.removeEventListener("mousemove",
|
|
45
|
+
e && (e.removeEventListener("mousedown", L), e.removeEventListener("touchstart", L), window.removeEventListener("mousemove", T), window.removeEventListener("touchmove", T), window.removeEventListener("mouseup", p), window.removeEventListener("touchend", p), e.removeEventListener("mouseover", s), e.removeEventListener("mouseout", l), e.removeEventListener("wheel", E));
|
|
46
46
|
}
|
|
47
47
|
function I(e) {
|
|
48
48
|
d("click", e);
|
|
49
49
|
}
|
|
50
50
|
function L(e) {
|
|
51
|
-
const o = e instanceof TouchEvent ? e.touches[0] : e, { defaultYaw:
|
|
51
|
+
const o = e instanceof TouchEvent ? e.touches[0] : e, { defaultYaw: m = 0, defaultPitch: M = 0 } = t.value, w = Number(m) - Number(v.value.currentPoint?.yaw || 0);
|
|
52
52
|
f.value = {
|
|
53
53
|
pageX: o.pageX,
|
|
54
54
|
pageY: o.pageY,
|
|
55
55
|
defaultYaw: w,
|
|
56
56
|
defaultPitch: M
|
|
57
|
-
},
|
|
57
|
+
}, X(!0), d("mousedown", e);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
if (!f.value || !
|
|
61
|
-
const o = e instanceof TouchEvent ? e.touches[0] : e, { pageX:
|
|
62
|
-
let B = (Number(b) - (
|
|
59
|
+
function T(e) {
|
|
60
|
+
if (!f.value || !ee()) return;
|
|
61
|
+
const o = e instanceof TouchEvent ? e.touches[0] : e, { pageX: m, pageY: M } = o, { pageX: w, pageY: _ } = f.value, { defaultYaw: b = 0, defaultPitch: Y = 0 } = f.value, x = Math.PI * 0.15 / 180;
|
|
62
|
+
let B = (Number(b) - (m - w) * x) % (2 * Math.PI), R = (Number(Y) + (M - _) * x) % (2 * Math.PI);
|
|
63
63
|
R = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, R));
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const G = new j({ yaw: B, pitch: R });
|
|
65
|
+
te(G);
|
|
66
66
|
}
|
|
67
67
|
function p() {
|
|
68
|
-
|
|
68
|
+
X(!1), f.value = void 0;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
70
|
+
function s() {
|
|
71
|
+
O(!0);
|
|
72
72
|
}
|
|
73
73
|
function l() {
|
|
74
|
-
|
|
74
|
+
O(!1);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function E(e) {
|
|
77
77
|
e.preventDefault(), e.stopPropagation();
|
|
78
78
|
const o = Math.sign(e.deltaY) * 5;
|
|
79
79
|
if (o === 0) return;
|
|
80
|
-
const { minFov:
|
|
81
|
-
_ !== w &&
|
|
80
|
+
const { minFov: m = 0, maxFov: M = 0 } = t.value, { hFov: w = 0 } = i.value || {}, _ = Math.min(Math.max(w + o, m), M);
|
|
81
|
+
_ !== w && oe(z.fovToZoomLevel(_));
|
|
82
82
|
}
|
|
83
83
|
function P() {
|
|
84
84
|
const { defaultYaw: e, defaultPitch: o } = t.value;
|
|
@@ -88,33 +88,33 @@ function Ve(r, m, n, d) {
|
|
|
88
88
|
return t.value.defaultZoomLvl;
|
|
89
89
|
}
|
|
90
90
|
function D() {
|
|
91
|
-
return
|
|
91
|
+
return i.value?.position;
|
|
92
92
|
}
|
|
93
93
|
function Z() {
|
|
94
|
-
return
|
|
94
|
+
return i.value?.hFov;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return
|
|
96
|
+
function Q() {
|
|
97
|
+
return i.value?.target;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return
|
|
99
|
+
function A() {
|
|
100
|
+
return i.value;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function me() {
|
|
103
103
|
return t.value?.mouseover ?? !1;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function ee() {
|
|
106
106
|
return t.value?.mousedown ?? !1;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
108
|
+
function U(e) {
|
|
109
|
+
i.value = { ...i.value, ...e };
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function ve(e) {
|
|
112
112
|
c({ visible: e });
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function O(e) {
|
|
115
115
|
c({ mouseover: e });
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function X(e) {
|
|
118
118
|
c({ mousedown: e });
|
|
119
119
|
}
|
|
120
120
|
function fe(e) {
|
|
@@ -124,39 +124,39 @@ function Ve(r, m, n, d) {
|
|
|
124
124
|
c({ maxFov: e });
|
|
125
125
|
}
|
|
126
126
|
function he(e) {
|
|
127
|
-
const { currentPoint: o } =
|
|
127
|
+
const { currentPoint: o } = v.value;
|
|
128
128
|
if (o) {
|
|
129
|
-
const { minFov:
|
|
130
|
-
c({ defaultYaw:
|
|
129
|
+
const { minFov: m, maxFov: M } = t.value, { zoom: w = 0 } = e, { yaw: _ = 0, pitch: b = 0 } = e.position || {}, Y = new j({ yaw: _, pitch: b }), x = z.modelPointToCameraPosition(o), B = z.maskerRotateToCameraTarget(Y, x), R = z.zoomLevelToFov(w);
|
|
130
|
+
c({ defaultYaw: _, defaultPitch: b, defaultZoomLvl: w }), U({ position: x, target: B, hFov: R, minFov: m, maxFov: M });
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
const o =
|
|
133
|
+
function te(e) {
|
|
134
|
+
const o = i.value?.position;
|
|
135
135
|
if (!o) return;
|
|
136
|
-
const { yaw:
|
|
137
|
-
c({ defaultYaw: w, defaultPitch: M }),
|
|
136
|
+
const { yaw: m, pitch: M } = e, w = Number(v.value.currentPoint?.yaw || 0) + m, _ = new j({ yaw: Number(w), pitch: Number(M) }), b = z.maskerRotateToCameraTarget(_, o);
|
|
137
|
+
c({ defaultYaw: w, defaultPitch: M }), U({ target: b }), d("position-updated", { position: e, target: b });
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
const o =
|
|
141
|
-
c({ defaultZoomLvl: e }),
|
|
139
|
+
function oe(e) {
|
|
140
|
+
const o = z.zoomLevelToFov(e);
|
|
141
|
+
c({ defaultZoomLvl: e }), U({ hFov: o }), d("zoom-updated", { zoomLevel: e, hFov: o });
|
|
142
142
|
}
|
|
143
143
|
function we(e) {
|
|
144
|
-
return new
|
|
144
|
+
return new ne(e);
|
|
145
145
|
}
|
|
146
146
|
function Me(e, o) {
|
|
147
|
-
const { x:
|
|
148
|
-
return new
|
|
147
|
+
const { x: m = 0, y: M = 0, z: w = 0 } = o, { yaw: _, pitch: b } = e, Y = -_, x = b, B = 100, R = 0, G = B * Math.cos(R + Y) + m, ye = B * Math.sin(R + Y) + M, Se = B * Math.tan(x) + w;
|
|
148
|
+
return new ne({ x: G, y: ye, z: Se });
|
|
149
149
|
}
|
|
150
150
|
function Pe(e) {
|
|
151
|
-
const { minFov: o = 20, maxFov:
|
|
151
|
+
const { minFov: o = 20, maxFov: m = 120 } = t.value, w = 100 - (Math.max(o, Math.min(m, e)) - o) / (m - o) * 100;
|
|
152
152
|
return Math.max(0, Math.min(100, Math.round(w)));
|
|
153
153
|
}
|
|
154
154
|
function ge(e) {
|
|
155
|
-
const { minFov: o = 20, maxFov:
|
|
156
|
-
let M =
|
|
157
|
-
return Math.max(o, Math.min(
|
|
155
|
+
const { minFov: o = 20, maxFov: m = 120 } = t.value;
|
|
156
|
+
let M = m + e / 100 * (o - m);
|
|
157
|
+
return Math.max(o, Math.min(m, M));
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const z = {
|
|
160
160
|
modelPointToCameraPosition: we,
|
|
161
161
|
maskerRotateToCameraTarget: Me,
|
|
162
162
|
fovToZoomLevel: Pe,
|
|
@@ -166,216 +166,218 @@ function Ve(r, m, n, d) {
|
|
|
166
166
|
getProps: t,
|
|
167
167
|
getBindValue: h,
|
|
168
168
|
maskerAction: {
|
|
169
|
-
dataHelper:
|
|
170
|
-
isMouseover:
|
|
171
|
-
isMousedown:
|
|
169
|
+
dataHelper: z,
|
|
170
|
+
isMouseover: me,
|
|
171
|
+
isMousedown: ee,
|
|
172
172
|
setState: c,
|
|
173
|
-
setVisible:
|
|
174
|
-
setMousedown:
|
|
175
|
-
setMouseover:
|
|
173
|
+
setVisible: ve,
|
|
174
|
+
setMousedown: X,
|
|
175
|
+
setMouseover: O,
|
|
176
176
|
setMinFov: fe,
|
|
177
177
|
setMaxFov: pe,
|
|
178
178
|
setMaskerStatus: he,
|
|
179
|
-
zoom:
|
|
180
|
-
rotate:
|
|
179
|
+
zoom: oe,
|
|
180
|
+
rotate: te,
|
|
181
181
|
getState: u,
|
|
182
182
|
getPosition: P,
|
|
183
183
|
getZoomLevel: N,
|
|
184
184
|
getCameraPosition: D,
|
|
185
|
-
getCameraTarget:
|
|
185
|
+
getCameraTarget: Q,
|
|
186
186
|
getCameraHFov: Z,
|
|
187
|
-
getCameraStatus:
|
|
187
|
+
getCameraStatus: A
|
|
188
188
|
},
|
|
189
|
-
handleMaskerEvents:
|
|
190
|
-
handleUninstallEvents:
|
|
189
|
+
handleMaskerEvents: S,
|
|
190
|
+
handleUninstallEvents: k
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
const Ze = { class: "vsleem-masker" }, Ae = /* @__PURE__ */
|
|
193
|
+
const Ze = { class: "vsleem-masker" }, Ae = /* @__PURE__ */ se({
|
|
194
194
|
__name: "Masker",
|
|
195
195
|
props: {
|
|
196
196
|
bimseeProps: {},
|
|
197
197
|
bimseeStore: {}
|
|
198
198
|
},
|
|
199
199
|
emits: ["ready", "click", "mousedown", "zoom-updated", "position-updated"],
|
|
200
|
-
setup(r, { expose:
|
|
201
|
-
const d = r, a = n,
|
|
202
|
-
$(() => C(t)?.ready,
|
|
203
|
-
function T
|
|
204
|
-
|
|
200
|
+
setup(r, { expose: v, emit: n }) {
|
|
201
|
+
const d = r, a = n, i = g(), f = F(() => d.bimseeProps), t = F(() => d.bimseeStore), { getProps: h, getBindValue: y, maskerAction: u, handleMaskerEvents: c, handleUninstallEvents: S } = Ve(f, t, i, a);
|
|
202
|
+
$(() => C(t)?.ready, k, { immediate: !0 }), ie(L);
|
|
203
|
+
function k(T) {
|
|
204
|
+
T && (I(), c());
|
|
205
205
|
}
|
|
206
206
|
function I() {
|
|
207
207
|
a("ready", u?.getCameraStatus());
|
|
208
208
|
}
|
|
209
209
|
function L() {
|
|
210
|
-
|
|
210
|
+
S();
|
|
211
211
|
}
|
|
212
|
-
return
|
|
212
|
+
return v(u), (T, p) => (ce(), ue("div", Ze, [
|
|
213
213
|
ke(Te("div", {
|
|
214
214
|
ref_key: "maskerElRef",
|
|
215
|
-
ref:
|
|
215
|
+
ref: i,
|
|
216
216
|
class: "masker-container"
|
|
217
217
|
}, null, 512), [
|
|
218
218
|
[Ee, C(h).visible]
|
|
219
219
|
]),
|
|
220
|
-
|
|
220
|
+
q(T.$slots, "default", K(W(C(y))), void 0, !0)
|
|
221
221
|
]));
|
|
222
222
|
}
|
|
223
|
-
}),
|
|
223
|
+
}), de = (r, v) => {
|
|
224
224
|
const n = r.__vccOpts || r;
|
|
225
|
-
for (const [d, a] of
|
|
225
|
+
for (const [d, a] of v)
|
|
226
226
|
n[d] = a;
|
|
227
227
|
return n;
|
|
228
|
-
}, Ue = /* @__PURE__ */
|
|
228
|
+
}, Ue = /* @__PURE__ */ de(Ae, [["__scopeId", "data-v-605902cc"]]);
|
|
229
229
|
var V = /* @__PURE__ */ ((r) => (r[r.StoreMissParams = 11e3] = "StoreMissParams", r[r.StoreNoCSTree = 11001] = "StoreNoCSTree", r[r.StoreSelectNoBIMModel = 11002] = "StoreSelectNoBIMModel", r))(V || {});
|
|
230
|
-
function Oe(r, { setReferPoint:
|
|
231
|
-
const n =
|
|
232
|
-
async function u(
|
|
233
|
-
const { projectId: l, modelCsId:
|
|
230
|
+
function Oe(r, { setReferPoint: v }) {
|
|
231
|
+
const n = g(), d = g(), a = g(!1), i = g(!1), f = g(), t = g(), h = F(() => n.value?.findCsById(f.value)), y = F(() => h.value?.findParentSpace());
|
|
232
|
+
async function u(s) {
|
|
233
|
+
const { projectId: l, modelCsId: E } = s || {};
|
|
234
234
|
try {
|
|
235
235
|
if (!l)
|
|
236
|
-
throw new
|
|
236
|
+
throw new H(V.StoreMissParams, "缺少必要的查询参数");
|
|
237
237
|
if (a.value = !0, l != n.value?.projectId) {
|
|
238
238
|
const N = await Be.getCoordinateTree(l), D = await r.value.handleResponseFn?.(N) || N;
|
|
239
239
|
if (!D)
|
|
240
|
-
throw new
|
|
240
|
+
throw new H(
|
|
241
241
|
V.StoreNoCSTree,
|
|
242
242
|
`未查询到项目ID为 ${l} 的坐标系树`
|
|
243
243
|
);
|
|
244
244
|
n.value = D;
|
|
245
245
|
}
|
|
246
|
-
const P = n.value?.findCsById(
|
|
247
|
-
d.value = P?.getMappedCsTree(),
|
|
246
|
+
const P = n.value?.findCsById(E);
|
|
247
|
+
d.value = P?.getMappedCsTree(), S({ modelCsId: E }), r.value.fetchSuccess?.(n.value);
|
|
248
248
|
} catch (P) {
|
|
249
249
|
console.error(P), r.value.fetchError?.(P);
|
|
250
250
|
} finally {
|
|
251
251
|
a.value = !1;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
function c(
|
|
255
|
-
|
|
254
|
+
function c(s = !1) {
|
|
255
|
+
i.value = s;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
const { modelCsId: l } =
|
|
259
|
-
l &&
|
|
257
|
+
function S(s) {
|
|
258
|
+
const { modelCsId: l } = s;
|
|
259
|
+
l && k({ id: l });
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const { id: l } =
|
|
263
|
-
if (n.value?.findCsById(l)?.modelType ===
|
|
261
|
+
function k(s) {
|
|
262
|
+
const { id: l } = s;
|
|
263
|
+
if (n.value?.findCsById(l)?.modelType === xe.BIMModel)
|
|
264
264
|
f.value = l;
|
|
265
265
|
else
|
|
266
|
-
throw new
|
|
266
|
+
throw new H(V.StoreSelectNoBIMModel, `未找到ID为 ${l} 的BIM模型坐标系`);
|
|
267
267
|
}
|
|
268
|
-
function I(
|
|
269
|
-
t.value =
|
|
268
|
+
function I(s) {
|
|
269
|
+
t.value = s;
|
|
270
270
|
}
|
|
271
|
-
function L(
|
|
272
|
-
if (!h.value || !
|
|
273
|
-
const l = n.value?.findCsById(
|
|
271
|
+
function L(s) {
|
|
272
|
+
if (!h.value || !s) return;
|
|
273
|
+
const l = n.value?.findCsById(s.coordinate?.id);
|
|
274
274
|
if (!l) return;
|
|
275
|
-
const
|
|
276
|
-
if (!
|
|
277
|
-
const P = new
|
|
278
|
-
|
|
275
|
+
const E = l?.getDestRelativeMap(h.value);
|
|
276
|
+
if (!E) return;
|
|
277
|
+
const P = new ze(s.point).projection(
|
|
278
|
+
E,
|
|
279
279
|
l,
|
|
280
280
|
h.value
|
|
281
281
|
);
|
|
282
282
|
if (P)
|
|
283
283
|
return P.y = -P.y, {
|
|
284
|
-
...
|
|
284
|
+
...s,
|
|
285
285
|
coordinate: h.value,
|
|
286
286
|
point: P,
|
|
287
287
|
position: P
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function T() {
|
|
291
291
|
return p.value;
|
|
292
292
|
}
|
|
293
293
|
const p = F(
|
|
294
294
|
() => ({
|
|
295
295
|
// 状态
|
|
296
|
-
ready:
|
|
296
|
+
ready: i.value,
|
|
297
297
|
coordinateTree: n.value,
|
|
298
298
|
mappedCoordinateTree: d.value,
|
|
299
299
|
currentPoint: t.value,
|
|
300
300
|
// 计算属性
|
|
301
|
-
currentSpace:
|
|
301
|
+
currentSpace: y.value,
|
|
302
302
|
currentModel: h.value,
|
|
303
303
|
// 方法
|
|
304
304
|
reload: u,
|
|
305
|
-
selectModel:
|
|
305
|
+
selectModel: k,
|
|
306
306
|
selectPoint: I,
|
|
307
|
-
setReferPoint:
|
|
307
|
+
setReferPoint: v,
|
|
308
308
|
normalizeToModelPoint: L
|
|
309
309
|
})
|
|
310
310
|
);
|
|
311
311
|
return {
|
|
312
312
|
storeRef: p,
|
|
313
|
-
getStore:
|
|
313
|
+
getStore: T,
|
|
314
314
|
setReady: c
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
const { cloneDeep:
|
|
318
|
-
function je(r,
|
|
319
|
-
const d =
|
|
320
|
-
$(() =>
|
|
317
|
+
const { cloneDeep: re, deepMergeProps: Xe, getDiffProps: Ge } = le;
|
|
318
|
+
function je(r, v, n) {
|
|
319
|
+
const d = g(re(De)), a = F(() => d.value);
|
|
320
|
+
$(() => re(r), u, { immediate: !0, deep: !0 }), $(
|
|
321
321
|
() => a.value.searchInfo,
|
|
322
|
-
() => I(
|
|
322
|
+
() => I(i.value.ready),
|
|
323
323
|
{ deep: !0 }
|
|
324
324
|
);
|
|
325
|
-
const { storeRef:
|
|
326
|
-
Ce(h),
|
|
325
|
+
const { storeRef: i, getStore: f, setReady: t } = Oe(a, { setReferPoint: T });
|
|
326
|
+
Ce(h), ie(y);
|
|
327
327
|
async function h() {
|
|
328
|
-
const { appSetting: p, immediate:
|
|
329
|
-
p && Ne.setRequestGlobalConfig(p),
|
|
328
|
+
const { appSetting: p, immediate: s } = C(a);
|
|
329
|
+
p && Ne.setRequestGlobalConfig(p), s && (await I(!0), setTimeout(k, 0));
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function y() {
|
|
332
332
|
n?.("destroy");
|
|
333
333
|
}
|
|
334
|
-
function u(p,
|
|
335
|
-
const l = Ge(p,
|
|
336
|
-
|
|
334
|
+
function u(p, s) {
|
|
335
|
+
const l = Ge(p, s);
|
|
336
|
+
S(l);
|
|
337
337
|
}
|
|
338
338
|
function c() {
|
|
339
339
|
return C(a);
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function S(p) {
|
|
342
342
|
p && Xe(d.value, p);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function k() {
|
|
345
345
|
t(!0), n?.("ready");
|
|
346
346
|
}
|
|
347
347
|
async function I(p) {
|
|
348
|
-
const { searchInfo:
|
|
349
|
-
p &&
|
|
348
|
+
const { searchInfo: s } = a.value;
|
|
349
|
+
p && s && (await i.value?.reload(s), n?.("reload"));
|
|
350
350
|
}
|
|
351
351
|
function L() {
|
|
352
|
-
return
|
|
352
|
+
return v.value;
|
|
353
353
|
}
|
|
354
|
-
async function
|
|
354
|
+
async function T(p, s) {
|
|
355
355
|
const l = f();
|
|
356
356
|
if (l) {
|
|
357
|
-
const
|
|
358
|
-
if (!
|
|
359
|
-
l.
|
|
360
|
-
|
|
361
|
-
|
|
357
|
+
const E = L();
|
|
358
|
+
if (!E) return;
|
|
359
|
+
const P = l.normalizeToModelPoint(p);
|
|
360
|
+
if (!P) return;
|
|
361
|
+
l.selectPoint(P.point), await Le();
|
|
362
|
+
const { zoom: N = 0 } = s, { yaw: D = 0, pitch: Z = 0 } = s.position || {}, A = { yaw: P.point?.yaw + D, pitch: Z };
|
|
363
|
+
E.setMaskerStatus({ position: A, zoom: N });
|
|
362
364
|
}
|
|
363
365
|
}
|
|
364
366
|
return {
|
|
365
|
-
storeRef:
|
|
367
|
+
storeRef: i,
|
|
366
368
|
getStore: f,
|
|
367
369
|
getMasker: L,
|
|
368
370
|
getState: c,
|
|
369
|
-
setState:
|
|
371
|
+
setState: S
|
|
370
372
|
};
|
|
371
373
|
}
|
|
372
|
-
function He(r,
|
|
374
|
+
function He(r, v, n) {
|
|
373
375
|
const d = F(() => r.value.ready && !!r.value.currentModel), a = F(() => {
|
|
374
|
-
const { coordinateTree: t, mappedCoordinateTree: h, currentSpace:
|
|
376
|
+
const { coordinateTree: t, mappedCoordinateTree: h, currentSpace: y, currentModel: u, currentPoint: c } = r.value || {};
|
|
375
377
|
return {
|
|
376
378
|
coordinateTree: t,
|
|
377
379
|
mappedCoordinateTree: h,
|
|
378
|
-
currentSpace:
|
|
380
|
+
currentSpace: y,
|
|
379
381
|
currentModel: u,
|
|
380
382
|
currentPoint: c
|
|
381
383
|
};
|
|
@@ -383,7 +385,7 @@ function He(r, m, n) {
|
|
|
383
385
|
$(
|
|
384
386
|
() => a.value?.currentModel?.id,
|
|
385
387
|
(t) => {
|
|
386
|
-
t &&
|
|
388
|
+
t && i(a.value?.currentModel);
|
|
387
389
|
},
|
|
388
390
|
{
|
|
389
391
|
immediate: !0
|
|
@@ -398,7 +400,7 @@ function He(r, m, n) {
|
|
|
398
400
|
deep: !0
|
|
399
401
|
}
|
|
400
402
|
);
|
|
401
|
-
function
|
|
403
|
+
function i(t) {
|
|
402
404
|
n("change-model", t);
|
|
403
405
|
}
|
|
404
406
|
function f(t) {
|
|
@@ -409,43 +411,43 @@ function He(r, m, n) {
|
|
|
409
411
|
getBindValue: a
|
|
410
412
|
};
|
|
411
413
|
}
|
|
412
|
-
function qe(r,
|
|
413
|
-
const n =
|
|
414
|
+
function qe(r, v) {
|
|
415
|
+
const n = g({ yaw: 0, pitch: 0 });
|
|
414
416
|
function d(u) {
|
|
415
|
-
|
|
417
|
+
v("masker-ready", u);
|
|
416
418
|
}
|
|
417
419
|
function a(u) {
|
|
418
|
-
|
|
420
|
+
v("masker-click", u);
|
|
419
421
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
422
|
+
function i(u) {
|
|
423
|
+
v("masker-mousedown", u);
|
|
422
424
|
}
|
|
423
425
|
function f(u) {
|
|
424
|
-
|
|
426
|
+
v("masker-zoom-updated", u);
|
|
425
427
|
}
|
|
426
428
|
function t(u) {
|
|
427
|
-
|
|
429
|
+
v("masker-position-updated", u, h(u));
|
|
428
430
|
}
|
|
429
431
|
function h(u) {
|
|
430
|
-
const { yaw: c, pitch:
|
|
431
|
-
return n.value = { yaw: c, pitch:
|
|
432
|
+
const { yaw: c, pitch: S } = u.position, { yaw: k, pitch: I } = C(n);
|
|
433
|
+
return n.value = { yaw: c, pitch: S }, { yaw: c - k, pitch: S - I };
|
|
432
434
|
}
|
|
433
435
|
return { maskerEvents: {
|
|
434
436
|
ready: d,
|
|
435
437
|
click: a,
|
|
436
|
-
mousedown:
|
|
438
|
+
mousedown: i,
|
|
437
439
|
zoomUpdated: f,
|
|
438
440
|
positionUpdated: t
|
|
439
441
|
} };
|
|
440
442
|
}
|
|
441
|
-
const Ke = { class: "vsleem-bimsee" }, We = /* @__PURE__ */
|
|
443
|
+
const Ke = { class: "vsleem-bimsee" }, We = /* @__PURE__ */ se({
|
|
442
444
|
name: "Bimsee",
|
|
443
445
|
__name: "Bimsee",
|
|
444
446
|
props: {
|
|
445
447
|
appSetting: {},
|
|
446
448
|
searchInfo: {},
|
|
447
449
|
bimseeSetting: {},
|
|
448
|
-
masker: { default: () =>
|
|
450
|
+
masker: { default: () => J },
|
|
449
451
|
immediate: { type: Boolean, default: !0 },
|
|
450
452
|
handleResponseFn: {},
|
|
451
453
|
fetchSuccess: {},
|
|
@@ -463,27 +465,27 @@ const Ke = { class: "vsleem-bimsee" }, We = /* @__PURE__ */ ae({
|
|
|
463
465
|
"masker-zoom-updated",
|
|
464
466
|
"masker-position-updated"
|
|
465
467
|
],
|
|
466
|
-
setup(r, { expose:
|
|
467
|
-
const d = r, a = n,
|
|
468
|
-
return
|
|
468
|
+
setup(r, { expose: v, emit: n }) {
|
|
469
|
+
const d = r, a = n, i = g(), f = je(d, i, a), { storeRef: t, getMasker: h } = f, { getBindValue: y } = He(t, h, a), { maskerEvents: u } = qe(h, a);
|
|
470
|
+
return v(f), (c, S) => (ce(), ue("div", Ke, [
|
|
469
471
|
_e(Ue, Ie({
|
|
470
472
|
ref_key: "maskerElRef",
|
|
471
|
-
ref:
|
|
473
|
+
ref: i,
|
|
472
474
|
bimseeProps: d,
|
|
473
475
|
bimseeStore: C(t)
|
|
474
476
|
}, Fe(C(u))), {
|
|
475
|
-
default: be((
|
|
476
|
-
|
|
477
|
+
default: be((k) => [
|
|
478
|
+
q(c.$slots, "masker", K(W(k)), void 0, !0)
|
|
477
479
|
]),
|
|
478
480
|
_: 3
|
|
479
481
|
}, 16, ["bimseeStore"]),
|
|
480
|
-
|
|
482
|
+
q(c.$slots, "default", K(W(C(y))), void 0, !0)
|
|
481
483
|
]));
|
|
482
484
|
}
|
|
483
|
-
}), tt = /* @__PURE__ */
|
|
485
|
+
}), tt = /* @__PURE__ */ de(We, [["__scopeId", "data-v-348a21e7"]]);
|
|
484
486
|
export {
|
|
485
487
|
De as BIMSEE_CONFIG,
|
|
486
488
|
tt as Bimsee,
|
|
487
489
|
tt as BimseePlugin,
|
|
488
|
-
|
|
490
|
+
J as MASKER_CONFIG
|
|
489
491
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_.BimseePlugin={},_.Vue,_.VSLeemShared))})(this,(function(_,e,g){"use strict";const V={visible:!0,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,minFov:20,maxFov:120},j={appSetting:g.APP_SETTING,masker:V,immediate:!0},{cloneDeep:X,deepMergeProps:ee,getDiffProps:te}=g.utils;function oe(s,p,a,f){const r=e.ref(X(V)),i=e.ref(),v=e.ref(),o=e.computed(()=>r.value),w=e.computed(()=>{const{coordinateTree:t,mappedCoordinateTree:n,currentSpace:m,currentModel:P,currentPoint:M}=p.value||{};return{coordinateTree:t,mappedCoordinateTree:n,currentSpace:m,currentModel:P,currentPoint:M,cameraStatus:i.value,state:o.value}});e.watch(()=>X(s.value.masker),k,{immediate:!0,deep:!0});function k(t,n){const m=te(t,n);l(m)}function u(){return e.unref(o)}function l(t){t&&ee(r.value,t)}function T(){const t=e.unref(a);t&&(t.addEventListener("mousedown",L),t.addEventListener("touchstart",L),t.addEventListener("click",F),window.addEventListener("mousemove",C),window.addEventListener("touchmove",C),window.addEventListener("mouseup",h),window.addEventListener("touchend",h),t.addEventListener("mouseover",c),t.addEventListener("mouseout",d),t.addEventListener("wheel",S))}function E(){const t=e.unref(a);t&&(t.removeEventListener("mousedown",L),t.removeEventListener("touchstart",L),window.removeEventListener("mousemove",C),window.removeEventListener("touchmove",C),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),t.removeEventListener("mouseover",c),t.removeEventListener("mouseout",d),t.removeEventListener("wheel",S))}function F(t){f("click",t)}function L(t){const n=t instanceof TouchEvent?t.touches[0]:t,{defaultYaw:m=0,defaultPitch:P=0}=o.value,M=Number(m)-Number(p.value.currentPoint?.yaw||0);v.value={pageX:n.pageX,pageY:n.pageY,defaultYaw:M,defaultPitch:P},Z(!0),f("mousedown",t)}function C(t){if(!v.value||!W())return;const n=t instanceof TouchEvent?t.touches[0]:t,{pageX:m,pageY:P}=n,{pageX:M,pageY:I}=v.value,{defaultYaw:B=0,defaultPitch:Y=0}=v.value,z=Math.PI*.15/180;let N=(Number(B)-(m-M)*z)%(2*Math.PI),R=(Number(Y)+(P-I)*z)%(2*Math.PI);R=Math.max(-Math.PI/2,Math.min(Math.PI/2,R));const G=new g.Position({yaw:N,pitch:R});J(G)}function h(){Z(!1),v.value=void 0}function c(){U(!0)}function d(){U(!1)}function S(t){t.preventDefault(),t.stopPropagation();const n=Math.sign(t.deltaY)*5;if(n===0)return;const{minFov:m=0,maxFov:P=0}=o.value,{hFov:M=0}=i.value||{},I=Math.min(Math.max(M+n,m),P);I!==M&&Q(b.fovToZoomLevel(I))}function y(){const{defaultYaw:t,defaultPitch:n}=o.value;return{yaw:t,pitch:n}}function x(){return o.value.defaultZoomLvl}function D(){return i.value?.position}function A(){return i.value?.hFov}function me(){return i.value?.target}function pe(){return i.value}function ve(){return o.value?.mouseover??!1}function W(){return o.value?.mousedown??!1}function O(t){i.value={...i.value,...t}}function he(t){l({visible:t})}function U(t){l({mouseover:t})}function Z(t){l({mousedown:t})}function we(t){l({minFov:t})}function Me(t){l({maxFov:t})}function Pe(t){const{currentPoint:n}=p.value;if(n){const{minFov:m,maxFov:P}=o.value,{yaw:M=0,pitch:I=0,zoomLevel:B=0}=t,Y=new g.Position({yaw:M,pitch:I}),z=b.modelPointToCameraPosition(n),N=b.maskerRotateToCameraTarget(Y,z),R=b.zoomLevelToFov(B);l({defaultYaw:M,defaultPitch:I,defaultZoomLvl:B}),O({position:z,target:N,hFov:R,minFov:m,maxFov:P})}}function J(t){const n=i.value?.position;if(!n)return;const{yaw:m,pitch:P}=t,M=Number(p.value.currentPoint?.yaw||0)+m,I=new g.Position({yaw:Number(M),pitch:Number(P)}),B=b.maskerRotateToCameraTarget(I,n);l({defaultYaw:M,defaultPitch:P}),O({target:B}),f("position-updated",{position:t,target:B})}function Q(t){const n=b.zoomLevelToFov(t);l({defaultZoomLvl:t}),O({hFov:n}),f("zoom-updated",{zoomLevel:t,hFov:n})}function ge(t){return new g.Vector3(t)}function ye(t,n){const{x:m=0,y:P=0,z:M=0}=n,{yaw:I,pitch:B}=t,Y=-I,z=B,N=100,R=0,G=N*Math.cos(R+Y)+m,Te=N*Math.sin(R+Y)+P,Ee=N*Math.tan(z)+M;return new g.Vector3({x:G,y:Te,z:Ee})}function Se(t){const{minFov:n=20,maxFov:m=120}=o.value,M=100-(Math.max(n,Math.min(m,t))-n)/(m-n)*100;return Math.max(0,Math.min(100,Math.round(M)))}function ke(t){const{minFov:n=20,maxFov:m=120}=o.value;let P=m+t/100*(n-m);return Math.max(n,Math.min(m,P))}const b={modelPointToCameraPosition:ge,maskerRotateToCameraTarget:ye,fovToZoomLevel:Se,zoomLevelToFov:ke};return{getProps:o,getBindValue:w,maskerAction:{dataHelper:b,isMouseover:ve,isMousedown:W,setState:l,setVisible:he,setMousedown:Z,setMouseover:U,setMinFov:we,setMaxFov:Me,setMaskerStatus:Pe,zoom:Q,rotate:J,getState:u,getPosition:y,getZoomLevel:x,getCameraPosition:D,getCameraTarget:me,getCameraHFov:A,getCameraStatus:pe},handleMaskerEvents:T,handleUninstallEvents:E}}const ne={class:"vsleem-masker"},ae=e.defineComponent({__name:"Masker",props:{bimseeProps:{},bimseeStore:{}},emits:["ready","click","mousedown","zoom-updated","position-updated"],setup(s,{expose:p,emit:a}){const f=s,r=a,i=e.ref(),v=e.computed(()=>f.bimseeProps),o=e.computed(()=>f.bimseeStore),{getProps:w,getBindValue:k,maskerAction:u,handleMaskerEvents:l,handleUninstallEvents:T}=oe(v,o,i,r);e.watch(()=>e.unref(o)?.ready,E,{immediate:!0}),e.onBeforeUnmount(L);function E(C){C&&(F(),l())}function F(){r("ready",u?.getCameraStatus())}function L(){T()}return p(u),(C,h)=>(e.openBlock(),e.createElementBlock("div",ne,[e.withDirectives(e.createElementVNode("div",{ref_key:"maskerElRef",ref:i,class:"masker-container"},null,512),[[e.vShow,e.unref(w).visible]]),e.renderSlot(C.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(k))),void 0,!0)]))}}),q=(s,p)=>{const a=s.__vccOpts||s;for(const[f,r]of p)a[f]=r;return a},re=q(ae,[["__scopeId","data-v-605902cc"]]);var $=(s=>(s[s.StoreMissParams=11e3]="StoreMissParams",s[s.StoreNoCSTree=11001]="StoreNoCSTree",s[s.StoreSelectNoBIMModel=11002]="StoreSelectNoBIMModel",s))($||{});function se(s,{setReferPoint:p}){const a=e.ref(),f=e.ref(),r=e.ref(!1),i=e.ref(!1),v=e.ref(),o=e.ref(),w=e.computed(()=>a.value?.findCsById(v.value)),k=e.computed(()=>w.value?.findParentSpace());async function u(c){const{projectId:d,modelCsId:S}=c||{};try{if(!d)throw new g.AppError($.StoreMissParams,"缺少必要的查询参数");if(r.value=!0,d!=a.value?.projectId){const x=await g.DataSource.getCoordinateTree(d),D=await s.value.handleResponseFn?.(x)||x;if(!D)throw new g.AppError($.StoreNoCSTree,`未查询到项目ID为 ${d} 的坐标系树`);a.value=D}const y=a.value?.findCsById(S);f.value=y?.getMappedCsTree(),T({modelCsId:S}),s.value.fetchSuccess?.(a.value)}catch(y){console.error(y),s.value.fetchError?.(y)}finally{r.value=!1}}function l(c=!1){i.value=c}function T(c){const{modelCsId:d}=c;d&&E({id:d})}function E(c){const{id:d}=c;if(a.value?.findCsById(d)?.modelType===g.CoordinateModelType.BIMModel)v.value=d;else throw new g.AppError($.StoreSelectNoBIMModel,`未找到ID为 ${d} 的BIM模型坐标系`)}function F(c){o.value=c}function L(c){if(!w.value||!c)return;const d=a.value?.findCsById(c.coordinate?.id);if(!d)return;const S=d?.getDestRelativeMap(w.value);if(!S)return;const y=new g.Point(c.point).projection(S,d,w.value);if(y)return y.y=-y.y,{...c,coordinate:w.value,point:y,position:y}}function C(){return h.value}const h=e.computed(()=>({ready:i.value,coordinateTree:a.value,mappedCoordinateTree:f.value,currentPoint:o.value,currentSpace:k.value,currentModel:w.value,reload:u,selectModel:E,selectPoint:F,setReferPoint:p,normalizeToModelPoint:L}));return{storeRef:h,getStore:C,setReady:l}}const{cloneDeep:H,deepMergeProps:ie,getDiffProps:ce}=g.utils;function ue(s,p,a){const f=e.ref(H(j)),r=e.computed(()=>f.value);e.watch(()=>H(s),u,{immediate:!0,deep:!0}),e.watch(()=>r.value.searchInfo,()=>F(i.value.ready),{deep:!0});const{storeRef:i,getStore:v,setReady:o}=se(r,{setReferPoint:C});e.onMounted(w),e.onBeforeUnmount(k);async function w(){const{appSetting:h,immediate:c}=e.unref(r);h&&g.http.setRequestGlobalConfig(h),c&&(await F(!0),setTimeout(E,0))}function k(){a?.("destroy")}function u(h,c){const d=ce(h,c);T(d)}function l(){return e.unref(r)}function T(h){h&&ie(f.value,h)}function E(){o(!0),a?.("ready")}async function F(h){const{searchInfo:c}=r.value;h&&c&&(await i.value?.reload(c),a?.("reload"))}function L(){return p.value}async function C(h,c){const d=v();if(d){const S=d.normalizeToModelPoint(h);if(!S)return;d.selectPoint(S.point),await e.nextTick();const{yaw:y=0,pitch:x=0,zoomLevel:D=0}=c,A=S.point?.yaw+y;L()?.setMaskerStatus({yaw:A,pitch:x,zoomLevel:D})}}return{storeRef:i,getStore:v,getMasker:L,getState:l,setState:T}}function le(s,p,a){const f=e.computed(()=>s.value.ready&&!!s.value.currentModel),r=e.computed(()=>{const{coordinateTree:o,mappedCoordinateTree:w,currentSpace:k,currentModel:u,currentPoint:l}=s.value||{};return{coordinateTree:o,mappedCoordinateTree:w,currentSpace:k,currentModel:u,currentPoint:l}});e.watch(()=>r.value?.currentModel?.id,o=>{o&&i(r.value?.currentModel)},{immediate:!0}),e.watch(()=>r.value?.currentPoint,o=>{o&&v(r.value?.currentPoint)},{immediate:!0,deep:!0});function i(o){a("change-model",o)}function v(o){a("change-point",o)}return{getShow:f,getBindValue:r}}function de(s,p){const a=e.ref({yaw:0,pitch:0});function f(u){p("masker-ready",u)}function r(u){p("masker-click",u)}function i(u){p("masker-mousedown",u)}function v(u){p("masker-zoom-updated",u)}function o(u){p("masker-position-updated",u,w(u))}function w(u){const{yaw:l,pitch:T}=u.position,{yaw:E,pitch:F}=e.unref(a);return a.value={yaw:l,pitch:T},{yaw:l-E,pitch:T-F}}return{maskerEvents:{ready:f,click:r,mousedown:i,zoomUpdated:v,positionUpdated:o}}}const fe={class:"vsleem-bimsee"},K=q(e.defineComponent({name:"Bimsee",__name:"Bimsee",props:{appSetting:{},searchInfo:{},bimseeSetting:{},masker:{default:()=>V},immediate:{type:Boolean,default:!0},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-point","masker-ready","masker-click","masker-mousedown","masker-zoom-updated","masker-position-updated"],setup(s,{expose:p,emit:a}){const f=s,r=a,i=e.ref(),v=ue(f,i,r),{storeRef:o,getMasker:w}=v,{getBindValue:k}=le(o,w,r),{maskerEvents:u}=de(w,r);return p(v),(l,T)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(re,e.mergeProps({ref_key:"maskerElRef",ref:i,bimseeProps:f,bimseeStore:e.unref(o)},e.toHandlers(e.unref(u))),{default:e.withCtx(E=>[e.renderSlot(l.$slots,"masker",e.normalizeProps(e.guardReactiveProps(E)),void 0,!0)]),_:3},16,["bimseeStore"]),e.renderSlot(l.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(k))),void 0,!0)]))}}),[["__scopeId","data-v-348a21e7"]]);_.BIMSEE_CONFIG=j,_.Bimsee=K,_.BimseePlugin=K,_.MASKER_CONFIG=V,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_.BimseePlugin={},_.Vue,_.VSLeemShared))})(this,(function(_,e,y){"use strict";const V={visible:!0,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,minFov:20,maxFov:120},X={appSetting:y.APP_SETTING,masker:V,immediate:!0},{cloneDeep:q,deepMergeProps:oe,getDiffProps:ne}=y.utils;function ae(s,p,a,f){const r=e.ref(q(V)),c=e.ref(),v=e.ref(),o=e.computed(()=>r.value),w=e.computed(()=>{const{coordinateTree:t,mappedCoordinateTree:n,currentSpace:m,currentModel:P,currentPoint:M}=p.value||{};return{coordinateTree:t,mappedCoordinateTree:n,currentSpace:m,currentModel:P,currentPoint:M,cameraStatus:c.value,state:o.value}});e.watch(()=>q(s.value.masker),S,{immediate:!0,deep:!0});function S(t,n){const m=ne(t,n);l(m)}function u(){return e.unref(o)}function l(t){t&&oe(r.value,t)}function k(){const t=e.unref(a);t&&(t.addEventListener("mousedown",I),t.addEventListener("touchstart",I),t.addEventListener("click",F),window.addEventListener("mousemove",E),window.addEventListener("touchmove",E),window.addEventListener("mouseup",h),window.addEventListener("touchend",h),t.addEventListener("mouseover",i),t.addEventListener("mouseout",d),t.addEventListener("wheel",C))}function T(){const t=e.unref(a);t&&(t.removeEventListener("mousedown",I),t.removeEventListener("touchstart",I),window.removeEventListener("mousemove",E),window.removeEventListener("touchmove",E),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),t.removeEventListener("mouseover",i),t.removeEventListener("mouseout",d),t.removeEventListener("wheel",C))}function F(t){f("click",t)}function I(t){const n=t instanceof TouchEvent?t.touches[0]:t,{defaultYaw:m=0,defaultPitch:P=0}=o.value,M=Number(m)-Number(p.value.currentPoint?.yaw||0);v.value={pageX:n.pageX,pageY:n.pageY,defaultYaw:M,defaultPitch:P},G(!0),f("mousedown",t)}function E(t){if(!v.value||!Q())return;const n=t instanceof TouchEvent?t.touches[0]:t,{pageX:m,pageY:P}=n,{pageX:M,pageY:L}=v.value,{defaultYaw:B=0,defaultPitch:Y=0}=v.value,z=Math.PI*.15/180;let N=(Number(B)-(m-M)*z)%(2*Math.PI),R=(Number(Y)+(P-L)*z)%(2*Math.PI);R=Math.max(-Math.PI/2,Math.min(Math.PI/2,R));const j=new y.Position({yaw:N,pitch:R});ee(j)}function h(){G(!1),v.value=void 0}function i(){Z(!0)}function d(){Z(!1)}function C(t){t.preventDefault(),t.stopPropagation();const n=Math.sign(t.deltaY)*5;if(n===0)return;const{minFov:m=0,maxFov:P=0}=o.value,{hFov:M=0}=c.value||{},L=Math.min(Math.max(M+n,m),P);L!==M&&te(b.fovToZoomLevel(L))}function g(){const{defaultYaw:t,defaultPitch:n}=o.value;return{yaw:t,pitch:n}}function x(){return o.value.defaultZoomLvl}function D(){return c.value?.position}function A(){return c.value?.hFov}function J(){return c.value?.target}function O(){return c.value}function ve(){return o.value?.mouseover??!1}function Q(){return o.value?.mousedown??!1}function U(t){c.value={...c.value,...t}}function he(t){l({visible:t})}function Z(t){l({mouseover:t})}function G(t){l({mousedown:t})}function we(t){l({minFov:t})}function Me(t){l({maxFov:t})}function Pe(t){const{currentPoint:n}=p.value;if(n){const{minFov:m,maxFov:P}=o.value,{zoom:M=0}=t,{yaw:L=0,pitch:B=0}=t.position||{},Y=new y.Position({yaw:L,pitch:B}),z=b.modelPointToCameraPosition(n),N=b.maskerRotateToCameraTarget(Y,z),R=b.zoomLevelToFov(M);l({defaultYaw:L,defaultPitch:B,defaultZoomLvl:M}),U({position:z,target:N,hFov:R,minFov:m,maxFov:P})}}function ee(t){const n=c.value?.position;if(!n)return;const{yaw:m,pitch:P}=t,M=Number(p.value.currentPoint?.yaw||0)+m,L=new y.Position({yaw:Number(M),pitch:Number(P)}),B=b.maskerRotateToCameraTarget(L,n);l({defaultYaw:M,defaultPitch:P}),U({target:B}),f("position-updated",{position:t,target:B})}function te(t){const n=b.zoomLevelToFov(t);l({defaultZoomLvl:t}),U({hFov:n}),f("zoom-updated",{zoomLevel:t,hFov:n})}function ge(t){return new y.Vector3(t)}function ye(t,n){const{x:m=0,y:P=0,z:M=0}=n,{yaw:L,pitch:B}=t,Y=-L,z=B,N=100,R=0,j=N*Math.cos(R+Y)+m,Te=N*Math.sin(R+Y)+P,Ee=N*Math.tan(z)+M;return new y.Vector3({x:j,y:Te,z:Ee})}function Se(t){const{minFov:n=20,maxFov:m=120}=o.value,M=100-(Math.max(n,Math.min(m,t))-n)/(m-n)*100;return Math.max(0,Math.min(100,Math.round(M)))}function ke(t){const{minFov:n=20,maxFov:m=120}=o.value;let P=m+t/100*(n-m);return Math.max(n,Math.min(m,P))}const b={modelPointToCameraPosition:ge,maskerRotateToCameraTarget:ye,fovToZoomLevel:Se,zoomLevelToFov:ke};return{getProps:o,getBindValue:w,maskerAction:{dataHelper:b,isMouseover:ve,isMousedown:Q,setState:l,setVisible:he,setMousedown:G,setMouseover:Z,setMinFov:we,setMaxFov:Me,setMaskerStatus:Pe,zoom:te,rotate:ee,getState:u,getPosition:g,getZoomLevel:x,getCameraPosition:D,getCameraTarget:J,getCameraHFov:A,getCameraStatus:O},handleMaskerEvents:k,handleUninstallEvents:T}}const re={class:"vsleem-masker"},se=e.defineComponent({__name:"Masker",props:{bimseeProps:{},bimseeStore:{}},emits:["ready","click","mousedown","zoom-updated","position-updated"],setup(s,{expose:p,emit:a}){const f=s,r=a,c=e.ref(),v=e.computed(()=>f.bimseeProps),o=e.computed(()=>f.bimseeStore),{getProps:w,getBindValue:S,maskerAction:u,handleMaskerEvents:l,handleUninstallEvents:k}=ae(v,o,c,r);e.watch(()=>e.unref(o)?.ready,T,{immediate:!0}),e.onBeforeUnmount(I);function T(E){E&&(F(),l())}function F(){r("ready",u?.getCameraStatus())}function I(){k()}return p(u),(E,h)=>(e.openBlock(),e.createElementBlock("div",re,[e.withDirectives(e.createElementVNode("div",{ref_key:"maskerElRef",ref:c,class:"masker-container"},null,512),[[e.vShow,e.unref(w).visible]]),e.renderSlot(E.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(S))),void 0,!0)]))}}),H=(s,p)=>{const a=s.__vccOpts||s;for(const[f,r]of p)a[f]=r;return a},ie=H(se,[["__scopeId","data-v-605902cc"]]);var $=(s=>(s[s.StoreMissParams=11e3]="StoreMissParams",s[s.StoreNoCSTree=11001]="StoreNoCSTree",s[s.StoreSelectNoBIMModel=11002]="StoreSelectNoBIMModel",s))($||{});function ce(s,{setReferPoint:p}){const a=e.ref(),f=e.ref(),r=e.ref(!1),c=e.ref(!1),v=e.ref(),o=e.ref(),w=e.computed(()=>a.value?.findCsById(v.value)),S=e.computed(()=>w.value?.findParentSpace());async function u(i){const{projectId:d,modelCsId:C}=i||{};try{if(!d)throw new y.AppError($.StoreMissParams,"缺少必要的查询参数");if(r.value=!0,d!=a.value?.projectId){const x=await y.DataSource.getCoordinateTree(d),D=await s.value.handleResponseFn?.(x)||x;if(!D)throw new y.AppError($.StoreNoCSTree,`未查询到项目ID为 ${d} 的坐标系树`);a.value=D}const g=a.value?.findCsById(C);f.value=g?.getMappedCsTree(),k({modelCsId:C}),s.value.fetchSuccess?.(a.value)}catch(g){console.error(g),s.value.fetchError?.(g)}finally{r.value=!1}}function l(i=!1){c.value=i}function k(i){const{modelCsId:d}=i;d&&T({id:d})}function T(i){const{id:d}=i;if(a.value?.findCsById(d)?.modelType===y.CoordinateModelType.BIMModel)v.value=d;else throw new y.AppError($.StoreSelectNoBIMModel,`未找到ID为 ${d} 的BIM模型坐标系`)}function F(i){o.value=i}function I(i){if(!w.value||!i)return;const d=a.value?.findCsById(i.coordinate?.id);if(!d)return;const C=d?.getDestRelativeMap(w.value);if(!C)return;const g=new y.Point(i.point).projection(C,d,w.value);if(g)return g.y=-g.y,{...i,coordinate:w.value,point:g,position:g}}function E(){return h.value}const h=e.computed(()=>({ready:c.value,coordinateTree:a.value,mappedCoordinateTree:f.value,currentPoint:o.value,currentSpace:S.value,currentModel:w.value,reload:u,selectModel:T,selectPoint:F,setReferPoint:p,normalizeToModelPoint:I}));return{storeRef:h,getStore:E,setReady:l}}const{cloneDeep:K,deepMergeProps:ue,getDiffProps:le}=y.utils;function de(s,p,a){const f=e.ref(K(X)),r=e.computed(()=>f.value);e.watch(()=>K(s),u,{immediate:!0,deep:!0}),e.watch(()=>r.value.searchInfo,()=>F(c.value.ready),{deep:!0});const{storeRef:c,getStore:v,setReady:o}=ce(r,{setReferPoint:E});e.onMounted(w),e.onBeforeUnmount(S);async function w(){const{appSetting:h,immediate:i}=e.unref(r);h&&y.http.setRequestGlobalConfig(h),i&&(await F(!0),setTimeout(T,0))}function S(){a?.("destroy")}function u(h,i){const d=le(h,i);k(d)}function l(){return e.unref(r)}function k(h){h&&ue(f.value,h)}function T(){o(!0),a?.("ready")}async function F(h){const{searchInfo:i}=r.value;h&&i&&(await c.value?.reload(i),a?.("reload"))}function I(){return p.value}async function E(h,i){const d=v();if(d){const C=I();if(!C)return;const g=d.normalizeToModelPoint(h);if(!g)return;d.selectPoint(g.point),await e.nextTick();const{zoom:x=0}=i,{yaw:D=0,pitch:A=0}=i.position||{},O={yaw:g.point?.yaw+D,pitch:A};C.setMaskerStatus({position:O,zoom:x})}}return{storeRef:c,getStore:v,getMasker:I,getState:l,setState:k}}function fe(s,p,a){const f=e.computed(()=>s.value.ready&&!!s.value.currentModel),r=e.computed(()=>{const{coordinateTree:o,mappedCoordinateTree:w,currentSpace:S,currentModel:u,currentPoint:l}=s.value||{};return{coordinateTree:o,mappedCoordinateTree:w,currentSpace:S,currentModel:u,currentPoint:l}});e.watch(()=>r.value?.currentModel?.id,o=>{o&&c(r.value?.currentModel)},{immediate:!0}),e.watch(()=>r.value?.currentPoint,o=>{o&&v(r.value?.currentPoint)},{immediate:!0,deep:!0});function c(o){a("change-model",o)}function v(o){a("change-point",o)}return{getShow:f,getBindValue:r}}function me(s,p){const a=e.ref({yaw:0,pitch:0});function f(u){p("masker-ready",u)}function r(u){p("masker-click",u)}function c(u){p("masker-mousedown",u)}function v(u){p("masker-zoom-updated",u)}function o(u){p("masker-position-updated",u,w(u))}function w(u){const{yaw:l,pitch:k}=u.position,{yaw:T,pitch:F}=e.unref(a);return a.value={yaw:l,pitch:k},{yaw:l-T,pitch:k-F}}return{maskerEvents:{ready:f,click:r,mousedown:c,zoomUpdated:v,positionUpdated:o}}}const pe={class:"vsleem-bimsee"},W=H(e.defineComponent({name:"Bimsee",__name:"Bimsee",props:{appSetting:{},searchInfo:{},bimseeSetting:{},masker:{default:()=>V},immediate:{type:Boolean,default:!0},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-point","masker-ready","masker-click","masker-mousedown","masker-zoom-updated","masker-position-updated"],setup(s,{expose:p,emit:a}){const f=s,r=a,c=e.ref(),v=de(f,c,r),{storeRef:o,getMasker:w}=v,{getBindValue:S}=fe(o,w,r),{maskerEvents:u}=me(w,r);return p(v),(l,k)=>(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(ie,e.mergeProps({ref_key:"maskerElRef",ref:c,bimseeProps:f,bimseeStore:e.unref(o)},e.toHandlers(e.unref(u))),{default:e.withCtx(T=>[e.renderSlot(l.$slots,"masker",e.normalizeProps(e.guardReactiveProps(T)),void 0,!0)]),_:3},16,["bimseeStore"]),e.renderSlot(l.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(S))),void 0,!0)]))}}),[["__scopeId","data-v-348a21e7"]]);_.BIMSEE_CONFIG=X,_.Bimsee=W,_.BimseePlugin=W,_.MASKER_CONFIG=V,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/types/masker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Position, Vector3
|
|
1
|
+
import { Point, Position, Vector3 } from '@vsleem-realsee-viewer/shared';
|
|
2
2
|
export type CameraStatus = {
|
|
3
3
|
position?: Vector3 /** 相机在世界坐标系中的位置 */;
|
|
4
4
|
target?: Vector3 /** 相机瞄准的目标点 */;
|
|
@@ -7,11 +7,10 @@ export type CameraStatus = {
|
|
|
7
7
|
minFov?: number /** 最小视野角度 */;
|
|
8
8
|
maxFov?: number /** 最大视野角度 */;
|
|
9
9
|
};
|
|
10
|
-
/**
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
zoomLevel: number /** 默认缩放级别(球面基准) */;
|
|
10
|
+
/** 部分全景图选项 */
|
|
11
|
+
export type PanoOptions = {
|
|
12
|
+
position: Partial<Position> /** 球面视角(球面基准) */;
|
|
13
|
+
zoom: number /** 缩放级别(球面基准) */;
|
|
15
14
|
};
|
|
16
15
|
/** 蒙层参数 */
|
|
17
16
|
export type MaskerProps = {
|
|
@@ -48,7 +47,7 @@ export type MaskerElement = {
|
|
|
48
47
|
setMouseover: (mouseover: boolean) => void /** 设置鼠标悬停状态 */;
|
|
49
48
|
setMinFov: (minFov: number) => void /** 设置最小视野 */;
|
|
50
49
|
setMaxFov: (maxFov: number) => void /** 设置最大视野 */;
|
|
51
|
-
setMaskerStatus: (options:
|
|
50
|
+
setMaskerStatus: (options: PanoOptions) => void /** 更新蒙层状态 */;
|
|
52
51
|
zoom: (level: number) => void /** 缩放到指定级别 */;
|
|
53
52
|
rotate: (position: Position) => void /** 旋转视图到指定位置 */;
|
|
54
53
|
getState: () => MaskerProps /** 获取当前蒙层状态 */;
|
package/dist/types/store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Coordinate, Point } from '@vsleem-realsee-viewer/shared';
|
|
2
|
-
import { SearchInfo, TrackPoint
|
|
2
|
+
import { PanoOptions, SearchInfo, TrackPoint } from '../types';
|
|
3
3
|
/** Bimsee 状态管理元素类型 */
|
|
4
4
|
export type BimseeStore = {
|
|
5
5
|
/** 是否加载完成 */
|
|
@@ -21,7 +21,7 @@ export type BimseeStore = {
|
|
|
21
21
|
/**设置模型的点 */
|
|
22
22
|
selectPoint: (point: Point) => void;
|
|
23
23
|
/** 设置参考点 */
|
|
24
|
-
setReferPoint: (current: TrackPoint, options:
|
|
24
|
+
setReferPoint: (current: TrackPoint, options: PanoOptions) => void;
|
|
25
25
|
/**将参考点坐标归一化到当前模型坐标系点 */
|
|
26
26
|
normalizeToModelPoint: (current: TrackPoint) => TrackPoint | undefined;
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vsleem-realsee-viewer/bimsee-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26",
|
|
4
4
|
"description": "Bimsee plugin for VSLeem RealSee Viewer",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vsleem-realsee-viewer/shared": "2.0.
|
|
16
|
+
"@vsleem-realsee-viewer/shared": "2.0.26"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"vue": "^3.0.0",
|
|
20
|
-
"@vsleem-realsee-viewer/shared": "2.0.
|
|
20
|
+
"@vsleem-realsee-viewer/shared": "2.0.26"
|
|
21
21
|
},
|
|
22
22
|
"peerDependenciesMeta": {
|
|
23
23
|
"vue": {
|