@itwin/frontend-devtools 4.0.0-dev.10 → 4.0.0-dev.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +1 -1
  3. package/lib/cjs/ClipboardUtilities.d.ts +8 -8
  4. package/lib/cjs/ClipboardUtilities.js +26 -26
  5. package/lib/cjs/ClipboardUtilities.js.map +1 -1
  6. package/lib/cjs/FrontEndDevTools.d.ts +19 -19
  7. package/lib/cjs/FrontEndDevTools.js +221 -221
  8. package/lib/cjs/FrontEndDevTools.js.map +1 -1
  9. package/lib/cjs/effects/Convolution.d.ts +68 -68
  10. package/lib/cjs/effects/Convolution.js +165 -165
  11. package/lib/cjs/effects/Convolution.js.map +1 -1
  12. package/lib/cjs/effects/EffectTools.d.ts +33 -33
  13. package/lib/cjs/effects/EffectTools.js +67 -68
  14. package/lib/cjs/effects/EffectTools.js.map +1 -1
  15. package/lib/cjs/effects/Explosion.d.ts +12 -12
  16. package/lib/cjs/effects/Explosion.js +168 -168
  17. package/lib/cjs/effects/Explosion.js.map +1 -1
  18. package/lib/cjs/effects/FlipImage.d.ts +30 -30
  19. package/lib/cjs/effects/FlipImage.js +99 -99
  20. package/lib/cjs/effects/FlipImage.js.map +1 -1
  21. package/lib/cjs/effects/LensDistortion.d.ts +34 -34
  22. package/lib/cjs/effects/LensDistortion.js +109 -109
  23. package/lib/cjs/effects/LensDistortion.js.map +1 -1
  24. package/lib/cjs/effects/Random.d.ts +24 -24
  25. package/lib/cjs/effects/Random.js +49 -49
  26. package/lib/cjs/effects/Random.js.map +1 -1
  27. package/lib/cjs/effects/Saturation.d.ts +30 -30
  28. package/lib/cjs/effects/Saturation.js +85 -85
  29. package/lib/cjs/effects/Saturation.js.map +1 -1
  30. package/lib/cjs/effects/Snow.d.ts +76 -76
  31. package/lib/cjs/effects/Snow.js +187 -187
  32. package/lib/cjs/effects/Snow.js.map +1 -1
  33. package/lib/cjs/effects/Vignette.d.ts +39 -39
  34. package/lib/cjs/effects/Vignette.js +108 -108
  35. package/lib/cjs/effects/Vignette.js.map +1 -1
  36. package/lib/cjs/frontend-devtools.d.ts +82 -82
  37. package/lib/cjs/frontend-devtools.js +102 -98
  38. package/lib/cjs/frontend-devtools.js.map +1 -1
  39. package/lib/cjs/tools/AnimationIntervalTool.d.ts +15 -15
  40. package/lib/cjs/tools/AnimationIntervalTool.js +30 -30
  41. package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
  42. package/lib/cjs/tools/ChangeUnitsTool.d.ts +15 -15
  43. package/lib/cjs/tools/ChangeUnitsTool.js +41 -41
  44. package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
  45. package/lib/cjs/tools/ClipTools.d.ts +67 -67
  46. package/lib/cjs/tools/ClipTools.js +161 -164
  47. package/lib/cjs/tools/ClipTools.js.map +1 -1
  48. package/lib/cjs/tools/DisplayStyleTools.d.ts +145 -145
  49. package/lib/cjs/tools/DisplayStyleTools.js +368 -370
  50. package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
  51. package/lib/cjs/tools/EmphasizeElementsTool.d.ts +60 -60
  52. package/lib/cjs/tools/EmphasizeElementsTool.js +154 -154
  53. package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
  54. package/lib/cjs/tools/FrustumDecoration.d.ts +57 -57
  55. package/lib/cjs/tools/FrustumDecoration.js +374 -374
  56. package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
  57. package/lib/cjs/tools/InspectElementTool.d.ts +42 -42
  58. package/lib/cjs/tools/InspectElementTool.js +198 -198
  59. package/lib/cjs/tools/InspectElementTool.js.map +1 -1
  60. package/lib/cjs/tools/MapLayerTool.d.ts +264 -264
  61. package/lib/cjs/tools/MapLayerTool.d.ts.map +1 -1
  62. package/lib/cjs/tools/MapLayerTool.js +509 -507
  63. package/lib/cjs/tools/MapLayerTool.js.map +1 -1
  64. package/lib/cjs/tools/MeasureTileLoadTime.d.ts +12 -12
  65. package/lib/cjs/tools/MeasureTileLoadTime.js +63 -63
  66. package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
  67. package/lib/cjs/tools/ModelAppearanceTools.d.ts +86 -86
  68. package/lib/cjs/tools/ModelAppearanceTools.js +183 -183
  69. package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
  70. package/lib/cjs/tools/PlanProjectionTools.d.ts +40 -40
  71. package/lib/cjs/tools/PlanProjectionTools.js +149 -149
  72. package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
  73. package/lib/cjs/tools/PlanarMaskTools.d.ts +182 -182
  74. package/lib/cjs/tools/PlanarMaskTools.js +391 -393
  75. package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
  76. package/lib/cjs/tools/ProjectExtents.d.ts +41 -41
  77. package/lib/cjs/tools/ProjectExtents.js +110 -110
  78. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  79. package/lib/cjs/tools/RealityModelTools.d.ts +116 -116
  80. package/lib/cjs/tools/RealityModelTools.js +281 -281
  81. package/lib/cjs/tools/RealityModelTools.js.map +1 -1
  82. package/lib/cjs/tools/RealityTransitionTool.d.ts +25 -25
  83. package/lib/cjs/tools/RealityTransitionTool.js +115 -116
  84. package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
  85. package/lib/cjs/tools/RenderSystemTools.d.ts +38 -38
  86. package/lib/cjs/tools/RenderSystemTools.js +69 -70
  87. package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
  88. package/lib/cjs/tools/RenderTargetTools.d.ts +107 -107
  89. package/lib/cjs/tools/RenderTargetTools.d.ts.map +1 -1
  90. package/lib/cjs/tools/RenderTargetTools.js +174 -174
  91. package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
  92. package/lib/cjs/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  93. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +30 -30
  94. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  95. package/lib/cjs/tools/SavedViews.d.ts +46 -46
  96. package/lib/cjs/tools/SavedViews.js +136 -136
  97. package/lib/cjs/tools/SavedViews.js.map +1 -1
  98. package/lib/cjs/tools/ScheduleScriptTools.d.ts +37 -37
  99. package/lib/cjs/tools/ScheduleScriptTools.js +157 -159
  100. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  101. package/lib/cjs/tools/SelectionTools.d.ts +28 -28
  102. package/lib/cjs/tools/SelectionTools.js +87 -87
  103. package/lib/cjs/tools/SelectionTools.js.map +1 -1
  104. package/lib/cjs/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  105. package/lib/cjs/tools/SetGpuMemoryLimitTool.js +33 -33
  106. package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
  107. package/lib/cjs/tools/SourceAspectIdTools.d.ts +40 -40
  108. package/lib/cjs/tools/SourceAspectIdTools.js +85 -86
  109. package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
  110. package/lib/cjs/tools/TileRequestDecoration.d.ts +12 -12
  111. package/lib/cjs/tools/TileRequestDecoration.js +83 -83
  112. package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
  113. package/lib/cjs/tools/TileTreeBoundsDecoration.d.ts +11 -11
  114. package/lib/cjs/tools/TileTreeBoundsDecoration.js +74 -74
  115. package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
  116. package/lib/cjs/tools/ToolTipProvider.d.ts +15 -15
  117. package/lib/cjs/tools/ToolTipProvider.js +66 -66
  118. package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
  119. package/lib/cjs/tools/ViewportTools.d.ts +218 -218
  120. package/lib/cjs/tools/ViewportTools.d.ts.map +1 -1
  121. package/lib/cjs/tools/ViewportTools.js +516 -516
  122. package/lib/cjs/tools/ViewportTools.js.map +1 -1
  123. package/lib/cjs/tools/parseArgs.d.ts +23 -23
  124. package/lib/cjs/tools/parseArgs.js +51 -51
  125. package/lib/cjs/tools/parseArgs.js.map +1 -1
  126. package/lib/cjs/tools/parseBoolean.d.ts +8 -8
  127. package/lib/cjs/tools/parseBoolean.js +26 -26
  128. package/lib/cjs/tools/parseBoolean.js.map +1 -1
  129. package/lib/cjs/tools/parseToggle.d.ts +8 -8
  130. package/lib/cjs/tools/parseToggle.js +25 -25
  131. package/lib/cjs/tools/parseToggle.js.map +1 -1
  132. package/lib/cjs/ui/Button.d.ts +29 -29
  133. package/lib/cjs/ui/Button.d.ts.map +1 -1
  134. package/lib/cjs/ui/Button.js +26 -26
  135. package/lib/cjs/ui/Button.js.map +1 -1
  136. package/lib/cjs/ui/CheckBox.d.ts +23 -23
  137. package/lib/cjs/ui/CheckBox.d.ts.map +1 -1
  138. package/lib/cjs/ui/CheckBox.js +27 -27
  139. package/lib/cjs/ui/CheckBox.js.map +1 -1
  140. package/lib/cjs/ui/ColorInput.d.ts +27 -27
  141. package/lib/cjs/ui/ColorInput.d.ts.map +1 -1
  142. package/lib/cjs/ui/ColorInput.js +53 -53
  143. package/lib/cjs/ui/ColorInput.js.map +1 -1
  144. package/lib/cjs/ui/ComboBox.d.ts +28 -28
  145. package/lib/cjs/ui/ComboBox.d.ts.map +1 -1
  146. package/lib/cjs/ui/ComboBox.js +42 -42
  147. package/lib/cjs/ui/ComboBox.js.map +1 -1
  148. package/lib/cjs/ui/DataList.d.ts +27 -27
  149. package/lib/cjs/ui/DataList.d.ts.map +1 -1
  150. package/lib/cjs/ui/DataList.js +39 -39
  151. package/lib/cjs/ui/DataList.js.map +1 -1
  152. package/lib/cjs/ui/NestedMenu.d.ts +19 -19
  153. package/lib/cjs/ui/NestedMenu.d.ts.map +1 -1
  154. package/lib/cjs/ui/NestedMenu.js +46 -46
  155. package/lib/cjs/ui/NestedMenu.js.map +1 -1
  156. package/lib/cjs/ui/NumericInput.d.ts +35 -35
  157. package/lib/cjs/ui/NumericInput.d.ts.map +1 -1
  158. package/lib/cjs/ui/NumericInput.js +61 -61
  159. package/lib/cjs/ui/NumericInput.js.map +1 -1
  160. package/lib/cjs/ui/RadioBox.d.ts +29 -29
  161. package/lib/cjs/ui/RadioBox.d.ts.map +1 -1
  162. package/lib/cjs/ui/RadioBox.js +76 -76
  163. package/lib/cjs/ui/RadioBox.js.map +1 -1
  164. package/lib/cjs/ui/Slider.d.ts +28 -28
  165. package/lib/cjs/ui/Slider.d.ts.map +1 -1
  166. package/lib/cjs/ui/Slider.js +42 -42
  167. package/lib/cjs/ui/Slider.js.map +1 -1
  168. package/lib/cjs/ui/TextBox.d.ts +32 -32
  169. package/lib/cjs/ui/TextBox.d.ts.map +1 -1
  170. package/lib/cjs/ui/TextBox.js +56 -56
  171. package/lib/cjs/ui/TextBox.js.map +1 -1
  172. package/lib/cjs/widgets/DiagnosticsPanel.d.ts +37 -37
  173. package/lib/cjs/widgets/DiagnosticsPanel.js +81 -81
  174. package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
  175. package/lib/cjs/widgets/FpsTracker.d.ts +19 -19
  176. package/lib/cjs/widgets/FpsTracker.js +56 -56
  177. package/lib/cjs/widgets/FpsTracker.js.map +1 -1
  178. package/lib/cjs/widgets/GpuProfiler.d.ts +16 -16
  179. package/lib/cjs/widgets/GpuProfiler.js +192 -192
  180. package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
  181. package/lib/cjs/widgets/KeyinField.d.ts +61 -61
  182. package/lib/cjs/widgets/KeyinField.js +186 -187
  183. package/lib/cjs/widgets/KeyinField.js.map +1 -1
  184. package/lib/cjs/widgets/MemoryTracker.d.ts +27 -27
  185. package/lib/cjs/widgets/MemoryTracker.js +242 -243
  186. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  187. package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +15 -15
  188. package/lib/cjs/widgets/RenderCommandBreakdown.js +67 -68
  189. package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
  190. package/lib/cjs/widgets/TileMemoryBreakdown.d.ts +30 -30
  191. package/lib/cjs/widgets/TileMemoryBreakdown.js +203 -204
  192. package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
  193. package/lib/cjs/widgets/TileStatisticsTracker.d.ts +21 -21
  194. package/lib/cjs/widgets/TileStatisticsTracker.d.ts.map +1 -1
  195. package/lib/cjs/widgets/TileStatisticsTracker.js +144 -142
  196. package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
  197. package/lib/cjs/widgets/ToolSettingsTracker.d.ts +9 -9
  198. package/lib/cjs/widgets/ToolSettingsTracker.js +211 -211
  199. package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
  200. package/lib/esm/ClipboardUtilities.d.ts +8 -8
  201. package/lib/esm/ClipboardUtilities.js +22 -22
  202. package/lib/esm/ClipboardUtilities.js.map +1 -1
  203. package/lib/esm/FrontEndDevTools.d.ts +19 -19
  204. package/lib/esm/FrontEndDevTools.js +218 -217
  205. package/lib/esm/FrontEndDevTools.js.map +1 -1
  206. package/lib/esm/effects/Convolution.d.ts +68 -68
  207. package/lib/esm/effects/Convolution.js +161 -155
  208. package/lib/esm/effects/Convolution.js.map +1 -1
  209. package/lib/esm/effects/EffectTools.d.ts +33 -33
  210. package/lib/esm/effects/EffectTools.js +63 -62
  211. package/lib/esm/effects/EffectTools.js.map +1 -1
  212. package/lib/esm/effects/Explosion.d.ts +12 -12
  213. package/lib/esm/effects/Explosion.js +165 -164
  214. package/lib/esm/effects/Explosion.js.map +1 -1
  215. package/lib/esm/effects/FlipImage.d.ts +30 -30
  216. package/lib/esm/effects/FlipImage.js +96 -94
  217. package/lib/esm/effects/FlipImage.js.map +1 -1
  218. package/lib/esm/effects/LensDistortion.d.ts +34 -34
  219. package/lib/esm/effects/LensDistortion.js +106 -104
  220. package/lib/esm/effects/LensDistortion.js.map +1 -1
  221. package/lib/esm/effects/Random.d.ts +24 -24
  222. package/lib/esm/effects/Random.js +41 -41
  223. package/lib/esm/effects/Random.js.map +1 -1
  224. package/lib/esm/effects/Saturation.d.ts +30 -30
  225. package/lib/esm/effects/Saturation.js +82 -80
  226. package/lib/esm/effects/Saturation.js.map +1 -1
  227. package/lib/esm/effects/Snow.d.ts +76 -76
  228. package/lib/esm/effects/Snow.js +184 -182
  229. package/lib/esm/effects/Snow.js.map +1 -1
  230. package/lib/esm/effects/Vignette.d.ts +39 -39
  231. package/lib/esm/effects/Vignette.js +105 -103
  232. package/lib/esm/effects/Vignette.js.map +1 -1
  233. package/lib/esm/frontend-devtools.d.ts +82 -82
  234. package/lib/esm/frontend-devtools.js +86 -86
  235. package/lib/esm/frontend-devtools.js.map +1 -1
  236. package/lib/esm/tools/AnimationIntervalTool.d.ts +15 -15
  237. package/lib/esm/tools/AnimationIntervalTool.js +27 -26
  238. package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
  239. package/lib/esm/tools/ChangeUnitsTool.d.ts +15 -15
  240. package/lib/esm/tools/ChangeUnitsTool.js +38 -37
  241. package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
  242. package/lib/esm/tools/ClipTools.d.ts +67 -67
  243. package/lib/esm/tools/ClipTools.js +158 -158
  244. package/lib/esm/tools/ClipTools.js.map +1 -1
  245. package/lib/esm/tools/DisplayStyleTools.d.ts +145 -145
  246. package/lib/esm/tools/DisplayStyleTools.js +364 -356
  247. package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
  248. package/lib/esm/tools/EmphasizeElementsTool.d.ts +60 -60
  249. package/lib/esm/tools/EmphasizeElementsTool.js +150 -145
  250. package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
  251. package/lib/esm/tools/FrustumDecoration.d.ts +57 -57
  252. package/lib/esm/tools/FrustumDecoration.js +370 -367
  253. package/lib/esm/tools/FrustumDecoration.js.map +1 -1
  254. package/lib/esm/tools/InspectElementTool.d.ts +42 -42
  255. package/lib/esm/tools/InspectElementTool.js +195 -194
  256. package/lib/esm/tools/InspectElementTool.js.map +1 -1
  257. package/lib/esm/tools/MapLayerTool.d.ts +264 -264
  258. package/lib/esm/tools/MapLayerTool.d.ts.map +1 -1
  259. package/lib/esm/tools/MapLayerTool.js +506 -485
  260. package/lib/esm/tools/MapLayerTool.js.map +1 -1
  261. package/lib/esm/tools/MeasureTileLoadTime.d.ts +12 -12
  262. package/lib/esm/tools/MeasureTileLoadTime.js +60 -59
  263. package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
  264. package/lib/esm/tools/ModelAppearanceTools.d.ts +86 -86
  265. package/lib/esm/tools/ModelAppearanceTools.js +180 -172
  266. package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
  267. package/lib/esm/tools/PlanProjectionTools.d.ts +40 -40
  268. package/lib/esm/tools/PlanProjectionTools.js +146 -143
  269. package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
  270. package/lib/esm/tools/PlanarMaskTools.d.ts +182 -182
  271. package/lib/esm/tools/PlanarMaskTools.js +387 -377
  272. package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
  273. package/lib/esm/tools/ProjectExtents.d.ts +41 -41
  274. package/lib/esm/tools/ProjectExtents.js +105 -104
  275. package/lib/esm/tools/ProjectExtents.js.map +1 -1
  276. package/lib/esm/tools/RealityModelTools.d.ts +116 -116
  277. package/lib/esm/tools/RealityModelTools.js +278 -268
  278. package/lib/esm/tools/RealityModelTools.js.map +1 -1
  279. package/lib/esm/tools/RealityTransitionTool.d.ts +25 -25
  280. package/lib/esm/tools/RealityTransitionTool.js +112 -112
  281. package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
  282. package/lib/esm/tools/RenderSystemTools.d.ts +38 -38
  283. package/lib/esm/tools/RenderSystemTools.js +65 -63
  284. package/lib/esm/tools/RenderSystemTools.js.map +1 -1
  285. package/lib/esm/tools/RenderTargetTools.d.ts +107 -107
  286. package/lib/esm/tools/RenderTargetTools.d.ts.map +1 -1
  287. package/lib/esm/tools/RenderTargetTools.js +169 -159
  288. package/lib/esm/tools/RenderTargetTools.js.map +1 -1
  289. package/lib/esm/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  290. package/lib/esm/tools/ReportWebGLCompatibilityTool.js +27 -26
  291. package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  292. package/lib/esm/tools/SavedViews.d.ts +46 -46
  293. package/lib/esm/tools/SavedViews.js +131 -128
  294. package/lib/esm/tools/SavedViews.js.map +1 -1
  295. package/lib/esm/tools/ScheduleScriptTools.d.ts +37 -37
  296. package/lib/esm/tools/ScheduleScriptTools.js +154 -153
  297. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  298. package/lib/esm/tools/SelectionTools.d.ts +28 -28
  299. package/lib/esm/tools/SelectionTools.js +84 -82
  300. package/lib/esm/tools/SelectionTools.js.map +1 -1
  301. package/lib/esm/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  302. package/lib/esm/tools/SetGpuMemoryLimitTool.js +30 -29
  303. package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
  304. package/lib/esm/tools/SourceAspectIdTools.d.ts +40 -40
  305. package/lib/esm/tools/SourceAspectIdTools.js +81 -80
  306. package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
  307. package/lib/esm/tools/TileRequestDecoration.d.ts +12 -12
  308. package/lib/esm/tools/TileRequestDecoration.js +80 -79
  309. package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
  310. package/lib/esm/tools/TileTreeBoundsDecoration.d.ts +11 -11
  311. package/lib/esm/tools/TileTreeBoundsDecoration.js +71 -70
  312. package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
  313. package/lib/esm/tools/ToolTipProvider.d.ts +15 -15
  314. package/lib/esm/tools/ToolTipProvider.js +63 -62
  315. package/lib/esm/tools/ToolTipProvider.js.map +1 -1
  316. package/lib/esm/tools/ViewportTools.d.ts +218 -218
  317. package/lib/esm/tools/ViewportTools.d.ts.map +1 -1
  318. package/lib/esm/tools/ViewportTools.js +511 -492
  319. package/lib/esm/tools/ViewportTools.js.map +1 -1
  320. package/lib/esm/tools/parseArgs.d.ts +23 -23
  321. package/lib/esm/tools/parseArgs.js +47 -47
  322. package/lib/esm/tools/parseArgs.js.map +1 -1
  323. package/lib/esm/tools/parseBoolean.d.ts +8 -8
  324. package/lib/esm/tools/parseBoolean.js +22 -22
  325. package/lib/esm/tools/parseBoolean.js.map +1 -1
  326. package/lib/esm/tools/parseToggle.d.ts +8 -8
  327. package/lib/esm/tools/parseToggle.js +21 -21
  328. package/lib/esm/tools/parseToggle.js.map +1 -1
  329. package/lib/esm/ui/Button.d.ts +29 -29
  330. package/lib/esm/ui/Button.d.ts.map +1 -1
  331. package/lib/esm/ui/Button.js +22 -22
  332. package/lib/esm/ui/Button.js.map +1 -1
  333. package/lib/esm/ui/CheckBox.d.ts +23 -23
  334. package/lib/esm/ui/CheckBox.d.ts.map +1 -1
  335. package/lib/esm/ui/CheckBox.js +23 -23
  336. package/lib/esm/ui/CheckBox.js.map +1 -1
  337. package/lib/esm/ui/ColorInput.d.ts +27 -27
  338. package/lib/esm/ui/ColorInput.d.ts.map +1 -1
  339. package/lib/esm/ui/ColorInput.js +48 -48
  340. package/lib/esm/ui/ColorInput.js.map +1 -1
  341. package/lib/esm/ui/ComboBox.d.ts +28 -28
  342. package/lib/esm/ui/ComboBox.d.ts.map +1 -1
  343. package/lib/esm/ui/ComboBox.js +38 -38
  344. package/lib/esm/ui/ComboBox.js.map +1 -1
  345. package/lib/esm/ui/DataList.d.ts +27 -27
  346. package/lib/esm/ui/DataList.d.ts.map +1 -1
  347. package/lib/esm/ui/DataList.js +34 -34
  348. package/lib/esm/ui/DataList.js.map +1 -1
  349. package/lib/esm/ui/NestedMenu.d.ts +19 -19
  350. package/lib/esm/ui/NestedMenu.d.ts.map +1 -1
  351. package/lib/esm/ui/NestedMenu.js +42 -42
  352. package/lib/esm/ui/NestedMenu.js.map +1 -1
  353. package/lib/esm/ui/NumericInput.d.ts +35 -35
  354. package/lib/esm/ui/NumericInput.d.ts.map +1 -1
  355. package/lib/esm/ui/NumericInput.js +56 -56
  356. package/lib/esm/ui/NumericInput.js.map +1 -1
  357. package/lib/esm/ui/RadioBox.d.ts +29 -29
  358. package/lib/esm/ui/RadioBox.d.ts.map +1 -1
  359. package/lib/esm/ui/RadioBox.js +72 -72
  360. package/lib/esm/ui/RadioBox.js.map +1 -1
  361. package/lib/esm/ui/Slider.d.ts +28 -28
  362. package/lib/esm/ui/Slider.d.ts.map +1 -1
  363. package/lib/esm/ui/Slider.js +38 -38
  364. package/lib/esm/ui/Slider.js.map +1 -1
  365. package/lib/esm/ui/TextBox.d.ts +32 -32
  366. package/lib/esm/ui/TextBox.d.ts.map +1 -1
  367. package/lib/esm/ui/TextBox.js +52 -52
  368. package/lib/esm/ui/TextBox.js.map +1 -1
  369. package/lib/esm/widgets/DiagnosticsPanel.d.ts +37 -37
  370. package/lib/esm/widgets/DiagnosticsPanel.js +77 -77
  371. package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
  372. package/lib/esm/widgets/FpsTracker.d.ts +19 -19
  373. package/lib/esm/widgets/FpsTracker.js +52 -52
  374. package/lib/esm/widgets/FpsTracker.js.map +1 -1
  375. package/lib/esm/widgets/GpuProfiler.d.ts +16 -16
  376. package/lib/esm/widgets/GpuProfiler.js +188 -188
  377. package/lib/esm/widgets/GpuProfiler.js.map +1 -1
  378. package/lib/esm/widgets/KeyinField.d.ts +61 -61
  379. package/lib/esm/widgets/KeyinField.js +182 -183
  380. package/lib/esm/widgets/KeyinField.js.map +1 -1
  381. package/lib/esm/widgets/MemoryTracker.d.ts +27 -27
  382. package/lib/esm/widgets/MemoryTracker.js +237 -238
  383. package/lib/esm/widgets/MemoryTracker.js.map +1 -1
  384. package/lib/esm/widgets/RenderCommandBreakdown.d.ts +15 -15
  385. package/lib/esm/widgets/RenderCommandBreakdown.js +63 -64
  386. package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
  387. package/lib/esm/widgets/TileMemoryBreakdown.d.ts +30 -30
  388. package/lib/esm/widgets/TileMemoryBreakdown.js +199 -200
  389. package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
  390. package/lib/esm/widgets/TileStatisticsTracker.d.ts +21 -21
  391. package/lib/esm/widgets/TileStatisticsTracker.d.ts.map +1 -1
  392. package/lib/esm/widgets/TileStatisticsTracker.js +140 -138
  393. package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
  394. package/lib/esm/widgets/ToolSettingsTracker.d.ts +9 -9
  395. package/lib/esm/widgets/ToolSettingsTracker.js +208 -207
  396. package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
  397. package/lib/public/locales/en/FrontendDevTools.json +484 -484
  398. package/package.json +15 -16
