@vsleem-realsee-viewer/bimsee-plugin 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +350 -0
- package/dist/index.mjs +409 -0
- package/dist/index.umd.js +1 -0
- package/package.json +33 -0
package/README.md
ADDED
|
File without changes
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vsleem-bimsee-viewer[data-v-29adba86]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:20;cursor:all-scroll}.vsleem-bimsee[data-v-23825a8d]{position:relative;width:100%;height:100%}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { AppSetting } from '@vsleem-realsee-viewer/shared';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { Coordinate } from '@vsleem-realsee-viewer/shared';
|
|
5
|
+
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
6
|
+
import { DefineComponent } from 'vue';
|
|
7
|
+
import { GlobalComponents } from 'vue';
|
|
8
|
+
import { GlobalDirectives } from 'vue';
|
|
9
|
+
import { Point } from '@vsleem-realsee-viewer/shared';
|
|
10
|
+
import { Position } from '@vsleem-realsee-viewer/shared';
|
|
11
|
+
import { PublicProps } from 'vue';
|
|
12
|
+
import { Vector3 } from '@vsleem-realsee-viewer/shared';
|
|
13
|
+
|
|
14
|
+
declare const __VLS_component: DefineComponent<BimseeProps, {
|
|
15
|
+
getStore: () => BimseeStore;
|
|
16
|
+
getViewer: () => ViewerElement | undefined;
|
|
17
|
+
getState: () => BimseeProps;
|
|
18
|
+
setState: (options?: UpdatableBimseeProps) => void;
|
|
19
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
20
|
+
ready: (...args: any[]) => void;
|
|
21
|
+
"viewer-ready": (...args: any[]) => void;
|
|
22
|
+
"viewer-click": (...args: any[]) => void;
|
|
23
|
+
"viewer-mousedown": (...args: any[]) => void;
|
|
24
|
+
"viewer-zoom-updated": (...args: any[]) => void;
|
|
25
|
+
"viewer-position-updated": (...args: any[]) => void;
|
|
26
|
+
"viewer-point-updated": (...args: any[]) => void;
|
|
27
|
+
"change-model": (...args: any[]) => void;
|
|
28
|
+
}, string, PublicProps, Readonly<BimseeProps> & Readonly<{
|
|
29
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
"onViewer-ready"?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
"onViewer-click"?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
"onViewer-mousedown"?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
"onViewer-zoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
"onViewer-position-updated"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
"onViewer-point-updated"?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
"onChange-model"?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
immediate: boolean;
|
|
39
|
+
appSetting: AppSetting;
|
|
40
|
+
viewer: ViewerProps;
|
|
41
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
42
|
+
viewerElRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
43
|
+
bimseeProps: BimseeProps;
|
|
44
|
+
bimseeStore: BimseeStore;
|
|
45
|
+
}> & Readonly<{
|
|
46
|
+
onMousedown?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
"onPoint-updated"?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
52
|
+
}>, {
|
|
53
|
+
isMoveover: () => boolean;
|
|
54
|
+
isMovedown: () => boolean;
|
|
55
|
+
setMovedown: (mousedown: boolean) => void;
|
|
56
|
+
setMoveover: (moveover: boolean) => void;
|
|
57
|
+
setMinFov: (minFov: number) => void;
|
|
58
|
+
setMaxFov: (maxFov: number) => void;
|
|
59
|
+
zoom: (level: number) => void;
|
|
60
|
+
rotate: (position: Position) => void;
|
|
61
|
+
getState: () => {
|
|
62
|
+
defaultYaw?: number | undefined;
|
|
63
|
+
defaultPitch?: number | undefined;
|
|
64
|
+
defaultZoomLvl?: number | undefined;
|
|
65
|
+
minFov?: number | undefined;
|
|
66
|
+
maxFov?: number | undefined;
|
|
67
|
+
moveover?: boolean | undefined;
|
|
68
|
+
mousedown?: boolean | undefined;
|
|
69
|
+
};
|
|
70
|
+
getPosition: () => Position;
|
|
71
|
+
getZoomLevel: () => number | undefined;
|
|
72
|
+
getCameraPosition: () => Vector3 | undefined;
|
|
73
|
+
getCameraTarget: () => Vector3 | undefined;
|
|
74
|
+
getCameraFov: () => number | undefined;
|
|
75
|
+
getCameraStatus: () => CameraStatus | undefined;
|
|
76
|
+
rotateToTarget: (rotate?: Position, position?: Vector3) => Vector3 | undefined;
|
|
77
|
+
fovToZoomLevel: (fov: number) => number;
|
|
78
|
+
zoomLevelToFov: (level: number) => number;
|
|
79
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
80
|
+
mousedown: (...args: any[]) => void;
|
|
81
|
+
ready: (...args: any[]) => void;
|
|
82
|
+
click: (...args: any[]) => void;
|
|
83
|
+
"point-updated": (...args: any[]) => void;
|
|
84
|
+
"position-updated": (...args: any[]) => void;
|
|
85
|
+
"zoom-updated": (...args: any[]) => void;
|
|
86
|
+
}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
87
|
+
viewerElRef: HTMLDivElement;
|
|
88
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
89
|
+
P: {};
|
|
90
|
+
B: {};
|
|
91
|
+
D: {};
|
|
92
|
+
C: {};
|
|
93
|
+
M: {};
|
|
94
|
+
Defaults: {};
|
|
95
|
+
}, Readonly<{
|
|
96
|
+
bimseeProps: BimseeProps;
|
|
97
|
+
bimseeStore: BimseeStore;
|
|
98
|
+
}> & Readonly<{
|
|
99
|
+
onMousedown?: ((...args: any[]) => any) | undefined;
|
|
100
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
101
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
102
|
+
"onPoint-updated"?: ((...args: any[]) => any) | undefined;
|
|
103
|
+
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
104
|
+
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
isMoveover: () => boolean;
|
|
107
|
+
isMovedown: () => boolean;
|
|
108
|
+
setMovedown: (mousedown: boolean) => void;
|
|
109
|
+
setMoveover: (moveover: boolean) => void;
|
|
110
|
+
setMinFov: (minFov: number) => void;
|
|
111
|
+
setMaxFov: (maxFov: number) => void;
|
|
112
|
+
zoom: (level: number) => void;
|
|
113
|
+
rotate: (position: Position) => void;
|
|
114
|
+
getState: () => {
|
|
115
|
+
defaultYaw?: number | undefined;
|
|
116
|
+
defaultPitch?: number | undefined;
|
|
117
|
+
defaultZoomLvl?: number | undefined;
|
|
118
|
+
minFov?: number | undefined;
|
|
119
|
+
maxFov?: number | undefined;
|
|
120
|
+
moveover?: boolean | undefined;
|
|
121
|
+
mousedown?: boolean | undefined;
|
|
122
|
+
};
|
|
123
|
+
getPosition: () => Position;
|
|
124
|
+
getZoomLevel: () => number | undefined;
|
|
125
|
+
getCameraPosition: () => Vector3 | undefined;
|
|
126
|
+
getCameraTarget: () => Vector3 | undefined;
|
|
127
|
+
getCameraFov: () => number | undefined;
|
|
128
|
+
getCameraStatus: () => CameraStatus | undefined;
|
|
129
|
+
rotateToTarget: (rotate?: Position, position?: Vector3) => Vector3 | undefined;
|
|
130
|
+
fovToZoomLevel: (fov: number) => number;
|
|
131
|
+
zoomLevelToFov: (level: number) => number;
|
|
132
|
+
}, {}, {}, {}, {}> | null;
|
|
133
|
+
}, HTMLDivElement>;
|
|
134
|
+
|
|
135
|
+
declare function __VLS_template(): {
|
|
136
|
+
attrs: Partial<{}>;
|
|
137
|
+
slots: {
|
|
138
|
+
default?(_: {}): any;
|
|
139
|
+
};
|
|
140
|
+
refs: {
|
|
141
|
+
viewerElRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
142
|
+
bimseeProps: BimseeProps;
|
|
143
|
+
bimseeStore: BimseeStore;
|
|
144
|
+
}> & Readonly<{
|
|
145
|
+
onMousedown?: ((...args: any[]) => any) | undefined;
|
|
146
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
147
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
148
|
+
"onPoint-updated"?: ((...args: any[]) => any) | undefined;
|
|
149
|
+
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
150
|
+
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
151
|
+
}>, {
|
|
152
|
+
isMoveover: () => boolean;
|
|
153
|
+
isMovedown: () => boolean;
|
|
154
|
+
setMovedown: (mousedown: boolean) => void;
|
|
155
|
+
setMoveover: (moveover: boolean) => void;
|
|
156
|
+
setMinFov: (minFov: number) => void;
|
|
157
|
+
setMaxFov: (maxFov: number) => void;
|
|
158
|
+
zoom: (level: number) => void;
|
|
159
|
+
rotate: (position: Position) => void;
|
|
160
|
+
getState: () => {
|
|
161
|
+
defaultYaw?: number | undefined;
|
|
162
|
+
defaultPitch?: number | undefined;
|
|
163
|
+
defaultZoomLvl?: number | undefined;
|
|
164
|
+
minFov?: number | undefined;
|
|
165
|
+
maxFov?: number | undefined;
|
|
166
|
+
moveover?: boolean | undefined;
|
|
167
|
+
mousedown?: boolean | undefined;
|
|
168
|
+
};
|
|
169
|
+
getPosition: () => Position;
|
|
170
|
+
getZoomLevel: () => number | undefined;
|
|
171
|
+
getCameraPosition: () => Vector3 | undefined;
|
|
172
|
+
getCameraTarget: () => Vector3 | undefined;
|
|
173
|
+
getCameraFov: () => number | undefined;
|
|
174
|
+
getCameraStatus: () => CameraStatus | undefined;
|
|
175
|
+
rotateToTarget: (rotate?: Position, position?: Vector3) => Vector3 | undefined;
|
|
176
|
+
fovToZoomLevel: (fov: number) => number;
|
|
177
|
+
zoomLevelToFov: (level: number) => number;
|
|
178
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
179
|
+
mousedown: (...args: any[]) => void;
|
|
180
|
+
ready: (...args: any[]) => void;
|
|
181
|
+
click: (...args: any[]) => void;
|
|
182
|
+
"point-updated": (...args: any[]) => void;
|
|
183
|
+
"position-updated": (...args: any[]) => void;
|
|
184
|
+
"zoom-updated": (...args: any[]) => void;
|
|
185
|
+
}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
186
|
+
viewerElRef: HTMLDivElement;
|
|
187
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
188
|
+
P: {};
|
|
189
|
+
B: {};
|
|
190
|
+
D: {};
|
|
191
|
+
C: {};
|
|
192
|
+
M: {};
|
|
193
|
+
Defaults: {};
|
|
194
|
+
}, Readonly<{
|
|
195
|
+
bimseeProps: BimseeProps;
|
|
196
|
+
bimseeStore: BimseeStore;
|
|
197
|
+
}> & Readonly<{
|
|
198
|
+
onMousedown?: ((...args: any[]) => any) | undefined;
|
|
199
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
200
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
201
|
+
"onPoint-updated"?: ((...args: any[]) => any) | undefined;
|
|
202
|
+
"onPosition-updated"?: ((...args: any[]) => any) | undefined;
|
|
203
|
+
"onZoom-updated"?: ((...args: any[]) => any) | undefined;
|
|
204
|
+
}>, {
|
|
205
|
+
isMoveover: () => boolean;
|
|
206
|
+
isMovedown: () => boolean;
|
|
207
|
+
setMovedown: (mousedown: boolean) => void;
|
|
208
|
+
setMoveover: (moveover: boolean) => void;
|
|
209
|
+
setMinFov: (minFov: number) => void;
|
|
210
|
+
setMaxFov: (maxFov: number) => void;
|
|
211
|
+
zoom: (level: number) => void;
|
|
212
|
+
rotate: (position: Position) => void;
|
|
213
|
+
getState: () => {
|
|
214
|
+
defaultYaw?: number | undefined;
|
|
215
|
+
defaultPitch?: number | undefined;
|
|
216
|
+
defaultZoomLvl?: number | undefined;
|
|
217
|
+
minFov?: number | undefined;
|
|
218
|
+
maxFov?: number | undefined;
|
|
219
|
+
moveover?: boolean | undefined;
|
|
220
|
+
mousedown?: boolean | undefined;
|
|
221
|
+
};
|
|
222
|
+
getPosition: () => Position;
|
|
223
|
+
getZoomLevel: () => number | undefined;
|
|
224
|
+
getCameraPosition: () => Vector3 | undefined;
|
|
225
|
+
getCameraTarget: () => Vector3 | undefined;
|
|
226
|
+
getCameraFov: () => number | undefined;
|
|
227
|
+
getCameraStatus: () => CameraStatus | undefined;
|
|
228
|
+
rotateToTarget: (rotate?: Position, position?: Vector3) => Vector3 | undefined;
|
|
229
|
+
fovToZoomLevel: (fov: number) => number;
|
|
230
|
+
zoomLevelToFov: (level: number) => number;
|
|
231
|
+
}, {}, {}, {}, {}> | null;
|
|
232
|
+
};
|
|
233
|
+
rootEl: HTMLDivElement;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
237
|
+
|
|
238
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
239
|
+
new (): {
|
|
240
|
+
$slots: S;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export declare const BIMSEE_CONFIG: {
|
|
245
|
+
appSetting: {
|
|
246
|
+
baseUrl: string;
|
|
247
|
+
obsType: string;
|
|
248
|
+
};
|
|
249
|
+
viewer: {
|
|
250
|
+
defaultYaw: number;
|
|
251
|
+
defaultPitch: number;
|
|
252
|
+
defaultZoomLvl: number;
|
|
253
|
+
minFov: number;
|
|
254
|
+
maxFov: number;
|
|
255
|
+
};
|
|
256
|
+
immediate: boolean;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export declare type BimseeElement = {
|
|
260
|
+
getState: () => UpdatableBimseeProps;
|
|
261
|
+
setState: (options: Partial<UpdatableBimseeProps>) => void;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export declare type BimseeProps = {
|
|
265
|
+
appSetting?: AppSetting;
|
|
266
|
+
bimseeSetting?: BimseeSetting;
|
|
267
|
+
searchInfo?: SearchInfo;
|
|
268
|
+
viewer?: ViewerProps;
|
|
269
|
+
immediate?: boolean;
|
|
270
|
+
delay?: number;
|
|
271
|
+
handleCheckedFn?: (res?: Coordinate) => Promise<boolean>;
|
|
272
|
+
handleResponseFn?: (res?: Coordinate) => Promise<Coordinate>;
|
|
273
|
+
fetchSuccess?: (coordinate?: Coordinate) => void;
|
|
274
|
+
fetchError?: (error: any) => void;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export declare type BimseeSetting = {};
|
|
278
|
+
|
|
279
|
+
export declare type BimseeStore = {
|
|
280
|
+
ready: boolean;
|
|
281
|
+
coordinateTree: Coordinate | undefined;
|
|
282
|
+
mappedCoordinateTree: Coordinate | undefined;
|
|
283
|
+
srcCoordinate: Coordinate | undefined;
|
|
284
|
+
currentModel: Coordinate | undefined;
|
|
285
|
+
currentPoint: Point | undefined;
|
|
286
|
+
reload: (searchInfo: SearchInfo) => Promise<void>;
|
|
287
|
+
setReady: (value?: boolean) => void;
|
|
288
|
+
selectModel: (coordinate: Partial<Coordinate>) => void;
|
|
289
|
+
setPoint: (point: Point, coordinate: Partial<Coordinate>) => void;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export declare type CameraStatus = {
|
|
293
|
+
position?: Vector3;
|
|
294
|
+
target?: Vector3;
|
|
295
|
+
fov?: number;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
299
|
+
export { _default as Bimsee }
|
|
300
|
+
export { _default as BimseePlugin }
|
|
301
|
+
|
|
302
|
+
export declare type SearchInfo = {
|
|
303
|
+
projectId: number;
|
|
304
|
+
modelCsId: number;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export declare type UpdatableBimseeProps = Partial<BimseeProps>;
|
|
308
|
+
|
|
309
|
+
export declare type UpdatableViewerProps = Partial<ViewerProps>;
|
|
310
|
+
|
|
311
|
+
export declare const VIEWER_CONFIG: {
|
|
312
|
+
defaultYaw: number;
|
|
313
|
+
defaultPitch: number;
|
|
314
|
+
defaultZoomLvl: number;
|
|
315
|
+
minFov: number;
|
|
316
|
+
maxFov: number;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export declare type ViewerElement = {
|
|
320
|
+
isMoveover(): boolean;
|
|
321
|
+
isMovedown(): boolean;
|
|
322
|
+
setMovedown: (mousedown: boolean) => void;
|
|
323
|
+
setMoveover: (moveover: boolean) => void;
|
|
324
|
+
setMinFov: (minFov: number) => void;
|
|
325
|
+
setMaxFov: (maxFov: number) => void;
|
|
326
|
+
zoom: (level: number) => void;
|
|
327
|
+
rotate: (position: Position) => void;
|
|
328
|
+
getState(): () => ViewerProps;
|
|
329
|
+
getPosition(): () => Position;
|
|
330
|
+
getZoomLevel(): () => number;
|
|
331
|
+
getCameraPosition: () => Vector3 | undefined;
|
|
332
|
+
getCameraTarget: () => Vector3 | undefined;
|
|
333
|
+
getCameraFov: () => number | undefined;
|
|
334
|
+
getCameraStatus(): () => CameraStatus | undefined;
|
|
335
|
+
rotateToTarget: (rotate?: Position, position?: Vector3) => Vector3 | undefined;
|
|
336
|
+
fovToZoomLevel: (fov: number) => number;
|
|
337
|
+
zoomLevelToFov: (level: number) => number;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export declare type ViewerProps = {
|
|
341
|
+
defaultYaw?: number;
|
|
342
|
+
defaultPitch?: number;
|
|
343
|
+
defaultZoomLvl?: number;
|
|
344
|
+
minFov?: number;
|
|
345
|
+
maxFov?: number;
|
|
346
|
+
moveover?: boolean;
|
|
347
|
+
mousedown?: boolean;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export { }
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { ref as M, computed as T, watch as ee, unref as F, defineComponent as de, onMounted as le, onBeforeUnmount as he, createElementBlock as te, openBlock as ne, createCommentVNode as Me, Fragment as ye, createVNode as ge, renderSlot as Pe, mergeProps as Se, toHandlers as Ee } from "vue";
|
|
2
|
+
import { APP_SETTING as ve, utils as fe, Vector3 as ie, Position as K, Point as ue, CoordinateModelType as ce, AppError as Q, DataSource as _e, http as Ie } from "@vsleem-realsee-viewer/shared";
|
|
3
|
+
const oe = {
|
|
4
|
+
defaultYaw: 0,
|
|
5
|
+
// 默认偏航角
|
|
6
|
+
defaultPitch: 0,
|
|
7
|
+
// 默认俯仰角
|
|
8
|
+
defaultZoomLvl: 30,
|
|
9
|
+
// 默认缩放级别
|
|
10
|
+
minFov: 20,
|
|
11
|
+
//最小视野角度
|
|
12
|
+
maxFov: 120
|
|
13
|
+
// 最大视野角度
|
|
14
|
+
}, Ce = {
|
|
15
|
+
appSetting: ve,
|
|
16
|
+
//全局设置
|
|
17
|
+
viewer: oe,
|
|
18
|
+
immediate: !0
|
|
19
|
+
// 是否立即生效
|
|
20
|
+
}, { cloneDeep: Le, deepMergeProps: Te } = fe;
|
|
21
|
+
function Fe(o, n, v, i) {
|
|
22
|
+
const f = M(Le(oe)), a = M(), c = M(), r = T(() => f.value);
|
|
23
|
+
ee(() => {
|
|
24
|
+
var e;
|
|
25
|
+
return (e = F(o)) == null ? void 0 : e.viewer;
|
|
26
|
+
}, S, { immediate: !0 }), ee(
|
|
27
|
+
() => n.value.currentPoint,
|
|
28
|
+
(e) => {
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
function w() {
|
|
32
|
+
C(), $(), i("ready", N(), s());
|
|
33
|
+
}
|
|
34
|
+
function u() {
|
|
35
|
+
x();
|
|
36
|
+
}
|
|
37
|
+
function C() {
|
|
38
|
+
const e = F(v);
|
|
39
|
+
e && (e.addEventListener("mousedown", E), e.addEventListener("touchstart", E), window.addEventListener("mousemove", y), window.addEventListener("touchmove", y), window.addEventListener("mouseup", _), window.addEventListener("touchend", _), e.addEventListener("mouseover", b), e.addEventListener("mouseout", z), e.addEventListener("wheel", Y));
|
|
40
|
+
}
|
|
41
|
+
function x() {
|
|
42
|
+
const e = F(v);
|
|
43
|
+
e && (e.removeEventListener("mousedown", E), e.removeEventListener("touchstart", E), window.removeEventListener("mousemove", y), window.removeEventListener("touchmove", y), window.removeEventListener("mouseup", _), window.removeEventListener("touchend", _), e.removeEventListener("mouseover", b), e.removeEventListener("mouseout", z), e.removeEventListener("wheel", Y));
|
|
44
|
+
}
|
|
45
|
+
function E(e) {
|
|
46
|
+
const t = e instanceof TouchEvent ? e.touches[0] : e, { defaultYaw: l = 0, defaultPitch: m = 0 } = r.value;
|
|
47
|
+
c.value = {
|
|
48
|
+
pageX: t.pageX,
|
|
49
|
+
pageY: t.pageY,
|
|
50
|
+
defaultYaw: l,
|
|
51
|
+
defaultPitch: m
|
|
52
|
+
}, W(!0), i("mousedown", e);
|
|
53
|
+
}
|
|
54
|
+
function y(e) {
|
|
55
|
+
var G;
|
|
56
|
+
if (!c.value || !U()) return;
|
|
57
|
+
const t = e instanceof TouchEvent ? e.touches[0] : e, { pageX: l, pageY: m } = t, { pageX: p, pageY: P } = c.value, B = ((G = n.value.currentPoint) == null ? void 0 : G.yaw) ?? 0, { defaultYaw: L = 0, defaultPitch: V = 0 } = c.value, D = Math.PI * 0.15 / 180;
|
|
58
|
+
let X = L - (l - p) * D, Z = V + (m - P) * D;
|
|
59
|
+
Z = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Z));
|
|
60
|
+
const J = new K({ yaw: X - B, pitch: Z });
|
|
61
|
+
ae(J);
|
|
62
|
+
}
|
|
63
|
+
function _() {
|
|
64
|
+
W(!1), c.value = void 0;
|
|
65
|
+
}
|
|
66
|
+
function b() {
|
|
67
|
+
R(!0);
|
|
68
|
+
}
|
|
69
|
+
function z() {
|
|
70
|
+
R(!1);
|
|
71
|
+
}
|
|
72
|
+
function Y(e) {
|
|
73
|
+
e.preventDefault(), e.stopPropagation();
|
|
74
|
+
const t = Math.sign(e.deltaY) * 5;
|
|
75
|
+
if (t === 0) return;
|
|
76
|
+
const { minFov: l = 0, maxFov: m = 0 } = r.value, { fov: p = 0 } = a.value || {}, P = Math.min(Math.max(p + t, l), m);
|
|
77
|
+
P !== p && re(se(P));
|
|
78
|
+
}
|
|
79
|
+
function $() {
|
|
80
|
+
const { currentPoint: e } = n.value, { defaultYaw: t = 0, defaultPitch: l = 0, defaultZoomLvl: m = 0 } = r.value;
|
|
81
|
+
if (e) {
|
|
82
|
+
const p = new ie(e), P = t + ((e == null ? void 0 : e.yaw) ?? 0), B = new K({ yaw: P, pitch: l }), L = q(B, p), V = H(m);
|
|
83
|
+
h({ position: p, target: L, fov: V }), S({ defaultYaw: P });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function s() {
|
|
87
|
+
return r.value;
|
|
88
|
+
}
|
|
89
|
+
function d() {
|
|
90
|
+
const { defaultYaw: e, defaultPitch: t } = r.value;
|
|
91
|
+
return { yaw: e, pitch: t };
|
|
92
|
+
}
|
|
93
|
+
function g() {
|
|
94
|
+
return r.value.defaultZoomLvl;
|
|
95
|
+
}
|
|
96
|
+
function I() {
|
|
97
|
+
var e;
|
|
98
|
+
return (e = a.value) == null ? void 0 : e.position;
|
|
99
|
+
}
|
|
100
|
+
function k() {
|
|
101
|
+
var e;
|
|
102
|
+
return (e = a.value) == null ? void 0 : e.fov;
|
|
103
|
+
}
|
|
104
|
+
function A() {
|
|
105
|
+
var e;
|
|
106
|
+
return (e = a.value) == null ? void 0 : e.target;
|
|
107
|
+
}
|
|
108
|
+
function N() {
|
|
109
|
+
return a.value;
|
|
110
|
+
}
|
|
111
|
+
function O() {
|
|
112
|
+
var e;
|
|
113
|
+
return ((e = r.value) == null ? void 0 : e.moveover) ?? !1;
|
|
114
|
+
}
|
|
115
|
+
function U() {
|
|
116
|
+
var e;
|
|
117
|
+
return ((e = r.value) == null ? void 0 : e.mousedown) ?? !1;
|
|
118
|
+
}
|
|
119
|
+
function S(e) {
|
|
120
|
+
Te(f.value, e);
|
|
121
|
+
}
|
|
122
|
+
function h(e) {
|
|
123
|
+
a.value = { ...a.value, ...e };
|
|
124
|
+
}
|
|
125
|
+
function R(e) {
|
|
126
|
+
S({ moveover: e });
|
|
127
|
+
}
|
|
128
|
+
function W(e) {
|
|
129
|
+
S({ mousedown: e });
|
|
130
|
+
}
|
|
131
|
+
function pe(e) {
|
|
132
|
+
S({ minFov: e });
|
|
133
|
+
}
|
|
134
|
+
function we(e) {
|
|
135
|
+
S({ maxFov: e });
|
|
136
|
+
}
|
|
137
|
+
function ae(e) {
|
|
138
|
+
var B, L, V;
|
|
139
|
+
const t = ((L = (B = n.value) == null ? void 0 : B.currentPoint) == null ? void 0 : L.yaw) ?? 0, { yaw: l, pitch: m } = e, p = new K({ yaw: l + t, pitch: m }), P = q(p, (V = a.value) == null ? void 0 : V.position);
|
|
140
|
+
S({ defaultYaw: l, defaultPitch: m }), h({ target: P }), i("position-updated", { position: p, target: P });
|
|
141
|
+
}
|
|
142
|
+
function re(e) {
|
|
143
|
+
const t = H(e);
|
|
144
|
+
S({ defaultZoomLvl: e }), h({ fov: t }), i("zoom-updated", { level: e, fov: t });
|
|
145
|
+
}
|
|
146
|
+
function q(e, t) {
|
|
147
|
+
if (!e || !t) return;
|
|
148
|
+
const { x: l = 0, y: m = 0, z: p = 0 } = t, { yaw: P, pitch: B } = e, L = -P, V = B, D = 100, X = 0, Z = D * Math.cos(X + L) + l, J = D * Math.sin(X + L) + m, G = D * Math.tan(V) + p;
|
|
149
|
+
return new ie({ x: Z, y: J, z: G });
|
|
150
|
+
}
|
|
151
|
+
function se(e) {
|
|
152
|
+
const { minFov: t = 20, maxFov: l = 120 } = r.value, p = 100 - (Math.max(t, Math.min(l, e)) - t) / (l - t) * 100;
|
|
153
|
+
return Math.max(0, Math.min(100, Math.round(p)));
|
|
154
|
+
}
|
|
155
|
+
function H(e) {
|
|
156
|
+
const { minFov: t = 20, maxFov: l = 120 } = r.value;
|
|
157
|
+
let m = l + e / 100 * (t - l);
|
|
158
|
+
return Math.max(t, Math.min(l, m));
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
viewerAction: {
|
|
162
|
+
isMoveover: O,
|
|
163
|
+
isMovedown: U,
|
|
164
|
+
setMovedown: W,
|
|
165
|
+
setMoveover: R,
|
|
166
|
+
setMinFov: pe,
|
|
167
|
+
setMaxFov: we,
|
|
168
|
+
zoom: re,
|
|
169
|
+
rotate: ae,
|
|
170
|
+
getState: s,
|
|
171
|
+
getPosition: d,
|
|
172
|
+
getZoomLevel: g,
|
|
173
|
+
getCameraPosition: I,
|
|
174
|
+
getCameraTarget: A,
|
|
175
|
+
getCameraFov: k,
|
|
176
|
+
getCameraStatus: N,
|
|
177
|
+
rotateToTarget: q,
|
|
178
|
+
fovToZoomLevel: se,
|
|
179
|
+
zoomLevelToFov: H
|
|
180
|
+
},
|
|
181
|
+
handleReady: w,
|
|
182
|
+
handleDestroy: u
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const xe = /* @__PURE__ */ de({
|
|
186
|
+
name: "Viewer",
|
|
187
|
+
__name: "Viewer",
|
|
188
|
+
props: {
|
|
189
|
+
bimseeProps: {},
|
|
190
|
+
bimseeStore: {}
|
|
191
|
+
},
|
|
192
|
+
emits: [
|
|
193
|
+
"ready",
|
|
194
|
+
"click",
|
|
195
|
+
"mousedown",
|
|
196
|
+
"zoom-updated",
|
|
197
|
+
"position-updated",
|
|
198
|
+
"point-updated"
|
|
199
|
+
],
|
|
200
|
+
setup(o, { expose: n, emit: v }) {
|
|
201
|
+
const i = o, f = v, a = M(), c = T(() => i.bimseeProps), r = T(() => i.bimseeStore), { viewerAction: w, handleReady: u, handleDestroy: C } = Fe(
|
|
202
|
+
c,
|
|
203
|
+
r,
|
|
204
|
+
a,
|
|
205
|
+
f
|
|
206
|
+
);
|
|
207
|
+
return le(u), he(C), n({ ...w }), (x, E) => (ne(), te("div", {
|
|
208
|
+
ref_key: "viewerElRef",
|
|
209
|
+
ref: a,
|
|
210
|
+
class: "vsleem-bimsee-viewer"
|
|
211
|
+
}, null, 512));
|
|
212
|
+
}
|
|
213
|
+
}), me = (o, n) => {
|
|
214
|
+
const v = o.__vccOpts || o;
|
|
215
|
+
for (const [i, f] of n)
|
|
216
|
+
v[i] = f;
|
|
217
|
+
return v;
|
|
218
|
+
}, Re = /* @__PURE__ */ me(xe, [["__scopeId", "data-v-29adba86"]]);
|
|
219
|
+
var j = /* @__PURE__ */ ((o) => (o[o.StoreMissParams = 11e3] = "StoreMissParams", o[o.StoreNoCSTree = 11001] = "StoreNoCSTree", o[o.StoreSelectNoBIMModel = 11002] = "StoreSelectNoBIMModel", o))(j || {});
|
|
220
|
+
function Be(o) {
|
|
221
|
+
const n = M(), v = M(), i = M(!1), f = M(!1), a = M(), c = M(), r = M(), w = T(() => {
|
|
222
|
+
var s;
|
|
223
|
+
return (s = n.value) == null ? void 0 : s.findCsById(a.value);
|
|
224
|
+
}), u = T(() => {
|
|
225
|
+
var s;
|
|
226
|
+
return (s = n.value) == null ? void 0 : s.findCsById(c.value);
|
|
227
|
+
}), C = T(() => z(r.value, u.value));
|
|
228
|
+
async function x(s) {
|
|
229
|
+
var I, k, A, N, O, U, S;
|
|
230
|
+
const { projectId: d, modelCsId: g } = s || {};
|
|
231
|
+
try {
|
|
232
|
+
if (!d)
|
|
233
|
+
throw new Q(j.StoreMissParams, "缺少必要的查询参数");
|
|
234
|
+
i.value = !0;
|
|
235
|
+
const h = await _e.getCoordinateTree(d);
|
|
236
|
+
let R = (I = h == null ? void 0 : h.findCsById(g)) == null ? void 0 : I.findCsByLevel(ce.BIMModel);
|
|
237
|
+
if (R = await ((A = (k = o.value).handleResponseFn) == null ? void 0 : A.call(k, R)) || R, !h)
|
|
238
|
+
throw new Q(
|
|
239
|
+
j.StoreNoCSTree,
|
|
240
|
+
`未查询到坐标系ID为 ${g} 的坐标系树`
|
|
241
|
+
);
|
|
242
|
+
n.value = h, v.value = R, y({ modelCsId: g }), (O = (N = o.value).fetchSuccess) == null || O.call(N, h);
|
|
243
|
+
} catch (h) {
|
|
244
|
+
console.error(h), (S = (U = o.value).fetchError) == null || S.call(U, h);
|
|
245
|
+
} finally {
|
|
246
|
+
i.value = !1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function E(s = !1) {
|
|
250
|
+
f.value = s;
|
|
251
|
+
}
|
|
252
|
+
function y(s) {
|
|
253
|
+
const { modelCsId: d } = s;
|
|
254
|
+
d && _({ id: d });
|
|
255
|
+
}
|
|
256
|
+
function _(s) {
|
|
257
|
+
var I;
|
|
258
|
+
const { id: d } = s, g = (I = n.value) == null ? void 0 : I.findCsById(d);
|
|
259
|
+
if ((g == null ? void 0 : g.modelType) === ce.BIMModel)
|
|
260
|
+
a.value = d;
|
|
261
|
+
else
|
|
262
|
+
throw new Q(j.StoreSelectNoBIMModel, `未找到ID为 ${d} 的BIM模型坐标系`);
|
|
263
|
+
}
|
|
264
|
+
function b(s, d) {
|
|
265
|
+
r.value = s, c.value = d.id;
|
|
266
|
+
}
|
|
267
|
+
function z(s, d) {
|
|
268
|
+
if (s && d && w.value) {
|
|
269
|
+
const g = d == null ? void 0 : d.getDestRelativeMap(w.value);
|
|
270
|
+
if (!g) return;
|
|
271
|
+
const I = new ue(s).projection(
|
|
272
|
+
g,
|
|
273
|
+
d,
|
|
274
|
+
w.value
|
|
275
|
+
), { y: k = 0 } = I || {};
|
|
276
|
+
return new ue({ ...I, y: -k });
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function Y() {
|
|
280
|
+
return $.value;
|
|
281
|
+
}
|
|
282
|
+
const $ = T(
|
|
283
|
+
() => ({
|
|
284
|
+
// 状态
|
|
285
|
+
ready: f.value,
|
|
286
|
+
coordinateTree: n.value,
|
|
287
|
+
mappedCoordinateTree: v.value,
|
|
288
|
+
// 计算属性
|
|
289
|
+
srcCoordinate: u.value,
|
|
290
|
+
currentModel: w.value,
|
|
291
|
+
currentPoint: C.value,
|
|
292
|
+
// 方法
|
|
293
|
+
reload: x,
|
|
294
|
+
setReady: E,
|
|
295
|
+
selectModel: _,
|
|
296
|
+
setPoint: b
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
return {
|
|
300
|
+
storeRef: $,
|
|
301
|
+
getStore: Y,
|
|
302
|
+
setReady: E
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
const { cloneDeep: Ve, deepMergeProps: Ye } = fe;
|
|
306
|
+
function be(o, n, v) {
|
|
307
|
+
const i = M(Ve(Ce)), f = T(() => i.value), a = T(() => c.value.ready && c.value.currentModel);
|
|
308
|
+
ee(() => o, x, { immediate: !0, deep: !0 });
|
|
309
|
+
const { storeRef: c, getStore: r, setReady: w } = Be(f);
|
|
310
|
+
le(u);
|
|
311
|
+
async function u() {
|
|
312
|
+
var Y;
|
|
313
|
+
const { appSetting: y, searchInfo: _, immediate: b, delay: z = 0 } = F(f);
|
|
314
|
+
y && Ie.setRequestGlobalConfig(y), b && _ && (await ((Y = c.value) == null ? void 0 : Y.reload(_)), setTimeout(() => {
|
|
315
|
+
w(!0), v == null || v("ready");
|
|
316
|
+
}, z));
|
|
317
|
+
}
|
|
318
|
+
function C() {
|
|
319
|
+
return F(f);
|
|
320
|
+
}
|
|
321
|
+
function x(y) {
|
|
322
|
+
y && Ye(i.value, y);
|
|
323
|
+
}
|
|
324
|
+
function E() {
|
|
325
|
+
return F(n);
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
getShow: a,
|
|
329
|
+
storeRef: c,
|
|
330
|
+
getStore: r,
|
|
331
|
+
getViewer: E,
|
|
332
|
+
getState: C,
|
|
333
|
+
setState: x
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function ze(o, n) {
|
|
337
|
+
function v() {
|
|
338
|
+
n("viewer-ready");
|
|
339
|
+
}
|
|
340
|
+
function i(u) {
|
|
341
|
+
n("viewer-click", u);
|
|
342
|
+
}
|
|
343
|
+
function f(u) {
|
|
344
|
+
n("viewer-mousedown", u);
|
|
345
|
+
}
|
|
346
|
+
function a(u) {
|
|
347
|
+
n("viewer-zoom-updated", u);
|
|
348
|
+
}
|
|
349
|
+
function c(u) {
|
|
350
|
+
n("viewer-position-updated", u);
|
|
351
|
+
}
|
|
352
|
+
function r(u) {
|
|
353
|
+
n("viewer-point-updated", u);
|
|
354
|
+
}
|
|
355
|
+
return { viewerEvents: {
|
|
356
|
+
ready: v,
|
|
357
|
+
click: i,
|
|
358
|
+
mousedown: f,
|
|
359
|
+
zoomUpdated: a,
|
|
360
|
+
positionUpdated: c,
|
|
361
|
+
pointUpdated: r
|
|
362
|
+
} };
|
|
363
|
+
}
|
|
364
|
+
const ke = { class: "vsleem-bimsee" }, De = /* @__PURE__ */ de({
|
|
365
|
+
name: "Bimsee",
|
|
366
|
+
__name: "Bimsee",
|
|
367
|
+
props: {
|
|
368
|
+
appSetting: { default: () => ve },
|
|
369
|
+
bimseeSetting: {},
|
|
370
|
+
searchInfo: {},
|
|
371
|
+
viewer: { default: () => oe },
|
|
372
|
+
immediate: { type: Boolean, default: !0 },
|
|
373
|
+
delay: {},
|
|
374
|
+
handleCheckedFn: {},
|
|
375
|
+
handleResponseFn: {},
|
|
376
|
+
fetchSuccess: {},
|
|
377
|
+
fetchError: {}
|
|
378
|
+
},
|
|
379
|
+
emits: [
|
|
380
|
+
"ready",
|
|
381
|
+
"change-model",
|
|
382
|
+
"viewer-ready",
|
|
383
|
+
"viewer-click",
|
|
384
|
+
"viewer-mousedown",
|
|
385
|
+
"viewer-zoom-updated",
|
|
386
|
+
"viewer-position-updated",
|
|
387
|
+
"viewer-point-updated"
|
|
388
|
+
],
|
|
389
|
+
setup(o, { expose: n, emit: v }) {
|
|
390
|
+
const i = o, f = v, a = M(), { getShow: c, storeRef: r, ...w } = be(i, a, f), { viewerEvents: u } = ze(a, f);
|
|
391
|
+
return n(w), (C, x) => (ne(), te("div", ke, [
|
|
392
|
+
F(c) ? (ne(), te(ye, { key: 0 }, [
|
|
393
|
+
ge(Re, Se({
|
|
394
|
+
ref_key: "viewerElRef",
|
|
395
|
+
ref: a,
|
|
396
|
+
bimseeProps: i,
|
|
397
|
+
bimseeStore: F(r)
|
|
398
|
+
}, Ee(F(u))), null, 16, ["bimseeStore"]),
|
|
399
|
+
Pe(C.$slots, "default", {}, void 0, !0)
|
|
400
|
+
], 64)) : Me("", !0)
|
|
401
|
+
]));
|
|
402
|
+
}
|
|
403
|
+
}), $e = /* @__PURE__ */ me(De, [["__scopeId", "data-v-23825a8d"]]);
|
|
404
|
+
export {
|
|
405
|
+
Ce as BIMSEE_CONFIG,
|
|
406
|
+
$e as Bimsee,
|
|
407
|
+
$e as BimseePlugin,
|
|
408
|
+
oe as VIEWER_CONFIG
|
|
409
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(E,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],t):(E=typeof globalThis<"u"?globalThis:E||self,t(E.BimseePlugin={},E.Vue,E.VSLeemShared))})(this,function(E,t,v){"use strict";const O={defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,minFov:20,maxFov:120},Q={appSetting:v.APP_SETTING,viewer:O,immediate:!0},{cloneDeep:re,deepMergeProps:ie}=v.utils;function se(a,o,p,c){const m=t.ref(re(O)),r=t.ref(),d=t.ref(),i=t.computed(()=>m.value);t.watch(()=>{var e;return(e=t.unref(a))==null?void 0:e.viewer},_,{immediate:!0}),t.watch(()=>o.value.currentPoint,e=>{});function M(){L(),Z(),c("ready",D(),s())}function u(){F()}function L(){const e=t.unref(p);e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I),window.addEventListener("mousemove",P),window.addEventListener("touchmove",P),window.addEventListener("mouseup",C),window.addEventListener("touchend",C),e.addEventListener("mouseover",Y),e.addEventListener("mouseout",b),e.addEventListener("wheel",k))}function F(){const e=t.unref(p);e&&(e.removeEventListener("mousedown",I),e.removeEventListener("touchstart",I),window.removeEventListener("mousemove",P),window.removeEventListener("touchmove",P),window.removeEventListener("mouseup",C),window.removeEventListener("touchend",C),e.removeEventListener("mouseover",Y),e.removeEventListener("mouseout",b),e.removeEventListener("wheel",k))}function I(e){const n=e instanceof TouchEvent?e.touches[0]:e,{defaultYaw:f=0,defaultPitch:w=0}=i.value;d.value={pageX:n.pageX,pageY:n.pageY,defaultYaw:f,defaultPitch:w},W(!0),c("mousedown",e)}function P(e){var q;if(!d.value||!U())return;const n=e instanceof TouchEvent?e.touches[0]:e,{pageX:f,pageY:w}=n,{pageX:h,pageY:g}=d.value,R=((q=o.value.currentPoint)==null?void 0:q.yaw)??0,{defaultYaw:B=0,defaultPitch:x=0}=d.value,z=Math.PI*.15/180;let j=B-(f-h)*z,A=x+(w-g)*z;A=Math.max(-Math.PI/2,Math.min(Math.PI/2,A));const K=new v.Position({yaw:j-R,pitch:A});ne(K)}function C(){W(!1),d.value=void 0}function Y(){V(!0)}function b(){V(!1)}function k(e){e.preventDefault(),e.stopPropagation();const n=Math.sign(e.deltaY)*5;if(n===0)return;const{minFov:f=0,maxFov:w=0}=i.value,{fov:h=0}=r.value||{},g=Math.min(Math.max(h+n,f),w);g!==h&&oe(ae(g))}function Z(){const{currentPoint:e}=o.value,{defaultYaw:n=0,defaultPitch:f=0,defaultZoomLvl:w=0}=i.value;if(e){const h=new v.Vector3(e),g=n+((e==null?void 0:e.yaw)??0),R=new v.Position({yaw:g,pitch:f}),B=H(R,h),x=J(w);y({position:h,target:B,fov:x}),_({defaultYaw:g})}}function s(){return i.value}function l(){const{defaultYaw:e,defaultPitch:n}=i.value;return{yaw:e,pitch:n}}function S(){return i.value.defaultZoomLvl}function T(){var e;return(e=r.value)==null?void 0:e.position}function N(){var e;return(e=r.value)==null?void 0:e.fov}function $(){var e;return(e=r.value)==null?void 0:e.target}function D(){return r.value}function X(){var e;return((e=i.value)==null?void 0:e.moveover)??!1}function U(){var e;return((e=i.value)==null?void 0:e.mousedown)??!1}function _(e){ie(m.value,e)}function y(e){r.value={...r.value,...e}}function V(e){_({moveover:e})}function W(e){_({mousedown:e})}function we(e){_({minFov:e})}function he(e){_({maxFov:e})}function ne(e){var R,B,x;const n=((B=(R=o.value)==null?void 0:R.currentPoint)==null?void 0:B.yaw)??0,{yaw:f,pitch:w}=e,h=new v.Position({yaw:f+n,pitch:w}),g=H(h,(x=r.value)==null?void 0:x.position);_({defaultYaw:f,defaultPitch:w}),y({target:g}),c("position-updated",{position:h,target:g})}function oe(e){const n=J(e);_({defaultZoomLvl:e}),y({fov:n}),c("zoom-updated",{level:e,fov:n})}function H(e,n){if(!e||!n)return;const{x:f=0,y:w=0,z:h=0}=n,{yaw:g,pitch:R}=e,B=-g,x=R,z=100,j=0,A=z*Math.cos(j+B)+f,K=z*Math.sin(j+B)+w,q=z*Math.tan(x)+h;return new v.Vector3({x:A,y:K,z:q})}function ae(e){const{minFov:n=20,maxFov:f=120}=i.value,h=100-(Math.max(n,Math.min(f,e))-n)/(f-n)*100;return Math.max(0,Math.min(100,Math.round(h)))}function J(e){const{minFov:n=20,maxFov:f=120}=i.value;let w=f+e/100*(n-f);return Math.max(n,Math.min(f,w))}return{viewerAction:{isMoveover:X,isMovedown:U,setMovedown:W,setMoveover:V,setMinFov:we,setMaxFov:he,zoom:oe,rotate:ne,getState:s,getPosition:l,getZoomLevel:S,getCameraPosition:T,getCameraTarget:$,getCameraFov:N,getCameraStatus:D,rotateToTarget:H,fovToZoomLevel:ae,zoomLevelToFov:J},handleReady:M,handleDestroy:u}}const ce=t.defineComponent({name:"Viewer",__name:"Viewer",props:{bimseeProps:{},bimseeStore:{}},emits:["ready","click","mousedown","zoom-updated","position-updated","point-updated"],setup(a,{expose:o,emit:p}){const c=a,m=p,r=t.ref(),d=t.computed(()=>c.bimseeProps),i=t.computed(()=>c.bimseeStore),{viewerAction:M,handleReady:u,handleDestroy:L}=se(d,i,r,m);return t.onMounted(u),t.onBeforeUnmount(L),o({...M}),(F,I)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"viewerElRef",ref:r,class:"vsleem-bimsee-viewer"},null,512))}}),ee=(a,o)=>{const p=a.__vccOpts||a;for(const[c,m]of o)p[c]=m;return p},ue=ee(ce,[["__scopeId","data-v-29adba86"]]);var G=(a=>(a[a.StoreMissParams=11e3]="StoreMissParams",a[a.StoreNoCSTree=11001]="StoreNoCSTree",a[a.StoreSelectNoBIMModel=11002]="StoreSelectNoBIMModel",a))(G||{});function de(a){const o=t.ref(),p=t.ref(),c=t.ref(!1),m=t.ref(!1),r=t.ref(),d=t.ref(),i=t.ref(),M=t.computed(()=>{var s;return(s=o.value)==null?void 0:s.findCsById(r.value)}),u=t.computed(()=>{var s;return(s=o.value)==null?void 0:s.findCsById(d.value)}),L=t.computed(()=>b(i.value,u.value));async function F(s){var T,N,$,D,X,U,_;const{projectId:l,modelCsId:S}=s||{};try{if(!l)throw new v.AppError(G.StoreMissParams,"缺少必要的查询参数");c.value=!0;const y=await v.DataSource.getCoordinateTree(l);let V=(T=y==null?void 0:y.findCsById(S))==null?void 0:T.findCsByLevel(v.CoordinateModelType.BIMModel);if(V=await(($=(N=a.value).handleResponseFn)==null?void 0:$.call(N,V))||V,!y)throw new v.AppError(G.StoreNoCSTree,`未查询到坐标系ID为 ${S} 的坐标系树`);o.value=y,p.value=V,P({modelCsId:S}),(X=(D=a.value).fetchSuccess)==null||X.call(D,y)}catch(y){console.error(y),(_=(U=a.value).fetchError)==null||_.call(U,y)}finally{c.value=!1}}function I(s=!1){m.value=s}function P(s){const{modelCsId:l}=s;l&&C({id:l})}function C(s){var T;const{id:l}=s,S=(T=o.value)==null?void 0:T.findCsById(l);if((S==null?void 0:S.modelType)===v.CoordinateModelType.BIMModel)r.value=l;else throw new v.AppError(G.StoreSelectNoBIMModel,`未找到ID为 ${l} 的BIM模型坐标系`)}function Y(s,l){i.value=s,d.value=l.id}function b(s,l){if(s&&l&&M.value){const S=l==null?void 0:l.getDestRelativeMap(M.value);if(!S)return;const T=new v.Point(s).projection(S,l,M.value),{y:N=0}=T||{};return new v.Point({...T,y:-N})}}function k(){return Z.value}const Z=t.computed(()=>({ready:m.value,coordinateTree:o.value,mappedCoordinateTree:p.value,srcCoordinate:u.value,currentModel:M.value,currentPoint:L.value,reload:F,setReady:I,selectModel:C,setPoint:Y}));return{storeRef:Z,getStore:k,setReady:I}}const{cloneDeep:le,deepMergeProps:fe}=v.utils;function ve(a,o,p){const c=t.ref(le(Q)),m=t.computed(()=>c.value),r=t.computed(()=>d.value.ready&&d.value.currentModel);t.watch(()=>a,F,{immediate:!0,deep:!0});const{storeRef:d,getStore:i,setReady:M}=de(m);t.onMounted(u);async function u(){var k;const{appSetting:P,searchInfo:C,immediate:Y,delay:b=0}=t.unref(m);P&&v.http.setRequestGlobalConfig(P),Y&&C&&(await((k=d.value)==null?void 0:k.reload(C)),setTimeout(()=>{M(!0),p==null||p("ready")},b))}function L(){return t.unref(m)}function F(P){P&&fe(c.value,P)}function I(){return t.unref(o)}return{getShow:r,storeRef:d,getStore:i,getViewer:I,getState:L,setState:F}}function pe(a,o){function p(){o("viewer-ready")}function c(u){o("viewer-click",u)}function m(u){o("viewer-mousedown",u)}function r(u){o("viewer-zoom-updated",u)}function d(u){o("viewer-position-updated",u)}function i(u){o("viewer-point-updated",u)}return{viewerEvents:{ready:p,click:c,mousedown:m,zoomUpdated:r,positionUpdated:d,pointUpdated:i}}}const me={class:"vsleem-bimsee"},te=ee(t.defineComponent({name:"Bimsee",__name:"Bimsee",props:{appSetting:{default:()=>v.APP_SETTING},bimseeSetting:{},searchInfo:{},viewer:{default:()=>O},immediate:{type:Boolean,default:!0},delay:{},handleCheckedFn:{},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","change-model","viewer-ready","viewer-click","viewer-mousedown","viewer-zoom-updated","viewer-position-updated","viewer-point-updated"],setup(a,{expose:o,emit:p}){const c=a,m=p,r=t.ref(),{getShow:d,storeRef:i,...M}=ve(c,r,m),{viewerEvents:u}=pe(r,m);return o(M),(L,F)=>(t.openBlock(),t.createElementBlock("div",me,[t.unref(d)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(ue,t.mergeProps({ref_key:"viewerElRef",ref:r,bimseeProps:c,bimseeStore:t.unref(i)},t.toHandlers(t.unref(u))),null,16,["bimseeStore"]),t.renderSlot(L.$slots,"default",{},void 0,!0)],64)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-23825a8d"]]);E.BIMSEE_CONFIG=Q,E.Bimsee=te,E.BimseePlugin=te,E.VIEWER_CONFIG=O,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vsleem-realsee-viewer/bimsee-plugin",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Bimsee plugin for VSLeem RealSee Viewer",
|
|
5
|
+
"main": "./dist/index.umd.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@vsleem-realsee-viewer/shared": "2.0.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"vue": "^3.0.0",
|
|
20
|
+
"@vsleem-realsee-viewer/shared": "2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"vue": {
|
|
24
|
+
"optional": false
|
|
25
|
+
},
|
|
26
|
+
"@vsleem-realsee-viewer/shared": {
|
|
27
|
+
"optional": false
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "vite build"
|
|
32
|
+
}
|
|
33
|
+
}
|