您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

README.md 3.3KB


实用工具 🌎

三维场景中的辅助工具,方便在场景中进行各种测量、标绘、位置编辑

DC.Plot

标绘类

example

let plot = new DC.Plot(viewer, {})
plot.draw(DC.OverlayType.POINT, (overlay) => {}, {})

creation

  • constructor(viewer,[options])

构造函数

  • 参数
    • {Viewer} viewer:场景
    • {Object} options:属性
  • 返回值 plot
//属性参数(可选)
{
  "icon_center": "**.png", // 自定义的中心点图标
  "icon_anchor": "**.png", //自定义的锚点图标
  "icon_midAnchor": "**.png", //自定义的中心锚点图标
  "icon_size": [12, 12],//自定义的中心锚点大小
  "clampToModel":false // 点位是否获取模型表面坐标
}

methods

  • draw(type,callback,[style],[clampToModel])

标绘

  • 参数
    • {String} type:覆盖物类型,参照 OverlayType
    • {Function} callback:标绘完成的回调函数,参数为覆盖物
    • {Object} style:标绘的覆盖物样式设置
    • {Boolean} clampToModel:点位是否获取模型表面坐标
  • 返回值 this

  • edit(overlay,callback,[clampToModel])

编辑

  • 参数
    • {Overlay} overlay:覆盖物
    • {Function} callback:编辑完成的回调函数,参数为覆盖物
    • {Boolean} clampToModel:点位是否获取模型表面坐标
  • 返回值 this

  • stop()

停止

  • 返回值 this

DC.PositionEditor

位置编辑工具

example

let coords = new DC.PositionEditor(viewer)

creation

  • constructor(viewer,[options])

构造函数

  • 参数
    • {Viewer} viewer:场景
    • {Object} options:属性
  • 返回值 plot
//属性参数(可选)
{
  "arrow": true, // 辅助轴线是否为箭头
  "width": 8, // 辅助轴线宽度
  "depthFail": true, // 辅助轴线是否支持深度检测
  "axisLineScale": 1 // 辅助轴线比例
}

properties

  • {Overlay} overlay:覆盖物 writeOnly

methods

  • activate(type, callback)

激活

  • 参数
    • {String} type:类型,DC.PositionEditorType
    • {Function} callback:回调函数,参数为:position
  • 返回值 this

  • deactivate()

失效

  • 返回值 this

DC.ModelManager

模型管理工具

example

let manager = new DC.ModelManager(viewer, layer.getOverlays())

creation

  • constructor(viewer,models,[options])

构造函数

  • 参数
    • {Viewer} viewer:场景
    • {Array} models:覆盖物
    • {Object} options:属性
  • 返回值 manager
//属性参数(可选)
{
  "disappearHeight": 1000, // 消失高度
  "disappearSeconds": 0.5, // 消失时间
  "appearSeconds": 0.5 // 出现时间
}

properties

  • {Array} models:覆盖物

methods

  • spread(height, seconds)

展开

  • 参数
    • {Number} height:高度
    • {Number} seconds:时间
  • 返回值 this

  • combine(seconds)

合并

  • 参数
    • {Number} seconds:时间
  • 返回值 this

  • showModel(modelIndex)

展示模型

  • 参数
    • {Number} modelIndex:模型索引,和数组索引一致
  • 返回值 this

  • restore()

还原

  • 返回值 this