ViewerDrawingSet

Glodon.Bimface.Viewer. ViewerDrawingSet

new Glodon.Bimface.Viewer.ViewerDrawingSet()

操作二维矢量图纸集

Methods

addDrawing(id, viewtoken, callback)

Parameters:
Name Type Description
id Number

用户自定义唯一标识

viewtoken Object

图纸密钥

callback function

监听事件

addDrawings(arr, callback)

批量添加图纸

Parameters:
Name Type Description
arr Array

待加载的图纸信息列表,格式为[{id:2,viewToken:"XXXXXX"}]

callback function

加载图纸数据后的回调函数

createSnapshotAsync(color, callback)

生成图纸当前的视图截图

Parameters:
Name Type Description
color Glodon.Web.Graphics.Color

截图的背景颜色

callback function

返回截图的BASE64字符串的回调函数

enableFullScreen(isEnabled)

进入全屏显示

Parameters:
Name Type Description
isEnabled Boolean

进入或者退出全屏状态

enableSnap(enabled)

开启/关闭对象捕捉

Parameters:
Name Type Description
enabled Boolean

开启或关闭鼠标捕捉效果,必填

enableViewport(bool)

是否以源文件视图状态打开,默认为false

Parameters:
Name Type Description
bool Boolean

是否以源文件视图状态打开

endMoving()

结束移动图纸

getCurrentState()

获取当前图纸集视图的状态,保存后以便恢复图纸集状态

Returns:
Type Description
Object

图纸集视图状态

getDisplayMode()

获取显示模式(黑白模式、普通模式、白底模式)

Returns:
Type Description
Number

显示模式

getDrawingById()

根据ID获取当前图纸集中单张图纸的信息

Returns:
Type Description
Object

单张图纸的信息

hideDrawing(id)

隐藏图纸

Parameters:
Name Type Description
id Number

图纸ID

home()

进入home视角

rectZoom()

进入框选放大状态

removeDrawing(id)

Parameters:
Name Type Description
id Number

用户自定义唯一标识

selectDrawing(id)

选中要移动的图纸(在startMoving后使用)

Parameters:
Name Type Description
id Number

图纸ID

setCurrentState(state)

设置图纸集视图的状态

Parameters:
Name Type Description
state Object

图纸集视图状态,getCurrentState获得的state

setDisplayMode(PrintMode)

设置图纸显示模式

Parameters:
Name Type Description
PrintMode Number

0:普通模式 1:白底模式 2:黑白模式 3:自定义模式

setSnapMode(snapMode)

设置对象捕捉模式

Parameters:
Name Type Description
snapMode Glodon.Bimface.Viewer.SnapMode

捕捉模式

showDrawing(id)

显示图纸

Parameters:
Name Type Description
id Number

图纸ID

showLineWidth(bool)

显示线宽

Parameters:
Name Type Description
bool Boolean

是否显示线宽

startMoving()

开始移动图纸

zoomToBoundingBox(boundingBox, margin)

将视口缩放至包围盒

Parameters:
Name Type Description
boundingBox Array

图元包围盒

margin Number

包围盒缩放比例,默认为0.5