Viewer3D

Glodon.Bimface.Viewer. Viewer3D

Glodon.Bimface.Viewer.Viewer3D

Constructor

new Viewer3D(option)

三维视图

Parameters:
Name Type Description
option Glodon.Bimface.Viewer.Viewer3DConfig

配置

Methods

addArea(areaInfo, height, idopt, faceColoropt, frameColoropt) → {string}

添加空间

Parameters:
Name Type Attributes Description
areaInfo object

空间体块信息

height number

空间体块高度

id string <optional>

空间体块 id

faceColor color <optional>

空间体块颜色

frameColor color <optional>

空间体块边框颜色

Returns:
Type Description
string

id 空间体块 id

addPlane(min, max, url, callback)

在模型中插入图片

Parameters:
Name Type Description
min Glodon.Web.Geometry.Point3d

插入图片的起始点

max Glodon.Web.Geometry.Point3d

插入图片的结束点

url string

插入图片的路径

callback function

图片插入成功后的回调函数

addSelectedComponentsById(id)

添加构件到选中集合

Parameters:
Name Type Description
id string

构件 Id

clearArea()

清除空间

clearAreasById(objectIds)

清除指定ID的空间体块

Parameters:
Name Type Description
objectIds array

空间体块的ID集合

clearIsolation()

取消模型隔离

clearOverrideColorComponents()

还原着色构件

clearSelectedComponents()

情况构件选中状态

createSnapshot(backgroundColor, callback)

创建模型快照

Parameters:
Name Type Description
backgroundColor object

快照背景颜色

callback function

快照回调函数

disableMouseHoverHighlight()

关闭鼠标 hover 高亮

enableGravity(isEnabled)

切换漫游模式

Parameters:
Name Type Description
isEnabled bool

开启或关闭重力漫游

enableHitDetection(isEnabled)

切换漫游碰撞模式

Parameters:
Name Type Description
isEnabled bool

开启或关闭漫游碰撞

enableHover(isEnabled)

设置鼠标 hover 效果

Parameters:
Name Type Description
isEnabled bool

开启或关闭鼠标 hover 效果

enableIBLBackground(withBackground)

设置 IBL 背景

Parameters:
Name Type Description
withBackground bool

是否作为背景显示

enableMouseHoverHighlight()

开启鼠标 hover 高亮

enableOrbit(isEnabled)

设置模型是否可以旋转

Parameters:
Name Type Description
isEnabled bool

开启或关闭模型旋转功能

enableSSAO(isEnabled)

开启/关闭SSAO

Parameters:
Name Type Description
isEnabled isEnabled

SSAO状态

exitWalk()

退出漫游模式

getAreaColorById(objectId) → {color}

根据空间体块的ID获取体块颜色

Parameters:
Name Type Description
objectId string

空间体块的ID

Returns:
Type Description
color

color 空间体块的体块颜色

getAreaFrameColorById(objectId) → {color}

根据空间体块的ID获取体块线框颜色

Parameters:
Name Type Description
objectId string

空间体块的ID

Returns:
Type Description
color

color 空间体块的线框颜色

getAreaProperty(Id, callback)

获取空间属性

Parameters:
Name Type Description
Id string

要获取属性的空间 Id

callback function

获取属性回调函数

getAreas(callback)

获取空间

Parameters:
Name Type Description
callback function

获取空间回调函数

getCameraAnimation()

获取模型动画状态

Returns:
Type Description

getCameraStatus()

获取当前相机状态

Returns:
Type Description

getComponentProperty(Id, callback)

获取构件属性

Parameters:
Name Type Description
Id string

要获取属性的构件 Id

callback function

获取属性回调函数

getComponentStatus(id)

获取构件显示状态

Parameters:
Name Type Description
id string

构件ID

Returns:
Type Description

getCurrentState()

获取当前状态

Returns:
Type Description

getDrawingsheets(callback)

获取模型的图纸列表

Parameters:
Name Type Description
callback function

获取模型的图纸列表的回调函数

getDrawingsheets(callback)

获取模型的小地图信息

Parameters:
Name Type Description
callback function

获取模型的小地图信息的回调函数

getDrawingsheets(callback)

获取模型的所有图纸列表

Parameters:
Name Type Description
callback function

获取模型的图纸列表的回调函数

getElementByPropery(fileId, conditions, callback)

根据参数类型ID、族和族类型获取相应的构件ID

Parameters:
Name Type Description
fileId function

文件ID

conditions function

类型对象

callback function

获取目录树回调函数

getFamilyTypes()

获取族文件类型

Returns:
Type Description

getFiles(callback)

获取集成模型的文件列表

