@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,493 +1,512 @@
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
- /** @packageDocumentation
6
- * @module Tools
7
- */
8
- import { BeDuration } from "@itwin/core-bentley";
9
- import { ColorDef, Hilite } from "@itwin/core-common";
10
- import { DrawingViewState, FlashMode, FlashSettings, IModelApp, TileBoundingBoxes, Tool, } from "@itwin/core-frontend";
11
- import { parseArgs } from "./parseArgs";
12
- import { parseToggle } from "./parseToggle";
13
- /** Base class for a tool that toggles some aspect of a Viewport.
14
- * @beta
15
- */
16
- export class ViewportToggleTool extends Tool {
17
- static get minArgs() { return 0; }
18
- static get maxArgs() { return 1; }
19
- async run(enable) {
20
- const vp = IModelApp.viewManager.selectedView;
21
- if (undefined !== vp)
22
- await this.toggle(vp, enable);
23
- return true;
24
- }
25
- async parseAndRun(...args) {
26
- const enable = parseToggle(args[0]);
27
- if (typeof enable !== "string")
28
- await this.run(enable);
29
- return true;
30
- }
31
- }
32
- /** Freeze or unfreeze the scene for the selected viewport. While the scene is frozen, no new tiles will be selected for drawing within the viewport.
33
- * @beta
34
- */
35
- export class FreezeSceneTool extends ViewportToggleTool {
36
- async toggle(vp, enable) {
37
- if (undefined === enable || enable !== vp.freezeScene)
38
- vp.freezeScene = !vp.freezeScene;
39
- return Promise.resolve();
40
- }
41
- }
42
- FreezeSceneTool.toolId = "FreezeScene";
43
- const boundingVolumeNames = [
44
- "none",
45
- "volume",
46
- "content",
47
- "both",
48
- "children",
49
- "sphere",
50
- ];
51
- /** Set the tile bounding volume decorations to display in the selected viewport.
52
- * Omitting the argument turns on Volume bounding boxes if bounding boxes are currently off; otherwise, toggles them off.
53
- * Allowed inputs are "none", "volume", "content", "both" (volume and content), "children", and "sphere".
54
- * @beta
55
- */
56
- export class ShowTileVolumesTool extends Tool {
57
- static get minArgs() { return 0; }
58
- static get maxArgs() { return 1; }
59
- async run(boxes) {
60
- const vp = IModelApp.viewManager.selectedView;
61
- if (undefined === vp)
62
- return true;
63
- if (undefined === boxes)
64
- boxes = TileBoundingBoxes.None === vp.debugBoundingBoxes ? TileBoundingBoxes.Volume : TileBoundingBoxes.None;
65
- vp.debugBoundingBoxes = boxes;
66
- return true;
67
- }
68
- async parseAndRun(...args) {
69
- let boxes;
70
- if (0 !== args.length) {
71
- const arg = args[0].toLowerCase();
72
- for (let i = 0; i < boundingVolumeNames.length; i++) {
73
- if (arg === boundingVolumeNames[i]) {
74
- boxes = i;
75
- break;
76
- }
77
- }
78
- if (undefined === boxes)
79
- return true;
80
- }
81
- return this.run(boxes);
82
- }
83
- }
84
- ShowTileVolumesTool.toolId = "ShowTileVolumes";
85
- /** Sets or unsets or flips the deactivated state of one or more tile tree references within the selected viewport.
86
- * Deactivated tile tree references are omitted from the scene.
87
- * This is useful for isolating particular tile trees or tiles for debugging.
88
- * @beta
89
- */
90
- export class ToggleTileTreeReferencesTool extends Tool {
91
- static get minArgs() { return 1; }
92
- static get maxArgs() { return 3; }
93
- async parseAndRun(...args) {
94
- const which = args[0].toLowerCase();
95
- switch (which) {
96
- case "all":
97
- case "animated":
98
- case "primary":
99
- case "section":
100
- this._which = which;
101
- break;
102
- default:
103
- this._which = which.split(",").map((x) => Number.parseInt(x, 10)).filter((x) => !Number.isNaN(x));
104
- }
105
- let modelIds = args[2];
106
- let deactivate = parseToggle(args[1]);
107
- if (typeof deactivate !== "string") {
108
- if (typeof deactivate === "boolean")
109
- deactivate = !deactivate;
110
- this._deactivate = deactivate;
111
- }
112
- else {
113
- modelIds = args[1];
114
- }
115
- if (modelIds)
116
- this._modelIds = modelIds.toLowerCase().split(",");
117
- return this.run();
118
- }
119
- async run() {
120
- const vp = IModelApp.viewManager.selectedView;
121
- if (!vp || !this._which || !vp.view.isSpatialView())
122
- return false;
123
- vp.view.setTileTreeReferencesDeactivated(this._modelIds, this._deactivate, this._which);
124
- vp.invalidateScene();
125
- return true;
126
- }
127
- }
128
- ToggleTileTreeReferencesTool.toolId = "ToggleTileTreeReferences";
129
- /** This tool sets the aspect ratio skew for the selected viewport.
130
- * @beta
131
- */
132
- export class SetAspectRatioSkewTool extends Tool {
133
- static get minArgs() { return 0; }
134
- static get maxArgs() { return 1; }
135
- /** This method runs the tool, setting the aspect ratio skew for the selected viewport.
136
- * @param skew the aspect ratio (x/y) skew value; 1.0 or undefined removes any skew
137
- */
138
- async run(skew) {
139
- if (undefined === skew)
140
- skew = 1.0;
141
- const vp = IModelApp.viewManager.selectedView;
142
- if (undefined !== vp) {
143
- vp.view.setAspectRatioSkew(skew);
144
- vp.synchWithView();
145
- }
146
- return true;
147
- }
148
- /** Executes this tool's run method.
149
- * @param args the first entry of this array contains the `skew` argument
150
- * @see [[run]]
151
- */
152
- async parseAndRun(...args) {
153
- const skew = args.length > 0 ? parseFloat(args[0]) : 1.0;
154
- return !Number.isNaN(skew) && this.run(skew);
155
- }
156
- }
157
- SetAspectRatioSkewTool.toolId = "SetAspectRatioSkew";
158
- /** Changes the [ModelSubCategoryHiliteMode]($frontend) for the [HiliteSet]($frontend) associated with the selected Viewport.
159
- * @beta
160
- */
161
- export class ChangeHiliteModeTool extends Tool {
162
- static get minArgs() { return 1; }
163
- static get maxArgs() { return 1; }
164
- async run(mode) {
165
- var _a;
166
- const hilites = (_a = IModelApp.viewManager.selectedView) === null || _a === void 0 ? void 0 : _a.iModel.hilited;
167
- if (!hilites)
168
- return false;
169
- if (mode === "union" || mode === "intersection")
170
- hilites.modelSubCategoryMode = mode;
171
- return true;
172
- }
173
- async parseAndRun(...args) {
174
- return this.run(args[0]);
175
- }
176
- }
177
- ChangeHiliteModeTool.toolId = "ChangeHiliteMode";
178
- /** Changes the selected viewport's hilite or emphasis settings.
179
- * @beta
180
- */
181
- export class ChangeHiliteTool extends Tool {
182
- static get minArgs() { return 0; }
183
- static get maxArgs() { return 6; }
184
- async run(settings) {
185
- const vp = IModelApp.viewManager.selectedView;
186
- if (undefined !== vp)
187
- this.apply(vp, settings);
188
- return true;
189
- }
190
- async parseAndRun(...inputArgs) {
191
- if (0 === inputArgs.length)
192
- return this.run();
193
- const vp = IModelApp.viewManager.selectedView;
194
- if (undefined === vp)
195
- return true;
196
- const cur = this.getCurrentSettings(vp);
197
- const colors = cur.color.colors;
198
- let visible = cur.visibleRatio;
199
- let hidden = cur.hiddenRatio;
200
- let silhouette = cur.silhouette;
201
- const args = parseArgs(inputArgs);
202
- const parseColorComponent = (c) => {
203
- const num = args.getInteger(c);
204
- if (undefined !== num)
205
- colors[c] = Math.floor(Math.max(0, Math.min(255, num)));
206
- };
207
- parseColorComponent("r");
208
- parseColorComponent("g");
209
- parseColorComponent("b");
210
- const silhouetteArg = args.getInteger("s");
211
- if (undefined !== silhouetteArg && silhouetteArg >= Hilite.Silhouette.None && silhouetteArg <= Hilite.Silhouette.Thick)
212
- silhouette = silhouetteArg;
213
- const v = args.getFloat("v");
214
- if (undefined !== v && v >= 0 && v <= 1)
215
- visible = v;
216
- const h = args.getFloat("h");
217
- if (undefined !== h && h >= 0 && h <= 1)
218
- hidden = h;
219
- if (undefined === silhouette)
220
- silhouette = cur.silhouette;
221
- if (undefined === visible)
222
- visible = cur.visibleRatio;
223
- if (undefined === hidden)
224
- hidden = cur.hiddenRatio;
225
- const settings = {
226
- color: ColorDef.from(colors.r, colors.g, colors.b),
227
- silhouette,
228
- visibleRatio: visible,
229
- hiddenRatio: hidden,
230
- };
231
- return this.run(settings);
232
- }
233
- }
234
- /** Changes the selected viewport's hilite settings, or resets to defaults.
235
- * @beta
236
- */
237
- export class ChangeHiliteSettingsTool extends ChangeHiliteTool {
238
- getCurrentSettings(vp) { return vp.hilite; }
239
- apply(vp, settings) {
240
- vp.hilite = undefined !== settings ? settings : new Hilite.Settings();
241
- }
242
- }
243
- ChangeHiliteSettingsTool.toolId = "ChangeHiliteSettings";
244
- /** Changes the selected viewport's emphasis settings.
245
- * @beta
246
- */
247
- export class ChangeEmphasisSettingsTool extends ChangeHiliteTool {
248
- getCurrentSettings(vp) { return vp.emphasisSettings; }
249
- apply(vp, settings) {
250
- if (undefined !== settings)
251
- vp.emphasisSettings = settings;
252
- }
253
- }
254
- ChangeEmphasisSettingsTool.toolId = "ChangeEmphasisSettings";
255
- /** Changes the [FlashSettings]($frontend) for the selected [Viewport]($frontend).
256
- * @beta
257
- */
258
- export class ChangeFlashSettingsTool extends Tool {
259
- static get minArgs() { return 0; }
260
- static get maxArgs() { return 3; }
261
- async run(settings) {
262
- const vp = IModelApp.viewManager.selectedView;
263
- if (vp)
264
- vp.flashSettings = settings !== null && settings !== void 0 ? settings : new FlashSettings();
265
- return true;
266
- }
267
- async parseAndRun(...inputArgs) {
268
- const vp = IModelApp.viewManager.selectedView;
269
- if (!vp)
270
- return true;
271
- if (1 === inputArgs.length && "default" === inputArgs[0].toLowerCase())
272
- return this.run();
273
- const options = {};
274
- const args = parseArgs(inputArgs);
275
- const intensity = args.getFloat("i");
276
- if (undefined !== intensity)
277
- options.maxIntensity = intensity;
278
- const mode = args.get("m");
279
- if (mode) {
280
- switch (mode[0].toLowerCase()) {
281
- case "b":
282
- options.litMode = FlashMode.Brighten;
283
- break;
284
- case "h":
285
- options.litMode = FlashMode.Hilite;
286
- break;
287
- default:
288
- return false;
289
- }
290
- }
291
- const duration = args.getFloat("d");
292
- if (undefined !== duration)
293
- options.duration = BeDuration.fromSeconds(duration);
294
- return this.run(vp.flashSettings.clone(options));
295
- }
296
- }
297
- ChangeFlashSettingsTool.toolId = "ChangeFlashSettings";
298
- /** Enables or disables fade-out transparency mode for the selected viewport.
299
- * @beta
300
- */
301
- export class FadeOutTool extends ViewportToggleTool {
302
- async toggle(vp, enable) {
303
- if (undefined === enable || enable !== vp.isFadeOutActive)
304
- vp.isFadeOutActive = !vp.isFadeOutActive;
305
- return Promise.resolve();
306
- }
307
- }
308
- FadeOutTool.toolId = "FadeOut";
309
- /** Sets the default tile size modifier used for all viewports that don't explicitly override it.
310
- * @beta
311
- */
312
- export class DefaultTileSizeModifierTool extends Tool {
313
- static get minArgs() { return 1; }
314
- static get maxArgs() { return 1; }
315
- /** This method runs the tool, setting the default tile size modifier used for all viewports that don't explicitly override it.
316
- * @param modifier the tile size modifier to use; if undefined, do not set modifier
317
- */
318
- async run(modifier) {
319
- if (undefined !== modifier)
320
- IModelApp.tileAdmin.defaultTileSizeModifier = modifier;
321
- return true;
322
- }
323
- /** Executes this tool's run method with args[0] containing `modifier`.
324
- * @see [[run]]
325
- */
326
- async parseAndRun(...args) {
327
- return this.run(Number.parseFloat(args[0]));
328
- }
329
- }
330
- DefaultTileSizeModifierTool.toolId = "DefaultTileSizeMod";
331
- /** Sets or clears the tile size modifier override for the selected viewport.
332
- * @beta
333
- */
334
- export class ViewportTileSizeModifierTool extends Tool {
335
- static get minArgs() { return 1; }
336
- static get maxArgs() { return 1; }
337
- /** This method runs the tool, setting the tile size modifier used for the selected viewport.
338
- * @param modifier the tile size modifier to use; if undefined, reset the modifier
339
- */
340
- async run(modifier) {
341
- const vp = IModelApp.viewManager.selectedView;
342
- if (undefined !== vp)
343
- vp.setTileSizeModifier(modifier);
344
- return true;
345
- }
346
- /** Executes this tool's run method with args[0] containing the `modifier` argument or the string "reset" in order to reset the modifier.
347
- * @see [[run]]
348
- */
349
- async parseAndRun(...args) {
350
- const arg = args[0].toLowerCase();
351
- const modifier = "reset" === arg ? undefined : Number.parseFloat(args[0]);
352
- return this.run(modifier);
353
- }
354
- }
355
- ViewportTileSizeModifierTool.toolId = "ViewportTileSizeMod";
356
- /** This tool adds a reality model to the viewport.
357
- * @beta
358
- */
359
- export class ViewportAddRealityModel extends Tool {
360
- static get minArgs() { return 1; }
361
- static get maxArgs() { return 1; }
362
- /** This method runs the tool, adding a reality model to the viewport
363
- * @param url the URL which points to the reality model tileset
364
- */
365
- async run(url) {
366
- const vp = IModelApp.viewManager.selectedView;
367
- if (undefined !== vp)
368
- vp.displayStyle.attachRealityModel({ tilesetUrl: url });
369
- return true;
370
- }
371
- /** Executes this tool's run method with args[0] containing the `url` argument.
372
- * @see [[run]]
373
- */
374
- async parseAndRun(...args) {
375
- return this.run(args[0]);
376
- }
377
- }
378
- ViewportAddRealityModel.toolId = "ViewportAddRealityModel";
379
- /** Changes the `allow3dManipulations` flag for the selected viewport if the viewport is displaying a `ViewState3d`.
380
- * @beta
381
- */
382
- export class Toggle3dManipulationsTool extends ViewportToggleTool {
383
- async toggle(vp, allow) {
384
- if (!vp.view.is3d())
385
- return Promise.resolve();
386
- if (undefined === allow)
387
- allow = !vp.view.allow3dManipulations();
388
- if (allow !== vp.view.allow3dManipulations()) {
389
- vp.view.setAllow3dManipulations(allow);
390
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
391
- IModelApp.toolAdmin.startDefaultTool();
392
- }
393
- return Promise.resolve();
394
- }
395
- }
396
- Toggle3dManipulationsTool.toolId = "Toggle3dManipulations";
397
- /** Toggles display of view attachments in sheet views.
398
- * @beta
399
- */
400
- export class ToggleViewAttachmentsTool extends ViewportToggleTool {
401
- async toggle(vp, enable) {
402
- if (undefined === enable || enable !== vp.wantViewAttachments)
403
- vp.wantViewAttachments = !vp.wantViewAttachments;
404
- return Promise.resolve();
405
- }
406
- }
407
- ToggleViewAttachmentsTool.toolId = "ToggleViewAttachments";
408
- /** Toggle display of view attachment boundaries in sheet views.
409
- * @beta
410
- */
411
- export class ToggleViewAttachmentBoundariesTool extends ViewportToggleTool {
412
- async toggle(vp, enable) {
413
- if (undefined === enable || enable !== vp.wantViewAttachmentBoundaries)
414
- vp.wantViewAttachmentBoundaries = !vp.wantViewAttachmentBoundaries;
415
- return Promise.resolve();
416
- }
417
- }
418
- ToggleViewAttachmentBoundariesTool.toolId = "ToggleViewAttachmentBoundaries";
419
- /** Toggle display of view attachment clip shapes in sheet views.
420
- * @beta
421
- */
422
- export class ToggleViewAttachmentClipShapesTool extends ViewportToggleTool {
423
- async toggle(vp, enable) {
424
- if (undefined === enable || enable !== vp.wantViewAttachmentClipShapes)
425
- vp.wantViewAttachmentClipShapes = !vp.wantViewAttachmentClipShapes;
426
- return Promise.resolve();
427
- }
428
- }
429
- ToggleViewAttachmentClipShapesTool.toolId = "ToggleViewAttachmentClipShapes";
430
- /** Toggles display of 2d graphics in a [DrawingViewState]($frontend). This setting affects all drawing views until it is reset.
431
- * @beta
432
- */
433
- export class ToggleDrawingGraphicsTool extends ViewportToggleTool {
434
- async toggle(vp, enable) {
435
- if (undefined === enable || enable !== DrawingViewState.hideDrawingGraphics) {
436
- DrawingViewState.hideDrawingGraphics = !DrawingViewState.hideDrawingGraphics;
437
- vp.invalidateScene();
438
- }
439
- return Promise.resolve();
440
- }
441
- }
442
- ToggleDrawingGraphicsTool.toolId = "ToggleDrawingGraphics";
443
- /** Toggles whether a [SectionDrawing]($backend)'s spatial view is always displayed along with the 2d graphics by a [DrawingViewState]($frontend), even
444
- * if it otherwise would not be. This setting affects all section drawing views until it is reset.
445
- * @beta
446
- */
447
- export class ToggleSectionDrawingSpatialViewTool extends ViewportToggleTool {
448
- async toggle(vp, enable) {
449
- if (undefined === enable || enable !== DrawingViewState.alwaysDisplaySpatialView) {
450
- DrawingViewState.alwaysDisplaySpatialView = !DrawingViewState.alwaysDisplaySpatialView;
451
- if (vp.view instanceof DrawingViewState) {
452
- // Force the view to update its section drawing attachment.
453
- const view = vp.view.clone();
454
- await view.changeViewedModel(view.baseModelId);
455
- await view.load();
456
- vp.changeView(view);
457
- }
458
- }
459
- }
460
- }
461
- ToggleSectionDrawingSpatialViewTool.toolId = "ToggleSectionDrawingSpatialView";
462
- /** Change the camera settings of the selected viewport.
463
- * @beta
464
- */
465
- export class ChangeCameraTool extends Tool {
466
- static get minArgs() { return 1; }
467
- static get maxArgs() { return 2; }
468
- async run(camera) {
469
- const vp = IModelApp.viewManager.selectedView;
470
- if (camera && vp && vp.view.is3d()) {
471
- const view = vp.view.clone();
472
- view.camera.setFrom(camera);
473
- vp.changeView(view);
474
- }
475
- return true;
476
- }
477
- async parseAndRun(...inArgs) {
478
- const vp = IModelApp.viewManager.selectedView;
479
- if (!vp || !vp.view.is3d())
480
- return false;
481
- const camera = vp.view.camera.clone();
482
- const args = parseArgs(inArgs);
483
- const lens = args.getFloat("l");
484
- if (undefined !== lens)
485
- camera.lens.setDegrees(lens);
486
- const focusDist = args.getFloat("d");
487
- if (undefined !== focusDist)
488
- camera.focusDist = focusDist;
489
- return this.run(camera);
490
- }
491
- }
492
- ChangeCameraTool.toolId = "ChangeCamera";
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
+ /** @packageDocumentation
6
+ * @module Tools
7
+ */
8
+ import { BeDuration } from "@itwin/core-bentley";
9
+ import { ColorDef, Hilite } from "@itwin/core-common";
10
+ import { DrawingViewState, FlashMode, FlashSettings, IModelApp, TileBoundingBoxes, Tool, } from "@itwin/core-frontend";
11
+ import { parseArgs } from "./parseArgs";
12
+ import { parseToggle } from "./parseToggle";
13
+ /** Base class for a tool that toggles some aspect of a Viewport.
14
+ * @beta
15
+ */
16
+ export class ViewportToggleTool extends Tool {
17
+ static get minArgs() { return 0; }
18
+ static get maxArgs() { return 1; }
19
+ async run(enable) {
20
+ const vp = IModelApp.viewManager.selectedView;
21
+ if (undefined !== vp)
22
+ await this.toggle(vp, enable);
23
+ return true;
24
+ }
25
+ async parseAndRun(...args) {
26
+ const enable = parseToggle(args[0]);
27
+ if (typeof enable !== "string")
28
+ await this.run(enable);
29
+ return true;
30
+ }
31
+ }
32
+ /** Freeze or unfreeze the scene for the selected viewport. While the scene is frozen, no new tiles will be selected for drawing within the viewport.
33
+ * @beta
34
+ */
35
+ class FreezeSceneTool extends ViewportToggleTool {
36
+ async toggle(vp, enable) {
37
+ if (undefined === enable || enable !== vp.freezeScene)
38
+ vp.freezeScene = !vp.freezeScene;
39
+ return Promise.resolve();
40
+ }
41
+ }
42
+ FreezeSceneTool.toolId = "FreezeScene";
43
+ export { FreezeSceneTool };
44
+ const boundingVolumeNames = [
45
+ "none",
46
+ "volume",
47
+ "content",
48
+ "both",
49
+ "children",
50
+ "sphere",
51
+ "solid",
52
+ ];
53
+ /** Set the tile bounding volume decorations to display in the selected viewport.
54
+ * Omitting the argument turns on Volume bounding boxes if bounding boxes are currently off; otherwise, toggles them off.
55
+ * Allowed inputs are "none", "volume", "content", "both" (volume and content), "children", and "sphere".
56
+ * @beta
57
+ */
58
+ class ShowTileVolumesTool extends Tool {
59
+ static get minArgs() { return 0; }
60
+ static get maxArgs() { return 1; }
61
+ async run(boxes) {
62
+ const vp = IModelApp.viewManager.selectedView;
63
+ if (undefined === vp)
64
+ return true;
65
+ if (undefined === boxes)
66
+ boxes = TileBoundingBoxes.None === vp.debugBoundingBoxes ? TileBoundingBoxes.Volume : TileBoundingBoxes.None;
67
+ vp.debugBoundingBoxes = boxes;
68
+ return true;
69
+ }
70
+ async parseAndRun(...args) {
71
+ let boxes;
72
+ if (0 !== args.length) {
73
+ const arg = args[0].toLowerCase();
74
+ for (let i = 0; i < boundingVolumeNames.length; i++) {
75
+ if (arg === boundingVolumeNames[i]) {
76
+ boxes = i;
77
+ break;
78
+ }
79
+ }
80
+ if (undefined === boxes)
81
+ return true;
82
+ }
83
+ return this.run(boxes);
84
+ }
85
+ }
86
+ ShowTileVolumesTool.toolId = "ShowTileVolumes";
87
+ export { ShowTileVolumesTool };
88
+ /** Sets or unsets or flips the deactivated state of one or more tile tree references within the selected viewport.
89
+ * Deactivated tile tree references are omitted from the scene.
90
+ * This is useful for isolating particular tile trees or tiles for debugging.
91
+ * @beta
92
+ */
93
+ class ToggleTileTreeReferencesTool extends Tool {
94
+ static get minArgs() { return 1; }
95
+ static get maxArgs() { return 3; }
96
+ async parseAndRun(...args) {
97
+ const which = args[0].toLowerCase();
98
+ switch (which) {
99
+ case "all":
100
+ case "animated":
101
+ case "primary":
102
+ case "section":
103
+ this._which = which;
104
+ break;
105
+ default:
106
+ this._which = which.split(",").map((x) => Number.parseInt(x, 10)).filter((x) => !Number.isNaN(x));
107
+ }
108
+ let modelIds = args[2];
109
+ let deactivate = parseToggle(args[1]);
110
+ if (typeof deactivate !== "string") {
111
+ if (typeof deactivate === "boolean")
112
+ deactivate = !deactivate;
113
+ this._deactivate = deactivate;
114
+ }
115
+ else {
116
+ modelIds = args[1];
117
+ }
118
+ if (modelIds)
119
+ this._modelIds = modelIds.toLowerCase().split(",");
120
+ return this.run();
121
+ }
122
+ async run() {
123
+ const vp = IModelApp.viewManager.selectedView;
124
+ if (!vp || !this._which || !vp.view.isSpatialView())
125
+ return false;
126
+ vp.view.setTileTreeReferencesDeactivated(this._modelIds, this._deactivate, this._which);
127
+ vp.invalidateScene();
128
+ return true;
129
+ }
130
+ }
131
+ ToggleTileTreeReferencesTool.toolId = "ToggleTileTreeReferences";
132
+ export { ToggleTileTreeReferencesTool };
133
+ /** This tool sets the aspect ratio skew for the selected viewport.
134
+ * @beta
135
+ */
136
+ class SetAspectRatioSkewTool extends Tool {
137
+ static get minArgs() { return 0; }
138
+ static get maxArgs() { return 1; }
139
+ /** This method runs the tool, setting the aspect ratio skew for the selected viewport.
140
+ * @param skew the aspect ratio (x/y) skew value; 1.0 or undefined removes any skew
141
+ */
142
+ async run(skew) {
143
+ if (undefined === skew)
144
+ skew = 1.0;
145
+ const vp = IModelApp.viewManager.selectedView;
146
+ if (undefined !== vp) {
147
+ vp.view.setAspectRatioSkew(skew);
148
+ vp.synchWithView();
149
+ }
150
+ return true;
151
+ }
152
+ /** Executes this tool's run method.
153
+ * @param args the first entry of this array contains the `skew` argument
154
+ * @see [[run]]
155
+ */
156
+ async parseAndRun(...args) {
157
+ const skew = args.length > 0 ? parseFloat(args[0]) : 1.0;
158
+ return !Number.isNaN(skew) && this.run(skew);
159
+ }
160
+ }
161
+ SetAspectRatioSkewTool.toolId = "SetAspectRatioSkew";
162
+ export { SetAspectRatioSkewTool };
163
+ /** Changes the [ModelSubCategoryHiliteMode]($frontend) for the [HiliteSet]($frontend) associated with the selected Viewport.
164
+ * @beta
165
+ */
166
+ class ChangeHiliteModeTool extends Tool {
167
+ static get minArgs() { return 1; }
168
+ static get maxArgs() { return 1; }
169
+ async run(mode) {
170
+ const hilites = IModelApp.viewManager.selectedView?.iModel.hilited;
171
+ if (!hilites)
172
+ return false;
173
+ if (mode === "union" || mode === "intersection")
174
+ hilites.modelSubCategoryMode = mode;
175
+ return true;
176
+ }
177
+ async parseAndRun(...args) {
178
+ return this.run(args[0]);
179
+ }
180
+ }
181
+ ChangeHiliteModeTool.toolId = "ChangeHiliteMode";
182
+ export { ChangeHiliteModeTool };
183
+ /** Changes the selected viewport's hilite or emphasis settings.
184
+ * @beta
185
+ */
186
+ export class ChangeHiliteTool extends Tool {
187
+ static get minArgs() { return 0; }
188
+ static get maxArgs() { return 6; }
189
+ async run(settings) {
190
+ const vp = IModelApp.viewManager.selectedView;
191
+ if (undefined !== vp)
192
+ this.apply(vp, settings);
193
+ return true;
194
+ }
195
+ async parseAndRun(...inputArgs) {
196
+ if (0 === inputArgs.length)
197
+ return this.run();
198
+ const vp = IModelApp.viewManager.selectedView;
199
+ if (undefined === vp)
200
+ return true;
201
+ const cur = this.getCurrentSettings(vp);
202
+ const colors = cur.color.colors;
203
+ let visible = cur.visibleRatio;
204
+ let hidden = cur.hiddenRatio;
205
+ let silhouette = cur.silhouette;
206
+ const args = parseArgs(inputArgs);
207
+ const parseColorComponent = (c) => {
208
+ const num = args.getInteger(c);
209
+ if (undefined !== num)
210
+ colors[c] = Math.floor(Math.max(0, Math.min(255, num)));
211
+ };
212
+ parseColorComponent("r");
213
+ parseColorComponent("g");
214
+ parseColorComponent("b");
215
+ const silhouetteArg = args.getInteger("s");
216
+ if (undefined !== silhouetteArg && silhouetteArg >= Hilite.Silhouette.None && silhouetteArg <= Hilite.Silhouette.Thick)
217
+ silhouette = silhouetteArg;
218
+ const v = args.getFloat("v");
219
+ if (undefined !== v && v >= 0 && v <= 1)
220
+ visible = v;
221
+ const h = args.getFloat("h");
222
+ if (undefined !== h && h >= 0 && h <= 1)
223
+ hidden = h;
224
+ if (undefined === silhouette)
225
+ silhouette = cur.silhouette;
226
+ if (undefined === visible)
227
+ visible = cur.visibleRatio;
228
+ if (undefined === hidden)
229
+ hidden = cur.hiddenRatio;
230
+ const settings = {
231
+ color: ColorDef.from(colors.r, colors.g, colors.b),
232
+ silhouette,
233
+ visibleRatio: visible,
234
+ hiddenRatio: hidden,
235
+ };
236
+ return this.run(settings);
237
+ }
238
+ }
239
+ /** Changes the selected viewport's hilite settings, or resets to defaults.
240
+ * @beta
241
+ */
242
+ class ChangeHiliteSettingsTool extends ChangeHiliteTool {
243
+ getCurrentSettings(vp) { return vp.hilite; }
244
+ apply(vp, settings) {
245
+ vp.hilite = undefined !== settings ? settings : new Hilite.Settings();
246
+ }
247
+ }
248
+ ChangeHiliteSettingsTool.toolId = "ChangeHiliteSettings";
249
+ export { ChangeHiliteSettingsTool };
250
+ /** Changes the selected viewport's emphasis settings.
251
+ * @beta
252
+ */
253
+ class ChangeEmphasisSettingsTool extends ChangeHiliteTool {
254
+ getCurrentSettings(vp) { return vp.emphasisSettings; }
255
+ apply(vp, settings) {
256
+ if (undefined !== settings)
257
+ vp.emphasisSettings = settings;
258
+ }
259
+ }
260
+ ChangeEmphasisSettingsTool.toolId = "ChangeEmphasisSettings";
261
+ export { ChangeEmphasisSettingsTool };
262
+ /** Changes the [FlashSettings]($frontend) for the selected [Viewport]($frontend).
263
+ * @beta
264
+ */
265
+ class ChangeFlashSettingsTool extends Tool {
266
+ static get minArgs() { return 0; }
267
+ static get maxArgs() { return 3; }
268
+ async run(settings) {
269
+ const vp = IModelApp.viewManager.selectedView;
270
+ if (vp)
271
+ vp.flashSettings = settings ?? new FlashSettings();
272
+ return true;
273
+ }
274
+ async parseAndRun(...inputArgs) {
275
+ const vp = IModelApp.viewManager.selectedView;
276
+ if (!vp)
277
+ return true;
278
+ if (1 === inputArgs.length && "default" === inputArgs[0].toLowerCase())
279
+ return this.run();
280
+ const options = {};
281
+ const args = parseArgs(inputArgs);
282
+ const intensity = args.getFloat("i");
283
+ if (undefined !== intensity)
284
+ options.maxIntensity = intensity;
285
+ const mode = args.get("m");
286
+ if (mode) {
287
+ switch (mode[0].toLowerCase()) {
288
+ case "b":
289
+ options.litMode = FlashMode.Brighten;
290
+ break;
291
+ case "h":
292
+ options.litMode = FlashMode.Hilite;
293
+ break;
294
+ default:
295
+ return false;
296
+ }
297
+ }
298
+ const duration = args.getFloat("d");
299
+ if (undefined !== duration)
300
+ options.duration = BeDuration.fromSeconds(duration);
301
+ return this.run(vp.flashSettings.clone(options));
302
+ }
303
+ }
304
+ ChangeFlashSettingsTool.toolId = "ChangeFlashSettings";
305
+ export { ChangeFlashSettingsTool };
306
+ /** Enables or disables fade-out transparency mode for the selected viewport.
307
+ * @beta
308
+ */
309
+ class FadeOutTool extends ViewportToggleTool {
310
+ async toggle(vp, enable) {
311
+ if (undefined === enable || enable !== vp.isFadeOutActive)
312
+ vp.isFadeOutActive = !vp.isFadeOutActive;
313
+ return Promise.resolve();
314
+ }
315
+ }
316
+ FadeOutTool.toolId = "FadeOut";
317
+ export { FadeOutTool };
318
+ /** Sets the default tile size modifier used for all viewports that don't explicitly override it.
319
+ * @beta
320
+ */
321
+ class DefaultTileSizeModifierTool extends Tool {
322
+ static get minArgs() { return 1; }
323
+ static get maxArgs() { return 1; }
324
+ /** This method runs the tool, setting the default tile size modifier used for all viewports that don't explicitly override it.
325
+ * @param modifier the tile size modifier to use; if undefined, do not set modifier
326
+ */
327
+ async run(modifier) {
328
+ if (undefined !== modifier)
329
+ IModelApp.tileAdmin.defaultTileSizeModifier = modifier;
330
+ return true;
331
+ }
332
+ /** Executes this tool's run method with args[0] containing `modifier`.
333
+ * @see [[run]]
334
+ */
335
+ async parseAndRun(...args) {
336
+ return this.run(Number.parseFloat(args[0]));
337
+ }
338
+ }
339
+ DefaultTileSizeModifierTool.toolId = "DefaultTileSizeMod";
340
+ export { DefaultTileSizeModifierTool };
341
+ /** Sets or clears the tile size modifier override for the selected viewport.
342
+ * @beta
343
+ */
344
+ class ViewportTileSizeModifierTool extends Tool {
345
+ static get minArgs() { return 1; }
346
+ static get maxArgs() { return 1; }
347
+ /** This method runs the tool, setting the tile size modifier used for the selected viewport.
348
+ * @param modifier the tile size modifier to use; if undefined, reset the modifier
349
+ */
350
+ async run(modifier) {
351
+ const vp = IModelApp.viewManager.selectedView;
352
+ if (undefined !== vp)
353
+ vp.setTileSizeModifier(modifier);
354
+ return true;
355
+ }
356
+ /** Executes this tool's run method with args[0] containing the `modifier` argument or the string "reset" in order to reset the modifier.
357
+ * @see [[run]]
358
+ */
359
+ async parseAndRun(...args) {
360
+ const arg = args[0].toLowerCase();
361
+ const modifier = "reset" === arg ? undefined : Number.parseFloat(args[0]);
362
+ return this.run(modifier);
363
+ }
364
+ }
365
+ ViewportTileSizeModifierTool.toolId = "ViewportTileSizeMod";
366
+ export { ViewportTileSizeModifierTool };
367
+ /** This tool adds a reality model to the viewport.
368
+ * @beta
369
+ */
370
+ class ViewportAddRealityModel extends Tool {
371
+ static get minArgs() { return 1; }
372
+ static get maxArgs() { return 1; }
373
+ /** This method runs the tool, adding a reality model to the viewport
374
+ * @param url the URL which points to the reality model tileset
375
+ */
376
+ async run(url) {
377
+ const vp = IModelApp.viewManager.selectedView;
378
+ if (undefined !== vp)
379
+ vp.displayStyle.attachRealityModel({ tilesetUrl: url });
380
+ return true;
381
+ }
382
+ /** Executes this tool's run method with args[0] containing the `url` argument.
383
+ * @see [[run]]
384
+ */
385
+ async parseAndRun(...args) {
386
+ return this.run(args[0]);
387
+ }
388
+ }
389
+ ViewportAddRealityModel.toolId = "ViewportAddRealityModel";
390
+ export { ViewportAddRealityModel };
391
+ /** Changes the `allow3dManipulations` flag for the selected viewport if the viewport is displaying a `ViewState3d`.
392
+ * @beta
393
+ */
394
+ class Toggle3dManipulationsTool extends ViewportToggleTool {
395
+ async toggle(vp, allow) {
396
+ if (!vp.view.is3d())
397
+ return Promise.resolve();
398
+ if (undefined === allow)
399
+ allow = !vp.view.allow3dManipulations();
400
+ if (allow !== vp.view.allow3dManipulations()) {
401
+ vp.view.setAllow3dManipulations(allow);
402
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
403
+ IModelApp.toolAdmin.startDefaultTool();
404
+ }
405
+ return Promise.resolve();
406
+ }
407
+ }
408
+ Toggle3dManipulationsTool.toolId = "Toggle3dManipulations";
409
+ export { Toggle3dManipulationsTool };
410
+ /** Toggles display of view attachments in sheet views.
411
+ * @beta
412
+ */
413
+ class ToggleViewAttachmentsTool extends ViewportToggleTool {
414
+ async toggle(vp, enable) {
415
+ if (undefined === enable || enable !== vp.wantViewAttachments)
416
+ vp.wantViewAttachments = !vp.wantViewAttachments;
417
+ return Promise.resolve();
418
+ }
419
+ }
420
+ ToggleViewAttachmentsTool.toolId = "ToggleViewAttachments";
421
+ export { ToggleViewAttachmentsTool };
422
+ /** Toggle display of view attachment boundaries in sheet views.
423
+ * @beta
424
+ */
425
+ class ToggleViewAttachmentBoundariesTool extends ViewportToggleTool {
426
+ async toggle(vp, enable) {
427
+ if (undefined === enable || enable !== vp.wantViewAttachmentBoundaries)
428
+ vp.wantViewAttachmentBoundaries = !vp.wantViewAttachmentBoundaries;
429
+ return Promise.resolve();
430
+ }
431
+ }
432
+ ToggleViewAttachmentBoundariesTool.toolId = "ToggleViewAttachmentBoundaries";
433
+ export { ToggleViewAttachmentBoundariesTool };
434
+ /** Toggle display of view attachment clip shapes in sheet views.
435
+ * @beta
436
+ */
437
+ class ToggleViewAttachmentClipShapesTool extends ViewportToggleTool {
438
+ async toggle(vp, enable) {
439
+ if (undefined === enable || enable !== vp.wantViewAttachmentClipShapes)
440
+ vp.wantViewAttachmentClipShapes = !vp.wantViewAttachmentClipShapes;
441
+ return Promise.resolve();
442
+ }
443
+ }
444
+ ToggleViewAttachmentClipShapesTool.toolId = "ToggleViewAttachmentClipShapes";
445
+ export { ToggleViewAttachmentClipShapesTool };
446
+ /** Toggles display of 2d graphics in a [DrawingViewState]($frontend). This setting affects all drawing views until it is reset.
447
+ * @beta
448
+ */
449
+ class ToggleDrawingGraphicsTool extends ViewportToggleTool {
450
+ async toggle(vp, enable) {
451
+ if (undefined === enable || enable !== DrawingViewState.hideDrawingGraphics) {
452
+ DrawingViewState.hideDrawingGraphics = !DrawingViewState.hideDrawingGraphics;
453
+ vp.invalidateScene();
454
+ }
455
+ return Promise.resolve();
456
+ }
457
+ }
458
+ ToggleDrawingGraphicsTool.toolId = "ToggleDrawingGraphics";
459
+ export { ToggleDrawingGraphicsTool };
460
+ /** Toggles whether a [SectionDrawing]($backend)'s spatial view is always displayed along with the 2d graphics by a [DrawingViewState]($frontend), even
461
+ * if it otherwise would not be. This setting affects all section drawing views until it is reset.
462
+ * @beta
463
+ */
464
+ class ToggleSectionDrawingSpatialViewTool extends ViewportToggleTool {
465
+ async toggle(vp, enable) {
466
+ if (undefined === enable || enable !== DrawingViewState.alwaysDisplaySpatialView) {
467
+ DrawingViewState.alwaysDisplaySpatialView = !DrawingViewState.alwaysDisplaySpatialView;
468
+ if (vp.view instanceof DrawingViewState) {
469
+ // Force the view to update its section drawing attachment.
470
+ const view = vp.view.clone();
471
+ await view.changeViewedModel(view.baseModelId);
472
+ await view.load();
473
+ vp.changeView(view);
474
+ }
475
+ }
476
+ }
477
+ }
478
+ ToggleSectionDrawingSpatialViewTool.toolId = "ToggleSectionDrawingSpatialView";
479
+ export { ToggleSectionDrawingSpatialViewTool };
480
+ /** Change the camera settings of the selected viewport.
481
+ * @beta
482
+ */
483
+ class ChangeCameraTool extends Tool {
484
+ static get minArgs() { return 1; }
485
+ static get maxArgs() { return 2; }
486
+ async run(camera) {
487
+ const vp = IModelApp.viewManager.selectedView;
488
+ if (camera && vp && vp.view.is3d()) {
489
+ const view = vp.view.clone();
490
+ view.camera.setFrom(camera);
491
+ vp.changeView(view);
492
+ }
493
+ return true;
494
+ }
495
+ async parseAndRun(...inArgs) {
496
+ const vp = IModelApp.viewManager.selectedView;
497
+ if (!vp || !vp.view.is3d())
498
+ return false;
499
+ const camera = vp.view.camera.clone();
500
+ const args = parseArgs(inArgs);
501
+ const lens = args.getFloat("l");
502
+ if (undefined !== lens)
503
+ camera.lens.setDegrees(lens);
504
+ const focusDist = args.getFloat("d");
505
+ if (undefined !== focusDist)
506
+ camera.focusDist = focusDist;
507
+ return this.run(camera);
508
+ }
509
+ }
510
+ ChangeCameraTool.toolId = "ChangeCamera";
511
+ export { ChangeCameraTool };
493
512
  //# sourceMappingURL=ViewportTools.js.map