new OMScene()
omScene: {
data:,
entity:,
theme:, // 主题Theme
buildings: // 所有的building数据
}
Members
-
autoIndoor
-
是否自动根据zoomLevel, 视锥等因素, 自动显示室内部分
Methods
-
addBuilding(building)
-
为omScene添加建筑omBuilding
Parameters:
Name Type Description building
OMBuilding OMBuilding 实例 -
clear()
-
清空omScene,主要用于重新设置data后的重新创建
-
createScene()
-
全部创建, 主要用在 editor 中, sdk使用 visibleManager 来按视口创建
-
findData(query, config) → {thenable}
-
针对全场景及所有建筑的搜索
Parameters:
Name Type Description query
config
object Properties
Name Type Attributes Default Description multi
boolean <optional>
false 是否为多选方式 recursive
boolean <optional>
true 是否在当前结点未检索到时,继续向下检索 floors
Array.<int> <optional>
null 检索的楼层, 默认为null,即为所有的楼层 Returns:
thenable - thenable对象 -
getBuildingByID(buildingID, callback) → {thenable}
-
通过buildingID得到对应的OMBuilding实例, 如果当前建筑未加载, 会自动进行加载
Parameters:
Name Type Description buildingID
string buildingID callback
function 回调函数, 同时支持 promise Returns:
thenable - thenable对象, 参数为OMBuilding对象实例, 因为你所请求的建筑对象,可能尚未加载Example
omScene.getBuildingByID(bid).then( building => {} )
-
getBuildingByIndex(index) → {Promise}
-
通过索引得到建筑对象
Parameters:
Name Type Description index
int 建筑在场景数据 buildings 中的索引 Returns:
Promise - thenable对象, 参数为OMBuilding对象实例, 因为你所请求的建筑对象,可能尚未加载 -
getBuildingIndex(building) → {object}
-
得到building对应的 buildingIndex 数据
Parameters:
Name Type Description building
OMBuilding OMBuilding 对象 Returns:
object - buildingIndex -
getFloor(building, floorNumbersopt) → {OMFloor}
-
快速得到某建筑中的某些或某个楼层, 如果只传入一个参数(floorNumber), 则返回场景中的第一个建筑的指定楼层
Parameters:
Name Type Attributes Description building
string | int buildingID 或 buildingIndex 即建筑的索引, 如果只传入一个参考, 此值为场景中第一个建筑的floorNumber floorNumbers
int | Array.<int> <optional>
楼层的 floorNumber, 或 floorNumber 数组 Returns:
OMFloor - 返回 OMFloor 对象, 如果传入的floorNumbers为数组则返回OMFloor数组, 如floorNumber为单个值, 则返回的是单个的OMFloor对象 -
removeBuilding(building) → {null}
-
从omScene中移除建筑omBuilding
Parameters:
Name Type Description building
OMBuilding OMBuilding实例 Returns:
null -
removeChildren()
-
清除所有已经加入到场景的子Mesh 已经data
-
setData(data)
-
根据data中的数据来创建场景
Parameters:
Name Type Description data
object scene's data, null => this.data