@xtctwins/tctwins-bimx-engine 0.3.6 → 0.3.8

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.
Files changed (29) hide show
  1. package/dist/01.xtc +0 -0
  2. package/dist/02.xtc +0 -0
  3. package/dist/03.xtc +0 -0
  4. package/dist/{AnnotationTool-De1jiTCz.mjs → AnnotationTool-DgppLcwx.mjs} +2 -2
  5. package/dist/BIMX_Viewer_Lib.es.js +1 -1
  6. package/dist/BIMX_Viewer_Lib.umd.js +95 -145
  7. package/dist/{CameraViewTool-BMlOMrqB.mjs → CameraViewTool-BReDlFEv.mjs} +1 -1
  8. package/dist/{CommentTool-Bk1VOqfh.mjs → CommentTool-D6DWQCa5.mjs} +1 -1
  9. package/dist/{HiddenTool-qc2Haq7s.mjs → HiddenTool-B8rcAH0z.mjs} +1 -1
  10. package/dist/{InspectorTool-DBACJEov.mjs → InspectorTool-WZToT3N-.mjs} +3 -3
  11. package/dist/{MeasureTool-nm_WvEIk.mjs → MeasureTool-DIHDiSpu.mjs} +2 -2
  12. package/dist/{MouseTool-By-GTmEQ.mjs → MouseTool-DgV53G0A.mjs} +1 -1
  13. package/dist/{NavigateTool-CnPNDkhr.mjs → NavigateTool-8DMKaXiT.mjs} +1 -1
  14. package/dist/{RoamTool-8gO-GTJH.mjs → RoamTool-CyvTgXrr.mjs} +1 -1
  15. package/dist/{ScreenShotTool-CjoT6Nzl.mjs → ScreenShotTool-HqPWEnrT.mjs} +2 -2
  16. package/dist/{SectionTool-BIxZykdw.mjs → SectionTool-DfjGtjao.mjs} +4 -4
  17. package/dist/{SettingTool-GPs6TF0J.mjs → SettingTool-DTIFj4Tj.mjs} +3 -3
  18. package/dist/{StructureTree-B2-F3HmW.mjs → StructureTree-Cu7KYRrz.mjs} +3 -3
  19. package/dist/{alert-kNj-KGee.mjs → alert-DRz67LTB.mjs} +1 -1
  20. package/dist/{el-input-number-DskNrGeD.mjs → el-input-number-BGkEOqim.mjs} +1 -1
  21. package/dist/{index-DK7roCJZ.mjs → index-Bv-246pp.mjs} +21922 -22285
  22. package/dist/{panel.vue_vue_type_style_index_0_lang-CQG6ZX_R.mjs → panel.vue_vue_type_style_index_0_lang-DMkX22H2.mjs} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{tallPanel-_5WiJEu-.mjs → tallPanel-CBDkSWkE.mjs} +1 -1
  25. package/package.json +2 -2
  26. package/types/components/BimxViewerComp.vue.d.ts +4 -0
  27. package/types/pages/BimxViewerEntry.vue.d.ts +4 -0
  28. package/types/utils/OSSHelper.d.ts +2 -0
  29. package/types/viewerManager/load/loadModel.d.ts +88 -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-DK7roCJZ.mjs";
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-Bv-246pp.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.6",
3
+ "version": "0.3.8",
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-viewer": "^1.1.2",
41
+ "@xtctwins/tctwins-bimx-viewer": "^1.1.4",
42
42
  "ali-oss": "^6.20.0",
43
43
  "axios": "^1.7.3",
44
44
  "element-plus": "^2.8.0",
@@ -12,6 +12,8 @@ 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
+ loadSequential?: boolean;
16
+ loadInterval?: number;
15
17
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
18
  emitHandler: (...args: any[]) => void;
