iflow-engine-base 2.0.1 → 2.0.3
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 +4868 -3949
- package/dist/bim-engine-sdk.es.js.map +1 -1
- package/dist/bim-engine-sdk.umd.js +229 -21
- package/dist/bim-engine-sdk.umd.js.map +1 -1
- package/dist/iflow-engine-base.css +1 -1
- package/dist/index.d.ts +209 -3
- package/dist/model0/info +0 -0
- package/dist/model0/lod0 +0 -0
- package/dist/model0/property +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none}.measureBack{cursor:pointer;pointer-events:auto;fill:orange;top:-50px;rx:5;ry:5}.measureLabel{position:absolute;fill:#fff;font-size:14px;font-family:Arial,sans-serif;pointer-events:none}.measurePointer{fill:orange}.Hight{stroke:#fff;stroke-width:2}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}
|
|
1
|
+
.originRotate{width:10px;height:10px;background-color:red}.versionText{position:absolute;right:10px;color:#86d9ff;z-index:1000;bottom:0;font-size:10px;background:transparent;pointer-events:none}.originDiv{position:absolute;top:100px;left:100px;width:30px;height:30px;border-radius:50%;z-index:1000;pointer-events:none}.catchPoint{pointer-events:none;stroke:#08dfd7;fill:transparent;stroke-width:2}.catchLine{position:absolute;width:10px;height:10px;pointer-events:none;background-color:green}.catchPlane{position:absolute;width:10px;height:10px;pointer-events:none;background-color:#ff0}.ViewCube{position:absolute;width:120px;height:120px;top:0;right:0;z-index:999}.homeViewWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-image:url(/assets/viewcube/home.png);background-size:100% 100%;background-repeat:no-repeat;background-color:#fff0;color:#fff;top:10px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.viewSettingWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-size:100% 100%;background-repeat:no-repeat;font-weight:800;background-color:#fff0;color:#fff;top:30px;right:100;width:20px;height:20px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:70px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cameraToggleWrapper.show{display:flex}.cameraToggleWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.screenshotWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:20px;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:120px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.screenshotWrapper.show{display:flex}.screenshotWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.fullscreenWrapper{position:absolute;cursor:pointer;pointer-events:auto;background-color:#ffffffe6;color:#333;font-size:26px;font-weight:700;display:none;align-items:center;justify-content:center;border-radius:4px;box-shadow:0 2px 4px #0003;transition:all .3s ease;top:170px;right:90px;width:44px;height:44px;z-index:999;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.fullscreenWrapper.show{display:flex}.fullscreenWrapper:hover{background-color:#fff;box-shadow:0 3px 6px #0000004d;transform:scale(1.1)}.measure-elevation{position:absolute;pointer-events:none}.measureSvg{position:absolute;width:1920px;height:1080px}.catch-point{position:absolute;width:10px;height:10px;background-color:red;border-radius:50%;pointer-events:none}.annotation-container{position:absolute;pointer-events:none;top:0;left:0}.measureLine{position:absolute;pointer-events:none}.measureBack{cursor:pointer;pointer-events:auto;fill:orange;top:-50px;rx:5;ry:5}.measureLabel{position:absolute;fill:#fff;font-size:14px;font-family:Arial,sans-serif;pointer-events:none}.measurePointer{fill:orange}.Hight{stroke:#fff;stroke-width:2}.allow-select{pointer-events:auto}.disallow-select{pointer-events:none}.angle-annotation{position:absolute;pointer-events:auto}
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ declare class ComposerModule {
|
|
|
143
143
|
private engine;
|
|
144
144
|
composer: any;
|
|
145
145
|
private saturationPass;
|
|
146
|
+
private ssaoPass;
|
|
146
147
|
constructor(engine: any);
|
|
147
148
|
resize(width?: number, height?: number): void;
|
|
148
149
|
init(): void;
|
|
@@ -242,6 +243,17 @@ declare class EngineKernelV2 {
|
|
|
242
243
|
private controlsEnabledBeforePause;
|
|
243
244
|
private animate;
|
|
244
245
|
private onWindowResize;
|
|
246
|
+
private _fpsFrameCount;
|
|
247
|
+
private _fpsLastCheck;
|
|
248
|
+
private _fpsLastSwitch;
|
|
249
|
+
private _lowFpsCount;
|
|
250
|
+
private _highFpsCount;
|
|
251
|
+
private readonly _fpsCheckInterval;
|
|
252
|
+
private readonly _fpsSwitchCooldown;
|
|
253
|
+
private readonly _fpsThreshold;
|
|
254
|
+
private readonly _fpsUpgradeThreshold;
|
|
255
|
+
private readonly _lowFpsRequired;
|
|
256
|
+
private readonly _highFpsRequired;
|
|
245
257
|
isMouseDown: boolean;
|
|
246
258
|
isWheeling: boolean;
|
|
247
259
|
scene: THREE.Scene | null;
|
|
@@ -279,15 +291,29 @@ declare class EngineKernelV2 {
|
|
|
279
291
|
ai: AI;
|
|
280
292
|
pathRoaming: PathRoaming;
|
|
281
293
|
hoverHighLight: HoverHighLight;
|
|
294
|
+
minMap: MiniMap;
|
|
295
|
+
grid: Grid;
|
|
296
|
+
level: Level;
|
|
297
|
+
text: Text_2;
|
|
282
298
|
models: any[];
|
|
283
299
|
reactBoundingClientRect: {
|
|
284
300
|
left: number;
|
|
285
301
|
top: number;
|
|
286
302
|
};
|
|
287
303
|
version: string;
|
|
304
|
+
private versionEl;
|
|
288
305
|
private container;
|
|
289
306
|
constructor(options: any);
|
|
307
|
+
updateVersionDisplay(): void;
|
|
290
308
|
updateLightPosition(camera: any, directionalLight: any): void;
|
|
309
|
+
/**
|
|
310
|
+
* 自适应渲染降级:将渲染模式降低一级
|
|
311
|
+
*/
|
|
312
|
+
private _adaptiveRenderingDowngrade;
|
|
313
|
+
/**
|
|
314
|
+
* 自适应渲染升级:将渲染模式提升一级
|
|
315
|
+
*/
|
|
316
|
+
private _adaptiveRenderingUpgrade;
|
|
291
317
|
/**
|
|
292
318
|
* 暂停渲染循环
|
|
293
319
|
*/
|
|
@@ -321,7 +347,9 @@ declare class EngineKernelV2 {
|
|
|
321
347
|
declare class EngineModelModule {
|
|
322
348
|
private engine;
|
|
323
349
|
private currentMode;
|
|
350
|
+
private isManualMode;
|
|
324
351
|
private gtaoPass;
|
|
352
|
+
private ssaoPass;
|
|
325
353
|
private saturationPass;
|
|
326
354
|
private outputPass;
|
|
327
355
|
private fxaaPass;
|
|
@@ -331,7 +359,25 @@ declare class EngineModelModule {
|
|
|
331
359
|
*/
|
|
332
360
|
init(): void;
|
|
333
361
|
/**
|
|
334
|
-
*
|
|
362
|
+
* 手动切换渲染模式(用户调用),锁定自动适配
|
|
363
|
+
* @param model - "simple"(性能) | "balance"(平衡) | "advanced"(效果)
|
|
364
|
+
*/
|
|
365
|
+
switchModel(model: string): void;
|
|
366
|
+
/**
|
|
367
|
+
* 自动切换渲染模式(引擎内部调用),若已手动设置则跳过
|
|
368
|
+
* @param model - "simple"(性能) | "balance"(平衡) | "advanced"(效果)
|
|
369
|
+
*/
|
|
370
|
+
autoSwitch(model: string): void;
|
|
371
|
+
/**
|
|
372
|
+
* 恢复自动适配模式(解除手动锁定)
|
|
373
|
+
*/
|
|
374
|
+
enableAutoMode(): void;
|
|
375
|
+
/**
|
|
376
|
+
* 是否处于手动锁定模式
|
|
377
|
+
*/
|
|
378
|
+
get isManual(): boolean;
|
|
379
|
+
/**
|
|
380
|
+
* 设置模式(内部初始化使用,不影响手动锁定状态)
|
|
335
381
|
* @param model - "simple"(性能) | "balance"(平衡) | "advanced"(效果)
|
|
336
382
|
*/
|
|
337
383
|
setMode(model: string): void;
|
|
@@ -343,7 +389,7 @@ declare class EngineModelModule {
|
|
|
343
389
|
* 缓存 Pass 引用
|
|
344
390
|
*/
|
|
345
391
|
private cachePassReferences;
|
|
346
|
-
private
|
|
392
|
+
private applyMode;
|
|
347
393
|
/**
|
|
348
394
|
* 设置阴影开关
|
|
349
395
|
*/
|
|
@@ -352,6 +398,10 @@ declare class EngineModelModule {
|
|
|
352
398
|
* 设置环境光遮蔽 (GTAO) 开关
|
|
353
399
|
*/
|
|
354
400
|
private setGTAO;
|
|
401
|
+
/**
|
|
402
|
+
* 设置环境光遮蔽 (SSAO) 开关
|
|
403
|
+
*/
|
|
404
|
+
private setSSAO;
|
|
355
405
|
/**
|
|
356
406
|
* 设置饱和度 Pass 开关
|
|
357
407
|
*/
|
|
@@ -373,9 +423,13 @@ declare class EngineModelModule {
|
|
|
373
423
|
*/
|
|
374
424
|
setBalancedMode(): void;
|
|
375
425
|
/**
|
|
376
|
-
*
|
|
426
|
+
* 设置效果模式(SSAO)
|
|
377
427
|
*/
|
|
378
428
|
setQualityMode(): void;
|
|
429
|
+
/**
|
|
430
|
+
* 设置超高级模式(GTAO,最高质量)
|
|
431
|
+
*/
|
|
432
|
+
setSuperQualityMode(): void;
|
|
379
433
|
/**
|
|
380
434
|
* 设置阴影质量
|
|
381
435
|
* @param quality - "low"(1024) | "medium"(2048) | "high"(4096)
|
|
@@ -479,6 +533,58 @@ declare enum EventType {
|
|
|
479
533
|
SectionMove = "section-move"
|
|
480
534
|
}
|
|
481
535
|
|
|
536
|
+
declare class Grid {
|
|
537
|
+
private readonly engine;
|
|
538
|
+
private rootGroup;
|
|
539
|
+
private isVisible;
|
|
540
|
+
private axes;
|
|
541
|
+
/**
|
|
542
|
+
* 坐标转换:BIM(X,Y,Z) → Three.js 世界坐标
|
|
543
|
+
* 默认规则:BIM X=水平, Y=水平深度, Z=高度
|
|
544
|
+
* → Three.js X=水平, Y=高度, Z=-深度
|
|
545
|
+
* 可在外部替换此函数以适配不同坐标系。
|
|
546
|
+
*/
|
|
547
|
+
coordinateMapper: (p: GridAxisPoint) => THREE.Vector3;
|
|
548
|
+
constructor(engine: any);
|
|
549
|
+
/** 传入轴网数据并在场景中构建对象 */
|
|
550
|
+
setData(data: GridAxisData[]): void;
|
|
551
|
+
/** 使用内置模拟数据(调试用) */
|
|
552
|
+
setMockData(): void;
|
|
553
|
+
/** 显示轴网 */
|
|
554
|
+
show(): void;
|
|
555
|
+
/** 隐藏轴网 */
|
|
556
|
+
hide(): void;
|
|
557
|
+
/** 切换显示/隐藏 */
|
|
558
|
+
toggle(): void;
|
|
559
|
+
/**
|
|
560
|
+
* 每帧更新(在动画循环中调用)
|
|
561
|
+
* 根据正交相机缩放动态调整圆圈大小,保持屏幕上视觉尺寸恒定(约 30px)
|
|
562
|
+
*/
|
|
563
|
+
update(): void;
|
|
564
|
+
/** 销毁,释放 Three.js 资源 */
|
|
565
|
+
dispose(): void;
|
|
566
|
+
private _initRoot;
|
|
567
|
+
private _clearAxes;
|
|
568
|
+
private _buildAxis;
|
|
569
|
+
/**
|
|
570
|
+
* 创建带文字的圆圈 Sprite
|
|
571
|
+
* Sprite 默认朝向相机(billboard),depthTest=false 保证始终可见
|
|
572
|
+
*/
|
|
573
|
+
private _makeCircleSprite;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
declare interface GridAxisData {
|
|
577
|
+
Id: string;
|
|
578
|
+
Name: string;
|
|
579
|
+
Points: [GridAxisPoint, GridAxisPoint];
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
declare interface GridAxisPoint {
|
|
583
|
+
X: number;
|
|
584
|
+
Y: number;
|
|
585
|
+
Z: number;
|
|
586
|
+
}
|
|
587
|
+
|
|
482
588
|
/**
|
|
483
589
|
* 行为处理器 - 管理引擎的交互行为(鼠标、键盘事件等)
|
|
484
590
|
* @param engine 引擎实例
|
|
@@ -588,6 +694,45 @@ declare interface IRoamingPoint extends ICameraPose {
|
|
|
588
694
|
stayTime?: number;
|
|
589
695
|
}
|
|
590
696
|
|
|
697
|
+
declare class Level {
|
|
698
|
+
private engine;
|
|
699
|
+
private isVisible;
|
|
700
|
+
private levels;
|
|
701
|
+
private svgContainer;
|
|
702
|
+
private svgOverlay;
|
|
703
|
+
private worldToScreen;
|
|
704
|
+
halfSize: number;
|
|
705
|
+
private readonly COLOR;
|
|
706
|
+
private readonly PLANE_OPACITY;
|
|
707
|
+
constructor(engine: any);
|
|
708
|
+
private _initSvg;
|
|
709
|
+
/** 传入标高数据并渲染 */
|
|
710
|
+
setData(data: LevelData[]): void;
|
|
711
|
+
/** 使用内置模拟数据(调试用) */
|
|
712
|
+
setMockData(): void;
|
|
713
|
+
/** 显示标高 */
|
|
714
|
+
show(): void;
|
|
715
|
+
/** 隐藏标高 */
|
|
716
|
+
hide(): void;
|
|
717
|
+
/** 切换显示/隐藏 */
|
|
718
|
+
toggle(): void;
|
|
719
|
+
/** 每帧刷新(需在动画循环中调用) */
|
|
720
|
+
update(): void;
|
|
721
|
+
/** 销毁,释放资源 */
|
|
722
|
+
dispose(): void;
|
|
723
|
+
private _initWorldToScreen;
|
|
724
|
+
private _clearAll;
|
|
725
|
+
private _buildThreeObject;
|
|
726
|
+
private _updateSvgLabels;
|
|
727
|
+
private _makeLabel;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
declare interface LevelData {
|
|
731
|
+
Id: string;
|
|
732
|
+
Name: string;
|
|
733
|
+
Elevation: number;
|
|
734
|
+
}
|
|
735
|
+
|
|
591
736
|
declare class LightModule {
|
|
592
737
|
private engine;
|
|
593
738
|
constructor(engine: any);
|
|
@@ -653,6 +798,61 @@ declare interface Message {
|
|
|
653
798
|
content: string;
|
|
654
799
|
}
|
|
655
800
|
|
|
801
|
+
declare class MiniMap {
|
|
802
|
+
private engine;
|
|
803
|
+
private miniMapCamera;
|
|
804
|
+
private miniMapRenderer;
|
|
805
|
+
private miniMapContainer;
|
|
806
|
+
private overlayCanvas;
|
|
807
|
+
private overlayCtx;
|
|
808
|
+
private isVisible;
|
|
809
|
+
private readonly mapSize;
|
|
810
|
+
private currentHalfSize;
|
|
811
|
+
private readonly minHalfSize;
|
|
812
|
+
private readonly maxHalfSize;
|
|
813
|
+
private halfSizeInitialized;
|
|
814
|
+
private camY;
|
|
815
|
+
private centerX;
|
|
816
|
+
private centerZ;
|
|
817
|
+
private dragMode;
|
|
818
|
+
private lastMouseX;
|
|
819
|
+
private lastMouseY;
|
|
820
|
+
constructor(engine: any);
|
|
821
|
+
getstate(): boolean;
|
|
822
|
+
private init;
|
|
823
|
+
/**
|
|
824
|
+
* 世界坐标 XZ → 小地图像素坐标
|
|
825
|
+
* 小地图 up=(0,0,-1):-Z 朝屏幕上方,+X 朝屏幕右方
|
|
826
|
+
*/
|
|
827
|
+
private worldToPixel;
|
|
828
|
+
/** 小地图像素坐标 → 世界坐标 XZ */
|
|
829
|
+
private pixelToWorld;
|
|
830
|
+
private setupEvents;
|
|
831
|
+
/** 滚轮缩放小地图视野 */
|
|
832
|
+
private readonly onWheel;
|
|
833
|
+
/**
|
|
834
|
+
* 点击指示器(中心 25px 范围)→ 进入旋转拖拽模式
|
|
835
|
+
* 点击其他位置 → 计算世界坐标,直接将相机传送过去
|
|
836
|
+
*/
|
|
837
|
+
private readonly onMouseDown;
|
|
838
|
+
private readonly onMouseMove;
|
|
839
|
+
private readonly onMouseUp;
|
|
840
|
+
/**
|
|
841
|
+
* 传送:点击小地图空白区域 → 计算世界坐标,将相机和 target 平移过去
|
|
842
|
+
*/
|
|
843
|
+
private handleTeleport;
|
|
844
|
+
/**
|
|
845
|
+
* 旋转:拖动指示器尖端 → 绕 controls.target 旋转主相机水平轨道角
|
|
846
|
+
*/
|
|
847
|
+
private handleRotate;
|
|
848
|
+
private drawOverlay;
|
|
849
|
+
show(): void;
|
|
850
|
+
hide(): void;
|
|
851
|
+
toggle(): void;
|
|
852
|
+
update(): void;
|
|
853
|
+
dispose(): void;
|
|
854
|
+
}
|
|
855
|
+
|
|
656
856
|
declare class ModelEdge {
|
|
657
857
|
private engine;
|
|
658
858
|
private isActive;
|
|
@@ -1061,6 +1261,12 @@ declare interface Step {
|
|
|
1061
1261
|
apiModules: string[];
|
|
1062
1262
|
}
|
|
1063
1263
|
|
|
1264
|
+
declare class Text_2 {
|
|
1265
|
+
private engine;
|
|
1266
|
+
constructor(engine: any);
|
|
1267
|
+
update(): void;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1064
1270
|
declare class ViewCube {
|
|
1065
1271
|
private engine;
|
|
1066
1272
|
cubeTool: any;
|
package/dist/model0/info
CHANGED
|
Binary file
|
package/dist/model0/lod0
CHANGED
|
Binary file
|
package/dist/model0/property
CHANGED
|
Binary file
|