Files
bim_engine/.recycle/2026-01-22/src/index.d.ts

449 lines
11 KiB
TypeScript
Raw Normal View History

import { default as default_2 } from 'stats.js';
import * as THREE from 'three';
declare class CameraModule {
private engine;
perspectiveCamera: THREE.PerspectiveCamera;
orthographicCamera: THREE.OrthographicCamera;
constructor(engine: any);
switchToPerspectiveCamera(): void;
switchToOrthographicCamera(): void;
getCameraType(): CameraType;
getCameraPose(): ICameraPose;
restoreCameraPose(pose: ICameraPose): void;
}
declare enum CameraType {
PERSPECTIVE = "perspective",
ORTHOGRAPHIC = "orthographic"
}
declare class Clipping {
private engine;
sectionPlaneX: any;
sectionPlaneY: any;
sectionPlaneZ: any;
sectionBox: any;
constructor(engine: any);
disActive(): void;
}
declare class ComposerModule {
private engine;
composer: any;
private saturationPass;
constructor(engine: any);
resize(): void;
init(): void;
}
declare class ControlModule {
private engine;
orbitControls: any;
firstPersonControls: any;
isActive: boolean;
constructor(engine: any);
init(): void;
active(): void;
disActive(): void;
switchFirstPersonMode(): void;
switchDefaultMode(): void;
update(): void;
}
/**
* Factory function to create the BIM Engine instance.
*
* @param options Configuration options
* @returns An instance adhering to IBimEngine interface
*/
export declare function createEngine(options: EngineOptions): EngineKernelV2;
declare class DeviceModule {
private engine;
deviceType: string;
constructor(engine: any);
getDeviceType(): string;
getContainerSize(): {
width: any;
height: any;
};
}
/**
*
*
*/
declare class EngineInfo {
private engine;
constructor(engine: any);
/**
*
*
* @returns
*/
getEngineInfo(): {
totalVertices: number;
totalTriangles: number;
meshCount: number;
};
}
declare class EngineKernelV2 {
private options;
private DeviceType;
private animationId;
private animate;
scene: THREE.Scene | null;
camera: THREE.Camera | null;
renderer: THREE.WebGLRenderer | null;
sceneModule: SceneModule;
cameraModule: CameraModule;
deviceModule: DeviceModule;
renderModule: RenderModule;
controlModule: ControlModule;
composerModule: ComposerModule;
loaderModule: LoaderModule;
engineStatus: EngineStatus;
events: EventModule;
lightModule: LightModule;
interactionModule: InteractionModule;
modelToolModule: ModelToolModule;
handelBehaved: typeof HandelBehaved;
octreeBox: any;
controls: any;
stats: default_2;
viewCube: ViewCube;
rangeScale: RangeScale;
setting: Setting;
measure: Measure;
clipping: Clipping;
modelTree: ModelTree;
engineInfo: EngineInfo;
modelProperties: ModelProperties;
modelMapperBatch: ModelMapperBatch;
models: any[];
private container;
constructor(options: any);
}
/**
*
*/
declare interface EngineOptions {
containerId: string;
backgroundColor?: string | number | null;
antialias?: boolean;
version?: 'v1' | 'v2';
showStats?: boolean;
showViewCube?: boolean;
}
declare class EngineStatus {
private engine;
isFree: boolean;
highlightModels: any[];
hideModels: any[];
models: any[];
constructor(engine: any);
init(): void;
updateFree(status: boolean): void;
closeAllFunction: () => void;
}
declare class EventModule {
private listeners;
on<T = any>(event: EventType, callback: (data: T) => void): void;
off<T = any>(event: EventType, callback: (data: T) => void): void;
trigger(event: EventType, data?: any): void;
}
/**
*
*/
declare enum EventType {
ModelLoadStart = "model-load-start",
ModelLoadProgress = "model-load-progress",
ModelLoaded = "model-loaded",
ModelError = "model-error",
SelectionChanged = "selection-changed",// data: { ids: string[], modelId: string }
HoverChanged = "hover-changed",// data: { id: string | null, point: Vector3 }
Click = "click",// data: MouseEventData
MouseMove = "mouse-move",// data: MouseEventData - 鼠标移动事件
CameraChanged = "camera-changed",// 相机移动时持续触发
CameraIdle = "camera-idle",// 相机静止后触发
EngineFree = "engine-free",
EngineBusy = "engine-busy"
}
/**
* -
* @param engine
* @returns
*/
declare function HandelBehaved(engine: any): any;
declare interface ICameraPose {
type: CameraType;
position: {
x: number;
y: number;
z: number;
};
rotation: {
x: number;
y: number;
z: number;
};
quaternion: {
x: number;
y: number;
z: number;
w: number;
};
target?: {
x: number;
y: number;
z: number;
};
zoom?: number;
}
declare class InteractionModule {
private engine;
private behavior;
private isCtrlDown;
constructor(engine: any);
init(): void;
active(): void;
disActive(): void;
handelKeyCtrlUp(): void;
handelKeyCtrlDown(): void;
handleMouseClick(event: any): void;
handleMouseDoubleClick(event: any): void;
}
declare class LightModule {
private engine;
constructor(engine: any);
init(): void;
}
declare class LoaderModule {
private engine;
constructor(engine: any);
loadModels(urls: string[], options?: LoadModelOptions): Promise<void>;
}
/**
*
*/
declare interface LoadModelOptions {
/** 自定义模型 ID若不提供则自动生成 UUID */
id?: string;
/** 初始名称 */
name?: string;
/** 初始变换矩阵 (平移、旋转、缩放) */
matrix?: number[];
/** 初始位置 [x, y, z] (如果提供了 matrix此项可能被忽略或叠加) */
position?: [number, number, number];
/** 初始旋转 [x, y, z] (欧拉角,弧度) */
rotation?: [number, number, number];
/** 初始缩放 [x, y, z] */
scale?: [number, number, number];
/** 加载进度回调 (0-100) */
onProgress?: (progress: number) => void;
}
declare class Measure {
private isActive;
private engine;
private clearHeightMeasure;
private distanceMeasure;
private clearDistanceMeasure;
private elevationMeasure;
private pointMeasure;
private angleMeasure;
private areaMeasure;
private slopeMeasure;
private tools;
private annotationContainer;
private annotationData;
constructor(engine: any);
active(): void;
disActive(): void;
clearAll(): void;
update(): void;
}
declare class ModelMapperBatch {
private engine;
constructor(engine: any);
getModelTypes(): void;
getModelMajors(): void;
getModelLevels(): void;
getModelMappers(models: any[]): void;
getModelMapper(url: string, id: number): any;
getModelSWithType(type: string, callback: any): any[];
getModelSWithLevel(level: string, callback: any): any[];
getModelsWithMajor(major: string, callback: any): any[];
}
declare class ModelProperties {
private engine;
constructor(engine: any);
init(): void;
getModelProperties(url: string, id: string, callback: (properties: any) => void): void;
}
declare class ModelToolModule {
private engine;
private highlightMaterial;
private hideMaterial;
constructor(engine_: any);
highlightModel(models: any): void;
unhighlightModel(models: any): void;
unhighlightAllModels(): void;
hideModel(models: any): void;
showModel(models: any): void;
showAllModels(): void;
setModelColor(model: any, color: string): void;
setAllModelsColor(color: string): void;
restoreAllModelsColor(): void;
getModelsBox(models: any): THREE.Box3;
getModelDescription(model: any): void;
}
declare class ModelTree {
private engine;
constructor(engine: any);
getTreeData(): any[];
}
/**
* RangeScale -
*
*
* 1.
* 2.
* 3.
* 4. 使
*/
declare class RangeScale {
private engine;
private isDrawing;
private startPoint;
private endPoint;
private selectionBox;
private worldToScreen;
private boundMouseDown;
private boundMouseMove;
private boundMouseUp;
private boundKeyDown;
constructor(engine: any);
/**
*
* UI元素
*/
init(): void;
/**
*
*
*/
active(): void;
/**
*
*
*/
disActive(): void;
/**
* UI元素
*
*/
private createSelectionBoxElement;
/**
*
*
*/
private onMouseDown;
/**
*
*
*/
private onMouseMove;
/**
*
*
*/
private onMouseUp;
/**
*
* ESC 退
*/
private onKeyDown;
/**
*
*
*/
private endDrawing;
/**
* UI
*
*/
private updateSelectionBoxUI;
/**
*
*
*/
private performZoom;
/**
*
* @param boundingBox -
*/
private fitCameraToBoundingBox;
}
declare class RenderModule {
private engine;
renderer: THREE.WebGLRenderer | null;
constructor(engine: any);
createRenderer(): THREE.WebGLRenderer;
disposeRenderer(): void;
}
declare class SceneModule {
private engine;
scene: THREE.Scene | null;
constructor(engine: any);
}
declare class Setting {
private engine;
constructor(engine: any);
init(): void;
}
declare class ViewCube {
private engine;
cubeTool: any;
constructor(engine: any);
init(): void;
CameraGoHome(): void;
zoomToModel(box: any): void;
}
export { }
declare module 'three' {
namespace THREE {
class OrbitControls {
enabled: boolean;
dampingFactor: number;
constructor(_Engine: any, object: any, domElement: HTMLElement);
update(): void;
addEventListener(type: string, listener: (event: any) => void): void;
[key: string]: any;
}
}
}