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