iflow-engine-base 3.12.4 → 3.12.5
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/bim-engine-sdk.es.js +14 -13
- package/dist/bim-engine-sdk.umd.js +672 -642
- package/dist/chunks/{engine-2d-DkVm5OrG.js → engine-2d-Bjr3p2Wy.js} +72 -62
- package/dist/chunks/{engine-3d-BcaOUY_t.js → engine-3d-Cap1x_4_.js} +2822 -2047
- package/dist/chunks/{engine-720-Bk8EPFS9.js → engine-720-CfHpVklG.js} +15 -15
- package/dist/chunks/{engine-gaussian-3AV9YIVN.js → engine-gaussian-CIruC3PT.js} +2 -2
- package/dist/chunks/{engine-gis-j4GvT41d.js → engine-gis-CXVisOHM.js} +3 -3
- package/dist/chunks/{sdk-assets-Cr-wEweL.js → sdk-assets-D5UGR827.js} +2 -2
- package/dist/chunks/{sdk-runtime-B4l79tmQ.js → sdk-runtime-83EeZHe_.js} +16 -16
- package/dist/chunks/{sdk-vendor-VZI0bEcg.js → sdk-vendor-CvevZpJO.js} +1 -1
- package/dist/chunks/{three-vendor-Bx2tSp_D.js → three-vendor-BL-jpeTM.js} +92 -91
- package/dist/index.d.ts +186 -1
- package/package.json +1 -1
- package/dist/assets/viewcube/cn_back.png +0 -0
- package/dist/assets/viewcube/cn_bottom.png +0 -0
- package/dist/assets/viewcube/cn_front.png +0 -0
- package/dist/assets/viewcube/cn_left.png +0 -0
- package/dist/assets/viewcube/cn_right.png +0 -0
- package/dist/assets/viewcube/cn_top.png +0 -0
- package/dist/assets/viewcube/home.png +0 -0
- package/dist/assets//350/267/263/350/267/263/345/215/241.glb +0 -0
- package/dist/assets//351/227/250/350/264/264.glb +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -551,17 +551,24 @@ declare class Calibration {
|
|
|
551
551
|
private static readonly sourceColor;
|
|
552
552
|
private static readonly targetColor;
|
|
553
553
|
private readonly matrices;
|
|
554
|
+
private readonly histories;
|
|
555
|
+
private readonly historyOrder;
|
|
554
556
|
private pointCalibrationUrl;
|
|
555
557
|
private pointCalibrationPoints;
|
|
558
|
+
private pointCalibrationCallback;
|
|
556
559
|
private behavior;
|
|
560
|
+
private readonly onKeyDown;
|
|
557
561
|
/** 供 handelBehaved 判断不同工具切换时释放当前鼠标监听。 */
|
|
558
562
|
readonly type = "point-calibration";
|
|
559
563
|
constructor(engine: any);
|
|
564
|
+
/** 释放校准管理器的全局快捷键监听。 */
|
|
565
|
+
dispose(): void;
|
|
560
566
|
/**
|
|
561
567
|
* 应用模型校准矩阵。
|
|
562
568
|
* flat 16 数组按 Three.js 列主序处理;二维 4x4 数组按常见行主序处理。
|
|
563
569
|
*/
|
|
564
570
|
apply(options: CalibrationOptions): boolean;
|
|
571
|
+
private applyInternal;
|
|
565
572
|
/**
|
|
566
573
|
* 兼容业务侧更直观的命名。
|
|
567
574
|
*/
|
|
@@ -605,18 +612,57 @@ declare class Calibration {
|
|
|
605
612
|
/**
|
|
606
613
|
* 清除指定模型的校准。
|
|
607
614
|
*/
|
|
608
|
-
clear(url: string): boolean;
|
|
615
|
+
clear(url: string, onChange?: CalibrationChangeCallback): boolean;
|
|
616
|
+
/** 撤回最近一次模型校准;传 url 时只撤回指定模型,不传时撤回最后变更的模型。 */
|
|
617
|
+
undo(url?: string, onChange?: CalibrationChangeCallback): boolean;
|
|
618
|
+
private pushHistory;
|
|
619
|
+
private findLatestHistoryUrl;
|
|
620
|
+
private notifyChange;
|
|
621
|
+
private createChangeEvent;
|
|
622
|
+
private handleKeyDown;
|
|
623
|
+
/** Ctrl+Z / Command+Z 撤回最近一次主模型校准,输入框焦点下保留原生编辑行为。 */
|
|
624
|
+
private isUndoShortcut;
|
|
609
625
|
private updateCachedModelBox;
|
|
610
626
|
private clearRuntimeWorldBoxCache;
|
|
611
627
|
private toThreeMatrix;
|
|
612
628
|
private toVector3;
|
|
613
629
|
}
|
|
614
630
|
|
|
631
|
+
export declare type CalibrationChangeCallback = (event: CalibrationChangeEvent) => void;
|
|
632
|
+
|
|
633
|
+
/** 3D 主模型校准变化回调数据。 */
|
|
634
|
+
export declare interface CalibrationChangeEvent {
|
|
635
|
+
url: string;
|
|
636
|
+
source: CalibrationChangeSource;
|
|
637
|
+
/** 模型根节点当前平移值,单位沿用引擎世界坐标。 */
|
|
638
|
+
offset: CalibrationVector3Array;
|
|
639
|
+
/** 模型根节点当前欧拉角,单位为角度,数组第 4 位保留 Three.js 的旋转顺序。 */
|
|
640
|
+
rotation: CalibrationEulerArray;
|
|
641
|
+
/** 模型根节点当前欧拉角,单位为弧度,供需要 Three.js 原始单位的业务使用。 */
|
|
642
|
+
rotationRadians: CalibrationEulerArray;
|
|
643
|
+
/** 便于 UI 直接显示的三轴角度制旋转值。 */
|
|
644
|
+
rotationDegrees: CalibrationVector3Array;
|
|
645
|
+
/** 模型根节点当前缩放,矩阵校准包含缩放时用于业务侧兜底保存。 */
|
|
646
|
+
scale: CalibrationVector3Array;
|
|
647
|
+
/** 当前 4x4 校准矩阵,按 Three.js 列主序导出。 */
|
|
648
|
+
matrix: number[];
|
|
649
|
+
/** 本次变更前的 4x4 校准矩阵,按 Three.js 列主序导出。 */
|
|
650
|
+
previousMatrix: number[];
|
|
651
|
+
/** 是否由 Ctrl+Z 或 undo 触发。 */
|
|
652
|
+
isUndo: boolean;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export declare type CalibrationChangeSource = 'apply' | 'segment' | 'point' | 'clear' | 'undo';
|
|
656
|
+
|
|
657
|
+
declare type CalibrationEulerArray = [number, number, number, THREE.EulerOrder];
|
|
658
|
+
|
|
615
659
|
declare type CalibrationMatrixInput = THREE.Matrix4 | number[] | ArrayLike<number> | number[][];
|
|
616
660
|
|
|
617
661
|
export declare interface CalibrationOptions {
|
|
618
662
|
url: string;
|
|
619
663
|
matrix: CalibrationMatrixInput;
|
|
664
|
+
/** 校准成功后返回当前模型的偏移、旋转和矩阵,便于业务侧保存手动调节结果。 */
|
|
665
|
+
onChange?: CalibrationChangeCallback;
|
|
620
666
|
}
|
|
621
667
|
|
|
622
668
|
declare type CalibrationPointInput = THREE.Vector3 | [number, number, number] | {
|
|
@@ -634,6 +680,8 @@ declare interface CalibrationSegmentInput {
|
|
|
634
680
|
end: CalibrationPointInput;
|
|
635
681
|
}
|
|
636
682
|
|
|
683
|
+
declare type CalibrationVector3Array = [number, number, number];
|
|
684
|
+
|
|
637
685
|
declare class CameraModule {
|
|
638
686
|
private static readonly MIN_VISIBLE_HEIGHT;
|
|
639
687
|
private static readonly MIN_CAMERA_DISTANCE;
|
|
@@ -2482,6 +2530,8 @@ declare class EngineKernelV2 {
|
|
|
2482
2530
|
modelComparison: ModelComparison;
|
|
2483
2531
|
/** 管理模型炸开代理对象,并保持炸开后的构件交互身份。 */
|
|
2484
2532
|
modelExplode: ModelExplode;
|
|
2533
|
+
/** 材质编辑器,提供 DOM 面板、材质修改记录读取和一键还原能力。 */
|
|
2534
|
+
materialTool: MaterialTool;
|
|
2485
2535
|
models: any[];
|
|
2486
2536
|
reactBoundingClientRect: {
|
|
2487
2537
|
left: number;
|
|
@@ -2943,6 +2993,7 @@ export declare enum EventType {
|
|
|
2943
2993
|
Click = "click",// data: ModelClickEventItem[]
|
|
2944
2994
|
MouseMove = "mouse-move",// data: MouseEventData - 鼠标移动事件
|
|
2945
2995
|
ModelPlaceSelected = "model-place-selected",
|
|
2996
|
+
ModelCalibrationChanged = "model-calibration-changed",
|
|
2946
2997
|
CameraChanged = "camera-changed",// 相机移动时持续触发
|
|
2947
2998
|
CameraIdle = "camera-idle",// 相机静止后触发
|
|
2948
2999
|
ViewportResize = "viewport-resize",// 窗口大小变化
|
|
@@ -4678,6 +4729,8 @@ declare class LinkElement2d3d {
|
|
|
4678
4729
|
private disActive;
|
|
4679
4730
|
dispose(): void;
|
|
4680
4731
|
private readonly listenElementClick;
|
|
4732
|
+
/** 二三维模型联动开启时保持 3D 引擎全帧渲染,避免等待空闲限帧间隔。 */
|
|
4733
|
+
private readonly listenLinkStateChange;
|
|
4681
4734
|
}
|
|
4682
4735
|
|
|
4683
4736
|
declare class LinkView2d3d {
|
|
@@ -5094,6 +5147,132 @@ declare interface Markup2dStyle {
|
|
|
5094
5147
|
|
|
5095
5148
|
declare type Markup2dType = 'line' | 'arrow' | 'rect' | 'ellipse' | 'text' | 'polygon' | 'cloudline';
|
|
5096
5149
|
|
|
5150
|
+
export declare interface MaterialEditorMaterialInfo {
|
|
5151
|
+
id: string;
|
|
5152
|
+
name: string;
|
|
5153
|
+
type: string;
|
|
5154
|
+
color?: string;
|
|
5155
|
+
opacity: number;
|
|
5156
|
+
transparent: boolean;
|
|
5157
|
+
roughness?: number;
|
|
5158
|
+
metalness?: number;
|
|
5159
|
+
emissive?: string;
|
|
5160
|
+
emissiveIntensity?: number;
|
|
5161
|
+
side: number;
|
|
5162
|
+
wireframe?: boolean;
|
|
5163
|
+
textures: MaterialTextureInfo[];
|
|
5164
|
+
}
|
|
5165
|
+
|
|
5166
|
+
export declare interface MaterialEditorOptions {
|
|
5167
|
+
visible?: boolean;
|
|
5168
|
+
title?: string;
|
|
5169
|
+
width?: number;
|
|
5170
|
+
}
|
|
5171
|
+
|
|
5172
|
+
export declare interface MaterialEditorTarget {
|
|
5173
|
+
url: string;
|
|
5174
|
+
ids?: Array<string | number>;
|
|
5175
|
+
}
|
|
5176
|
+
|
|
5177
|
+
export declare type MaterialMapSlot = 'map' | 'normalMap' | 'roughnessMap' | 'metalnessMap' | 'alphaMap' | 'aoMap' | 'bumpMap' | 'emissiveMap';
|
|
5178
|
+
|
|
5179
|
+
export declare interface MaterialModificationRecord {
|
|
5180
|
+
id: string;
|
|
5181
|
+
name: string;
|
|
5182
|
+
type: string;
|
|
5183
|
+
objectNames: string[];
|
|
5184
|
+
changes: Record<string, {
|
|
5185
|
+
before: unknown;
|
|
5186
|
+
after: unknown;
|
|
5187
|
+
}>;
|
|
5188
|
+
}
|
|
5189
|
+
|
|
5190
|
+
declare interface MaterialOption {
|
|
5191
|
+
material: THREE.Material;
|
|
5192
|
+
materials?: THREE.Material[];
|
|
5193
|
+
owners: THREE.Object3D[];
|
|
5194
|
+
}
|
|
5195
|
+
|
|
5196
|
+
export declare interface MaterialTextureInfo {
|
|
5197
|
+
slot: MaterialMapSlot;
|
|
5198
|
+
name: string;
|
|
5199
|
+
url: string;
|
|
5200
|
+
hasTexture: boolean;
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
/** 材质编辑器入口,负责对外 API、事件绑定和材质资源生命周期。 */
|
|
5204
|
+
export declare class MaterialTool {
|
|
5205
|
+
private readonly engine;
|
|
5206
|
+
options: Required<MaterialEditorOptions>;
|
|
5207
|
+
selectedMaterials: MaterialOption[];
|
|
5208
|
+
selectedMaterialId: string | null;
|
|
5209
|
+
targetText: string;
|
|
5210
|
+
visible: boolean;
|
|
5211
|
+
private readonly textureLoader;
|
|
5212
|
+
private readonly ownedTextures;
|
|
5213
|
+
private readonly objectUrls;
|
|
5214
|
+
private readonly collector;
|
|
5215
|
+
private readonly snapshots;
|
|
5216
|
+
private readonly panel;
|
|
5217
|
+
private isDisposed;
|
|
5218
|
+
private eventsBound;
|
|
5219
|
+
private readonly handleSelectionChanged;
|
|
5220
|
+
private readonly handleClick;
|
|
5221
|
+
private readonly handleLoadingCompleted;
|
|
5222
|
+
constructor(engine: any, options?: MaterialEditorOptions);
|
|
5223
|
+
/** 初始化 DOM 和事件监听;默认隐藏,业务可调用 show() 打开。 */
|
|
5224
|
+
init(options?: MaterialEditorOptions): void;
|
|
5225
|
+
/** 显示编辑器,可同时传入目标对象或构件选择信息。 */
|
|
5226
|
+
show(target?: THREE.Object3D | MaterialEditorTarget): void;
|
|
5227
|
+
/** 隐藏编辑器但保留已有修改记录。 */
|
|
5228
|
+
hide(): void;
|
|
5229
|
+
/** 切换编辑器显示状态。 */
|
|
5230
|
+
toggle(target?: THREE.Object3D | MaterialEditorTarget): void;
|
|
5231
|
+
/** 根据场景对象读取其下所有材质并刷新面板。 */
|
|
5232
|
+
selectObject(object: THREE.Object3D): MaterialEditorMaterialInfo[];
|
|
5233
|
+
/** 根据当前引擎选择数据读取构件材质。 */
|
|
5234
|
+
selectTarget(target: MaterialEditorTarget): MaterialEditorMaterialInfo[];
|
|
5235
|
+
/** 只读取目标对象材质,不改变当前 UI 选择。 */
|
|
5236
|
+
getMaterialsByObject(object: THREE.Object3D): MaterialEditorMaterialInfo[];
|
|
5237
|
+
/** 只读取指定构件材质,不改变当前 UI 选择。 */
|
|
5238
|
+
getMaterialsByTarget(target: MaterialEditorTarget): MaterialEditorMaterialInfo[];
|
|
5239
|
+
/** 读取当前场景中所有可编辑材质。 */
|
|
5240
|
+
getAllSceneMaterials(): MaterialEditorMaterialInfo[];
|
|
5241
|
+
/** 返回当前选择对象上可编辑的材质信息。 */
|
|
5242
|
+
getSelectedMaterials(): MaterialEditorMaterialInfo[];
|
|
5243
|
+
/** 返回全场景相对快照发生变化的材质信息。 */
|
|
5244
|
+
getModifiedMaterials(): MaterialModificationRecord[];
|
|
5245
|
+
/** 重建当前场景基准快照;通常在模型加载完成后由编辑器自动调用。 */
|
|
5246
|
+
captureSceneSnapshot(): void;
|
|
5247
|
+
/** 批量更新材质参数。 */
|
|
5248
|
+
updateMaterial(materialId: string, patch: Partial<Record<string, unknown>>): void;
|
|
5249
|
+
/** 通过 URL 或 File 修改指定贴图槽;传入 null 时清除贴图。 */
|
|
5250
|
+
setTexture(materialId: string, slot: MaterialMapSlot, source: string | File | null): Promise<void>;
|
|
5251
|
+
/** 一键还原所有有基准快照的场景材质。 */
|
|
5252
|
+
restoreAll(): void;
|
|
5253
|
+
/** 兼容常见命名:重置所有材质修改。 */
|
|
5254
|
+
resetAll(): void;
|
|
5255
|
+
/** 还原单个材质。 */
|
|
5256
|
+
restoreMaterial(materialId: string): void;
|
|
5257
|
+
/** 获取当前面板正在编辑的材质。 */
|
|
5258
|
+
getActiveMaterial(): THREE.Material | null;
|
|
5259
|
+
/** 刷新 DOM 面板。 */
|
|
5260
|
+
render(): void;
|
|
5261
|
+
/** 销毁 DOM、事件监听和编辑器创建的贴图资源。 */
|
|
5262
|
+
dispose(): void;
|
|
5263
|
+
private bindEvents;
|
|
5264
|
+
private setSelectedMaterials;
|
|
5265
|
+
/** 内容完全相同的材质只保留一个卡片,并合并它关联的对象和实际材质实例。 */
|
|
5266
|
+
private dedupeMaterials;
|
|
5267
|
+
private collectSceneMaterials;
|
|
5268
|
+
private findMaterialById;
|
|
5269
|
+
private findMaterialGroupById;
|
|
5270
|
+
private replaceTexture;
|
|
5271
|
+
private loadTexture;
|
|
5272
|
+
private requestRender;
|
|
5273
|
+
private disposeOwnedTextures;
|
|
5274
|
+
}
|
|
5275
|
+
|
|
5097
5276
|
declare class Measure {
|
|
5098
5277
|
private isActive;
|
|
5099
5278
|
private engine;
|
|
@@ -5862,6 +6041,8 @@ declare class ModelLink3d {
|
|
|
5862
6041
|
isApplyingLinkedEvent(): boolean;
|
|
5863
6042
|
dispose(): void;
|
|
5864
6043
|
private normalizeOptions;
|
|
6044
|
+
/** 模型联动开启后需要持续响应外部视图变化,不能进入空闲限帧。 */
|
|
6045
|
+
private syncIdleFrameRateExempt;
|
|
5865
6046
|
private createViewerGuid;
|
|
5866
6047
|
private wrapModelToolMethods;
|
|
5867
6048
|
private restoreModelToolMethods;
|
|
@@ -6890,6 +7071,8 @@ declare interface PerformanceStats {
|
|
|
6890
7071
|
/** 启动四点捕捉校准所需参数。 */
|
|
6891
7072
|
export declare interface PointCalibrationOptions {
|
|
6892
7073
|
url: string;
|
|
7074
|
+
/** 四点采集完成并应用校准后触发。 */
|
|
7075
|
+
onChange?: CalibrationChangeCallback;
|
|
6893
7076
|
}
|
|
6894
7077
|
|
|
6895
7078
|
/**
|
|
@@ -7572,6 +7755,8 @@ export declare interface SegmentCalibrationOptions {
|
|
|
7572
7755
|
url: string;
|
|
7573
7756
|
source: CalibrationSegmentInput;
|
|
7574
7757
|
target: CalibrationSegmentInput;
|
|
7758
|
+
/** 校准成功后返回当前模型的偏移、旋转和矩阵,便于业务侧保存手动调节结果。 */
|
|
7759
|
+
onChange?: CalibrationChangeCallback;
|
|
7575
7760
|
}
|
|
7576
7761
|
|
|
7577
7762
|
/**
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|