You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.3KB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. ---
  2. sidebar: auto
  3. ---
  4. # 实用工具 🌎
  5. 三维场景中的辅助工具,方便在场景中进行各种测量、标绘、位置编辑
  6. ## DC.Plot
  7. > 标绘类
  8. ### example
  9. ```js
  10. let plot = new DC.Plot(viewer, {})
  11. plot.draw(DC.OverlayType.POINT, (overlay) => {}, {})
  12. ```
  13. ### creation
  14. - **_constructor(viewer,[options])_**
  15. 构造函数
  16. - 参数
  17. - `{Viewer} viewer`:场景
  18. - `{Object} options`:属性
  19. - 返回值 `plot`
  20. ```json
  21. //属性参数(可选)
  22. {
  23. "icon_center": "**.png", // 自定义的中心点图标
  24. "icon_anchor": "**.png", //自定义的锚点图标
  25. "icon_midAnchor": "**.png", //自定义的中心锚点图标
  26. "icon_size": [12, 12],//自定义的中心锚点大小
  27. "clampToModel":false // 点位是否获取模型表面坐标
  28. }
  29. ```
  30. ### methods
  31. - **_draw(type,callback,[style],[clampToModel])_**
  32. 标绘
  33. - 参数
  34. - `{String} type`:覆盖物类型,参照 [OverlayType](../base/#overlaytype)
  35. - `{Function} callback`:标绘完成的回调函数,参数为覆盖物
  36. - `{Object} style`:标绘的覆盖物样式设置
  37. - `{Boolean} clampToModel`:点位是否获取模型表面坐标
  38. - 返回值 `this`
  39. - **_edit(overlay,callback,[clampToModel])_**
  40. 编辑
  41. - 参数
  42. - `{Overlay} overlay`:覆盖物
  43. - `{Function} callback`:编辑完成的回调函数,参数为覆盖物
  44. - `{Boolean} clampToModel`:点位是否获取模型表面坐标
  45. - 返回值 `this`
  46. - **_stop()_**
  47. 停止
  48. - 返回值 `this`
  49. ## DC.PositionEditor
  50. > 位置编辑工具
  51. ### example
  52. ```js
  53. let coords = new DC.PositionEditor(viewer)
  54. ```
  55. ### creation
  56. - **_constructor(viewer,[options])_**
  57. 构造函数
  58. - 参数
  59. - `{Viewer} viewer`:场景
  60. - `{Object} options`:属性
  61. - 返回值 `plot`
  62. ```json
  63. //属性参数(可选)
  64. {
  65. "arrow": true, // 辅助轴线是否为箭头
  66. "width": 8, // 辅助轴线宽度
  67. "depthFail": true, // 辅助轴线是否支持深度检测
  68. "axisLineScale": 1 // 辅助轴线比例
  69. }
  70. ```
  71. ### properties
  72. - `{Overlay} overlay`:覆盖物 **_`writeOnly`_**
  73. ### methods
  74. - **_activate(type, callback)_**
  75. 激活
  76. - 参数
  77. - `{String} type`:类型,`DC.PositionEditorType`
  78. - `{Function} callback`:回调函数,参数为:position
  79. - 返回值 `this`
  80. - **_deactivate()_**
  81. 失效
  82. - 返回值 `this`
  83. ## DC.ModelManager
  84. > 模型管理工具
  85. ### example
  86. ```js
  87. let manager = new DC.ModelManager(viewer, layer.getOverlays())
  88. ```
  89. ### creation
  90. - **_constructor(viewer,models,[options])_**
  91. 构造函数
  92. - 参数
  93. - `{Viewer} viewer`:场景
  94. - `{Array} models`:覆盖物
  95. - `{Object} options`:属性
  96. - 返回值 `manager`
  97. ```json
  98. //属性参数(可选)
  99. {
  100. "disappearHeight": 1000, // 消失高度
  101. "disappearSeconds": 0.5, // 消失时间
  102. "appearSeconds": 0.5 // 出现时间
  103. }
  104. ```
  105. ### properties
  106. - `{Array} models`:覆盖物
  107. ### methods
  108. - **_spread(height, seconds)_**
  109. 展开
  110. - 参数
  111. - `{Number} height`:高度
  112. - `{Number} seconds`:时间
  113. - 返回值 `this`
  114. - **_combine(seconds)_**
  115. 合并
  116. - 参数
  117. - `{Number} seconds`:时间
  118. - 返回值 `this`
  119. - **_showModel(modelIndex)_**
  120. 展示模型
  121. - 参数
  122. - `{Number} modelIndex`:模型索引,和数组索引一致
  123. - 返回值 `this`
  124. - **_restore()_**
  125. 还原
  126. - 返回值 `this`