@itwin/frontend-devtools 3.5.0-dev.18 → 3.5.0-dev.19

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