@itwin/frontend-devtools 4.0.0-dev.7 → 4.0.0-dev.70

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