@@ -1,508 +1,510 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.MapBaseVisibilityTool = exports.MapBaseTransparencyTool = exports.MapBaseColorTool = exports.ToggleTerrainTool = exports.MapLayerZoomTool = exports.MapLayerSubLayerVisibilityTool = exports.MapLayerTransparencyTool = exports.ReorderMapLayers = exports.MapLayerVisibilityTool = exports.DetachMapLayersTool = exports.SetMapBaseTool = exports.AttachMapOverlayTool = exports.AttachMapLayerTool = exports.AttachTileURLMapLayerByUrlTool = exports.AttachArcGISFeatureMapLayerByUrlTool = exports.AttachArcGISMapLayerByUrlTool = exports.AttachWmtsMapLayerByUrlTool = exports.AttachWmsMapLayerByUrlTool = exports.AttachModelMapLayerTool = void 0;
8
- const core_common_1 = require("@itwin/core-common");
9
- const core_frontend_1 = require("@itwin/core-frontend");
10
- const parseBoolean_1 = require("./parseBoolean");
11
- const parseToggle_1 = require("./parseToggle");
12
- /** Base class for attaching map layer tool. */
13
- class AttachMapLayerBaseTool extends core_frontend_1.Tool {
14
- constructor(_isBackground = true, _isBase = false) {
15
- super();
16
- this._isBackground = _isBackground;
17
- this._isBase = _isBase;
18
- }
19
- doAttach(source) {
20
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
21
- if (vp === undefined || source === undefined)
22
- return;
23
- source.validateSource().then((validation) => {
24
- if (validation.status === core_frontend_1.MapLayerSourceStatus.Valid || validation.status === core_frontend_1.MapLayerSourceStatus.RequireAuth) {
25
- if (this._isBase) {
26
- vp.displayStyle.backgroundMapBase = core_common_1.BaseMapLayerSettings.fromJSON({ ...source, subLayers: validation.subLayers });
27
- vp.invalidateRenderPlan();
28
- }
29
- else {
30
- const settings = source.toLayerSettings(validation.subLayers);
31
- if (settings) {
32
- vp.displayStyle.attachMapLayer({ settings, isOverlay: !this._isBackground });
33
- }
34
- }
35
- if (validation.status === core_frontend_1.MapLayerSourceStatus.Valid) {
36
- vp.invalidateRenderPlan();
37
- const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttached", { sourceName: source.name, sourceUrl: source.url });
38
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Info, msg));
39
- }
40
- else if (validation.status === core_frontend_1.MapLayerSourceStatus.RequireAuth) {
41
- const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachedRequiresAuth", { sourceName: source.name });
42
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Warning, msg));
43
- }
44
- }
45
- else {
46
- const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerValidationFailed", { sourceUrl: source.url });
47
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, msg));
48
- }
49
- }).catch((error) => {
50
- const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachError", { error, sourceUrl: source.url });
51
- core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, msg));
52
- });
53
- }
54
- }
55
- /** Attach a map layer from URL base class. A layer is attached for each unique model in the selection
56
- * @beta
57
- */
58
- class AttachModelMapLayerTool extends core_frontend_1.Tool {
59
- constructor(_formatId) {
60
- super();
61
- this._formatId = _formatId;
62
- }
63
- static get minArgs() { return 0; }
64
- static get maxArgs() { return 1; }
65
- async run(nameIn) {
66
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
67
- if (!vp)
68
- return false;
69
- const iModel = vp.iModel;
70
- const elements = await iModel.elements.getProps(iModel.selectionSet.elements);
71
- const modelIds = new Set();
72
- for (const element of elements)
73
- modelIds.add(element.model);
74
- for (const modelId of modelIds) {
75
- const modelProps = await iModel.models.getProps(modelId);
76
- const modelName = modelProps[0].name ? modelProps[0].name : modelId;
77
- const name = nameIn ? (modelIds.size > 1 ? `${nameIn}: ${modelName}` : nameIn) : modelName;
78
- const settings = core_common_1.ModelMapLayerSettings.fromJSON({ name, modelId });
79
- vp.displayStyle.attachMapLayer({ settings, isOverlay: false });
80
- }
81
- return true;
82
- }
83
- async parseAndRun(...args) {
84
- return this.run(args[0]);
85
- }
86
- async onRestartTool() {
87
- }
88
- }
89
- exports.AttachModelMapLayerTool = AttachModelMapLayerTool;
90
- AttachModelMapLayerTool.toolId = "AttachModelMapLayerTool";
91
- /** Attach a map layer from URL base class. */
92
- class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
93
- constructor(_formatId) {
94
- super();
95
- this._formatId = _formatId;
96
- }
97
- static get minArgs() { return 1; }
98
- static get maxArgs() { return 4; }
99
- async run(url, name, userName, password) {
100
- const source = core_frontend_1.MapLayerSource.fromJSON({ url, name: (name ? name : url), formatId: this._formatId });
101
- if (source) {
102
- source.userName = userName;
103
- source.password = password;
104
- }
105
- this.doAttach(source);
106
- return true;
107
- }
108
- async parseAndRun(...args) {
109
- return this.run(args[0], args[1], args[2], args[3]);
110
- }
111
- }
112
- /** This tool attaches a WMS map layer from a given URL.
113
- * @beta
114
- */
115
- class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
116
- constructor() { super("WMS"); }
117
- /** This method runs the tool, attaching a WMS map layer from a given URL.
118
- * @param args contains url, name, userName, password in array order
119
- */
120
- async parseAndRun(...args) {
121
- return this.run(core_frontend_1.WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
122
- }
123
- }
124
- exports.AttachWmsMapLayerByUrlTool = AttachWmsMapLayerByUrlTool;
125
- AttachWmsMapLayerByUrlTool.toolId = "AttachWmsMapLayerTool";
126
- /** This tool attaches a WMTS map layer from a given URL.
127
- * @beta
128
- */
129
- class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
130
- constructor() { super("WMTS"); }
131
- /** This method runs the tool, attaching a WMTS map layer from a given URL.
132
- * @param args contains url, name, userName, password in array order
133
- */
134
- async parseAndRun(...args) {
135
- return this.run(core_frontend_1.WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
136
- }
137
- }
138
- exports.AttachWmtsMapLayerByUrlTool = AttachWmtsMapLayerByUrlTool;
139
- AttachWmtsMapLayerByUrlTool.toolId = "AttachWmtsMapLayerTool";
140
- /** This tool attaches an ArcGIS map layer from a given URL.
141
- * @beta
142
- */
143
- class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
144
- constructor() { super("ArcGIS"); }
145
- }
146
- exports.AttachArcGISMapLayerByUrlTool = AttachArcGISMapLayerByUrlTool;
147
- AttachArcGISMapLayerByUrlTool.toolId = "AttachArcGISMapLayerTool";
148
- /** This tool attaches an ArcGIS map layer from a given URL.
149
- * @beta
150
- */
151
- class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
152
- constructor() { super("ArcGISFeature"); }
153
- }
154
- exports.AttachArcGISFeatureMapLayerByUrlTool = AttachArcGISFeatureMapLayerByUrlTool;
155
- AttachArcGISFeatureMapLayerByUrlTool.toolId = "AttachArcGISFeatureMapLayerTool";
156
- /** This tool attaches a map layer from a given tile URL.
157
- * @beta
158
- */
159
- class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
160
- constructor() { super("TileURL"); }
161
- }
162
- exports.AttachTileURLMapLayerByUrlTool = AttachTileURLMapLayerByUrlTool;
163
- AttachTileURLMapLayerByUrlTool.toolId = "AttachTileURLMapLayerTool";
164
- /** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).
165
- * @beta
166
- */
167
- class AttachMapLayerTool extends AttachMapLayerBaseTool {
168
- static get minArgs() { return 1; }
169
- static get maxArgs() { return 1; }
170
- /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.
171
- * @param name the name of the map layer to add
172
- */
173
- async run(name) {
174
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
175
- if (vp === undefined)
176
- return false;
177
- core_frontend_1.MapLayerSources.create().then((sources) => {
178
- if (sources !== undefined) {
179
- const source = sources.findByName(name, this._isBase);
180
- if (source !== undefined)
181
- this.doAttach(source);
182
- }
183
- }).catch((_err) => { });
184
- return true;
185
- }
186
- /** Executes this tool's run method with args[0] containing `name`.
187
- * @see [[run]]
188
- */
189
- async parseAndRun(...args) {
190
- return this.run(args[0]);
191
- }
192
- }
193
- exports.AttachMapLayerTool = AttachMapLayerTool;
194
- AttachMapLayerTool.toolId = "AttachMapLayerTool";
195
- /** This tool attaches a Overlay map layer.
196
- * @beta
197
- */
198
- class AttachMapOverlayTool extends AttachMapLayerTool {
199
- constructor() {
200
- super();
201
- this._isBackground = false;
202
- }
203
- }
204
- exports.AttachMapOverlayTool = AttachMapOverlayTool;
205
- AttachMapOverlayTool.toolId = "AttachMapOverlayTool";
206
- /** Sets map layer base tool.
207
- * @beta
208
- */
209
- class SetMapBaseTool extends AttachMapLayerTool {
210
- constructor() {
211
- super();
212
- this._isBase = true;
213
- }
214
- }
215
- exports.SetMapBaseTool = SetMapBaseTool;
216
- SetMapBaseTool.toolId = "SetMapBaseTool";
217
- /** Detach Map Layers Tool.
218
- * @beta
219
- */
220
- class DetachMapLayersTool extends core_frontend_1.Tool {
221
- static get minArgs() { return 0; }
222
- static get maxArgs() { return 0; }
223
- async parseAndRun(..._args) {
224
- return this.run();
225
- }
226
- async run() {
227
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
228
- if (vp === undefined)
229
- return false;
230
- vp.displayStyle.detachMapLayerByIndex(-1, true);
231
- vp.displayStyle.detachMapLayerByIndex(-1, false);
232
- vp.invalidateRenderPlan();
233
- return true;
234
- }
235
- }
236
- exports.DetachMapLayersTool = DetachMapLayersTool;
237
- DetachMapLayersTool.toolId = "DetachMapLayersTool";
238
- function parseLayerIndex(args) {
239
- const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;
240
- return isNaN(layerIndex) ? 0 : layerIndex;
241
- }
242
- /** This tool sets the visibility of the map layer.
243
- * @beta
244
- */
245
- class MapLayerVisibilityTool extends core_frontend_1.Tool {
246
- static get minArgs() { return 1; }
247
- static get maxArgs() { return 2; }
248
- /** This method runs the tool, setting the visibility of a map layer.
249
- * @param layerIndex the index of the layer to change
250
- * @param visible a boolean that should be true if the layer should be visible
251
- */
252
- async run(layerIndex, enable) {
253
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
254
- if (undefined === vp || !vp.view.isSpatialView())
255
- return false;
256
- const mapLayer = vp.displayStyle.mapLayerAtIndex(layerIndex, false);
257
- if (undefined === mapLayer)
258
- return false;
259
- const visible = (enable === undefined) ? !mapLayer.visible : enable;
260
- vp.displayStyle.changeMapLayerProps({ visible }, layerIndex, false);
261
- vp.invalidateRenderPlan();
262
- return true;
263
- }
264
- /** Executes this tool's run method with args[0] containing `enable` and args[1] containing `layerIndex`.
265
- * @see [[run]]
266
- */
267
- async parseAndRun(...args) {
268
- const enable = (0, parseToggle_1.parseToggle)(args[0]);
269
- const layerIndex = parseLayerIndex(args);
270
- if (typeof enable !== "string")
271
- await this.run(layerIndex, enable);
272
- return true;
273
- }
274
- }
275
- exports.MapLayerVisibilityTool = MapLayerVisibilityTool;
276
- MapLayerVisibilityTool.toolId = "SetMapLayerVisibility";
277
- /** This tool reorders map layers.
278
- * @beta
279
- */
280
- class ReorderMapLayers extends core_frontend_1.Tool {
281
- static get minArgs() { return 0; }
282
- static get maxArgs() { return 2; }
283
- /** This method runs the tool, reordering the map layers.
284
- * @param from a numeric value specifying the layer index that is being moved
285
- * @param from a numeric value specifying the layer index to move that layer to
286
- */
287
- async run(from, to) {
288
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
289
- if (undefined === vp || !vp.view.isSpatialView())
290
- return false;
291
- vp.displayStyle.moveMapLayerToIndex(isNaN(from) ? 0 : from, isNaN(to) ? vp.displayStyle.backgroundMapLayers.length : to, false);
292
- vp.invalidateRenderPlan();
293
- return true;
294
- }
295
- /** Executes this tool's run method with args[0] containing `from` and args[1] containing `to`.
296
- * @see [[run]]
297
- */
298
- async parseAndRun(...args) {
299
- const from = parseInt(args[0], 10);
300
- const to = parseInt(args[1], 10);
301
- await this.run(from, to);
302
- return true;
303
- }
304
- }
305
- exports.ReorderMapLayers = ReorderMapLayers;
306
- ReorderMapLayers.toolId = "ReorderMapLayers";
307
- /** This tool sets the transparency of a map layer.
308
- * @beta
309
- */
310
- class MapLayerTransparencyTool extends core_frontend_1.Tool {
311
- static get minArgs() { return 1; }
312
- static get maxArgs() { return 2; }
313
- /** This method runs the tool, setting the transparency of a map layer.
314
- * @param layerIndex the index of the layer to change
315
- * @param transparency a numeric value in the range 0.0 (fully opaque) to 1.0 (fully transparent)
316
- */
317
- async run(layerIndex, transparency) {
318
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
319
- if (undefined === vp || !vp.view.isSpatialView())
320
- return false;
321
- vp.displayStyle.changeMapLayerProps({ transparency }, layerIndex, false);
322
- vp.invalidateRenderPlan();
323
- return true;
324
- }
325
- /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.
326
- * @see [[run]]
327
- */
328
- async parseAndRun(...args) {
329
- const transparency = parseFloat(args[0]);
330
- const layerIndex = parseLayerIndex(args);
331
- if (transparency >= 0 && transparency <= 1)
332
- await this.run(layerIndex, transparency);
333
- return true;
334
- }
335
- }
336
- exports.MapLayerTransparencyTool = MapLayerTransparencyTool;
337
- MapLayerTransparencyTool.toolId = "SetMapLayerTransparency";
338
- /** This tool sets the visibility of the map sublayer.
339
- * @beta
340
- */
341
- class MapLayerSubLayerVisibilityTool extends core_frontend_1.Tool {
342
- static get minArgs() { return 1; }
343
- static get maxArgs() { return 2; }
344
- /** This method runs the tool, setting the visibility of a map sublayer.
345
- * @param layerIndex the index of the layer to change
346
- * @param visible a boolean that should be true if the sublayer should be visible
347
- */
348
- async run(layerIndex, visible) {
349
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
350
- if (undefined === vp || !vp.view.isSpatialView())
351
- return false;
352
- vp.displayStyle.changeMapSubLayerProps({ visible }, -1, layerIndex, false);
353
- vp.invalidateRenderPlan();
354
- return true;
355
- }
356
- /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.
357
- * @see [[run]]
358
- */
359
- async parseAndRun(...args) {
360
- const on = args[0] !== "off";
361
- const layerIndex = parseLayerIndex(args);
362
- await this.run(layerIndex, on);
363
- return true;
364
- }
365
- }
366
- exports.MapLayerSubLayerVisibilityTool = MapLayerSubLayerVisibilityTool;
367
- MapLayerSubLayerVisibilityTool.toolId = "SetMapSubLayerVisibility";
368
- /** This tool changes the viewport so it is zoomed to the range of a map layer.
369
- * @beta
370
- */
371
- class MapLayerZoomTool extends core_frontend_1.Tool {
372
- static get minArgs() { return 0; }
373
- static get maxArgs() { return 1; }
374
- /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.
375
- * @param layerIndex the index of the layer whose range to zoom to
376
- */
377
- async run(layerIndex) {
378
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
379
- if (undefined === vp || !vp.view.isSpatialView())
380
- return false;
381
- vp.displayStyle.viewMapLayerRange(layerIndex, false, vp).then(() => { }).catch(() => { });
382
- return true;
383
- }
384
- /** Executes this tool's run method with args[0] containing `layerIndex`.
385
- * @see [[run]]
386
- */
387
- async parseAndRun(...args) {
388
- const layerIndex = parseLayerIndex(args);
389
- await this.run(layerIndex);
390
- return true;
391
- }
392
- }
393
- exports.MapLayerZoomTool = MapLayerZoomTool;
394
- MapLayerZoomTool.toolId = "MapLayerZoom";
395
- /** This tool toggles whether to apply terrain heights to the map.
396
- * @beta
397
- */
398
- class ToggleTerrainTool extends core_frontend_1.Tool {
399
- static get minArgs() { return 0; }
400
- static get maxArgs() { return 1; }
401
- /** This method runs the tool, changing whether to apply terrain heights to the map.
402
- * @param enable whether or not to enable terrain heights on the map
403
- */
404
- async run(enable) {
405
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
406
- if (undefined === vp || !vp.view.isSpatialView())
407
- return false;
408
- const applyTerrain = (enable === undefined) ? !vp.displayStyle.backgroundMapSettings.applyTerrain : enable;
409
- vp.displayStyle.changeBackgroundMapProps({ applyTerrain });
410
- vp.invalidateRenderPlan();
411
- return true;
412
- }
413
- /** Executes this tool's run method with args[0] containing `enable`.
414
- * @see [[run]]
415
- */
416
- async parseAndRun(...args) {
417
- const enable = (0, parseToggle_1.parseToggle)(args[0]);
418
- if (typeof enable !== "string")
419
- await this.run(enable);
420
- return true;
421
- }
422
- }
423
- exports.ToggleTerrainTool = ToggleTerrainTool;
424
- ToggleTerrainTool.toolId = "ToggleTerrain";
425
- /** This tool changes the color of the base map.
426
- * @beta
427
- */
428
- class MapBaseColorTool extends core_frontend_1.Tool {
429
- static get minArgs() { return 3; }
430
- static get maxArgs() { return 3; }
431
- /** This method runs the tool, changing the color of the base map.
432
- * @param color the color for the base map
433
- */
434
- async run(color) {
435
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
436
- if (undefined === vp || !vp.view.isSpatialView())
437
- return false;
438
- const curTransparency = vp.displayStyle.backgroundMapBase instanceof core_common_1.ColorDef ? vp.displayStyle.backgroundMapBase.getTransparency() : 0;
439
- vp.displayStyle.backgroundMapBase = color.withTransparency(curTransparency);
440
- vp.invalidateRenderPlan();
441
- return true;
442
- }
443
- /** Executes this tool's run method with args[0] containing a 0 to 255 red component, args[1] containing a 0 to 255 green component, and args[2] containing a 0 to 255 blue component.
444
- * These rgb values will be used to construct the `color` parameter passed to this tool's run method.
445
- * @see [[run]]
446
- */
447
- async parseAndRun(...args) {
448
- const red = parseFloat(args[0]), green = parseFloat(args[1]), blue = parseFloat(args[2]);
449
- return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(core_common_1.ColorDef.from(red, green, blue));
450
- }
451
- }
452
- exports.MapBaseColorTool = MapBaseColorTool;
453
- MapBaseColorTool.toolId = "SetMapBaseColorTool";
454
- /** This tool changes the transparency of the base map.
455
- * @beta
456
- */
457
- class MapBaseTransparencyTool extends core_frontend_1.Tool {
458
- static get minArgs() { return 1; }
459
- static get maxArgs() { return 1; }
460
- /** This method runs the tool, changing the transparency of the base map.
461
- * @param transparency a numeric value in range 0.0 to 1.0 whether 0.0 means fully opaque and 1.0 means fully transparent
462
- */
463
- async run(transparency) {
464
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
465
- if (undefined === vp || !vp.view.isSpatialView())
466
- return false;
467
- vp.displayStyle.changeBaseMapTransparency(transparency);
468
- vp.invalidateRenderPlan();
469
- return true;
470
- }
471
- /** Executes this tool's run method with args[0] containing `transparency`.
472
- * @see [[run]]
473
- */
474
- async parseAndRun(...args) {
475
- const transparency = parseFloat(args[0]);
476
- return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);
477
- }
478
- }
479
- exports.MapBaseTransparencyTool = MapBaseTransparencyTool;
480
- MapBaseTransparencyTool.toolId = "SetMapBaseTransparencyTool";
481
- /** This tool changes the visibility of the base map.
482
- * @beta
483
- */
484
- class MapBaseVisibilityTool extends core_frontend_1.Tool {
485
- static get minArgs() { return 1; }
486
- static get maxArgs() { return 1; }
487
- /** This method runs the tool, changing the visibility of the base map.
488
- * @param visible a boolean which specifies whether or not to make the base map visible
489
- */
490
- async run(visible) {
491
- const vp = core_frontend_1.IModelApp.viewManager.selectedView;
492
- if (undefined === vp || !vp.view.isSpatialView() || vp.displayStyle.backgroundMapBase instanceof core_common_1.ColorDef)
493
- return false;
494
- vp.displayStyle.backgroundMapBase = vp.displayStyle.backgroundMapBase.clone({ visible });
495
- vp.invalidateRenderPlan();
496
- return true;
497
- }
498
- /** Executes this tool's run method with args[0] containing `visible`.
499
- * @see [[run]]
500
- */
501
- async parseAndRun(...args) {
502
- const visible = (0, parseBoolean_1.parseBoolean)(args[0]);
503
- return (visible !== undefined ? this.run(visible) : false);
504
- }
505
- }
506
- exports.MapBaseVisibilityTool = MapBaseVisibilityTool;
507
- MapBaseVisibilityTool.toolId = "SetMapBaseVisibilityTool";
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.MapBaseVisibilityTool = exports.MapBaseTransparencyTool = exports.MapBaseColorTool = exports.ToggleTerrainTool = exports.MapLayerZoomTool = exports.MapLayerSubLayerVisibilityTool = exports.MapLayerTransparencyTool = exports.ReorderMapLayers = exports.MapLayerVisibilityTool = exports.DetachMapLayersTool = exports.SetMapBaseTool = exports.AttachMapOverlayTool = exports.AttachMapLayerTool = exports.AttachTileURLMapLayerByUrlTool = exports.AttachArcGISFeatureMapLayerByUrlTool = exports.AttachArcGISMapLayerByUrlTool = exports.AttachWmtsMapLayerByUrlTool = exports.AttachWmsMapLayerByUrlTool = exports.AttachModelMapLayerTool = void 0;
8
+ const core_common_1 = require("@itwin/core-common");
9
+ const core_frontend_1 = require("@itwin/core-frontend");
10
+ const parseBoolean_1 = require("./parseBoolean");
11
+ const parseToggle_1 = require("./parseToggle");
12
+ /** Base class for attaching map layer tool. */
13
+ class AttachMapLayerBaseTool extends core_frontend_1.Tool {
14
+ constructor(_isBackground = true, _isBase = false) {
15
+ super();
16
+ this._isBackground = _isBackground;
17
+ this._isBase = _isBase;
18
+ }
19
+ doAttach(source) {
20
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
21
+ if (vp === undefined || source === undefined)
22
+ return;
23
+ source.validateSource().then((validation) => {
24
+ if (validation.status === core_frontend_1.MapLayerSourceStatus.Valid || validation.status === core_frontend_1.MapLayerSourceStatus.RequireAuth) {
25
+ if (this._isBase) {
26
+ vp.displayStyle.backgroundMapBase = core_common_1.BaseMapLayerSettings.fromJSON({ ...source, subLayers: validation.subLayers });
27
+ vp.invalidateRenderPlan();
28
+ }
29
+ else {
30
+ const settings = source.toLayerSettings(validation.subLayers);
31
+ if (settings) {
32
+ // Need to specify index in mapLayerIndex, so just use -1 to attach layer at the bottom
33
+ // Previously, this was done within attachMapLayer if index was undefined.
34
+ vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: !this._isBackground, index: -1 } });
35
+ }
36
+ }
37
+ if (validation.status === core_frontend_1.MapLayerSourceStatus.Valid) {
38
+ vp.invalidateRenderPlan();
39
+ const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttached", { sourceName: source.name, sourceUrl: source.url });
40
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Info, msg));
41
+ }
42
+ else if (validation.status === core_frontend_1.MapLayerSourceStatus.RequireAuth) {
43
+ const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachedRequiresAuth", { sourceName: source.name });
44
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Warning, msg));
45
+ }
46
+ }
47
+ else {
48
+ const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerValidationFailed", { sourceUrl: source.url });
49
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, msg));
50
+ }
51
+ }).catch((error) => {
52
+ const msg = core_frontend_1.IModelApp.localization.getLocalizedString("FrontendDevTools:tools.AttachMapLayerTool.Messages.MapLayerAttachError", { error, sourceUrl: source.url });
53
+ core_frontend_1.IModelApp.notifications.outputMessage(new core_frontend_1.NotifyMessageDetails(core_frontend_1.OutputMessagePriority.Error, msg));
54
+ });
55
+ }
56
+ }
57
+ /** Attach a map layer from URL base class. A layer is attached for each unique model in the selection
58
+ * @beta
59
+ */
60
+ class AttachModelMapLayerTool extends core_frontend_1.Tool {
61
+ static get minArgs() { return 0; }
62
+ static get maxArgs() { return 1; }
63
+ constructor(_formatId) {
64
+ super();
65
+ this._formatId = _formatId;
66
+ }
67
+ async run(nameIn) {
68
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
69
+ if (!vp)
70
+ return false;
71
+ const iModel = vp.iModel;
72
+ const elements = await iModel.elements.getProps(iModel.selectionSet.elements);
73
+ const modelIds = new Set();
74
+ for (const element of elements)
75
+ modelIds.add(element.model);
76
+ for (const modelId of modelIds) {
77
+ const modelProps = await iModel.models.getProps(modelId);
78
+ const modelName = modelProps[0].name ? modelProps[0].name : modelId;
79
+ const name = nameIn ? (modelIds.size > 1 ? `${nameIn}: ${modelName}` : nameIn) : modelName;
80
+ const settings = core_common_1.ModelMapLayerSettings.fromJSON({ name, modelId });
81
+ vp.displayStyle.attachMapLayer({ settings, mapLayerIndex: { isOverlay: false, index: -1 } });
82
+ }
83
+ return true;
84
+ }
85
+ async parseAndRun(...args) {
86
+ return this.run(args[0]);
87
+ }
88
+ async onRestartTool() {
89
+ }
90
+ }
91
+ AttachModelMapLayerTool.toolId = "AttachModelMapLayerTool";
92
+ exports.AttachModelMapLayerTool = AttachModelMapLayerTool;
93
+ /** Attach a map layer from URL base class. */
94
+ class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
95
+ static get minArgs() { return 1; }
96
+ static get maxArgs() { return 4; }
97
+ constructor(_formatId) {
98
+ super();
99
+ this._formatId = _formatId;
100
+ }
101
+ async run(url, name, userName, password) {
102
+ const source = core_frontend_1.MapLayerSource.fromJSON({ url, name: (name ? name : url), formatId: this._formatId });
103
+ if (source) {
104
+ source.userName = userName;
105
+ source.password = password;
106
+ }
107
+ this.doAttach(source);
108
+ return true;
109
+ }
110
+ async parseAndRun(...args) {
111
+ return this.run(args[0], args[1], args[2], args[3]);
112
+ }
113
+ }
114
+ /** This tool attaches a WMS map layer from a given URL.
115
+ * @beta
116
+ */
117
+ class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
118
+ constructor() { super("WMS"); }
119
+ /** This method runs the tool, attaching a WMS map layer from a given URL.
120
+ * @param args contains url, name, userName, password in array order
121
+ */
122
+ async parseAndRun(...args) {
123
+ return this.run(core_frontend_1.WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
124
+ }
125
+ }
126
+ AttachWmsMapLayerByUrlTool.toolId = "AttachWmsMapLayerTool";
127
+ exports.AttachWmsMapLayerByUrlTool = AttachWmsMapLayerByUrlTool;
128
+ /** This tool attaches a WMTS map layer from a given URL.
129
+ * @beta
130
+ */
131
+ class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
132
+ constructor() { super("WMTS"); }
133
+ /** This method runs the tool, attaching a WMTS map layer from a given URL.
134
+ * @param args contains url, name, userName, password in array order
135
+ */
136
+ async parseAndRun(...args) {
137
+ return this.run(core_frontend_1.WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
138
+ }
139
+ }
140
+ AttachWmtsMapLayerByUrlTool.toolId = "AttachWmtsMapLayerTool";
141
+ exports.AttachWmtsMapLayerByUrlTool = AttachWmtsMapLayerByUrlTool;
142
+ /** This tool attaches an ArcGIS map layer from a given URL.
143
+ * @beta
144
+ */
145
+ class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
146
+ constructor() { super("ArcGIS"); }
147
+ }
148
+ AttachArcGISMapLayerByUrlTool.toolId = "AttachArcGISMapLayerTool";
149
+ exports.AttachArcGISMapLayerByUrlTool = AttachArcGISMapLayerByUrlTool;
150
+ /** This tool attaches an ArcGIS map layer from a given URL.
151
+ * @beta
152
+ */
153
+ class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
154
+ constructor() { super("ArcGISFeature"); }
155
+ }
156
+ AttachArcGISFeatureMapLayerByUrlTool.toolId = "AttachArcGISFeatureMapLayerTool";
157
+ exports.AttachArcGISFeatureMapLayerByUrlTool = AttachArcGISFeatureMapLayerByUrlTool;
158
+ /** This tool attaches a map layer from a given tile URL.
159
+ * @beta
160
+ */
161
+ class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
162
+ constructor() { super("TileURL"); }
163
+ }
164
+ AttachTileURLMapLayerByUrlTool.toolId = "AttachTileURLMapLayerTool";
165
+ exports.AttachTileURLMapLayerByUrlTool = AttachTileURLMapLayerByUrlTool;
166
+ /** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).
167
+ * @beta
168
+ */
169
+ class AttachMapLayerTool extends AttachMapLayerBaseTool {
170
+ static get minArgs() { return 1; }
171
+ static get maxArgs() { return 1; }
172
+ /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.
173
+ * @param name the name of the map layer to add
174
+ */
175
+ async run(name) {
176
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
177
+ if (vp === undefined)
178
+ return false;
179
+ core_frontend_1.MapLayerSources.create().then((sources) => {
180
+ if (sources !== undefined) {
181
+ const source = sources.findByName(name, this._isBase);
182
+ if (source !== undefined)
183
+ this.doAttach(source);
184
+ }
185
+ }).catch((_err) => { });
186
+ return true;
187
+ }
188
+ /** Executes this tool's run method with args[0] containing `name`.
189
+ * @see [[run]]
190
+ */
191
+ async parseAndRun(...args) {
192
+ return this.run(args[0]);
193
+ }
194
+ }
195
+ AttachMapLayerTool.toolId = "AttachMapLayerTool";
196
+ exports.AttachMapLayerTool = AttachMapLayerTool;
197
+ /** This tool attaches a Overlay map layer.
198
+ * @beta
199
+ */
200
+ class AttachMapOverlayTool extends AttachMapLayerTool {
201
+ constructor() {
202
+ super();
203
+ this._isBackground = false;
204
+ }
205
+ }
206
+ AttachMapOverlayTool.toolId = "AttachMapOverlayTool";
207
+ exports.AttachMapOverlayTool = AttachMapOverlayTool;
208
+ /** Sets map layer base tool.
209
+ * @beta
210
+ */
211
+ class SetMapBaseTool extends AttachMapLayerTool {
212
+ constructor() {
213
+ super();
214
+ this._isBase = true;
215
+ }
216
+ }
217
+ SetMapBaseTool.toolId = "SetMapBaseTool";
218
+ exports.SetMapBaseTool = SetMapBaseTool;
219
+ /** Detach Map Layers Tool.
220
+ * @beta
221
+ */
222
+ class DetachMapLayersTool extends core_frontend_1.Tool {
223
+ static get minArgs() { return 0; }
224
+ static get maxArgs() { return 0; }
225
+ async parseAndRun(..._args) {
226
+ return this.run();
227
+ }
228
+ async run() {
229
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
230
+ if (vp === undefined)
231
+ return false;
232
+ vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: true });
233
+ vp.displayStyle.detachMapLayerByIndex({ index: -1, isOverlay: false });
234
+ vp.invalidateRenderPlan();
235
+ return true;
236
+ }
237
+ }
238
+ DetachMapLayersTool.toolId = "DetachMapLayersTool";
239
+ exports.DetachMapLayersTool = DetachMapLayersTool;
240
+ function parseLayerIndex(args) {
241
+ const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;
242
+ return isNaN(layerIndex) ? 0 : layerIndex;
243
+ }
244
+ /** This tool sets the visibility of the map layer.
245
+ * @beta
246
+ */
247
+ class MapLayerVisibilityTool extends core_frontend_1.Tool {
248
+ static get minArgs() { return 1; }
249
+ static get maxArgs() { return 2; }
250
+ /** This method runs the tool, setting the visibility of a map layer.
251
+ * @param layerIndex the index of the layer to change
252
+ * @param visible a boolean that should be true if the layer should be visible
253
+ */
254
+ async run(layerIndex, enable) {
255
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
256
+ if (undefined === vp || !vp.view.isSpatialView())
257
+ return false;
258
+ const mapLayer = vp.displayStyle.mapLayerAtIndex({ index: layerIndex, isOverlay: false });
259
+ if (undefined === mapLayer)
260
+ return false;
261
+ const visible = (enable === undefined) ? !mapLayer.visible : enable;
262
+ vp.displayStyle.changeMapLayerProps({ visible }, { index: layerIndex, isOverlay: false });
263
+ vp.invalidateRenderPlan();
264
+ return true;
265
+ }
266
+ /** Executes this tool's run method with args[0] containing `enable` and args[1] containing `layerIndex`.
267
+ * @see [[run]]
268
+ */
269
+ async parseAndRun(...args) {
270
+ const enable = (0, parseToggle_1.parseToggle)(args[0]);
271
+ const layerIndex = parseLayerIndex(args);
272
+ if (typeof enable !== "string")
273
+ await this.run(layerIndex, enable);
274
+ return true;
275
+ }
276
+ }
277
+ MapLayerVisibilityTool.toolId = "SetMapLayerVisibility";
278
+ exports.MapLayerVisibilityTool = MapLayerVisibilityTool;
279
+ /** This tool reorders map layers.
280
+ * @beta
281
+ */
282
+ class ReorderMapLayers extends core_frontend_1.Tool {
283
+ static get minArgs() { return 0; }
284
+ static get maxArgs() { return 2; }
285
+ /** This method runs the tool, reordering the map layers.
286
+ * @param from a numeric value specifying the layer index that is being moved
287
+ * @param from a numeric value specifying the layer index to move that layer to
288
+ */
289
+ async run(from, to) {
290
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
291
+ if (undefined === vp || !vp.view.isSpatialView())
292
+ return false;
293
+ vp.displayStyle.moveMapLayerToIndex(isNaN(from) ? 0 : from, isNaN(to) ? vp.displayStyle.settings.mapImagery.backgroundLayers.length : to, false);
294
+ vp.invalidateRenderPlan();
295
+ return true;
296
+ }
297
+ /** Executes this tool's run method with args[0] containing `from` and args[1] containing `to`.
298
+ * @see [[run]]
299
+ */
300
+ async parseAndRun(...args) {
301
+ const from = parseInt(args[0], 10);
302
+ const to = parseInt(args[1], 10);
303
+ await this.run(from, to);
304
+ return true;
305
+ }
306
+ }
307
+ ReorderMapLayers.toolId = "ReorderMapLayers";
308
+ exports.ReorderMapLayers = ReorderMapLayers;
309
+ /** This tool sets the transparency of a map layer.
310
+ * @beta
311
+ */
312
+ class MapLayerTransparencyTool extends core_frontend_1.Tool {
313
+ static get minArgs() { return 1; }
314
+ static get maxArgs() { return 2; }
315
+ /** This method runs the tool, setting the transparency of a map layer.
316
+ * @param layerIndex the index of the layer to change
317
+ * @param transparency a numeric value in the range 0.0 (fully opaque) to 1.0 (fully transparent)
318
+ */
319
+ async run(layerIndex, transparency) {
320
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
321
+ if (undefined === vp || !vp.view.isSpatialView())
322
+ return false;
323
+ vp.displayStyle.changeMapLayerProps({ transparency }, { index: layerIndex, isOverlay: false });
324
+ vp.invalidateRenderPlan();
325
+ return true;
326
+ }
327
+ /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.
328
+ * @see [[run]]
329
+ */
330
+ async parseAndRun(...args) {
331
+ const transparency = parseFloat(args[0]);
332
+ const layerIndex = parseLayerIndex(args);
333
+ if (transparency >= 0 && transparency <= 1)
334
+ await this.run(layerIndex, transparency);
335
+ return true;
336
+ }
337
+ }
338
+ MapLayerTransparencyTool.toolId = "SetMapLayerTransparency";
339
+ exports.MapLayerTransparencyTool = MapLayerTransparencyTool;
340
+ /** This tool sets the visibility of the map sublayer.
341
+ * @beta
342
+ */
343
+ class MapLayerSubLayerVisibilityTool extends core_frontend_1.Tool {
344
+ static get minArgs() { return 1; }
345
+ static get maxArgs() { return 2; }
346
+ /** This method runs the tool, setting the visibility of a map sublayer.
347
+ * @param layerIndex the index of the layer to change
348
+ * @param visible a boolean that should be true if the sublayer should be visible
349
+ */
350
+ async run(layerIndex, visible) {
351
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
352
+ if (undefined === vp || !vp.view.isSpatialView())
353
+ return false;
354
+ vp.displayStyle.changeMapSubLayerProps({ visible }, -1, { index: layerIndex, isOverlay: false });
355
+ vp.invalidateRenderPlan();
356
+ return true;
357
+ }
358
+ /** Executes this tool's run method with args[0] containing `transparency` and args[1] containing `layerIndex`.
359
+ * @see [[run]]
360
+ */
361
+ async parseAndRun(...args) {
362
+ const on = args[0] !== "off";
363
+ const layerIndex = parseLayerIndex(args);
364
+ await this.run(layerIndex, on);
365
+ return true;
366
+ }
367
+ }
368
+ MapLayerSubLayerVisibilityTool.toolId = "SetMapSubLayerVisibility";
369
+ exports.MapLayerSubLayerVisibilityTool = MapLayerSubLayerVisibilityTool;
370
+ /** This tool changes the viewport so it is zoomed to the range of a map layer.
371
+ * @beta
372
+ */
373
+ class MapLayerZoomTool extends core_frontend_1.Tool {
374
+ static get minArgs() { return 0; }
375
+ static get maxArgs() { return 1; }
376
+ /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.
377
+ * @param layerIndex the index of the layer whose range to zoom to
378
+ */
379
+ async run(layerIndex) {
380
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
381
+ if (undefined === vp || !vp.view.isSpatialView())
382
+ return false;
383
+ vp.viewMapLayerRange({ index: layerIndex, isOverlay: false }, vp).then(() => { }).catch(() => { });
384
+ return true;
385
+ }
386
+ /** Executes this tool's run method with args[0] containing `layerIndex`.
387
+ * @see [[run]]
388
+ */
389
+ async parseAndRun(...args) {
390
+ const layerIndex = parseLayerIndex(args);
391
+ await this.run(layerIndex);
392
+ return true;
393
+ }
394
+ }
395
+ MapLayerZoomTool.toolId = "MapLayerZoom";
396
+ exports.MapLayerZoomTool = MapLayerZoomTool;
397
+ /** This tool toggles whether to apply terrain heights to the map.
398
+ * @beta
399
+ */
400
+ class ToggleTerrainTool extends core_frontend_1.Tool {
401
+ static get minArgs() { return 0; }
402
+ static get maxArgs() { return 1; }
403
+ /** This method runs the tool, changing whether to apply terrain heights to the map.
404
+ * @param enable whether or not to enable terrain heights on the map
405
+ */
406
+ async run(enable) {
407
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
408
+ if (undefined === vp || !vp.view.isSpatialView())
409
+ return false;
410
+ const applyTerrain = (enable === undefined) ? !vp.displayStyle.backgroundMapSettings.applyTerrain : enable;
411
+ vp.displayStyle.changeBackgroundMapProps({ applyTerrain });
412
+ vp.invalidateRenderPlan();
413
+ return true;
414
+ }
415
+ /** Executes this tool's run method with args[0] containing `enable`.
416
+ * @see [[run]]
417
+ */
418
+ async parseAndRun(...args) {
419
+ const enable = (0, parseToggle_1.parseToggle)(args[0]);
420
+ if (typeof enable !== "string")
421
+ await this.run(enable);
422
+ return true;
423
+ }
424
+ }
425
+ ToggleTerrainTool.toolId = "ToggleTerrain";
426
+ exports.ToggleTerrainTool = ToggleTerrainTool;
427
+ /** This tool changes the color of the base map.
428
+ * @beta
429
+ */
430
+ class MapBaseColorTool extends core_frontend_1.Tool {
431
+ static get minArgs() { return 3; }
432
+ static get maxArgs() { return 3; }
433
+ /** This method runs the tool, changing the color of the base map.
434
+ * @param color the color for the base map
435
+ */
436
+ async run(color) {
437
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
438
+ if (undefined === vp || !vp.view.isSpatialView())
439
+ return false;
440
+ const curTransparency = vp.displayStyle.backgroundMapBase instanceof core_common_1.ColorDef ? vp.displayStyle.backgroundMapBase.getTransparency() : 0;
441
+ vp.displayStyle.backgroundMapBase = color.withTransparency(curTransparency);
442
+ vp.invalidateRenderPlan();
443
+ return true;
444
+ }
445
+ /** Executes this tool's run method with args[0] containing a 0 to 255 red component, args[1] containing a 0 to 255 green component, and args[2] containing a 0 to 255 blue component.
446
+ * These rgb values will be used to construct the `color` parameter passed to this tool's run method.
447
+ * @see [[run]]
448
+ */
449
+ async parseAndRun(...args) {
450
+ const red = parseFloat(args[0]), green = parseFloat(args[1]), blue = parseFloat(args[2]);
451
+ return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(core_common_1.ColorDef.from(red, green, blue));
452
+ }
453
+ }
454
+ MapBaseColorTool.toolId = "SetMapBaseColorTool";
455
+ exports.MapBaseColorTool = MapBaseColorTool;
456
+ /** This tool changes the transparency of the base map.
457
+ * @beta
458
+ */
459
+ class MapBaseTransparencyTool extends core_frontend_1.Tool {
460
+ static get minArgs() { return 1; }
461
+ static get maxArgs() { return 1; }
462
+ /** This method runs the tool, changing the transparency of the base map.
463
+ * @param transparency a numeric value in range 0.0 to 1.0 whether 0.0 means fully opaque and 1.0 means fully transparent
464
+ */
465
+ async run(transparency) {
466
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
467
+ if (undefined === vp || !vp.view.isSpatialView())
468
+ return false;
469
+ vp.displayStyle.changeBaseMapTransparency(transparency);
470
+ vp.invalidateRenderPlan();
471
+ return true;
472
+ }
473
+ /** Executes this tool's run method with args[0] containing `transparency`.
474
+ * @see [[run]]
475
+ */
476
+ async parseAndRun(...args) {
477
+ const transparency = parseFloat(args[0]);
478
+ return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);
479
+ }
480
+ }
481
+ MapBaseTransparencyTool.toolId = "SetMapBaseTransparencyTool";
482
+ exports.MapBaseTransparencyTool = MapBaseTransparencyTool;
483
+ /** This tool changes the visibility of the base map.
484
+ * @beta
485
+ */
486
+ class MapBaseVisibilityTool extends core_frontend_1.Tool {
487
+ static get minArgs() { return 1; }
488
+ static get maxArgs() { return 1; }
489
+ /** This method runs the tool, changing the visibility of the base map.
490
+ * @param visible a boolean which specifies whether or not to make the base map visible
491
+ */
492
+ async run(visible) {
493
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
494
+ if (undefined === vp || !vp.view.isSpatialView() || vp.displayStyle.backgroundMapBase instanceof core_common_1.ColorDef)
495
+ return false;
496
+ vp.displayStyle.backgroundMapBase = vp.displayStyle.backgroundMapBase.clone({ visible });
497
+ vp.invalidateRenderPlan();
498
+ return true;
499
+ }
500
+ /** Executes this tool's run method with args[0] containing `visible`.
501
+ * @see [[run]]
502
+ */
503
+ async parseAndRun(...args) {
504
+ const visible = (0, parseBoolean_1.parseBoolean)(args[0]);
505
+ return (visible !== undefined ? this.run(visible) : false);
506
+ }
507
+ }
508
+ MapBaseVisibilityTool.toolId = "SetMapBaseVisibilityTool";
509
+ exports.MapBaseVisibilityTool = MapBaseVisibilityTool;
508
510
  //# sourceMappingURL=MapLayerTool.js.map