@itwin/frontend-devtools 4.0.0-dev.8 → 4.0.0-dev.80

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