Parameters:
Name Type Description
callback function

获取集成模型的文件列表的回调函数

getFloors(callback)

获取楼层

Parameters:
Name Type Description
callback function

获取楼层回调函数

getInformation()

获取模型基本信息

Returns:
Type Description

getLinkGraph(callback)

获取集成模型的文件链接关系

Parameters:
Name Type Description
callback function

获取集成模型文件链接关系的回调函数

getMaterialProperty(Id, callback)

获取材质属性

Parameters:
Name Type Description
Id string

要获取属性的材质 Id

callback function

获取属性回调函数

getModelTree(callback)

获取目录树

Parameters:
Name Type Description
callback function

获取目录树回调函数

getObjectDataById(objectId)

根据userId获取userdata

Parameters:
Name Type Description
objectId string

构件Id

getRoomProperty(Id, callback)

获取房间属性

Parameters:
Name Type Description
Id string

要获取属性的房间 Id

callback function

获取属性回调函数

getSelectedComponents()

获取选中构件集合

Returns:
Type Description

hideAllAreas()

隐藏所有空间体块

hideAllComponents()

隐藏模型全部构件

hideAreasById(objectIds)

根据空间体块的ID隐藏体块

Parameters:
Name Type Description
objectIds array

空间体块的ID集合

hideComponentsById(ids)

根据 Id 隐藏构件

Parameters:
Name Type Description
ids array

隐藏构件 Id 集合

hideView(viewToken)

隐藏模型

Parameters:
Name Type Description
viewToken string

模型浏览凭证

hideViewHouse()

隐藏导航模型

isolateByBox(boundingBox, state)

根据 boundingBox 隔离模型

Parameters:
Name Type Description
boundingBox object

模型隔离 boundingBox

state string

被隔离构件显示状态

isolateComponentsById(ids, state)

根据 Id 隔离模型

Parameters:
Name Type Description
ids array

模型隔离 Id 集合

state string

被隔离构件显示状态

isolateComponentsByObjectData(conditions, state)

根据条件隔离模型

Parameters:
Name Type Description
conditions array

模型隔离条件

state string

被隔离构件显示状态

isSupportSSAO() → {bool}

检查是否支持SSAO

Returns:
Type Description
bool

是否支持SSAO

loadIBLScene(IBLSceneOption, withBackground)

加载 IBL 环境光照

Parameters:
Name Type Description
IBLSceneOption string

IBL 名称

withBackground bool

是否作为背景显示

moveTo(direction)

移动相机

Parameters:
Name Type Description
direction string

模型移动方向

opaqueAllComponents()

取消所有构件半透明

opaqueComponentsById(ids)

根据 Id 取消构件半透明

Parameters:
Name Type Description
ids array

取消半透明构件 Id 集合

opaqueComponentsByObjectData(conditions)

根据条件取消构件半透明

Parameters:
Name Type Description
conditions array

取消半透明构件的条件集合

overrideComponentsColorById(ids, color)

按 Id 给构件着色

Parameters:
Name Type Description
ids array

构件 Id 集合

color object

着色颜色

overrideComponentsColorByObjectData(conditions, color)

按条件给构件着色

Parameters:
Name Type Description
conditions array

着色条件

color object

着色颜色

removeSelectedId(id)

删除构件选中状态

Parameters:
Name Type Description
id string

构件 Id

removeView(viewToken)

卸载模型

Parameters:
Name Type Description
viewToken string

模型浏览凭证

render()

模型渲染

resize(width, height)

设置场景显示大小

Parameters:
Name Type Description
width number

设置宽度

height number

设置高度

restoreComponentsColorById(ids)

还原构件颜色

Parameters:
Name Type Description
ids array

构件 Id 集合

restoreComponentsColorByObjectData(conditions)

还原条件着色构件

Parameters:
Name Type Description
conditions array

着色条件

restoreIsolatedComponentColor()

恢复半透明构件的默认颜色

setArea(areaInfo, height, idopt)

设置空间

Parameters:
Name Type Attributes Description
areaInfo object

空间信息

height number

空间高度

id string <optional>

空间id

setAreasColorById(objectIds, color)

根据空间体块的ID修改体块颜色

Parameters:
Name Type Description
objectIds array

空间体块的ID集合

color color

空间体块的体块颜色

setAreasFrameColorById(objectIds, color)

根据空间体块的ID修改体块线框颜色

Parameters:
Name Type Description
objectIds array

空间体块的ID集合

color color

空间体块的线框颜色

setBackgroundColor(color1)

设置场景背景颜色

Parameters:
Name Type Description
color1 object

