declare module "kingfisher-tron-sdk/kingfisher-tron-sdk" { /** * 配置SDK * @param config 配置对象 */ export function configuration(config: Config): any; /** * 更新配置 * @param config 配置对象 */ export function updateConfig(config: Config): any; /** * 初始化数据管理器 */ export function initDataManager(): Promise; /** * 获取数据连接信息 */ export function getConnectors(): Array; /** * 获取物模型数据 */ export function getTSL(): Map>; /** * 查询设备 * @param query 查询对象 */ export function queryDevices(query: DeviceQuery): Array; /** * 查询设备类型 */ export function getDeviceTypes(): Array; /** * 设备管理器 */ export const deviceManager: DeviceManager; /** * 空间管理器 */ export const spaceManager: SpaceManager; /** * 获取三维管理器 * @param widget 三维组件 * @returns 三维管理器 */ export function getWeb3dManager(widget: any): Web3dManager; /** * 获取三维系统图管理器 * @param widget 三维系统图组件 * @returns 三维系统图管理器 */ export function getDiagram3dManager(widget: any): Diagram3dManager; /** * 更新Web3d组件属性 * @param props 组件属性 */ export function updateWeb3dProps(props: Web3dProps): void; /** * 空间管理器 */ export class SpaceManager { /** * 获取部件类型 */ getPartTypes(): Array /** * 获取建筑列表 * @param projectId 项目ID */ getBuildings(projectId: Number): Array /** * 获取楼层列表 * @param projectId 项目Id * @param buildingId 建筑Id */ getFloors(projectId: Number, buildingId: String): Array /** * 根据设备类型进行统计数量 * @param projectId 项目Id * @param buildingId 建筑Id * @param floorId 楼层Id * @param type 设备类型 */ countByGroup(projectId: Number, buildingId: String, floorId: String, type: String): any /** * 查询空间对象 * @param query 查询 */ findSpaceGeo(query: SpaceQuery) : Array; /** * 统计区域信息 * @param projectId 项目Id * @param buildingId 建筑Id * @param floorId 楼层Id * @param type 区域类型 */ aggArea(projectId: Number, buildingId: String, floorId: String, type: String): any } export class Geo { /** * 自定义ID */ customId: String /** * 名称 */ name: String /** * 类型 */ type: String /** * 子类型 */ subType: String /** * 父节点 */ parentId: String /** * 项目Id */ projectId: String /** * 建筑Id */ buildingId: String /** * 楼层Id */ floorId: String /** * 唯一Id */ nanoId: String /** * 子区域 */ childAreaNanoIds: Array /** * 子节点 */ childModelNanoIds: Array } export class SpaceQuery { /** * 项目Id */ projectId: Number /** * 建筑Id */ buildingId: String /** * 楼层Id */ floorId: String /** * 类型 */ type: String /** * 模型类型 */ subType: String } export class Building { /** * 名称 */ name: String /** * 项目ID */ projectId: Number /** * 唯一ID */ nanoId: String } export class Floor { /** * 名称 */ name: String /** * 建筑ID */ buildingId: String /** * 项目ID */ projectId: Number /** * 唯一ID */ nanoId: String } export class DeviceManager { /** * 获取设备数据 * @param deviceId 设备ID */ getDeviceDataForDeviceId(deviceId: string): Device /** * 获取设备相关物模型 * @param device 设备对象 */ getDeviceModel(device: Device): DeviceTLS /** * 获取设备属性列表 * @param device 设备对象 */ getDeviceProperties(device: Device): Array /** * 获取设备属性 * @param device 设备对象 * @param property 属性名 */ getDevicePropertyModel(device: Device, property: String): TSLProperty /** * 获取设备属性标签 * @param device 设备对象 * @param property 属性名 */ getPropertyLabel(device: Device, property: String): Label /** * 获取三维模型相关的物模型 * @param modelName 模型名 */ getModelBy3dModelName(modelName: String): DeviceTLS } /** * 三维场景 */ export class Scene { } /** * 三维场景管理器 */ export class SceneManager { } /** * 三维引擎 */ export class Engine { } /** * 三维节点 */ export class TransformNode { } /** * 三维模型 */ export class AbstractMesh { } /** * 材质 */ export class Material { } /** * 三维向量 */ export class Vector3 { } /** * 三维空间 */ export class Space { } /** * 机位 */ export class OrbitCameraArgs { } /** * 国际化标签 */ export class Label { /** * 英文 */ en: String /** * 中文 */ zhCN: String /** * 繁体中文 */ zhTW: String } /** * 物模型属性 */ export class TSLProperty { /** * 属性名 */ name: String /** * 源属性 */ orgName: String /** * 序号 */ sno: Number /** * 类型 */ type: String /** * 显示格式 */ format: String /** * 最小值 */ minimum: Number /** * 最大值 */ maximum: Number /** * 单位 */ unit: String /** * 父属性 */ parent: String /** * 国际化标签 */ label: Label /** * 必须 */ required: Boolean /** * 可控属性 */ controllable: Boolean /** * 默认值 */ defaultValue: any /** * 显示为枚举 */ openEnum: Boolean /** * 枚举值 */ enumItems: Array /** * 验证器 */ validators: Array } /** * 设备物模型 */ export class DeviceTLS { /** * 模型名称 */ name: String /** * 源名称 */ orgName: String /** * 国际化标签 */ label: Label /** * 分类 */ category: String /** * 二维组件 */ widget: String /** * 三维组件 */ component: String /** * 面板事件 */ panelEvent:String /** * 面板页面Id */ panelPageId: Number /** * 父模型 */ parent: String /** * 忽略的父模型属性 */ excludeProperties: Array /** * 属性列表 */ properties: Array /** * 模型类型 */ modelType: String /** * 设备类型 */ linkedDeviceType: String } export class Device { /** * 设备类型 */ deviceType: String /** * 设备图纸ID */ deviceMapId: String /** * 设备属性数据 */ data: any /** * 物模型 */ modelType: String /** * 设备ID */ deviceId: String /** * 设备名称 */ deviceName: String /** * 唯一ID */ uuid: Number /** * 所在建筑 */ building: String /** * 设备状态 */ deviceStatus: Number /** * 设备类型编码 */ deviceTypeCode: String /** * 供应商 */ provider: String /** * 连接ID */ connId: String /** * 供应商序号 */ sn: String /** * 楼层 */ floor: String /** * 项目ID */ projectId: Number /** * 更新时间签 */ timestamp: Number } export class DeviceQuery { /** * 过滤器 */ filter: any /** * 排序 */ order: any /** * 分组 */ group: any /** * 返回条数 */ top: Number } export class Web3dProps { /** * 是否使用线程渲染, 默认false */ workerRender: boolean /** * 是否禁用硬件缩放 */ disableHardwareScaling: boolean /** * 渲染宽度限制 */ renderWidth: number /** * 渲染高度限制 */ renderHeight: number /** * 场景ID */ sceneUrl: string /** * 自定义加载Logo图片URL地址 */ logo: string /** * 图片尺寸, , */ logoSize: string /** * 渲染质量, 1:高画质, 2:中画质, 3:低画质 */ sceneQuality: number /** * 机位 */ camera: string /** * 三维事件, 格式为 {event: "", args: } */ event: any /** * 场景背景图片URL */ sceneBackgroundImage: string /** * 背景图片保持比率 */ sceneBgAspect: boolean /** * 背景图片缩放, 默认1 */ sceneBgScale: number /** * 场景前景图片URL */ sceneForegroundImage: string /** * 保持前景图片比率 */ sceneFgAspect: boolean /** * 前景图片缩放, 默认1 */ sceneFgScale: number /** * 显示统计信息 */ showStats: boolean /** * 调试脚本 */ debugPuzzle: boolean } export class Diagram3dProps { /** * 场景ID */ sceneUrl: string /** * 自定义加载Logo图片URL地址 */ logo: string /** * 图片尺寸, , */ logoSize: string /** * 显示统计信息 */ showStats: boolean /** * 调试脚本 */ debugPuzzle: boolean } export class Space3dProps { /** * 项目ID */ projectId: number /** * 楼层 */ floors: Object[] /** * 自定义大楼名称 */ customBuildName: string /** * 自定义加载Logo图片URL地址 */ logo: string /** * 图片尺寸, , */ logoSize: string /** * 显示统计信息 */ showStats: boolean /** * 建筑Id */ buildingId: number /** * 建筑名称 */ buildingName: string /** * 楼层Id */ floorId: number /** * 楼层名称 */ floorName: string /** * 显示部件类型 */ partType: string[] } export class Config { /** * 翠鸟云服务器地址 */ server: string /** * 用户ID */ userId: string /** * 密码 */ password: string /** * 是否开启调试日志 */ detailLog: boolean /** * 是否开启统计页面 */ allowStatistics: boolean } export class Space3dManager { /** * 设置机位 * @param mode 机位模式, 0为透视模式, 1为顶视模式 */ resetCamera(mode: number): void; /** * 选择模型 * @param objects 模型列表 */ selectObjects(objects: string[]): void; /** * 设置楼层 * @param floor 楼层对象 */ setFloor(floor: object): void; /** * 设置建筑 * @param building 建筑对象 */ setBuilding(building: object): void; /** * 搜索部件 * @param keyword 搜索条件 */ search(keyword: string): void; } export class Diagram3dManager { /** * 场景 */ scene: Scene; /** * 场景管理器 */ sceneManager: SceneManager; /** * 引擎 */ engine: Engine; /** * @description 根据组件Id获取组件简要信息 * @param {Object} scene 场景对象 * @param {String} partId 组件id * @return {{partId,name,attribute,category,resourceName,groupName,groupId}} * partIdName:{ String } 组件Id
* name:{ String } 组件名称
* [attribute]:{ String } 组件大的分类
* [category]:{ String } 组件小的分类
* [resourceName]:{ String } 组件资源名称
* [groupName]:{ String } 组件分组名称
* [groupId]:{ String } 组件分组id
* */ getPartBriefInfoByPartId: (scene: Scene, partIdName: string) => {}; /** * @description 根据组件Id获取组件简要信息 * @param {Object} scene 场景对象 * @param {String | String[]} keywords 关键字 * @return {[{partId,name,attribute,category,resourceName,groupName,groupId}]} * partIdName:{ String } 组件Id
* name:{ String } 组件名称
* [attribute]:{ String } 组件大的分类
* [category]:{ String } 组件小的分类
* [resourceName]:{ String } 组件资源名称
* [groupName]:{ String } 组件分组名称
* [groupId]:{ String } 组件分组id
* */ getPartBriefInfoArrayByKeywords: (scene: Scene, keywords: string | string[]) => any[]; /** * @description 获取场景中所有组件的简要信息列表 * @param {Object} scene 场景对象 * @return {{partId,name,attribute,category,resourceName,groupName,groupId}[]} 组件数组 * partId:{ String } 组件Id
* name:{ String } 组件名称
* [attribute]:{ String } 组件大的分类
* [category]:{ String } 组件小的分类
* [resourceName]:{ String } 组件资源名称
* [groupName]:{ String } 组件分组名称
* [groupId]:{ String } 组件分组id
* */ getPartsBriefInfo: (scene: Scene) => any[]; /** * @description 根据组件分类获取组件 * @param {Object} scene 场景对象 * @return {Object[]} 组件数组 * */ getDevicePartsBriefInfo: (scene: Scene) => any[]; /** * @description 获取管线组件简要信息 * @param {Object} scene 场景对象 * @return {Object[]} 组件数组 * */ getPipelinePartsBriefInfo: (scene: Scene) => any[]; /** * @description 根据组件分类获取组件 * @param {Object} scene 场景对象 * @return {Object[]} 组件数组 * */ getMiscPartsBriefInfo: (scene: Scene) => any[]; /** * @description 获取场景分组信息 * @return {{groups,ungroup}} groups:分组列表信息,ungroup:未分组组件 * */ getGroups: (scene: Scene) => any; /** * @description 获取场景分组简要信息 * @return {{groups,ungroup}} groups:分组列表信息,ungroup:未分组组件 * */ getGroupsBriefInfo: (scene: any) => any; /** * @description 获取分组内组件列表 * @param {Object} group 分组对象 * @return {Object[]} 组件列表 * */ getPartsByGroup: (group: any) => any; /** * @description 获取组件状态列表 * @param {Object} scene 场景对象 * @param {String} partIdName 组件Id或名称 * @return {{partId,id,name,currState,defaultState,states:{name,stateId}[]}[]} * partId:{ String } 组件Id
* id:{ String } 状态id
* name:{ String } 状态名称
* currState:{ String } 当前状态值
* defaultState:{ String } 默认状态值
* states:{{name,stateId}[]} 状态列表
* states.name:{String} 状态值名称
* states.stateId:{NUmber} 状态值
* */ getStatesByPartId: (scene: Scene, partIdName: string) => any[]; /** * @description 设置组件状态 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {String} idName 状态id或名称 * @param {Number/String} stateId 状态值/状态名 * @return void * */ setPartState: (scene: Scene, partIdName: string, idName: string, stateId: number) => void; /** * @description 获取组件数据列表 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @return {{partId,name,value,group,type}[]} 数据对象列表 * partId:{ String } 组件Id
* name:{ String } 数据名称
* group:{ String } 数据组名称
* type:{ String:['Boolean'|'String'|'Number'|'Color3'|'enum'...] } 数据类型
* states:{{name,stateId}[]} 状态列表
* value: {Any} 数据值 * */ getDataListByPart: (scene: Scene, partIdName: String) => any[]; /** * @description 获取组件数据 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {String} key 数据key * @return {Object} value 数据值 * * */ getPartDataByKey: (scene: Scene, partIdName: string, key: string) => undefined; /** * @description 获取组件数据 * @param {Object} scene 场景对象 * @param {String} partId 组件id * @return {Object} values 数据值 * * */ getPartData: (scene: Scene, partIdName: string) => any; /** * @description 设置组件数据 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {String} key 数据key * @param {Object} value 数据值 * * */ setPartDataByKey: (scene: Scene, partIdName: string, key: string, value: any) => void; /** * @description 设置组件数据 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {Object} value 数据值 * * */ setPartData: (scene: Scene, partIdName: string, values: any) => void; /** * @description 设置组件用户编号 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {Object} value 数据值 * * */ setPartUserId: (scene: Scene, partIdName: string, value: string) => void; /** * @description 为组件添加点击回调 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {Function} callBack 回调 * @param {force} boolean 强制 * @return {Object} observer 回调注册 * * */ addEventListener: (Scene: any, partId: string, callBack: any, force?: boolean | undefined) => any; /** * @description 为组件移除点击回调 * @param {Object} scene 场景对象 * @param {String} partIdName 组件id或名称 * @param {object} observer 回调 * * */ removeEventListener: (Scene: any, partId: string, observer: any) => void; /** * @function getPanelsInfo * @description 获取场景所有面板信息 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @return { [{[key:string]:{panels:[{id:string,label:string,items:[{}]}]}}] } * key:绑定对象的key * panels:面板列表 * id:面板id * label:面板名称 * items:面板配置项 * **/ getPanelsInfo: (scene: { k3dc: { panels: any; }; }) => any; /** * @function getPanelsInfoByPartId * @description 根据组件id获取面板信息 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} partId 组件id * @return { [{[key:string]:{panels:[{id:string,label:string,items:[{}]}]}}] } * key:绑定对象的key * panels:面板列表 * id:面板id * label:面板名称 * items:面板配置项 * **/ getPanelsInfoByPartId: (scene: { k3dc: { panels: any; }; }, partId: string) => any; /** * @description 设置面板配置项值 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} panelId 面板id * @param {[String|number]} index 数据索引 ,字符类型会匹配标签文本,数值类型会匹配配置项索引,索引以0为起始位置 * @param {[String|number|Boolean]} value 基础类型 * @return void * **/ setPanelDataByKey: (scene: { k3dc: { panels: any; }; }, panelId: String, index: String | Number, value: String | Number | Boolean) => void; /** * @function setPanelData * @description 设置单独面板一组数据,会根据数据对象的key对面板进行赋值
* 注意事项: key会优先匹配标签文本,例如key如果是2,那么会优先匹配标签文本是2的配置项
* 在配置项不存在时,会寻找配置项列表中第三个配置项进行赋值(数据索引是从0开始的,所以2对应数据列表中第三个配置项
, * 数据列表中存在第三个配置项时,对配置项进行赋值) * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} panelId 面板id * @param {Object} value 数据对象 * @return void * **/ setPanelData: (scene: { k3dc: { panels: any; }; }, panelId: String, value: any) => void; /** * @function showPanel * @description 显示面板 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} panelId 面板id * **/ showPanel(scene: { k3dc: { panels: any; }; }, panelId: String): void; /** * @function showPanel * @description 隐藏面板 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} panelId 面板id * **/ hidePanel(scene: { k3dc: { panels: any; }; }, panelId: String): void; /** * @function showPanel * @description 切换面板显隐 * @param {{ k3dc: { panels: any; }; }} scene 三维组态场景 * @param {String} panelId 面板id * **/ togglePanel(scene: { k3dc: { panels: any; }; }, panelId: String): void; } export class Web3dManager { /** * 场景 */ scene: Scene; /** * 场景管理器 */ sceneManager: SceneManager; /** * 引擎 */ engine: Engine; /* * 场景事件列表 */ events: Array; /* * 场景脚本对象 */ logic: any; /****************** Lookups ******************/ /** * 按名字获取场景中的物体 * @param scene 场景对象 * @param name 物体的名字 * @returns 物体id或undefined */ getObjectByName(scene: Scene, name: string): string | undefined; /** * 获取场景中所有模型的列表 * @param scene 场景对象 * @returns 模型列表 */ getAllMeshes(scene: Scene): AbstractMesh[]; /** * 获取场景中所有轴的列表 * @param scene 场景对象 * @returns 坐标列表 */ getAllTransformNodes(scene: Scene): TransformNode[]; /** * 按名字获取场景中的模型 * @param scene 场景对象 * @param name 模型的名字 * @returns 模型或undefined */ getMeshByName(scene: Scene, name: string): string | undefined; /** * 按名字获取场景中的节点 * @param scene 场景对象 * @param name 节点的名字 * @returns 节点或undefined */ getNodeByName(scene: Scene, name: string): string | undefined; /** * 按名字获取场景中的模型 * @param scene 场景对象 * @param name 模型的名字 * @returns 模型或undefined */ getAnnotationByName(scene: Scene, name: string): string | undefined; /** * 获取场景中所有机位的列表 * @param scene 场景对象 * @returns 机位列表 */ getAllCameraArgs(scene: Scene): import("kingfisher").CameraArgs[]; /** * 按名字获取场景中的机位 * @param scene 场景对象 * @param name 机位名称 * @returns 机位或undefined */ getCameraArgsByName(scene: Scene, name: string): import("kingfisher").CameraArgs | undefined; /** * 获取场景中所有材质的列表 * @param scene 场景对象 * @returns 材质球列表 */ getAllMaterials(scene: Scene): Material[]; /** * 按名字获取场景里的灯光 * @param scene 场景对象 * @param name 灯光的名字 * @returns 灯光或undefined */ getLightByName(scene: Scene, name: string): string | undefined; /** * 按名字获取场景里的材质 * @param scene 场景对象 * @param name 材质的名字 * @returns 材质或undefined */ getMaterialByName(scene: Scene, name: string): string | undefined; /** * 判断轴是否可见 * @param scene 场景对象 * @param transformNode 轴 * @returns 若找到轴, 返回轴是否可见, 否则返回undefined */ transformNodeIsVisible(scene: Scene, transformNode: string): boolean | undefined; /** * 判断模型是否可见 * @param scene 场景对象 * @param mesh 模型 * @returns 若找到模型, 返回模型是否可见, 否则返回undefined */ meshIsVisible(scene: Scene, mesh: string): boolean | undefined; /** * 判断物体是否可见 * @param scene 场景对象 * @param object 物体 * @returns 若找到物体, 返回物体是否可见, 否则返回undefined */ objectIsVisible(scene: Scene, object: string): boolean | undefined; /***************** Transform *****************/ /** * 平移物体 * @param scene 场景对象 * @param object 物体 * @param vector 平移矢量 * @param space 空间. 0为模型空间, 1为世界空间 */ translateObject(scene: Scene, object: string, vector: Vector3, space?: Space): void; /** * 对物体进行自转或公转 * @param scene 场景对象 * @param object 物体 * @param axis 转动方向 * @param amountInDegree 转动角度 * @param space 转动空间. 0为模型空间(自转), 1为世界空间(公转) */ rotateObject(scene: Scene, object: string, axis: Vector3, amountInDegree: number, space?: Space): void; /** * 绕世界空间中过一点的轴转动物体 * @param scene 场景对象 * @param object 物体 * @param point 转动点 * @param axis 转动方向 * @param amountInDegree 转动角度 */ rotateObjectAroundPointAxis(scene: Scene, object: string, point: Vector3, axis: Vector3, amountInDegree: number): void; /** * 缩放物体 * @param scene 场景对象 * @param object 物体 * @param vector 缩放倍率 (x, y, z) */ scaleObject(scene: Scene, object: string, vector: Vector3): void; /** * 设置场景物体的可见度 * @param scene 场景对象 * @param object 物体 * @param visibility 可见度 (有效范围为[0, 1]) */ setObjectVisibility(scene: Scene, object: string, visibility: number): void; /****************** Camera *******************/ /** * 返回当前机位 * @param scene 场景对象 * @returns 当前机位 */ getCameraStatus(scene: Scene): OrbitCameraArgs; /** * 平滑过渡到指定机位 * @param scene 场景对象 * @param newStatus 新机位 * @param animationTimeInSeconds 动画时长 */ transitionCameraToStatus(scene: Scene, newStatus: OrbitCameraArgs, animationTimeInSeconds?: number): void; /** * 平滑过渡到指定目标 * @param scene 场景对象 * @param objectId 目标物体 * @param animationTimeInSeconds 动画时长 */ focusCameraOnObject(scene: Scene, objectId: string, animationTimeInSeconds?: number): void; /** * 设置镜头视角 * @param scene 场景对象 * @param fovInDegree 视角(角度) */ setCameraFov(scene: Scene, fovInDegree: number): void; /** * 将镜头设为正交模式(无透视效果) * @param scene 场景对象 */ makeCameraOrthographic(scene: Scene): void; /** * 将镜头设为透视模式(近大远小) * @param scene 场景对象 * @param newStatus 新机位 * @param animationTimeInSeconds 动画时长 */ makeCameraPerspective(scene: Scene, newStatus?: OrbitCameraArgs, animationTimeInSeconds?: number): void; /** * 设置机位旋转动画 * @param scene 场景对象 * @param cameraName 机位名称 * @param {Object} options 参数 * autoRotate:{number} 自动旋转 * rotateDuration:{number} 旋转一周时间 * invertRotate:{number} 逆时针旋转 * rotateWaitTime:{number} 旋转等待时间 */ setupCameraArgsRotation(scene: Scene, cameraName: string, options: { autoRotate: boolean; rotateDuration: number; invertRotate: boolean; rotateWaitTime: number; }): void; /*************** Event Handling ***************/ /************** Html annotation **************/ /** * 创建注释 * @param scene 场景对象 * @param name 注释名字 * @param tickFunc 每帧回调 * @param disposeFunc 销毁回调, 可以留空为默认 * @param showOnLoad 加载后立刻显示(默认为true) * @returns 返回新建注释的id */ createAnnotation(scene: Scene, name: string, tickFunc: AnnotationTick, disposeFunc?: AnnotationDispose, showOnLoad?: boolean): string; /** * 销毁注释 * @param scene 场景对象 * @param name 注释名称 * @returns 销毁注释数量 */ destroyAnnotationsByName(scene: Scene, name: string): number; /** * 销毁注释 * @param scene 场景对象 * @param name 注释ID * @returns 成功返回true, 失败返回false */ destroyAnnotationByID(scene: Scene, id: string): boolean; /** * 批量创建Html注释, 并在其中添加html模板 * @param scene 场景对象 * @param idProp id字段 * @param htmlTemplate html模板(支持{{大胡子表达式}}) * @param prefix 注释名字前缀 * @param bindMap 数据绑定关系 * @param attachedDataArray 注释数据 * @param parentNode html的父节点. 默认为canvas.parentNode * @param shiftXInPixel X偏移, 单位为像素 * @param shiftYInPixel Y偏移, 单位为像素 * @param showOnLoad 加载后直接显示(默认为true) * @returns 返回新建注释列表 */ createAnnotationWithHtmlTemplate(scene: Scene, idProp: string, prefix: string, htmlTemplate: string, bindMap: string, attachedDataArray: any[], parentNode?: string, shiftXInPixel?: number, shiftYInPixel?: number, showOnLoad?: boolean): HtmlAnnotation[] | undefined; /** * 注释开关 * @param scene 场景对象 * @param prefix 注释名字前缀 * @param idProp id字段 * @param attachedData 注释数据 * @param visibility 是否可见 */ setAnnotationVisibility(scene: Scene, prefix: string, idProp: string, attachedData: any, visibility: boolean): void; /** * 销毁注释 * @deprecated * @param scene 场景对象 * @param prefix 注释名字前缀 * @param idProp id字段 * @param attachedData 注释数据 */ destroyAnnotation(scene: Scene, prefix: string, idProp: string, attachedData: any): void; /** * 销毁所有指定前缀的注释 * @param scene 场景对象 * @param prefix 注释名字前缀 */ destroyAnnotationsByPrefix(scene: Scene, prefix: string): void; /****************** Actions *******************/ /** * 设置摄像机机位 * @param scene 场景对象 * @param cameraName 摄像机机位名称 * @param duration 动画时长, 默认1秒 */ setActiveCameraArg(scene: Scene, cameraName: string, duration?: number): void; /** * 复位摄像机机位 * @param scene 场景对象 * @param duration 动画时长, 默认1秒 */ resetCameraToDefault(scene: Scene, duration?: number): void; /** * 添加Camera回调 * @param scene 当前场景对象 * @param callback 回调函数 * @param once 仅触发一次 */ addCameraCallback(scene: Scene, callback: any, once?: boolean): void; /** * 移除Camera回调 * @param scene 当前场景对象 * @param callback 回调函数 */ removeCameraCallback(scene: Scene, callback: any): void; /** * 初始化撒点 * @param scene 场景对象 * @param id 撒点系统编号 * @param parent 父节点id * @param categoryIcons 图标信息 * @param callback 执行完成后回调 * @param poiTapCallback 点击回调 * @param poiMouseEnterCallback 鼠标进入回调 * @param poiMouseLeaveCallback 鼠标移出回调 */ createPoiSystem(scene: Scene, id: string, parent: string, categoryIcons: any[], callback: any, poiTapCallback: any, poiMouseEnterCallback: any, poiMouseLeaveCallback: any): void; /** * 批量添加点位 * @param scene 场景对象 * @param id 撒点系统编号 * @param datas 数据Array * @param bindMap 绑定关系 */ createPois(scene: Scene, id: string, scale: number, datas: any[], bindMap: string): void; /** * 清除点位 * @param scene 场景对象 * @param id 撒点系统编号 * @param rebuild 是否更新显示 */ clearPois(scene: Scene, id: string, rebuild?: boolean): void; /** * 刷新点位显示 * @param scene 场景对象 * @param id 撒点系统编号 */ buildPois(scene: Scene, id: string): void; /** * 初始化撒点 * @param scene 场景对象 * @param id 撒点系统编号 * @param parent 父节点id * @param category 图标类型 * @param scale 缩放 * @param datas 数据 * @param bindMap 绑定关系 * @param poiTapCallback 点击回调 * @param poiMouseEnterCallback 鼠标进入回调 * @param poiMouseLeaveCallback 鼠标移出回调 */ createPoiAndBuild(scene: Scene, id: string, parent: string, category: any[], scale: number, datas: any[], bindMap: string, poiTapCallback: any, poiMouseEnterCallback: any, poiMouseLeaveCallback: any): void; createPoiAddBuild(scene: Scene, id: string, parent: string, category: any[], scale: number, datas: any[], bindMap: string, poiTapCallback: any, poiMouseEnterCallback: any, poiMouseLeaveCallback: any): void; /** * 注册撒点回调 * @param scene 场景对象 * @param id 撒点系统编号 * @param listeners 回调 * { * onLoad(poi, wvp, visibility) * onBuilded(poi, wvp, visibility) * onPointClick(poi, point, wvp, pointerInfo) * onPositionChanged(poi, wvp) * onVisibilityChanged(poi, visibility) * onDisposed(poi) * } */ registerPoiListeners(scene: Scene, id: string, listeners: any): void; /** * 反注册撒点回调 * @param scene 场景对象 * @param id 撒点系统编号 * @param listeners 回调 * { * onLoad(poi, wvp, visibility) * onBuilded(poi, wvp, visibility) * onPointClick(poi, point, wvp, pointerInfo) * onPositionChanged(poi, wvp) * onVisibilityChanged(poi, visibility) * onDisposed(poi) * } */ unRegisterPoiListeners(scene: Scene, id: string, listeners: any): void; /** * 注册点击回调 * @param scene 场景对象 * @param id interaction编号 * @param listeners 回调 * { * onLoad(poi, wvp, visibility) * onBuilded(poi, wvp, visibility) * onClick(poi, point, wvp, pointerInfo) * onPositionChanged(poi, wvp) * onVisibilityChanged(poi, visibility) * onDisposed(poi) * } */ registerClickListeners(scene: Scene, id: string, listeners: any): void; /** * 反注册点击回调 * @param scene 场景对象 * @param id interaction编号 * @param listeners 回调 * { * onLoad(poi, wvp, visibility) * onBuilded(poi, wvp, visibility) * onPointClick(poi, point, wvp, pointerInfo) * onPositionChanged(poi, wvp) * onVisibilityChanged(poi, visibility) * onDisposed(poi) * } */ unRegisterClickListeners(scene: Scene, id: string, listeners: any): void; /** * 创建热力图 * @param scene 场景对象 * @param id 热力图系统编号 * @param parent 父节点id * @param categoryIcons 图标信息 * @param callback 执行完成后回调 * @param poiTapCallback 点击回调 * @param poiMouseEnterCallback 鼠标进入回调 * @param poiMouseLeaveCallback 鼠标移出回调 */ createHeatmap(scene: Scene, id: string, parent: string): any; /** * 设置热力图数据 * @param scene 场景对象 * @param id 热力图系统编号 * @param datas 数据Array * @param bindMap 绑定关系 */ updateHeatmap(scene: Scene, id: string, datas: any[], bindMap: string): void; /** * 清除热力图数据 * @param scene 场景对象 * @param id 热力图系统编号 */ clearHeatmap(scene: Scene, id: string): void; /** * 隐藏物体 * @param scene 场景对象 * @param object 物体id * @param actionTimeInSeconds 动画时长 */ hideObject(scene: Scene, object: string, actionTimeInSeconds?: number): void; /** * 显示物体 * @param scene 场景对象 * @param object 物体id * @param actionTimeInSeconds 动画时长 */ showObject(scene: Scene, object: string, actionTimeInSeconds?: number): void; /** * 设置材质颜色 * @param scene 场景对象 * @param material 材质 * @param color 颜色 */ setMaterialColor(scene: Scene, material: string, color: string): void; /** * 设置背景颜色 * @param scene 场景对象 * @param color 颜色 * @param alpha 透明度 */ setClearColor(scene: Scene, color: string, alpha?: number): void; /** * 设置雾 * @param scene 场景对象 * @param {Object} params 参数 * fogEnabled:{boolean} 开启 * fogColor:{string} 颜色 * fogAlpha:{number} 透明度 * fogStart:{number} 起始距离 * fogEnd:{number} 结束距离 * fogAmount:{number} 强度 */ setFog(scene: Scene, params: any): void; /** * 设置物体阴影 * @param scene 场景对象 * @param {Object} meshId 模型对象对象Id * @param {boolean} receiveShadows 接收阴影 * @param {boolean} castShadows 投射阴影 */ setMeshShadows(scene: Scene, meshId: string, receiveShadows?: boolean, castShadows?: boolean): void; /** * 设置地图参数 * @param scene 场景对象 * @param {Object} params 地图参数 * latOffset:{string} 维度中心 * lngOffset:{boolean} 经度中心 * scaling:{number} 缩放 * plottingScale:{number} 比例尺 */ setMapParams(scene: Scene, params: any): void; /** * 获取容器列表 * @param scene 场景对象 * @return {[{name,id}]} * name:{string} 名称 * id:{string} 编号 */ getContainers(scene: Scene): any[]; /** * 获取容器状态和数据列表 * @param scene 场景对象 * @param containerId 容器ID * @return {[{name,group,type,key,value,states}]} * name:{string} 容器名称 * group:{string} 分组 * type:{string} 类型 * key:{string} 键 * value:{Object} 值 * states:{{name,stateId}} 状态列表 */ getContainerDataList(scene: Scene, containerId: string): ({ name: string; group: string; type: string; key: string; value: any; states?: undefined; } | { name: string; type: string; states: any[]; key: string; value: number; group?: undefined; })[]; /** * 设置容器状态和数据 * @param scene 场景对象 * @param containerId 容器ID * @param values {{key:value}} 参数 * key:{string} 键 * value:{Object} 值/状态 */ setContainerData(scene: Scene, containerId: string, values: any): void; /** * 创建模型 * @param scene 场景对象 * @param type 模型类型 * @param options 数据 */ createMesh(scene: Scene, type: string, options?: any): BABYLON.Nullable; /** * 销毁模型 * @param scene 场景对象 * @param meshId 模型id */ disposeMesh(scene: Scene, meshId: string): void; /** * 创建后期效果 * @param scene 场景对象 * @param type 后期类型 * @param options 数据 */ createPostProcess(scene: Scene, type: string, options?: any): void; /** * 设置后期效果参数 * @param scene 场景对象 * @param type 后期类型 * @param options 数据 */ setPostProcessParams(scene: Scene, type: string, options: any): void; /** * 销毁后期效果 * @param scene 场景对象 * @param type 后期类型 */ disposePostProcess(scene: Scene, type: string): void; /** * 开启/关闭后期效果 * @param scene 场景对象 * @param type 后期类型 * @param isEnabled 是否开启 */ setPostProcessEnabled(scene: Scene, type: string, isEnabled?: boolean): void; /** * 设置镜面反射参数 * @param scene 场景对象 * @param params 参数 */ setMirrorParams(scene: Scene, params: any): void; /** * 设置重力 * @param scene 场景对象 * @param gravity 重力 */ setGravity(scene: Scene, gravity: any): void; /** * 开启/关闭相机物理碰撞 * @param scene 场景对象 * @param isEnabled 是否开启 */ setCollisionsEnabled(scene: Scene, isEnabled?: boolean): void; /** * 设置相机物理碰撞参数 * @param scene 场景对象 * @param radius 碰撞半径 */ setCollisionRadius(scene: Scene, radius: any): void; /** * 设置Gizmo附着 * @param scene 场景对象 * @param mode 模式 * @param nodeId 节点ID */ setGizmoAttachTo(scene: Scene, mode: number, nodeId?: string): void; /** * 创建物体高亮层 * @param scene 场景对象 * @param options 选项 * @param color 颜色 */ createHighlightLayer(scene: Scene, options?: any, color?: string): void; /** * 销毁物体高亮层 * @param scene 场景对象 */ disposeHighlightLayer(scene: Scene, options?: any, color?: string): void; /** * 设置物体高亮 * @param scene 场景对象 * @param nodeId 节点IDArray * @param color 颜色 */ setNodeHighlight(scene: Scene, nodeId?: string[], color?: string): void; /** * 清空高亮层 * @param scene 场景对象 */ clearHighlight(scene: Scene): void; /** * 导入Obj模型 * @param scene 场景对象 * @param model Obj模型数据 * @param callback 回调 * @param parentId 父级 */ importObjFile(scene: Scene, model: any, options: any): void; /** * 导入glb/gltf模型 * @param scene 场景对象 * @param model Obj模型数据 * @param callback 回调 * @param parentId 父级 */ importGltfFile(scene: Scene, model: any, options: any): void; /** * 叠加场景(加载另外一个场景中的内容到当前场景中) * @param scene 当前场景对象 * @param sceneId 新场景id * @param rootUrl 新场景根url * @param sceneFileName 新场景文件名 * @param fadeInTimeInSeconds 淡入场景的动画时长 * @param onSuccess 加载成功回调 * @param onProgress 加载过程回调 * @param onError 加载失败回调 */ appendScene(scene: Scene, sceneManager: SceneManager, sceneId: string, rootUrl: string, sceneFileName: string, fadeInTimeInSeconds: number, onSuccess: Nullable, onProgress: Nullable, onError: Nullable): void; /** * 切换场景 * @param scene 场景对象 * @param sceneIdToShow 新场景ID, 只能是一个. 要继续加载其他场景, 请参考appendScene. * @param rootUrl 新场景根url * @param sceneFileName 新场景文件名 * @param fadeOutTimeInSeconds 淡入场景的动画时长 * @param fadeInTimeInSeconds 淡入场景的动画时长 * @param onSuccess 加载成功回调 * @param onProgress 加载过程回调 * @param onError 加载失败回调 */ switchScene(scene: Scene, sceneManager: SceneManager, sceneIdToShow: string, rootUrl: string, sceneFileName: string, fadeOutTimeInSeconds: number, fadeInTimeInSeconds: number, onSuccess: Nullable, onProgress: Nullable, onError: Nullable): void; /** * 卸载场景 * @param scene 场景对象 * @param sceneId 场景id * @param fadeTimeInSeconds 淡出动画时长 * @param callback 卸载结束后回调 */ unloadScene(scene: Scene, sceneManager: SceneManager, sceneId: string, fadeTimeInSeconds: number, callback: Nullable): void; /** * 暂时禁用渲染 * @param scene 场景对象 */ pauseRendering(scene: Scene): void; /** * 继续渲染 * @param scene 场景对象 */ resumeRendering(scene: Scene): void; /** * 获取Mover参数 * @param scene 当前场景对象 * @param moverId Mover对象id */ getMoverParams(scene: Scene, moverId: string): { id?: undefined; target?: undefined; property?: undefined; min?: undefined; max?: undefined; duration?: undefined; swing?: undefined; delay?: undefined; offset?: undefined; enable?: undefined; active?: undefined; easing?: undefined; } | { id: string; target: any; property: string; min: number; max: number; duration: number; swing: boolean; delay: number; offset: number; enable: boolean; active: boolean; easing: { type: string; easingMode: number; }; }; /** * 设置KMover参数 * @param scene 当前场景对象 * @param moverId Mover对象Id * @param params 参数 * enable:{string} 使能 * active:{Object} 激活 * pause:{Object} 暂停 * swing:{Object} 往复 * min:{Object} 起始值 * max:{Object} 结束值 * base:{Object} 基础值 * duration:{Object} 时长 * delay:{Object} 延迟启动 * offset:{Object} 时基偏移 * easing:{Object} 函数类型 */ setMoverParams(scene: Scene, moverId: string, params: any): void; /** * 添加KMover回调 * @param scene 当前场景对象 * @param moverId Mover对象Id * @param callback 回调函数 * @param once 仅触发一次 */ addMoverCallback(scene: Scene, moverId: string, callback: any, once?: boolean): void; /** * 移除KMover回调 * @param scene 当前场景对象 * @param moverId Mover对象Id * @param callback 回调函数 */ removeMoverCallback(scene: Scene, moverId: string, callback: any): void; /** * 播放状态动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param state 状态 */ playStateAnimation(scene: Scene, animId: string, state: string): void; /** * 跳转状态动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param state 状态 */ jumpStateAnimation(scene: Scene, animId: string, state: string): void; /** * 播放状态动画到下一个状态 * @param scene 当前场景对象 * @param animId Animation对象Id * @param revert 反方向 */ playStateAnimationToNextState(scene: Scene, animId: string, mode?: boolean | string): void; /** * 获取状态动画的目标状态 * @param scene 当前场景对象 * @param animId Animation对象Id */ getStateAnimationCurrState(scene: Scene, animId: string): number | undefined; /** * 播放状态动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param progress 进度 * @param duration 耗时 */ playStateAnimationToProgress(scene: Scene, animId: string, progress: number, duration?: number): void; /** * 添加状态动画回调 * @param scene 当前场景对象 * @param animId 动画ID * @param callback 回调函数 * @param once 仅触发一次 */ addStateAnimationCallback(scene: Scene, animId: string, callback: any, once?: boolean): void; /** * 移除状态动画回调 * @param scene 当前场景对象 * @param animId 动画ID * @param callback 回调函数 */ removeStateAnimationCallback(scene: Scene, animId: string, callback: any): void; /** * 播放关键帧动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param params 参数 * speed:{number} 速度 * mode:{number} 模式 */ playKeyframeAnimation(scene: Scene, animId: string, params: any): void; /** * 暂停关键帧动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param state 状态 */ pauseKeyframeAnimation(scene: Scene, animId: string): void; /** * 播放关键帧动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param state 状态 */ playKeyframeAnimationToState(scene: Scene, animId: string, state: string): void; /** * 跳转关键帧动画 * @param scene 当前场景对象 * @param animId Animation对象Id * @param state 状态 */ jumpKeyframeAnimationToState(scene: Scene, animId: string, state: string): void; /** * 播放关键帧动画到下一个状态 * @param scene 当前场景对象 * @param animId Animation对象Id * @param mode 模式, 0:正向, 1:反向, random:随机 */ playKeyframeAnimationToNextState(scene: Scene, animId: string, mode?: boolean | string): void; /** * 获取关键帧动画的播放时间 * @param scene 当前场景对象 * @param animId Animation对象Id * @returns playingTime 播放时间 */ getKeyframeAnimationPlayingTime(scene: Scene, animId: string): number | undefined; /** * 获取关键帧动画的目标时间 * @param scene 当前场景对象 * @param animId Animation对象Id * @returns playingTime 播放时间 */ getKeyframeAnimationCurrTime(scene: Scene, animId: string): number | undefined; /** * 获取关键帧动画的目标状态 * @param scene 当前场景对象 * @param animId Animation对象Id * @returns stateId 状态id或undefined */ getKeyframeAnimationCurrState(scene: Scene, animId: string): number | undefined; /** * 播放关键帧动画到时间 * @param scene 当前场景对象 * @param animId Animation对象Id * @param time 时间 */ playKeyframeAnimationToTime(scene: Scene, animId: string, time: number): void; /** * 添加关键帧动画回调 * @param scene 当前场景对象 * @param animId 动画ID * @param callback 回调函数 * @param once 仅触发一次 */ addKeyframeAnimationCallback(scene: Scene, animId: string, callback: any, once?: boolean): void; /** * 移除关键帧动画回调 * @param scene 当前场景对象 * @param animId 动画ID * @param callback 回调函数 */ removeKeyframeAnimationCallback(scene: Scene, animId: string, callback: any): void; /** * 设置模型材质 * @param scene 当前场景对象 * @param meshId 模型对象对象Id * @param materialId 材质对象对象Id * @returns boolean 成功或失败 */ setMaterial(scene: Scene, meshId: string, materialId: string): boolean; /** * 通过名称设置模型材质 * @param scene 当前场景对象 * @param meshName 模型对象对象名称 * @param materialName 材质对象对象名称 * @returns boolean 成功或失败 */ setMaterialName(scene: Scene, meshName: string, materialName: string): boolean; /** * 获取节点属性 * @param scene 当前场景对象 * @param nodeId 模型对象对象Id * @param prop 属性 * @param targetValue 目标值 * @returns any 属性值 */ getNodePropValue(scene: Scene, nodeId: string, prop: string): any; /** * 设置节点属性 * @param scene 当前场景对象 * @param nodeId 模型对象对象Id * @param prop 属性 * @param targetValue 目标值 * @param params 目标值 * @returns boolean 成功或失败 */ setNodePropValue(scene: Scene, nodeId: string, prop: string, targetValue: any, params: any): boolean; /** * 更新GeoJson数据 * @param scene 当前场景对象 * @param keyword 过滤关键字 * @param options 参数 * @param geoDatas GeoJson数据 * @callback 数据转换回调函数 */ updateMeshByGeoJson(scene: Scene, keyword: string, options: { clockwiseCheck: boolean; autoCenter: boolean; autoScale: boolean; scaleText: boolean; scaling: number; parentId: string; controlId: string; convert: (point: number[]) => number[]; }, geoDatas: any, callback: (feature: any) => { id: string; name: string; height: number; cloneMesh: boolean; cloneMaterial: boolean; subMesh: boolean; material: string | Material; info: any; text: { text: string; rotationY: number; scaling: number; x: number; y: number; z: number; }; buildTop: boolean; buildSide: boolean; buildScan: boolean; adjustUV: boolean; }[]): true | undefined; /** * 设置背景图片 * @param scene 当前场景对象 * @param url: 图片url * @param keepAspect: 保持宽高比 * @param scale: 图片缩放 */ setBackgroundImage(scene: Scene, url?: string, keepAspect?: boolean, scale?: number): void; /** * 获取背景图片参数 * @param scene 当前场景对象 * @return {url, keepAspect, scale} * url: 图片url * keepAspect: 保持宽高比 * scale: 图片缩放 */ getBackgroundImage(scene: Scene): { url: string | null | undefined; keepAspect: boolean; scale: number; }; /** * 设置前景图片 * @param scene 当前场景对象 * @param url: 图片url * @param keepAspect: 保持宽高比 * @param scale: 图片缩放 */ setForegroundImage(scene: Scene, url?: string, keepAspect?: boolean, scale?: number): void; /** * 获取前景图片参数 * @param scene 当前场景对象 * @return {url, keepAspect, scale} * url: 图片url * keepAspect: 保持宽高比 * scale: 图片缩放 */ getForegroundImage(scene: Scene): { url: string | null | undefined; keepAspect: boolean; scale: number; }; /** * 设置色彩平衡 * @param scene 场景对象 * @param {Object} params 参数 * amount:{number} 强度 * hue:{number} 色相 * saturation:{number} 饱和度 * lift:{number} 亮度 * gain:{number} 增益 * offset:{number} 偏移 */ setColorBalance(scene: Scene, params: any): void; } }