Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

tools.md 3.1KB

2 år sedan
1 månad sedan
2 år sedan
1 månad sedan
2 år sedan
1 månad sedan
2 år sedan
1 månad sedan
2 år sedan
1 månad sedan
2 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # 工具 API 🌎
  2. 三维场景中的辅助工具,方便在场景中进行各种标绘、测量、位置编辑
  3. ## DC.Plot
  4. > 标绘类
  5. ### example
  6. ```js
  7. let plot = new DC.Plot(viewer, {})
  8. plot.draw(DC.OverlayType.POINT, (overlay) => {
  9. }, {})
  10. ```
  11. ### creation
  12. - **_constructor(viewer,[options])_**
  13. 构造函数
  14. - 参数
  15. - `{Viewer} viewer`:场景
  16. - `{Object} options`:属性
  17. - 返回值 `plot`
  18. ```js
  19. // options(属性可选)
  20. const options = {
  21. "icon_center": "**.png", // 自定义的中心点图标
  22. "icon_anchor": "**.png", //自定义的锚点图标
  23. "icon_midAnchor": "**.png", //自定义的中心锚点图标
  24. "icon_size": [12, 12],//自定义的中心锚点大小
  25. "clampToModel": false // 点位是否获取模型表面坐标
  26. }
  27. ```
  28. ### methods
  29. - **_draw(type,callback,[style],[clampToModel])_**
  30. 标绘
  31. - 参数
  32. - `{String} type`:覆盖物类型,[详细使用说明](./global#overlaytype)
  33. - `{Function} callback`:标绘完成的回调函数,参数为覆盖物
  34. - `{Object} style`:标绘的覆盖物样式设置
  35. - `{Boolean} clampToModel`:点位是否获取模型表面坐标
  36. - 返回值 `this`
  37. - **_edit(overlay,callback,[clampToModel])_**
  38. 编辑
  39. - 参数
  40. - `{Overlay} overlay`:覆盖物
  41. - `{Function} callback`:编辑完成的回调函数,参数为覆盖物
  42. - `{Boolean} clampToModel`:点位是否获取模型表面坐标
  43. - 返回值 `this`
  44. - **_stop()_**
  45. 停止
  46. - 返回值 `this`
  47. ## DC.Measure
  48. > 三维空间分析
  49. ### example
  50. ```js
  51. let measure = new DC.Measure(viewer)
  52. ```
  53. ### creation
  54. - **_constructor(viewer)_**
  55. 构造函数
  56. - 参数
  57. - `{Viewer} viewer`:场景
  58. - 返回值 `measure`
  59. ### methods
  60. - **_angle([options])_**
  61. 角度
  62. - 参数
  63. - `{Object} options`:配置
  64. - 返回值 `this`
  65. - **_area([options])_**
  66. 面积
  67. - 参数
  68. - `{Object} options`:配置
  69. - 返回值 `this`
  70. - **_areaSurface([options])_**
  71. 表面面积
  72. - 参数
  73. - `{Object} options`:配置
  74. - 返回值 `this`
  75. - **_distance([options])_**
  76. 距离
  77. - 参数
  78. - `{Object} options`:配置
  79. - 返回值 `this`
  80. - **_distanceSurface([options])_**
  81. 表面距离
  82. - 参数
  83. - `{Object} options`:配置
  84. - 返回值 `this`
  85. - **_heading([options])_**
  86. 偏航角
  87. - 参数
  88. - `{Object} options`:配置
  89. - 返回值 `this`
  90. - **_height([options])_**
  91. 高度
  92. - 参数
  93. - `{Object} options`:配置
  94. - 返回值 `this`
  95. - **_triangleHeight([options])_**
  96. 三角测量
  97. - 参数
  98. - `{Object} options`:配置
  99. - 返回值 `this`
  100. - **_activate(type,[options])_**
  101. 根据类型分析
  102. - 参数
  103. - `{String} type`:分析类型,参考 `DC.MeasureType`,
  104. - `{Object} options`:配置
  105. - 返回值 `this`
  106. ```js
  107. // options(属性可选)
  108. const options = {
  109. "icon_center": "**.png", // 自定义的中心点图标
  110. "icon_anchor": "**.png", //自定义的锚点图标
  111. "icon_midAnchor": "**.png", //自定义的中心锚点图标
  112. "icon_size": [12, 12], //自定义的中心锚点大小
  113. "clampToModel": false //点位是否获取模型表面坐标
  114. }
  115. ```
  116. - **_deactivate()_**
  117. 释放空间分析
  118. - 返回值 `this`