Room

房间应用(用于获取房间属性或空间关系计算)

Constructor

new Glodon.Bimface.Plugins.Rooms.Room(roomConfig)

Parameters:
NameTypeDescription
roomConfigGlodon.Bimface.Plugins.Spatial.RoomConfig

房间应用配置项

Methods

bindRoomByModelId(modelId)

根据模型ID将房间与模型相关联

Parameters:
NameTypeDescription
modelIdString

模型ID

enableDepthTest(isEnabled)

房间是否开启深度检测

Parameters:
NameTypeDescription
isEnabledBoolean

是否开启深度检测

getArea()

获取房间底面积

Returns:
TypeDescription
Object

房间面积信息

getBoundary()

获取房间边界

Returns:
TypeDescription
Object

房间边界,单位与场景单位保持一致

getComponents(roomToleranceXY, roomToleranceZ, callback)

获取房间内构件

Parameters:
NameTypeDescription
roomToleranceXYString

XY方向的误差容许程度,默认值:“ORDINARY”

roomToleranceZString

Z方向的误差容许程度,默认值:“STRICT”

callbackFunction

回调函数

Returns:
TypeDescription
Array

房间内的构件列表

getHeight()

获取房间高度(针对拉伸体)

Returns:
TypeDescription
Number

房间高度,单位与场景单位保持一致

getProperty(callback)

获取房间属性

Parameters:
NameTypeDescription
callbackFunction

获取属性回调函数

getRoomColor()

获取房间颜色

Returns:
TypeDescription
Glodon.Web.Graphics.Color

房间的颜色

getRoomFrameColor()

获取房间线框颜色

Returns:
TypeDescription
Glodon.Web.Graphics.Color

房间的线框颜色

isPointInside(point, strict)

判断点对象是否在房间内

Parameters:
NameTypeDescription
pointObject

点对象

strictBoolean

是否绝对包含,若为true,则点对象必须完全在房间内(不包括边界),若为false,则点对象位于房间边界也算在房间内,默认为true

Returns:
TypeDescription
Boolean

点对象是否在房间内

setBoundary(newBoundary, unit)

根据新的Boundary生成房间(针对拉伸体)

Parameters:
NameTypeDescription
newBoundaryObject

新的房间边界

unitString

边界单位,可选mm或m,不填写默认跟随场景单位

setHeight(height, unit)

设置房间的高度(针对拉伸体)

Parameters:
NameTypeDescription
heightNumber

房间高度

unitString

边界单位,可选mm或m,不填写默认跟随场景单位

setRoomColor(color)

设置房间的颜色

Parameters:
NameTypeDescription
colorGlodon.Web.Graphics.Color

着色颜色

setRoomFrameColor(color)

设置房间的线框颜色

Parameters:
NameTypeDescription
colorGlodon.Web.Graphics.Color

着色颜色