ModelAPI
模型相关接口。
# 接口
| 接口 | 说明 |
|---|---|
| getAllModels | 获取模型文件中的所有model。 |
| getAllCategories | 获取模型文件中的所有的图层。 |
| getDisplayedExtent | 获取模型显示包围盒。 |
| expandDisplayedExtents | 扩展显示包围盒。 |
| showCategoriesByNames | 通过图层名设置图层为显示。 |
| hideCategoriesByNames | 通过图层名设置图层为隐藏。 |
| showCategoriesByIds | 通过图层ID设置图层为显示。 |
| hideCategoriesByIds | 通过图层ID设置图层为隐藏。 |
| showModelsByNames | 通过模型名设置模型为显示。 |
| hideModelsByNames | 通过模型名设置模型为隐藏。 |
| showModelsByIds | 通过模型ID设置模型为显示。 |
| hideModelsByIds | 通过模型ID设置模型为隐藏。 |
| getAllElementIds | 获取模型所有elemnt的ID的数组。 |
# 1. getAllModels
获取模型文件中的所有的model。
getAllModels()
返回:
通过消息 onBWApiMessage/ModelApi/onGetAllModels 返回数据。
# 2. getAllCategories
获取模型文件中的所有的图层。
getAllCategories()
返回:
通过消息 onBWApiMessage/ModelApi/onGetAllCategories 返回数据。
# 3. getDisplayedExtent
获取当前模型对应的显示包围盒。
getDisplayedExtent()
返回:
通过消息 onBWApiMessage/ModelApi/onGetDisplayedExtent返回数据。
# 4. expandDisplayedExtents
扩展显示包围盒,按输入的包围盒,对现有的显示包围盒进行扩展,是的包围盒包含输入的包围盒。通常用于在添加新的场景要素的时候,通过该接口确保显示范围能包含新添加的要素。
expandDisplayedExtents(xMin, xMax, yMin, yMax, zMin, zMax)
参数:
xMin/xMax/yMin/yMax/zMin/zMax 要扩张的范围的最大最小值。
# 5. showCategoriesByNames
通过图层名设置图层为显示。
showCategoriesByNames(names, includeSub = true )
参数:
names 图层名的数组。
includeSub 是否包含下级,默认为 true。
# 6. hideCategoriesByNames
通过图层名设置图层为隐藏。
hideCategoriesByNames(names, includeSub = true )
参数:
names 图层名的数组。
includeSub 是否包含下级,默认为 true。
# 7. showCategoriesByIds
通过图层ID设置图层为显示。
showCategoriesByIds(ids, includeSub = true )
参数:
ids 图层ID的数组。
includeSub 是否包含下级,默认为 true。
# 8. hideCategoriesByIds
通过图层ID设置图层为隐藏。
hideCategoriesByIds(ids, includeSub = true )
参数:
ids 图层ID的数组。
includeSub 是否包含下级,默认为 true
# 9. showModelsByNames
通过模型名设置模型为显示。
showModelsByNames(names, includeSub = true )
参数:
names 模型名的数组。
includeSub 是否包含下级,默认为 true。
# 10. hideModelsByNames
通过模型名设置模型为隐藏。
hideModelsByNames(names, includeSub = true )
参数:
names 模型名的数组。
includeSub 是否包含下级,默认为 true。
# 11. showModelsByIds
通过模型ID设置模型为显示。
showModelsByIds(ids, includeSub = true )
参数:
ids 模型ID的数组。
includeSub 是否包含下级,默认为 true。
# 12. hideModelsByIds
通过模型ID设置模型为隐藏。
hideModelsByIds(ids, includeSub = true )
参数:
ids 模型ID的数组。
includeSub 是否包含下级,默认为 true。
# 13. getAllElementIds
获取模型所有elemnt的ID的数组。
getAllElementIds()
返回:
通过消息 onBWApiMessage/ModelApi/onGetAllElementIds返回数据。