17
19
  }, string, import('vue').PublicProps, Readonly<{
@@ -27,6 +29,8 @@ declare const _default: import('vue').DefineComponent<{
27
29
  modelIds?: string[];
28
30
  /** 每个模型的变换选项(与 modelIds 一一对应):{ position, scale, rotation, matrix, origin } */
29
31
  modelOptions?: Record<string, any>[];
32
+ loadSequential?: boolean;
33
+ loadInterval?: number;
30
34
  }> & Readonly<{
31
35
  onEmitHandler?: ((...args: any[]) => any) | undefined;
32
36
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -14,6 +14,8 @@ declare const _default: import('vue').DefineComponent<{
14
14
  multiModel?: boolean;
15
15
  filePaths?: string[];
16
16
  modelIds?: string[];
17
+ loadSequential?: boolean;
18
+ loadInterval?: number;
17
19
  themeColor?: ThemeColor;
18
20
  topHeight?: number;
19
21
  bottomHeight?: number;
@@ -72,6 +74,8 @@ declare const _default: import('vue').DefineComponent<{
72
74
  multiModel?: boolean;
73
75
  filePaths?: string[];
74
76
  modelIds?: string[];
77
+ loadSequential?: boolean;
78
+ loadInterval?: number;
75
79
  themeColor?: ThemeColor;
76
80
  topHeight?: number;
77
81
  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,3 +1,32 @@
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 各自就绪即加载(默认推荐),默认 true */
26
+ sequential?: boolean;
27
+ /** 非顺序加载时的发起间隔毫秒数(仅作节流),默认 0 表示不节流 */
28
+ loadInterval?: number;
29
+ }
1
30
  /**
2
31
  * BIMX 模型加载
3
32
  * @param modelId 模型 ID
@@ -9,3 +38,62 @@
9
38
  * - position / rotation / scale / origin / alignTo: 多模型坐标对齐参数
10
39
  */
11
40
  export default function viewerLoadModel(modelId: string, modelType: string, modelArrayBuffer: ArrayBuffer, callback?: Function, options?: Record<string, any>): void;
41
+ /**
42
+ * 模型加载器:统一封装「下载 -> 引擎加载 -> meta 加载」。
43
+ *
44
+ * 相比逐模型串行「下载-加载」,这里会:
45
+ * - 顺序加载时用流水线预取:下载第 i 个模型的同时加载第 i-1 个,让网络与解析重叠;
46
+ * - 非顺序加载时所有模型并发下载、就绪即加载;
47
+ * - 单文件(model + meta)并发下载;
48
+ * - OSS STS client 在 OSSHelper 内缓存复用,不再每个文件都申请一次凭证。
49
+ */
50
+ export declare class ModelLoader {
51
+ private modelType;
52
+ private loadMetaOverride?;
53
+ private emit;
54
+ /** 多模型是否顺序加载(默认 true) */
55
+ private sequential;
56
+ /** 非顺序加载的发起间隔(毫秒,默认 0 = 不节流) */
57
+ private loadInterval;
58
+ private metaBuffer?;
59
+ private metaReady;
60
+ private metaEventsBound;
61
+ private pendingMetaModel?;
62
+ constructor(config?: ModelLoaderConfig);
63
+ /** 运行时判断是否加载 meta(跟随 config,避免 setup 阶段 getConfig 尚未就绪) */
64
+ private getLoadMeta;
65
+ /** viewer 销毁/重建时重置内部 meta 状态 */
66
+ reset(): void;
67
+ /** 外部传入已就绪的 meta buffer(单模型外部 buffer 场景,可能晚于模型到达) */
68
+ setMetaBuffer(buffer?: ArrayBuffer): void;
69
+ /** 下载单个文件(http 直连 / OSS),返回 Promise<ArrayBuffer> */
70
+ private fetch;
71
+ /** 模型主体下载路径:http 直接用原地址;OSS 补上 .xtc 等类型后缀 */
72
+ private downloadModelPath;
73
+ /** 加载单个已就绪 buffer 的模型到引擎,模型成功后自动处理 meta */
74
+ loadSingle(modelId: string, buffer: ArrayBuffer, metaBuffer?: ArrayBuffer, options?: Record<string, any>): Promise<ModelLoadResult>;
75
+ /** 引擎模型加载成功后处理 meta:可用则立即加载,否则挂起等 setMetaBuffer */
76
+ private handleMetaAfterModelLoad;
77
+ private loadMetadata;
78
+ /** 绑定引擎 meta 事件(只绑一次),转发给 emit */
79
+ private bindMetaEvents;
80
+ /** 按路径加载单个模型:并发下载 model + meta,下载完再引擎加载;下载失败不抛异常 */
81
+ loadFromPath(modelId: string, filePath: string, options?: Record<string, any>): Promise<ModelLoadResult | undefined>;
82
+ /** 下载 meta(.xts);失败不阻断主流程 */
83
+ private downloadMeta;
84
+ /** 准备单个模型:并发下载 model + meta,返回可直接加载的数据;下载失败 buffer 为空(不抛异常) */
85
+ private prepareItem;
86
+ /**
87
+ * 多模型加载。
88
+ *
89
+ * sequential=true:一个一个来,等当前模型 loaded 后再加载下一个。
90
+ * sequential=false(对齐 xtctwins 示例用法):所有模型同时开始下载,
91
+ * 「谁的 buffer 先到就立即加载谁」,互不等待、默认不插入任何延迟。
92
+ * 这样下载与解析天然重叠,是引擎下最快的加载方式。
93
+ *
94
+ * loadInterval 仅作为可选的发起节流(默认 0 不节流)。
95
+ */
96
+ loadMulti(items: ModelLoadItem[]): Promise<ModelLoadResult[]>;
97
+ /** 延迟指定毫秒数 */
98
+ private sleep;
99
+ }