@itwin/frontend-devtools 3.4.0-dev.50 → 3.4.0-dev.56

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