@xtctwins/tctwins-bimx-engine 0.3.5 → 0.3.7
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/dist/{AnnotationTool-DK5_6F3a.mjs → AnnotationTool-CkIV37UE.mjs} +2 -2
- package/dist/BIMX_Viewer_Lib.es.js +1 -1
- package/dist/BIMX_Viewer_Lib.umd.js +181 -131
- package/dist/{CameraViewTool-bj-D4qTC.mjs → CameraViewTool-DeYagyPC.mjs} +1 -1
- package/dist/{CommentTool-BiJ_ERXE.mjs → CommentTool-C1JukDRV.mjs} +1 -1
- package/dist/{HiddenTool--ZhEcHHx.mjs → HiddenTool-CKIjuVdE.mjs} +1 -1
- package/dist/{InspectorTool-BZ3KodJ6.mjs → InspectorTool-DqCIiob9.mjs} +3 -3
- package/dist/{MeasureTool-ZX_QY2P8.mjs → MeasureTool-IHXJjZNc.mjs} +2 -2
- package/dist/{MouseTool-B4KE8WTI.mjs → MouseTool-C6IbMsSE.mjs} +1 -1
- package/dist/{NavigateTool-NHXzZdfp.mjs → NavigateTool-DSBy4FZy.mjs} +1 -1
- package/dist/{RoamTool-JAcpc5HA.mjs → RoamTool-CvVZdDiz.mjs} +1 -1
- package/dist/{ScreenShotTool-BJikIQgo.mjs → ScreenShotTool-DdIU0vQg.mjs} +2 -2
- package/dist/{SectionTool-Ba4Vhyjs.mjs → SectionTool-BinUb4wa.mjs} +4 -4
- package/dist/{SettingTool-CIJjnSxn.mjs → SettingTool-Bm2OgXES.mjs} +3 -3
- package/dist/{StructureTree-CF3k1jc2.mjs → StructureTree-CPDEM-gp.mjs} +3 -3
- package/dist/{alert-BgvqkGnh.mjs → alert-CWKghdMc.mjs} +1 -1
- package/dist/{el-input-number-D1zL_-nH.mjs → el-input-number-DXVRwG5u.mjs} +1 -1
- package/dist/{index-Cg9YgLyf.mjs → index-B9qL5nx5.mjs} +19288 -18630
- package/dist/{panel.vue_vue_type_style_index_0_lang-C-9DvZAr.mjs → panel.vue_vue_type_style_index_0_lang-D7G9bR05.mjs} +1 -1
- package/dist/style.css +3 -1
- package/dist/{tallPanel-8Rc6OZ8T.mjs → tallPanel-CHmr0WiN.mjs} +1 -1
- package/package.json +2 -2
- package/types/components/BimxViewerComp.vue.d.ts +8 -0
- package/types/pages/BimxViewerEntry.vue.d.ts +8 -0
- package/types/utils/OSSHelper.d.ts +2 -0
- package/types/viewerManager/load/loadModel.d.ts +93 -0
- package/types/viewerManager/viewerManager.d.ts +12 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as g, p as t, T as r, A as y, B as x, x as S, y as b } from "./index-
|
|
1
|
+
import { o as g, p as t, T as r, A as y, B as x, x as S, y as b } from "./index-B9qL5nx5.mjs";
|
|
2
2
|
import { defineComponent as k, ref as c, onMounted as P, watch as W, openBlock as _, createElementBlock as f, normalizeStyle as w, createElementVNode as o, toDisplayString as C, createVNode as T, unref as h, renderSlot as N, createCommentVNode as B } from "vue";
|
|
3
3
|
const E = { class: "tall_panel_content" }, $ = { class: "panel_top" }, H = { class: "panel_title" }, L = { class: "panel_close" }, A = { class: "panel_content" }, M = {
|
|
4
4
|
key: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtctwins/tctwins-bimx-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"main": "dist/BIMX_Viewer_Lib.umd.js",
|
|
5
5
|
"style": "dist/style.css",
|
|
6
6
|
"module": "dist/BIMX_Viewer_Lib.es.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
39
39
|
"@vue/eslint-config-typescript": "^13.0.0",
|
|
40
40
|
"@vue/tsconfig": "^0.5.1",
|
|
41
|
-
"@xtctwins/tctwins-bimx-
|
|
41
|
+
"@xtctwins/tctwins-bimx-viewer": "^1.1.3",
|
|
42
42
|
"ali-oss": "^6.20.0",
|
|
43
43
|
"axios": "^1.7.3",
|
|
44
44
|
"element-plus": "^2.8.0",
|
|
@@ -12,6 +12,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
12
12
|
modelIds?: string[];
|
|
13
13
|
/** 每个模型的变换选项(与 modelIds 一一对应):{ position, scale, rotation, matrix, origin } */
|
|
14
14
|
modelOptions?: Record<string, any>[];
|
|
15
|
+
/** 多模型是否顺序加载:true 等待每个模型加载完成再加载下一个;false 按 loadInterval 毫秒间隔依次发起,默认 true */
|
|
16
|
+
loadSequential?: boolean;
|
|
17
|
+
/** 非顺序加载时发起下一个模型的间隔毫秒数,默认 200 */
|
|
18
|
+
loadInterval?: number;
|
|
15
19
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
20
|
emitHandler: (...args: any[]) => void;
|
|
17
21
|
}, string, import('vue').PublicProps, Readonly<{
|
|
@@ -27,6 +31,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
27
31
|
modelIds?: string[];
|
|
28
32
|
/** 每个模型的变换选项(与 modelIds 一一对应):{ position, scale, rotation, matrix, origin } */
|
|
29
33
|
modelOptions?: Record<string, any>[];
|
|
34
|
+
/** 多模型是否顺序加载:true 等待每个模型加载完成再加载下一个;false 按 loadInterval 毫秒间隔依次发起,默认 true */
|
|
35
|
+
loadSequential?: boolean;
|
|
36
|
+
/** 非顺序加载时发起下一个模型的间隔毫秒数,默认 200 */
|
|
37
|
+
loadInterval?: number;
|
|
30
38
|
}> & Readonly<{
|
|
31
39
|
onEmitHandler?: ((...args: any[]) => any) | undefined;
|
|
32
40
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,6 +14,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
14
14
|
multiModel?: boolean;
|
|
15
15
|
filePaths?: string[];
|
|
16
16
|
modelIds?: string[];
|
|
17
|
+
/** 多模型是否顺序加载:true 等待每个模型加载完成再加载下一个;false 按 loadInterval 毫秒间隔依次发起,默认 true */
|
|
18
|
+
loadSequential?: boolean;
|
|
19
|
+
/** 非顺序加载时发起下一个模型的间隔毫秒数,默认 200 */
|
|
20
|
+
loadInterval?: number;
|
|
17
21
|
themeColor?: ThemeColor;
|
|
18
22
|
topHeight?: number;
|
|
19
23
|
bottomHeight?: number;
|
|
@@ -72,6 +76,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
72
76
|
multiModel?: boolean;
|
|
73
77
|
filePaths?: string[];
|
|
74
78
|
modelIds?: string[];
|
|
79
|
+
/** 多模型是否顺序加载:true 等待每个模型加载完成再加载下一个;false 按 loadInterval 毫秒间隔依次发起,默认 true */
|
|
80
|
+
loadSequential?: boolean;
|
|
81
|
+
/** 非顺序加载时发起下一个模型的间隔毫秒数,默认 200 */
|
|
82
|
+
loadInterval?: number;
|
|
75
83
|
themeColor?: ThemeColor;
|
|
76
84
|
topHeight?: number;
|
|
77
85
|
bottomHeight?: number;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default class OSSHelper {
|
|
2
2
|
static getBuffer(filePath: string, done: Function, error?: Function): Promise<void>;
|
|
3
|
+
/** 下载单个文件并返回 ArrayBuffer(Promise 风格,便于并发) */
|
|
4
|
+
static fetchBuffer(filePath: string): Promise<ArrayBuffer>;
|
|
3
5
|
static requestFileFromOSS(filePath: string, isFile: boolean, done: Function, error: Function): Promise<void>;
|
|
4
6
|
static downloadFile(filePath: string): Promise<ArrayBuffer>;
|
|
5
7
|
}
|
|
@@ -1 +1,94 @@
|
|
|
1
|
+
export interface ModelLoadResult {
|
|
2
|
+
code: 200 | -1;
|
|
3
|
+
result: string;
|
|
4
|
+
msg?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ModelLoadItem {
|
|
7
|
+
/** 模型 ID;为空时由 filePath 推导 */
|
|
8
|
+
modelId?: string;
|
|
9
|
+
/** 下载来源路径(http 完整地址 或 OSS 相对地址),为空表示直接使用 buffer */
|
|
10
|
+
filePath?: string;
|
|
11
|
+
/** 已下载好的模型二进制(filePath 为空时必填) */
|
|
12
|
+
buffer?: ArrayBuffer;
|
|
13
|
+
/** 已就绪的 meta 二进制(可选) */
|
|
14
|
+
metaBuffer?: ArrayBuffer;
|
|
15
|
+
/** 透传引擎 cfg:{ position, scale, rotation, matrix, origin, brightness, ... } */
|
|
16
|
+
options?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
export interface ModelLoaderConfig {
|
|
19
|
+
/** 模型类型(xtc / glb / ifc),默认 xtc */
|
|
20
|
+
modelType?: string;
|
|
21
|
+
/** 是否加载 meta(.xts);不传则运行时取 getConfig("loadMeta") */
|
|
22
|
+
loadMeta?: boolean;
|
|
23
|
+
/** 事件回调:modelLoaded / metaLoading / metaLoaded */
|
|
24
|
+
emit?: (event_name: string, content: any) => void;
|
|
25
|
+
/** 多模型是否顺序加载:true 等待每个模型加载完成再加载下一个;false 按 loadInterval 间隔依次发起,默认 true */
|
|
26
|
+
sequential?: boolean;
|
|
27
|
+
/** 非顺序加载时,发起下一个模型的间隔毫秒数,默认 200 */
|
|
28
|
+
loadInterval?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* BIMX 模型加载
|
|
32
|
+
* @param modelId 模型 ID
|
|
33
|
+
* @param modelType 模型类型(xtc / glb / ifc)
|
|
34
|
+
* @param modelArrayBuffer 模型二进制数据
|
|
35
|
+
* @param callback 加载结果回调
|
|
36
|
+
* @param options 附加加载参数,透传给接口层 BIMXViewer.loadModel 的 cfg:
|
|
37
|
+
* - brightness: 该模型的颜色亮度系数(1.0 原始,>1 提亮,<1 变暗),如 { brightness: 1.5 }
|
|
38
|
+
* - position / rotation / scale / origin / alignTo: 多模型坐标对齐参数
|
|
39
|
+
*/
|
|
1
40
|
export default function viewerLoadModel(modelId: string, modelType: string, modelArrayBuffer: ArrayBuffer, callback?: Function, options?: Record<string, any>): void;
|
|
41
|
+
/**
|
|
42
|
+
* 模型加载器:统一封装「下载 -> 引擎加载 -> meta 加载」。
|
|
43
|
+
*
|
|
44
|
+
* 相比逐模型串行「下载-加载」,这里会:
|
|
45
|
+
* - 多模型时先并发下载全部模型 + meta,再串行交给引擎(消除模型间的网络间隔);
|
|
46
|
+
* - 单文件(model + meta)也是并发下载;
|
|
47
|
+
* - OSS STS client 在 OSSHelper 内缓存复用,不再每个文件都申请一次凭证。
|
|
48
|
+
*/
|
|
49
|
+
export declare class ModelLoader {
|
|
50
|
+
private modelType;
|
|
51
|
+
private loadMetaOverride?;
|
|
52
|
+
private emit;
|
|
53
|
+
/** 多模型是否顺序加载(默认 true) */
|
|
54
|
+
private sequential;
|
|
55
|
+
/** 非顺序加载的发起间隔(毫秒,默认 200) */
|
|
56
|
+
private loadInterval;
|
|
57
|
+
private metaBuffer?;
|
|
58
|
+
private metaReady;
|
|
59
|
+
private metaEventsBound;
|
|
60
|
+
private pendingMetaModel?;
|
|
61
|
+
constructor(config?: ModelLoaderConfig);
|
|
62
|
+
/** 运行时判断是否加载 meta(跟随 config,避免 setup 阶段 getConfig 尚未就绪) */
|
|
63
|
+
private getLoadMeta;
|
|
64
|
+
/** viewer 销毁/重建时重置内部 meta 状态 */
|
|
65
|
+
reset(): void;
|
|
66
|
+
/** 外部传入已就绪的 meta buffer(单模型外部 buffer 场景,可能晚于模型到达) */
|
|
67
|
+
setMetaBuffer(buffer?: ArrayBuffer): void;
|
|
68
|
+
/** 下载单个文件(http 直连 / OSS),返回 Promise<ArrayBuffer> */
|
|
69
|
+
private fetch;
|
|
70
|
+
/** 模型主体下载路径:http 直接用原地址;OSS 补上 .xtc 等类型后缀 */
|
|
71
|
+
private downloadModelPath;
|
|
72
|
+
/** 加载单个已就绪 buffer 的模型到引擎,模型成功后自动处理 meta */
|
|
73
|
+
loadSingle(modelId: string, buffer: ArrayBuffer, metaBuffer?: ArrayBuffer, options?: Record<string, any>): Promise<ModelLoadResult>;
|
|
74
|
+
/** 引擎模型加载成功后处理 meta:可用则立即加载,否则挂起等 setMetaBuffer */
|
|
75
|
+
private handleMetaAfterModelLoad;
|
|
76
|
+
private loadMetadata;
|
|
77
|
+
/** 绑定引擎 meta 事件(只绑一次),转发给 emit */
|
|
78
|
+
private bindMetaEvents;
|
|
79
|
+
/** 按路径加载单个模型:并发下载 model + meta,下载完再引擎加载 */
|
|
80
|
+
loadFromPath(modelId: string, filePath: string, options?: Record<string, any>): Promise<ModelLoadResult | undefined>;
|
|
81
|
+
/** 下载 meta(.xts);失败不阻断主流程 */
|
|
82
|
+
private downloadMeta;
|
|
83
|
+
/**
|
|
84
|
+
* 多模型加载:先并发下载全部模型(含 meta),再交给引擎加载。
|
|
85
|
+
*
|
|
86
|
+
* 引擎加载调度由 config.sequential 决定:
|
|
87
|
+
* - sequential=true(默认):等待每个模型加载完成后再加载下一个(原循环方式);
|
|
88
|
+
* - sequential=false:不等每个模型加载完成,按 loadInterval 毫秒间隔依次发起下一个。
|
|
89
|
+
* @returns 每个模型的加载结果
|
|
90
|
+
*/
|
|
91
|
+
loadMulti(items: ModelLoadItem[]): Promise<ModelLoadResult[]>;
|
|
92
|
+
/** 延迟指定毫秒数 */
|
|
93
|
+
private sleep;
|
|
94
|
+
}
|
|
@@ -10,6 +10,18 @@ export default class ViewerManager {
|
|
|
10
10
|
edgesObjectIds: string[];
|
|
11
11
|
};
|
|
12
12
|
static ConfigViewer(eventTarget?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* 设置指定模型的颜色亮度(如贴图模型发暗补偿)
|
|
15
|
+
* @param modelId 模型 ID
|
|
16
|
+
* @param brightness 亮度系数,1.0 为原始亮度,>1 提亮,<1 变暗
|
|
17
|
+
*/
|
|
18
|
+
static SetModelBrightness(modelId: string, brightness: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* 获取指定模型的颜色亮度
|
|
21
|
+
* @param modelId 模型 ID
|
|
22
|
+
* @returns 亮度系数,未找到模型时返回 undefined
|
|
23
|
+
*/
|
|
24
|
+
static GetModelBrightness(modelId: string): number | undefined;
|
|
13
25
|
static SaveViewerState(content: any): void;
|
|
14
26
|
static SetToolActiveById(id: number, active?: boolean): void;
|
|
15
27
|
static SetToolActiveByKey(key: string, active?: boolean): void;
|