iflow-engine 1.5.1 → 2.1.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/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
1
  export * from './bim-engine';
2
+ export * from './bim-engine-2d';
3
+ export * from './bim-engine-720';
2
4
  export * from './types/component';
3
5
  export * from './types/events';
4
6
  export type { ThemeConfig, ThemeType } from './themes/types';
5
7
  export type { EngineOptions, ModelLoadOptions } from './components/engine/types';
8
+ export type { Engine2dOptions, DrawingLoadOptions, Drawing2dLayer } from './components/engine-2d/types';
9
+ export type { Engine720Options, PanoramaLoadOptions, PanoramaAnnotation } from './components/engine-720/types';
6
10
  export type { DialogOptions, DialogPosition } from './components/dialog/index.type';
7
11
  export type { ButtonConfig, ButtonGroupOptions } from './components/button-group/index.type';
8
12
  export type { TreeOptions, TreeNodeConfig, TreeNodeCheckState, NodeClickAction } from './components/tree/types';
@@ -0,0 +1,58 @@
1
+ import { Engine2d, Engine2dOptions, DrawingLoadOptions, Drawing2dLayer } from '../components/engine-2d';
2
+ import { BaseManager } from '../core/base-manager';
3
+ import { ManagerRegistry } from '../core/manager-registry';
4
+ /**
5
+ * 2D 图纸引擎管理器
6
+ * 封装底层 2D 引擎,提供图纸加载、图层控制等公共 API
7
+ */
8
+ export declare class Engine2dManager extends BaseManager {
9
+ /** 容器元素 */
10
+ private container;
11
+ /** 2D 引擎组件实例 */
12
+ private engineInstance;
13
+ constructor(container: HTMLElement, registry: ManagerRegistry);
14
+ /**
15
+ * 获取 Engine2d 组件实例
16
+ * 内部管理器通过此方法直接访问 Engine2d 组件的全部能力
17
+ * @returns Engine2d 组件实例,未初始化时返回 null
18
+ */
19
+ getEngine2dComponent(): Engine2d | null;
20
+ /**
21
+ * 初始化 2D 引擎
22
+ * @param options 引擎配置选项
23
+ * @returns 是否初始化成功
24
+ */
25
+ initialize(options?: Omit<Engine2dOptions, 'container'>): boolean;
26
+ /**
27
+ * 检查引擎是否已初始化
28
+ * @returns 是否已初始化
29
+ */
30
+ isInitialized(): boolean;
31
+ /**
32
+ * 加载 2D 图纸
33
+ * @param url 图纸文件 URL
34
+ * @param options 加载选项
35
+ */
36
+ loadDrawing(url: string, options?: DrawingLoadOptions): Promise<void>;
37
+ /**
38
+ * 获取所有图层
39
+ * @returns 图层列表
40
+ */
41
+ getLayers(): Drawing2dLayer[];
42
+ /**
43
+ * 设置图层可见性
44
+ * @param name 图层名称
45
+ * @param visible 是否可见
46
+ */
47
+ setLayerVisible(name: string, visible: boolean): void;
48
+ /**
49
+ * 重置视图
50
+ */
51
+ resetView(): void;
52
+ /**
53
+ * 适应视图
54
+ */
55
+ fitToView(): void;
56
+ /** 销毁 2D 引擎管理器 */
57
+ destroy(): void;
58
+ }
@@ -0,0 +1,58 @@
1
+ import { Engine720, Engine720Options, PanoramaLoadOptions } from '../components/engine-720';
2
+ import { BaseManager } from '../core/base-manager';
3
+ import { ManagerRegistry } from '../core/manager-registry';
4
+ /**
5
+ * 720 全景引擎管理器
6
+ * 封装底层 720 引擎,提供全景加载、视角控制等公共 API
7
+ */
8
+ export declare class Engine720Manager extends BaseManager {
9
+ /** 容器元素 */
10
+ private container;
11
+ /** 720 引擎组件实例 */
12
+ private engineInstance;
13
+ constructor(container: HTMLElement, registry: ManagerRegistry);
14
+ /**
15
+ * 获取 Engine720 组件实例
16
+ * 内部管理器通过此方法直接访问 Engine720 组件的全部能力
17
+ * @returns Engine720 组件实例,未初始化时返回 null
18
+ */
19
+ getEngine720Component(): Engine720 | null;
20
+ /**
21
+ * 初始化 720 引擎
22
+ * @param options 引擎配置选项
23
+ * @returns 是否初始化成功
24
+ */
25
+ initialize(options?: Omit<Engine720Options, 'container'>): boolean;
26
+ /**
27
+ * 检查引擎是否已初始化
28
+ * @returns 是否已初始化
29
+ */
30
+ isInitialized(): boolean;
31
+ /**
32
+ * 加载全景图
33
+ * @param url 全景图片 URL
34
+ * @param options 加载选项
35
+ */
36
+ loadPanorama(url: string, options?: PanoramaLoadOptions): Promise<void>;
37
+ /**
38
+ * 预加载多个全景图
39
+ * @param urls 全景图 URL 列表
40
+ */
41
+ preloadPanoramas(urls: string[]): Promise<void>;
42
+ /**
43
+ * 设置视场角
44
+ * @param fov 视场角值
45
+ */
46
+ setFov(fov: number): void;
47
+ /**
48
+ * 获取当前视场角
49
+ * @returns 当前视场角值
50
+ */
51
+ getFov(): number;
52
+ /**
53
+ * 重置视图
54
+ */
55
+ resetView(): void;
56
+ /** 销毁 720 引擎管理器 */
57
+ destroy(): void;
58
+ }
@@ -100,5 +100,26 @@ export interface EngineEvents {
100
100
  };
101
101
  'aiChat:new-chat': {};
102
102
  'aiChat:history-opened': {};
103
+ 'engine2d:drawing-loaded': {
104
+ url: string;
105
+ };
106
+ 'engine2d:entity-clicked': {
107
+ data: any;
108
+ };
109
+ 'engine2d:layer-changed': {
110
+ data: any;
111
+ };
112
+ 'engine720:panorama-loaded': {
113
+ data: any;
114
+ };
115
+ 'engine720:load-error': {
116
+ data: any;
117
+ };
118
+ 'engine720:annotation-click': {
119
+ data: any;
120
+ };
121
+ 'engine720:view-changed': {
122
+ data: any;
123
+ };
103
124
  'aiChat:settings-opened': {};
104
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iflow-engine",
3
- "version": "1.5.1",
3
+ "version": "2.1.0",
4
4
  "description": "iFlow Engine SDK for Vue2, Vue3, React and HTML",
5
5
  "main": "./dist/iflow-engine.umd.js",
6
6
  "module": "./dist/iflow-engine.es.js",
@@ -59,7 +59,7 @@
59
59
  "vite-plugin-dts": "^4.5.4"
60
60
  },
61
61
  "dependencies": {
62
- "iflow-engine-base": "^2.1.5",
62
+ "iflow-engine-base": "^3.1.2",
63
63
  "three": "^0.182.0"
64
64
  }
65
65
  }