设置背景颜色 color2 存在时即是由上而下的线性渐变背景颜色

setBackgroundColors(颜色信息)

设置场景背景颜色

Parameters:
Name Type Description
颜色信息 object

setBorderLineEnabled(isEnabled)

设置边框显示状态

Parameters:
Name Type Description
isEnabled bool

边框显示状态

setCameraAnimation(isEnabled)

设置模型动画

Parameters:
Name Type Description
isEnabled bool

开启或关闭模型动画

setCameraStatus(camera, callback)

还原相机状态

Parameters:
Name Type Description
camera string | object

相机状态

callback function

相机还原之后回调函数

setComponentsOpacity(ids, state)

设置构件显示状态

Parameters:
Name Type Description
ids array

构件 Id 集合

state string

构件显示状态

setExposureShift(number)

设置曝光强度

Parameters:
Name Type Description
number number

曝光强度 -1 -- 1

setFlySpeedRate(rate)

设置漫游倍率

Parameters:
Name Type Description
rate Number

倍率

setIsolatedComponentColor(color)

设置半透明构建的颜色

Parameters:
Name Type Description
color object

着色颜色

setIsolatedComponentColor() → {object}

获取半透明构建的颜色

Returns:
Type Description
object

color 着色颜色

setLightingMode(LightingMode)

设置光照模式

Parameters:
Name Type Description
LightingMode string

光照模式

setMinimumFPS(fps)

设置模型最小渲染帧率

Parameters:
Name Type Description
fps number

设置模型最小渲染帧率

setNavigationMode(navigationMode)

设置导航模式

Parameters:
Name Type Description
navigationMode string

设置导航模式

setOrbitButton(orbitButton)

设置鼠标功能键

Parameters:
Name Type Description
orbitButton string

设置鼠标旋转模型的按键

setSelectedComponentsById(ids)

设置模型选中构件

Parameters:
Name Type Description
ids array

构件 Id 集合

setState(state)

还原状态

Parameters:
Name Type Description
state object

场景状态

setView(view)

设置模型视角

Parameters:
Name Type Description
view string

设置模型视角

showAllAreas()

显示所有空间体块

showAllComponents(progressCallback, finishCallback)

显示模型全部构件

Parameters:
Name Type Description
progressCallback function

加载的进度

finishCallback function

加载完成

showAreasById(objectIds)

根据空间体块的ID显示体块

Parameters:
Name Type Description
objectIds array

空间体块的ID集合

showAxisGrid(floorId)

显示3D轴网

Parameters:
Name Type Description
floorId floorId

楼层Id

showComponentsById(ids)

根据 Id 显示构件

Parameters:
Name Type Description
ids array

显示构件 Id 集合

showComponentsByObjectData(conditions)

根据条件隐藏构件

Parameters:
Name Type Description
conditions array

隐藏构件的条件集合

showComponentsByObjectData(conditions)

根据条件显示构件

Parameters:
Name Type Description
conditions array

显示构件的条件集合

showExclusiveComponentsByObjectData(conditions, progressCallback, finishCallback)

按条件显示模型

Parameters:
Name Type Description
conditions array

只显示符合条件的构件

progressCallback function

加载的进度

finishCallback function

加载完成

showFamilyTypeById(Id)

显示族文件

Parameters:
Name Type Description
Id string

根据 Id显示族文件 针对 rfa 文件

showView(viewToken)

显示模型

Parameters:
Name Type Description
viewToken string

模型浏览凭证

showViewHouse()

显示导航模型

startAutoRotate(speed)

开始自动旋转模型

Parameters:
Name Type Description
speed number

模型自动旋转速度

stopAutoRotate()

停止自动旋转模型

toggleContextMenuDisplay(isEnabled)

切换右键菜单响应

Parameters:
Name Type Description
isEnabled bool

开启或关闭右键菜单响应

transparentAllComponents()

所有构件半透明

transparentComponentsById(ids)

根据 Id 半透明构件

Parameters:
Name Type Description
ids array

半透明构件 Id 集合

transparentComponentsByObjectData(conditions)

根据条件半透明构件

Parameters:
Name Type Description
conditions array

半透明构件的条件集合

zoomIn()

模型放大

zoomOut()

模型缩小

zoomToBoundingBox(boundingBox)

缩放到指定的 boundingBox

Parameters:
Name Type Description
boundingBox object

开启或关闭右键菜单响应

zoomToSelectedComponents(margin)

缩放到选择构件

Parameters:
Name Type Description
margin Number

包围盒缩放比例, 缺省值: 1, margin > 0 模型缩小(包围盒变大),margin < 0 模型放大(包围盒变小)