@itwin/frontend-devtools 3.4.0-dev.9 → 3.4.1

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 (387) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/lib/cjs/ClipboardUtilities.d.ts +8 -8
  3. package/lib/cjs/ClipboardUtilities.js +26 -26
  4. package/lib/cjs/ClipboardUtilities.js.map +1 -1
  5. package/lib/cjs/FrontEndDevTools.d.ts +19 -19
  6. package/lib/cjs/FrontEndDevTools.js +219 -219
  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 +165 -165
  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 +68 -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 +99 -99
  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 +109 -109
  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/Random.js.map +1 -1
  26. package/lib/cjs/effects/Saturation.d.ts +30 -30
  27. package/lib/cjs/effects/Saturation.js +85 -85
  28. package/lib/cjs/effects/Saturation.js.map +1 -1
  29. package/lib/cjs/effects/Snow.d.ts +76 -76
  30. package/lib/cjs/effects/Snow.js +187 -187
  31. package/lib/cjs/effects/Snow.js.map +1 -1
  32. package/lib/cjs/effects/Vignette.d.ts +39 -39
  33. package/lib/cjs/effects/Vignette.js +108 -108
  34. package/lib/cjs/effects/Vignette.js.map +1 -1
  35. package/lib/cjs/frontend-devtools.d.ts +82 -82
  36. package/lib/cjs/frontend-devtools.js +98 -98
  37. package/lib/cjs/frontend-devtools.js.map +1 -1
  38. package/lib/cjs/tools/AnimationIntervalTool.d.ts +15 -15
  39. package/lib/cjs/tools/AnimationIntervalTool.js +30 -30
  40. package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
  41. package/lib/cjs/tools/ChangeUnitsTool.d.ts +15 -15
  42. package/lib/cjs/tools/ChangeUnitsTool.js +41 -41
  43. package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
  44. package/lib/cjs/tools/ClipTools.d.ts +67 -67
  45. package/lib/cjs/tools/ClipTools.js +164 -164
  46. package/lib/cjs/tools/ClipTools.js.map +1 -1
  47. package/lib/cjs/tools/DisplayStyleTools.d.ts +145 -145
  48. package/lib/cjs/tools/DisplayStyleTools.js +370 -370
  49. package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
  50. package/lib/cjs/tools/EmphasizeElementsTool.d.ts +60 -60
  51. package/lib/cjs/tools/EmphasizeElementsTool.js +154 -154
  52. package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
  53. package/lib/cjs/tools/FrustumDecoration.d.ts +57 -57
  54. package/lib/cjs/tools/FrustumDecoration.d.ts.map +1 -1
  55. package/lib/cjs/tools/FrustumDecoration.js +374 -371
  56. package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
  57. package/lib/cjs/tools/InspectElementTool.d.ts +42 -42
  58. package/lib/cjs/tools/InspectElementTool.js +198 -198
  59. package/lib/cjs/tools/InspectElementTool.js.map +1 -1
  60. package/lib/cjs/tools/MapLayerTool.d.ts +257 -257
  61. package/lib/cjs/tools/MapLayerTool.js +499 -499
  62. package/lib/cjs/tools/MapLayerTool.js.map +1 -1
  63. package/lib/cjs/tools/MeasureTileLoadTime.d.ts +12 -12
  64. package/lib/cjs/tools/MeasureTileLoadTime.d.ts.map +1 -1
  65. package/lib/cjs/tools/MeasureTileLoadTime.js +63 -60
  66. package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
  67. package/lib/cjs/tools/ModelAppearanceTools.d.ts +86 -86
  68. package/lib/cjs/tools/ModelAppearanceTools.js +183 -183
  69. package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
  70. package/lib/cjs/tools/PlanProjectionTools.d.ts +40 -40
  71. package/lib/cjs/tools/PlanProjectionTools.js +149 -149
  72. package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
  73. package/lib/cjs/tools/PlanarMaskTools.d.ts +182 -182
  74. package/lib/cjs/tools/PlanarMaskTools.d.ts.map +1 -1
  75. package/lib/cjs/tools/PlanarMaskTools.js +393 -390
  76. package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
  77. package/lib/cjs/tools/ProjectExtents.d.ts +41 -41
  78. package/lib/cjs/tools/ProjectExtents.js +110 -110
  79. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  80. package/lib/cjs/tools/RealityModelTools.d.ts +116 -116
  81. package/lib/cjs/tools/RealityModelTools.js +281 -281
  82. package/lib/cjs/tools/RealityModelTools.js.map +1 -1
  83. package/lib/cjs/tools/RealityTransitionTool.d.ts +25 -25
  84. package/lib/cjs/tools/RealityTransitionTool.js +116 -116
  85. package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
  86. package/lib/cjs/tools/RenderSystemTools.d.ts +38 -38
  87. package/lib/cjs/tools/RenderSystemTools.js +70 -70
  88. package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
  89. package/lib/cjs/tools/RenderTargetTools.d.ts +100 -100
  90. package/lib/cjs/tools/RenderTargetTools.js +166 -166
  91. package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
  92. package/lib/cjs/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  93. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +30 -30
  94. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  95. package/lib/cjs/tools/SavedViews.d.ts +46 -46
  96. package/lib/cjs/tools/SavedViews.js +136 -136
  97. package/lib/cjs/tools/SavedViews.js.map +1 -1
  98. package/lib/cjs/tools/ScheduleScriptTools.d.ts +37 -37
  99. package/lib/cjs/tools/ScheduleScriptTools.js +159 -159
  100. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  101. package/lib/cjs/tools/SelectionTools.d.ts +28 -28
  102. package/lib/cjs/tools/SelectionTools.d.ts.map +1 -1
  103. package/lib/cjs/tools/SelectionTools.js +87 -87
  104. package/lib/cjs/tools/SelectionTools.js.map +1 -1
  105. package/lib/cjs/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  106. package/lib/cjs/tools/SetGpuMemoryLimitTool.js +33 -33
  107. package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
  108. package/lib/cjs/tools/SourceAspectIdTools.d.ts +40 -40
  109. package/lib/cjs/tools/SourceAspectIdTools.js +86 -86
  110. package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
  111. package/lib/cjs/tools/TileRequestDecoration.d.ts +12 -12
  112. package/lib/cjs/tools/TileRequestDecoration.js +83 -83
  113. package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
  114. package/lib/cjs/tools/TileTreeBoundsDecoration.d.ts +11 -11
  115. package/lib/cjs/tools/TileTreeBoundsDecoration.js +74 -74
  116. package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
  117. package/lib/cjs/tools/ToolTipProvider.d.ts +15 -15
  118. package/lib/cjs/tools/ToolTipProvider.js +66 -66
  119. package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
  120. package/lib/cjs/tools/ViewportTools.d.ts +218 -218
  121. package/lib/cjs/tools/ViewportTools.js +516 -516
  122. package/lib/cjs/tools/ViewportTools.js.map +1 -1
  123. package/lib/cjs/tools/parseArgs.d.ts +23 -23
  124. package/lib/cjs/tools/parseArgs.js +51 -51
  125. package/lib/cjs/tools/parseArgs.js.map +1 -1
  126. package/lib/cjs/tools/parseBoolean.d.ts +8 -8
  127. package/lib/cjs/tools/parseBoolean.js +26 -26
  128. package/lib/cjs/tools/parseBoolean.js.map +1 -1
  129. package/lib/cjs/tools/parseToggle.d.ts +8 -8
  130. package/lib/cjs/tools/parseToggle.js +25 -25
  131. package/lib/cjs/tools/parseToggle.js.map +1 -1
  132. package/lib/cjs/ui/Button.d.ts +29 -29
  133. package/lib/cjs/ui/Button.d.ts.map +1 -1
  134. package/lib/cjs/ui/Button.js +26 -26
  135. package/lib/cjs/ui/Button.js.map +1 -1
  136. package/lib/cjs/ui/CheckBox.d.ts +23 -23
  137. package/lib/cjs/ui/CheckBox.js +27 -27
  138. package/lib/cjs/ui/CheckBox.js.map +1 -1
  139. package/lib/cjs/ui/ColorInput.d.ts +27 -27
  140. package/lib/cjs/ui/ColorInput.d.ts.map +1 -1
  141. package/lib/cjs/ui/ColorInput.js +53 -53
  142. package/lib/cjs/ui/ColorInput.js.map +1 -1
  143. package/lib/cjs/ui/ComboBox.d.ts +28 -28
  144. package/lib/cjs/ui/ComboBox.js +42 -42
  145. package/lib/cjs/ui/ComboBox.js.map +1 -1
  146. package/lib/cjs/ui/DataList.d.ts +27 -27
  147. package/lib/cjs/ui/DataList.js +39 -39
  148. package/lib/cjs/ui/DataList.js.map +1 -1
  149. package/lib/cjs/ui/NestedMenu.d.ts +19 -19
  150. package/lib/cjs/ui/NestedMenu.d.ts.map +1 -1
  151. package/lib/cjs/ui/NestedMenu.js +46 -46
  152. package/lib/cjs/ui/NestedMenu.js.map +1 -1
  153. package/lib/cjs/ui/NumericInput.d.ts +34 -34
  154. package/lib/cjs/ui/NumericInput.d.ts.map +1 -1
  155. package/lib/cjs/ui/NumericInput.js +59 -59
  156. package/lib/cjs/ui/NumericInput.js.map +1 -1
  157. package/lib/cjs/ui/RadioBox.d.ts +28 -28
  158. package/lib/cjs/ui/RadioBox.js +76 -76
  159. package/lib/cjs/ui/RadioBox.js.map +1 -1
  160. package/lib/cjs/ui/Slider.d.ts +24 -24
  161. package/lib/cjs/ui/Slider.js +32 -32
  162. package/lib/cjs/ui/Slider.js.map +1 -1
  163. package/lib/cjs/ui/TextBox.d.ts +32 -32
  164. package/lib/cjs/ui/TextBox.js +56 -56
  165. package/lib/cjs/ui/TextBox.js.map +1 -1
  166. package/lib/cjs/widgets/DiagnosticsPanel.d.ts +37 -37
  167. package/lib/cjs/widgets/DiagnosticsPanel.js +81 -81
  168. package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
  169. package/lib/cjs/widgets/FpsTracker.d.ts +19 -19
  170. package/lib/cjs/widgets/FpsTracker.js +56 -56
  171. package/lib/cjs/widgets/FpsTracker.js.map +1 -1
  172. package/lib/cjs/widgets/GpuProfiler.d.ts +16 -16
  173. package/lib/cjs/widgets/GpuProfiler.js +192 -192
  174. package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
  175. package/lib/cjs/widgets/KeyinField.d.ts +61 -61
  176. package/lib/cjs/widgets/KeyinField.js +187 -187
  177. package/lib/cjs/widgets/KeyinField.js.map +1 -1
  178. package/lib/cjs/widgets/MemoryTracker.d.ts +27 -27
  179. package/lib/cjs/widgets/MemoryTracker.js +243 -243
  180. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  181. package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +15 -15
  182. package/lib/cjs/widgets/RenderCommandBreakdown.js +68 -68
  183. package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
  184. package/lib/cjs/widgets/TileMemoryBreakdown.d.ts +30 -30
  185. package/lib/cjs/widgets/TileMemoryBreakdown.js +204 -204
  186. package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
  187. package/lib/cjs/widgets/TileStatisticsTracker.d.ts +21 -21
  188. package/lib/cjs/widgets/TileStatisticsTracker.js +142 -142
  189. package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
  190. package/lib/cjs/widgets/ToolSettingsTracker.d.ts +9 -9
  191. package/lib/cjs/widgets/ToolSettingsTracker.d.ts.map +1 -1
  192. package/lib/cjs/widgets/ToolSettingsTracker.js +211 -181
  193. package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
  194. package/lib/esm/ClipboardUtilities.d.ts +8 -8
  195. package/lib/esm/ClipboardUtilities.js +22 -22
  196. package/lib/esm/ClipboardUtilities.js.map +1 -1
  197. package/lib/esm/FrontEndDevTools.d.ts +19 -19
  198. package/lib/esm/FrontEndDevTools.js +215 -215
  199. package/lib/esm/FrontEndDevTools.js.map +1 -1
  200. package/lib/esm/effects/Convolution.d.ts +68 -68
  201. package/lib/esm/effects/Convolution.js +155 -155
  202. package/lib/esm/effects/Convolution.js.map +1 -1
  203. package/lib/esm/effects/EffectTools.d.ts +33 -33
  204. package/lib/esm/effects/EffectTools.js +62 -62
  205. package/lib/esm/effects/EffectTools.js.map +1 -1
  206. package/lib/esm/effects/Explosion.d.ts +12 -12
  207. package/lib/esm/effects/Explosion.js +164 -164
  208. package/lib/esm/effects/Explosion.js.map +1 -1
  209. package/lib/esm/effects/FlipImage.d.ts +30 -30
  210. package/lib/esm/effects/FlipImage.js +94 -94
  211. package/lib/esm/effects/FlipImage.js.map +1 -1
  212. package/lib/esm/effects/LensDistortion.d.ts +34 -34
  213. package/lib/esm/effects/LensDistortion.js +104 -104
  214. package/lib/esm/effects/LensDistortion.js.map +1 -1
  215. package/lib/esm/effects/Random.d.ts +24 -24
  216. package/lib/esm/effects/Random.js +41 -41
  217. package/lib/esm/effects/Random.js.map +1 -1
  218. package/lib/esm/effects/Saturation.d.ts +30 -30
  219. package/lib/esm/effects/Saturation.js +80 -80
  220. package/lib/esm/effects/Saturation.js.map +1 -1
  221. package/lib/esm/effects/Snow.d.ts +76 -76
  222. package/lib/esm/effects/Snow.js +182 -182
  223. package/lib/esm/effects/Snow.js.map +1 -1
  224. package/lib/esm/effects/Vignette.d.ts +39 -39
  225. package/lib/esm/effects/Vignette.js +103 -103
  226. package/lib/esm/effects/Vignette.js.map +1 -1
  227. package/lib/esm/frontend-devtools.d.ts +82 -82
  228. package/lib/esm/frontend-devtools.js +86 -86
  229. package/lib/esm/frontend-devtools.js.map +1 -1
  230. package/lib/esm/tools/AnimationIntervalTool.d.ts +15 -15
  231. package/lib/esm/tools/AnimationIntervalTool.js +26 -26
  232. package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
  233. package/lib/esm/tools/ChangeUnitsTool.d.ts +15 -15
  234. package/lib/esm/tools/ChangeUnitsTool.js +37 -37
  235. package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
  236. package/lib/esm/tools/ClipTools.d.ts +67 -67
  237. package/lib/esm/tools/ClipTools.js +158 -158
  238. package/lib/esm/tools/ClipTools.js.map +1 -1
  239. package/lib/esm/tools/DisplayStyleTools.d.ts +145 -145
  240. package/lib/esm/tools/DisplayStyleTools.js +356 -356
  241. package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
  242. package/lib/esm/tools/EmphasizeElementsTool.d.ts +60 -60
  243. package/lib/esm/tools/EmphasizeElementsTool.js +145 -145
  244. package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
  245. package/lib/esm/tools/FrustumDecoration.d.ts +57 -57
  246. package/lib/esm/tools/FrustumDecoration.d.ts.map +1 -1
  247. package/lib/esm/tools/FrustumDecoration.js +367 -364
  248. package/lib/esm/tools/FrustumDecoration.js.map +1 -1
  249. package/lib/esm/tools/InspectElementTool.d.ts +42 -42
  250. package/lib/esm/tools/InspectElementTool.js +194 -194
  251. package/lib/esm/tools/InspectElementTool.js.map +1 -1
  252. package/lib/esm/tools/MapLayerTool.d.ts +257 -257
  253. package/lib/esm/tools/MapLayerTool.js +478 -478
  254. package/lib/esm/tools/MapLayerTool.js.map +1 -1
  255. package/lib/esm/tools/MeasureTileLoadTime.d.ts +12 -12
  256. package/lib/esm/tools/MeasureTileLoadTime.d.ts.map +1 -1
  257. package/lib/esm/tools/MeasureTileLoadTime.js +59 -56
  258. package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
  259. package/lib/esm/tools/ModelAppearanceTools.d.ts +86 -86
  260. package/lib/esm/tools/ModelAppearanceTools.js +172 -172
  261. package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
  262. package/lib/esm/tools/PlanProjectionTools.d.ts +40 -40
  263. package/lib/esm/tools/PlanProjectionTools.js +143 -143
  264. package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
  265. package/lib/esm/tools/PlanarMaskTools.d.ts +182 -182
  266. package/lib/esm/tools/PlanarMaskTools.d.ts.map +1 -1
  267. package/lib/esm/tools/PlanarMaskTools.js +377 -374
  268. package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
  269. package/lib/esm/tools/ProjectExtents.d.ts +41 -41
  270. package/lib/esm/tools/ProjectExtents.js +104 -104
  271. package/lib/esm/tools/ProjectExtents.js.map +1 -1
  272. package/lib/esm/tools/RealityModelTools.d.ts +116 -116
  273. package/lib/esm/tools/RealityModelTools.js +268 -268
  274. package/lib/esm/tools/RealityModelTools.js.map +1 -1
  275. package/lib/esm/tools/RealityTransitionTool.d.ts +25 -25
  276. package/lib/esm/tools/RealityTransitionTool.js +112 -112
  277. package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
  278. package/lib/esm/tools/RenderSystemTools.d.ts +38 -38
  279. package/lib/esm/tools/RenderSystemTools.js +63 -63
  280. package/lib/esm/tools/RenderSystemTools.js.map +1 -1
  281. package/lib/esm/tools/RenderTargetTools.d.ts +100 -100
  282. package/lib/esm/tools/RenderTargetTools.js +152 -152
  283. package/lib/esm/tools/RenderTargetTools.js.map +1 -1
  284. package/lib/esm/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  285. package/lib/esm/tools/ReportWebGLCompatibilityTool.js +26 -26
  286. package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  287. package/lib/esm/tools/SavedViews.d.ts +46 -46
  288. package/lib/esm/tools/SavedViews.js +128 -128
  289. package/lib/esm/tools/SavedViews.js.map +1 -1
  290. package/lib/esm/tools/ScheduleScriptTools.d.ts +37 -37
  291. package/lib/esm/tools/ScheduleScriptTools.js +153 -153
  292. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  293. package/lib/esm/tools/SelectionTools.d.ts +28 -28
  294. package/lib/esm/tools/SelectionTools.d.ts.map +1 -1
  295. package/lib/esm/tools/SelectionTools.js +82 -82
  296. package/lib/esm/tools/SelectionTools.js.map +1 -1
  297. package/lib/esm/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  298. package/lib/esm/tools/SetGpuMemoryLimitTool.js +29 -29
  299. package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
  300. package/lib/esm/tools/SourceAspectIdTools.d.ts +40 -40
  301. package/lib/esm/tools/SourceAspectIdTools.js +80 -80
  302. package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
  303. package/lib/esm/tools/TileRequestDecoration.d.ts +12 -12
  304. package/lib/esm/tools/TileRequestDecoration.js +79 -79
  305. package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
  306. package/lib/esm/tools/TileTreeBoundsDecoration.d.ts +11 -11
  307. package/lib/esm/tools/TileTreeBoundsDecoration.js +70 -70
  308. package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
  309. package/lib/esm/tools/ToolTipProvider.d.ts +15 -15
  310. package/lib/esm/tools/ToolTipProvider.js +62 -62
  311. package/lib/esm/tools/ToolTipProvider.js.map +1 -1
  312. package/lib/esm/tools/ViewportTools.d.ts +218 -218
  313. package/lib/esm/tools/ViewportTools.js +492 -492
  314. package/lib/esm/tools/ViewportTools.js.map +1 -1
  315. package/lib/esm/tools/parseArgs.d.ts +23 -23
  316. package/lib/esm/tools/parseArgs.js +47 -47
  317. package/lib/esm/tools/parseArgs.js.map +1 -1
  318. package/lib/esm/tools/parseBoolean.d.ts +8 -8
  319. package/lib/esm/tools/parseBoolean.js +22 -22
  320. package/lib/esm/tools/parseBoolean.js.map +1 -1
  321. package/lib/esm/tools/parseToggle.d.ts +8 -8
  322. package/lib/esm/tools/parseToggle.js +21 -21
  323. package/lib/esm/tools/parseToggle.js.map +1 -1
  324. package/lib/esm/ui/Button.d.ts +29 -29
  325. package/lib/esm/ui/Button.d.ts.map +1 -1
  326. package/lib/esm/ui/Button.js +22 -22
  327. package/lib/esm/ui/Button.js.map +1 -1
  328. package/lib/esm/ui/CheckBox.d.ts +23 -23
  329. package/lib/esm/ui/CheckBox.js +23 -23
  330. package/lib/esm/ui/CheckBox.js.map +1 -1
  331. package/lib/esm/ui/ColorInput.d.ts +27 -27
  332. package/lib/esm/ui/ColorInput.d.ts.map +1 -1
  333. package/lib/esm/ui/ColorInput.js +48 -48
  334. package/lib/esm/ui/ColorInput.js.map +1 -1
  335. package/lib/esm/ui/ComboBox.d.ts +28 -28
  336. package/lib/esm/ui/ComboBox.js +38 -38
  337. package/lib/esm/ui/ComboBox.js.map +1 -1
  338. package/lib/esm/ui/DataList.d.ts +27 -27
  339. package/lib/esm/ui/DataList.js +34 -34
  340. package/lib/esm/ui/DataList.js.map +1 -1
  341. package/lib/esm/ui/NestedMenu.d.ts +19 -19
  342. package/lib/esm/ui/NestedMenu.d.ts.map +1 -1
  343. package/lib/esm/ui/NestedMenu.js +42 -42
  344. package/lib/esm/ui/NestedMenu.js.map +1 -1
  345. package/lib/esm/ui/NumericInput.d.ts +34 -34
  346. package/lib/esm/ui/NumericInput.d.ts.map +1 -1
  347. package/lib/esm/ui/NumericInput.js +54 -54
  348. package/lib/esm/ui/NumericInput.js.map +1 -1
  349. package/lib/esm/ui/RadioBox.d.ts +28 -28
  350. package/lib/esm/ui/RadioBox.js +72 -72
  351. package/lib/esm/ui/RadioBox.js.map +1 -1
  352. package/lib/esm/ui/Slider.d.ts +24 -24
  353. package/lib/esm/ui/Slider.js +28 -28
  354. package/lib/esm/ui/Slider.js.map +1 -1
  355. package/lib/esm/ui/TextBox.d.ts +32 -32
  356. package/lib/esm/ui/TextBox.js +52 -52
  357. package/lib/esm/ui/TextBox.js.map +1 -1
  358. package/lib/esm/widgets/DiagnosticsPanel.d.ts +37 -37
  359. package/lib/esm/widgets/DiagnosticsPanel.js +77 -77
  360. package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
  361. package/lib/esm/widgets/FpsTracker.d.ts +19 -19
  362. package/lib/esm/widgets/FpsTracker.js +52 -52
  363. package/lib/esm/widgets/FpsTracker.js.map +1 -1
  364. package/lib/esm/widgets/GpuProfiler.d.ts +16 -16
  365. package/lib/esm/widgets/GpuProfiler.js +188 -188
  366. package/lib/esm/widgets/GpuProfiler.js.map +1 -1
  367. package/lib/esm/widgets/KeyinField.d.ts +61 -61
  368. package/lib/esm/widgets/KeyinField.js +183 -183
  369. package/lib/esm/widgets/KeyinField.js.map +1 -1
  370. package/lib/esm/widgets/MemoryTracker.d.ts +27 -27
  371. package/lib/esm/widgets/MemoryTracker.js +238 -238
  372. package/lib/esm/widgets/MemoryTracker.js.map +1 -1
  373. package/lib/esm/widgets/RenderCommandBreakdown.d.ts +15 -15
  374. package/lib/esm/widgets/RenderCommandBreakdown.js +64 -64
  375. package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
  376. package/lib/esm/widgets/TileMemoryBreakdown.d.ts +30 -30
  377. package/lib/esm/widgets/TileMemoryBreakdown.js +200 -200
  378. package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
  379. package/lib/esm/widgets/TileStatisticsTracker.d.ts +21 -21
  380. package/lib/esm/widgets/TileStatisticsTracker.js +138 -138
  381. package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
  382. package/lib/esm/widgets/ToolSettingsTracker.d.ts +9 -9
  383. package/lib/esm/widgets/ToolSettingsTracker.d.ts.map +1 -1
  384. package/lib/esm/widgets/ToolSettingsTracker.js +207 -177
  385. package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
  386. package/lib/public/locales/en/FrontendDevTools.json +479 -479
  387. package/package.json +8 -8
@@ -1,365 +1,368 @@
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 { Point3d } from "@itwin/core-geometry";
9
- import { ColorByName, ColorDef, LinePixels, Npc } from "@itwin/core-common";
10
- import { CoordSystem, GraphicType, IModelApp, Tool, } from "@itwin/core-frontend";
11
- import { parseToggle } from "./parseToggle";
12
- /**
13
- * Decorates the viewport with a graphical depiction of a Frustum.
14
- * This is obviously only useful when drawn inside a viewport using a *different* Frustum.
15
- * Options for doing so include:
16
- * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and
17
- * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.
18
- */
19
- class FrustumDecoration {
20
- constructor(vp, view, _options) {
21
- this._options = _options;
22
- this._worldFrustum = vp.getFrustum(CoordSystem.World, false);
23
- this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);
24
- this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();
25
- this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);
26
- this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();
27
- this._eyePoint = view.camera.getEyePoint().clone();
28
- this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;
29
- this._isCameraOn = vp.isCameraOn;
30
- }
31
- static create(vp, options) {
32
- const view = vp.view.isSpatialView() ? vp.view : undefined;
33
- return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;
34
- }
35
- decorate(context) {
36
- const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
37
- if (this._isCameraOn)
38
- FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);
39
- FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...
40
- FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...
41
- const options = this._options;
42
- if (options !== undefined) {
43
- if (options.showPreloadFrustum)
44
- FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);
45
- if (options === null || options === void 0 ? void 0 : options.showBackgroundIntersections) {
46
- const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();
47
- if (backgroundMapGeometry)
48
- backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);
49
- }
50
- }
51
- context.addDecorationFromBuilder(builder);
52
- }
53
- static drawPreloadFrustum(builder, frustum) {
54
- const preloadColor = ColorDef.create(ColorByName.coral);
55
- builder.setSymbology(preloadColor, preloadColor, 1, 2);
56
- builder.addFrustum(frustum);
57
- }
58
- static drawFrustumBox(builder, frustum, adjustedBox, vp) {
59
- const backPts = this.getPlanePts(frustum.points, false); // back plane
60
- const frontPts = this.getPlanePts(frustum.points, true); // front plane
61
- const bgColor = vp.view.backgroundColor;
62
- const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);
63
- const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);
64
- const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);
65
- const edgeWeight = adjustedBox ? 2 : 1;
66
- const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;
67
- // Back plane
68
- builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);
69
- builder.addLineString(backPts);
70
- // Front plane
71
- builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);
72
- builder.addLineString(frontPts);
73
- // Bottom edge
74
- builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);
75
- builder.addLineString(this.getEdgePts(backPts, frontPts, 0));
76
- builder.addLineString(this.getEdgePts(backPts, frontPts, 1));
77
- // Top edge
78
- builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);
79
- builder.addLineString(this.getEdgePts(backPts, frontPts, 2));
80
- builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);
81
- builder.addLineString(this.getEdgePts(backPts, frontPts, 3));
82
- }
83
- static getEdgePts(startPts, endPts, index) {
84
- return [
85
- startPts[index],
86
- endPts[index],
87
- ];
88
- }
89
- static getPlanePts(frustPts, front) {
90
- const baseIndex = front ? Npc._001 : Npc._000;
91
- const planePts = [
92
- frustPts[baseIndex + Npc._000],
93
- frustPts[baseIndex + Npc._100],
94
- frustPts[baseIndex + Npc._110],
95
- frustPts[baseIndex + Npc._010],
96
- ];
97
- planePts.push(planePts[0]);
98
- return planePts;
99
- }
100
- static drawEyePositionAndFocalPlane(builder, npcFrustum, worldToNpcMap, eyePoint, focusPlaneNpc, vp) {
101
- // Eye position...
102
- const contrastColor = vp.getContrastToBackgroundColor();
103
- builder.setSymbology(contrastColor, ColorDef.black, 8);
104
- builder.addPointString([eyePoint]);
105
- // Focal plane...
106
- const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);
107
- const focalPtsWorld = [];
108
- for (const npcPt of focalPtsNpc)
109
- focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));
110
- worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);
111
- const bgColor = vp.view.backgroundColor;
112
- const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);
113
- const focalTransColor = focalPlaneColor.withTransparency(100);
114
- builder.setSymbology(focalPlaneColor, focalTransColor, 2);
115
- builder.addLineString(focalPtsWorld);
116
- builder.addShape(focalPtsWorld);
117
- }
118
- }
119
- /**
120
- * Decorates the viewport with a graphical depiction of a Frustum.
121
- * This is obviously only useful when drawn inside a viewport using a *different* Frustum.
122
- * Options for doing so include:
123
- * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and
124
- * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.
125
- * @beta
126
- */
127
- export class FrustumDecorator {
128
- constructor(vp, options) {
129
- /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
130
- this.useCachedDecorations = true;
131
- this._decoration = FrustumDecoration.create(vp, options);
132
- }
133
- decorate(context) {
134
- if (undefined !== this._decoration)
135
- this._decoration.decorate(context);
136
- }
137
- /** Add the decoration to the specified viewport. */
138
- static enable(vp, options) {
139
- FrustumDecorator.disable();
140
- FrustumDecorator._instance = new FrustumDecorator(vp, options);
141
- IModelApp.viewManager.addDecorator(FrustumDecorator._instance);
142
- }
143
- /** Remove the decoration from the specified viewport. */
144
- static disable() {
145
- const instance = FrustumDecorator._instance;
146
- if (undefined !== instance) {
147
- IModelApp.viewManager.dropDecorator(instance);
148
- FrustumDecorator._instance = undefined;
149
- }
150
- }
151
- static get isEnabled() { return undefined !== FrustumDecorator._instance; }
152
- }
153
- /** Enable ("ON"), disable ("OFF"), or toggle ("TOGGLE" or omitted) the [[FrustumDecorator]].
154
- * @beta
155
- */
156
- export class ToggleFrustumSnapshotTool extends Tool {
157
- static get minArgs() { return 0; }
158
- static get maxArgs() { return 2; }
159
- async run(enable, showPreloadFrustum, showBackgroundIntersections) {
160
- const vp = IModelApp.viewManager.selectedView;
161
- if (undefined === vp)
162
- return true;
163
- if (undefined === enable)
164
- enable = !FrustumDecorator.isEnabled;
165
- if (enable !== FrustumDecorator.isEnabled) {
166
- if (enable) {
167
- FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });
168
- vp.onChangeView.addOnce(() => FrustumDecorator.disable());
169
- }
170
- else {
171
- FrustumDecorator.disable();
172
- }
173
- }
174
- return true;
175
- }
176
- async parseAndRun(...args) {
177
- let showPreload, showBackgroundIntersections, enable;
178
- for (const arg of args) {
179
- if (arg === "preload")
180
- showPreload = true;
181
- else if (arg === "background")
182
- showBackgroundIntersections = true;
183
- else
184
- enable = parseToggle(arg);
185
- }
186
- if (typeof enable !== "string")
187
- await this.run(enable, showPreload, showBackgroundIntersections);
188
- return true;
189
- }
190
- }
191
- ToggleFrustumSnapshotTool.toolId = "ToggleFrustumSnapshot";
192
- /**
193
- * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.
194
- * Only useful when more than one spatial viewport is open.
195
- */
196
- class SelectedViewFrustumDecoration {
197
- constructor(vp, _options) {
198
- this._options = _options;
199
- /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
200
- this.useCachedDecorations = true;
201
- this._targetVp = vp;
202
- this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);
203
- this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method
204
- IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
205
- }
206
- stop() {
207
- if (this._removeDecorationListener) {
208
- this._removeDecorationListener();
209
- this._removeDecorationListener = undefined;
210
- }
211
- if (this._removeViewChangedListener) {
212
- this._removeViewChangedListener();
213
- this._removeViewChangedListener = undefined;
214
- }
215
- IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
216
- }
217
- onViewChanged(targetVp) {
218
- if (targetVp !== this._targetVp)
219
- return;
220
- const decorator = SelectedViewFrustumDecoration._decorator;
221
- if (undefined !== decorator) {
222
- for (const vp of IModelApp.viewManager) {
223
- if (vp !== this._targetVp)
224
- vp.invalidateCachedDecorations(decorator);
225
- }
226
- }
227
- }
228
- decorate(context) {
229
- const vp = context.viewport;
230
- if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())
231
- return;
232
- const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
233
- if (this._targetVp.isCameraOn) {
234
- const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);
235
- const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;
236
- FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);
237
- }
238
- const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);
239
- const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);
240
- FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...
241
- FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...
242
- if (this._options && this._options.showPreloadFrustum)
243
- FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());
244
- context.addDecorationFromBuilder(builder);
245
- }
246
- // Returns true if decoration becomes enabled.
247
- static toggle(vp, enabled) {
248
- if (undefined !== enabled) {
249
- const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;
250
- if (enabled === alreadyEnabled)
251
- return alreadyEnabled;
252
- }
253
- if (undefined === SelectedViewFrustumDecoration._decorator) {
254
- SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);
255
- return true;
256
- }
257
- else {
258
- SelectedViewFrustumDecoration._decorator.stop();
259
- SelectedViewFrustumDecoration._decorator = undefined;
260
- return false;
261
- }
262
- }
263
- }
264
- /** Enable ("ON"), disable ("OFF"), or toggle ("TOGGLE" or omitted) the selected view frustum decoration.
265
- * @beta
266
- */
267
- export class ToggleSelectedViewFrustumTool extends Tool {
268
- static get minArgs() { return 0; }
269
- static get maxArgs() { return 1; }
270
- async run(enable) {
271
- const vp = IModelApp.viewManager.selectedView;
272
- if (undefined === vp || !vp.view.isSpatialView())
273
- return false;
274
- if (SelectedViewFrustumDecoration.toggle(vp, enable)) {
275
- const remove = vp.onChangeView.addListener((_vp, prev) => {
276
- if (!prev.hasSameCoordinates(vp.view)) {
277
- SelectedViewFrustumDecoration.toggle(vp, false);
278
- remove();
279
- }
280
- });
281
- }
282
- return true;
283
- }
284
- async parseAndRun(...args) {
285
- const enable = parseToggle(args[0]);
286
- if (typeof enable !== "string")
287
- await this.run(enable);
288
- return true;
289
- }
290
- }
291
- ToggleSelectedViewFrustumTool.toolId = "ToggleSelectedViewFrustum";
292
- class ShadowFrustumDecoration {
293
- constructor(vp) {
294
- /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
295
- this.useCachedDecorations = true;
296
- this._targetVp = vp;
297
- const removeDecorator = IModelApp.viewManager.addDecorator(this);
298
- const removeOnRender = vp.onRender.addListener((_) => this.onRender());
299
- this._cleanup = () => { removeDecorator(); removeOnRender(); };
300
- IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
301
- }
302
- stop() {
303
- if (undefined !== this._cleanup) {
304
- this._cleanup();
305
- this._cleanup = undefined;
306
- }
307
- IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
308
- }
309
- onRender() {
310
- const decorator = ShadowFrustumDecoration._instance;
311
- if (undefined !== decorator) {
312
- for (const vp of IModelApp.viewManager) {
313
- if (vp !== this._targetVp)
314
- vp.invalidateCachedDecorations(decorator);
315
- }
316
- }
317
- }
318
- decorate(context) {
319
- const frustum = this._targetVp.target.debugControl.shadowFrustum;
320
- if (undefined === frustum)
321
- return;
322
- const thisVp = context.viewport;
323
- if (thisVp === this._targetVp || !thisVp.view.isSpatialView())
324
- return;
325
- const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
326
- FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);
327
- context.addDecorationFromBuilder(builder);
328
- }
329
- static toggle(vp, enabled) {
330
- const instance = ShadowFrustumDecoration._instance;
331
- if (undefined !== enabled) {
332
- const alreadyEnabled = undefined !== instance;
333
- if (enabled === alreadyEnabled)
334
- return;
335
- }
336
- if (undefined === instance) {
337
- ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);
338
- }
339
- else {
340
- instance.stop();
341
- ShadowFrustumDecoration._instance = undefined;
342
- }
343
- }
344
- }
345
- /** Toggle visualization of the selected viewport's shadow frustum in all other viewports.
346
- * @beta
347
- */
348
- export class ToggleShadowFrustumTool extends Tool {
349
- static get minArgs() { return 0; }
350
- static get maxArgs() { return 1; }
351
- async run(enable) {
352
- const vp = IModelApp.viewManager.selectedView;
353
- if (undefined !== vp && vp.view.isSpatialView())
354
- ShadowFrustumDecoration.toggle(vp, enable);
355
- return true;
356
- }
357
- async parseAndRun(...args) {
358
- const enable = parseToggle(args[0]);
359
- if (typeof enable !== "string")
360
- await this.run(enable);
361
- return true;
362
- }
363
- }
364
- ToggleShadowFrustumTool.toolId = "ToggleShadowFrustum";
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 { Point3d } from "@itwin/core-geometry";
9
+ import { ColorByName, ColorDef, LinePixels, Npc } from "@itwin/core-common";
10
+ import { CoordSystem, GraphicType, IModelApp, Tool, } from "@itwin/core-frontend";
11
+ import { parseToggle } from "./parseToggle";
12
+ /**
13
+ * Decorates the viewport with a graphical depiction of a Frustum.
14
+ * This is obviously only useful when drawn inside a viewport using a *different* Frustum.
15
+ * Options for doing so include:
16
+ * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and
17
+ * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.
18
+ */
19
+ class FrustumDecoration {
20
+ constructor(vp, view, _options) {
21
+ this._options = _options;
22
+ this._worldFrustum = vp.getFrustum(CoordSystem.World, false);
23
+ this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);
24
+ this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();
25
+ this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);
26
+ this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();
27
+ this._eyePoint = view.camera.getEyePoint().clone();
28
+ this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;
29
+ this._isCameraOn = vp.isCameraOn;
30
+ }
31
+ static create(vp, options) {
32
+ const view = vp.view.isSpatialView() ? vp.view : undefined;
33
+ return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;
34
+ }
35
+ decorate(context) {
36
+ const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
37
+ if (this._isCameraOn)
38
+ FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);
39
+ FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...
40
+ FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...
41
+ const options = this._options;
42
+ if (options !== undefined) {
43
+ if (options.showPreloadFrustum)
44
+ FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);
45
+ if (options === null || options === void 0 ? void 0 : options.showBackgroundIntersections) {
46
+ const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();
47
+ if (backgroundMapGeometry)
48
+ backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);
49
+ }
50
+ }
51
+ context.addDecorationFromBuilder(builder);
52
+ }
53
+ static drawPreloadFrustum(builder, frustum) {
54
+ const preloadColor = ColorDef.create(ColorByName.coral);
55
+ builder.setSymbology(preloadColor, preloadColor, 1, 2);
56
+ builder.addFrustum(frustum);
57
+ }
58
+ static drawFrustumBox(builder, frustum, adjustedBox, vp) {
59
+ const backPts = this.getPlanePts(frustum.points, false); // back plane
60
+ const frontPts = this.getPlanePts(frustum.points, true); // front plane
61
+ const bgColor = vp.view.backgroundColor;
62
+ const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);
63
+ const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);
64
+ const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);
65
+ const edgeWeight = adjustedBox ? 2 : 1;
66
+ const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;
67
+ // Back plane
68
+ builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);
69
+ builder.addLineString(backPts);
70
+ // Front plane
71
+ builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);
72
+ builder.addLineString(frontPts);
73
+ // Bottom edge
74
+ builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);
75
+ builder.addLineString(this.getEdgePts(backPts, frontPts, 0));
76
+ builder.addLineString(this.getEdgePts(backPts, frontPts, 1));
77
+ // Top edge
78
+ builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);
79
+ builder.addLineString(this.getEdgePts(backPts, frontPts, 2));
80
+ builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);
81
+ builder.addLineString(this.getEdgePts(backPts, frontPts, 3));
82
+ }
83
+ static getEdgePts(startPts, endPts, index) {
84
+ return [
85
+ startPts[index],
86
+ endPts[index],
87
+ ];
88
+ }
89
+ static getPlanePts(frustPts, front) {
90
+ const baseIndex = front ? Npc._001 : Npc._000;
91
+ const planePts = [
92
+ frustPts[baseIndex + Npc._000],
93
+ frustPts[baseIndex + Npc._100],
94
+ frustPts[baseIndex + Npc._110],
95
+ frustPts[baseIndex + Npc._010],
96
+ ];
97
+ planePts.push(planePts[0]);
98
+ return planePts;
99
+ }
100
+ static drawEyePositionAndFocalPlane(builder, npcFrustum, worldToNpcMap, eyePoint, focusPlaneNpc, vp) {
101
+ // Eye position...
102
+ const contrastColor = vp.getContrastToBackgroundColor();
103
+ builder.setSymbology(contrastColor, ColorDef.black, 8);
104
+ builder.addPointString([eyePoint]);
105
+ // Focal plane...
106
+ const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);
107
+ const focalPtsWorld = [];
108
+ for (const npcPt of focalPtsNpc)
109
+ focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));
110
+ worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);
111
+ const bgColor = vp.view.backgroundColor;
112
+ const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);
113
+ const focalTransColor = focalPlaneColor.withTransparency(100);
114
+ builder.setSymbology(focalPlaneColor, focalTransColor, 2);
115
+ builder.addLineString(focalPtsWorld);
116
+ builder.addShape(focalPtsWorld);
117
+ }
118
+ }
119
+ /**
120
+ * Decorates the viewport with a graphical depiction of a Frustum.
121
+ * This is obviously only useful when drawn inside a viewport using a *different* Frustum.
122
+ * Options for doing so include:
123
+ * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and
124
+ * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.
125
+ * @beta
126
+ */
127
+ export class FrustumDecorator {
128
+ constructor(vp, options) {
129
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
130
+ this.useCachedDecorations = true;
131
+ this._decoration = FrustumDecoration.create(vp, options);
132
+ }
133
+ decorate(context) {
134
+ if (undefined !== this._decoration)
135
+ this._decoration.decorate(context);
136
+ }
137
+ /** Add the decoration to the specified viewport. */
138
+ static enable(vp, options) {
139
+ FrustumDecorator.disable();
140
+ FrustumDecorator._instance = new FrustumDecorator(vp, options);
141
+ IModelApp.viewManager.addDecorator(FrustumDecorator._instance);
142
+ }
143
+ /** Remove the decoration from the specified viewport. */
144
+ static disable() {
145
+ const instance = FrustumDecorator._instance;
146
+ if (undefined !== instance) {
147
+ IModelApp.viewManager.dropDecorator(instance);
148
+ FrustumDecorator._instance = undefined;
149
+ }
150
+ }
151
+ static get isEnabled() { return undefined !== FrustumDecorator._instance; }
152
+ }
153
+ /** Enable ("ON"), disable ("OFF"), or toggle ("TOGGLE" or omitted) the [[FrustumDecorator]].
154
+ * @beta
155
+ */
156
+ export class ToggleFrustumSnapshotTool extends Tool {
157
+ static get minArgs() { return 0; }
158
+ static get maxArgs() { return 2; }
159
+ async run(enable, showPreloadFrustum, showBackgroundIntersections) {
160
+ const vp = IModelApp.viewManager.selectedView;
161
+ if (undefined === vp)
162
+ return true;
163
+ if (undefined === enable)
164
+ enable = !FrustumDecorator.isEnabled;
165
+ if (enable !== FrustumDecorator.isEnabled) {
166
+ if (enable) {
167
+ FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });
168
+ vp.onChangeView.addOnce(() => FrustumDecorator.disable());
169
+ }
170
+ else {
171
+ FrustumDecorator.disable();
172
+ }
173
+ }
174
+ return true;
175
+ }
176
+ async parseAndRun(...args) {
177
+ let showPreload, showBackgroundIntersections, enable;
178
+ for (const arg of args) {
179
+ if (arg === "preload")
180
+ showPreload = true;
181
+ else if (arg === "background")
182
+ showBackgroundIntersections = true;
183
+ else
184
+ enable = parseToggle(arg);
185
+ }
186
+ if (typeof enable !== "string")
187
+ await this.run(enable, showPreload, showBackgroundIntersections);
188
+ return true;
189
+ }
190
+ }
191
+ ToggleFrustumSnapshotTool.toolId = "ToggleFrustumSnapshot";
192
+ /**
193
+ * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.
194
+ * Only useful when more than one spatial viewport is open.
195
+ */
196
+ class SelectedViewFrustumDecoration {
197
+ constructor(vp, _options) {
198
+ this._options = _options;
199
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
200
+ this.useCachedDecorations = true;
201
+ this._targetVp = vp;
202
+ this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);
203
+ this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method
204
+ IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
205
+ }
206
+ stop() {
207
+ if (this._removeDecorationListener) {
208
+ this._removeDecorationListener();
209
+ this._removeDecorationListener = undefined;
210
+ }
211
+ if (this._removeViewChangedListener) {
212
+ this._removeViewChangedListener();
213
+ this._removeViewChangedListener = undefined;
214
+ }
215
+ IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
216
+ }
217
+ onViewChanged(targetVp) {
218
+ if (targetVp !== this._targetVp)
219
+ return;
220
+ const decorator = SelectedViewFrustumDecoration._decorator;
221
+ if (undefined !== decorator) {
222
+ for (const vp of IModelApp.viewManager) {
223
+ if (vp !== this._targetVp)
224
+ vp.invalidateCachedDecorations(decorator);
225
+ }
226
+ }
227
+ }
228
+ decorate(context) {
229
+ const vp = context.viewport;
230
+ if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())
231
+ return;
232
+ const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
233
+ if (this._targetVp.isCameraOn) {
234
+ const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);
235
+ const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;
236
+ FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);
237
+ }
238
+ const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);
239
+ const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);
240
+ FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...
241
+ FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...
242
+ if (this._options && this._options.showPreloadFrustum)
243
+ FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());
244
+ context.addDecorationFromBuilder(builder);
245
+ }
246
+ // Returns true if decoration becomes enabled.
247
+ static toggle(vp, enabled) {
248
+ if (undefined !== enabled) {
249
+ const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;
250
+ if (enabled === alreadyEnabled)
251
+ return alreadyEnabled;
252
+ }
253
+ if (undefined === SelectedViewFrustumDecoration._decorator) {
254
+ SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);
255
+ return true;
256
+ }
257
+ else {
258
+ SelectedViewFrustumDecoration._decorator.stop();
259
+ SelectedViewFrustumDecoration._decorator = undefined;
260
+ return false;
261
+ }
262
+ }
263
+ }
264
+ /** Enable ("ON"), disable ("OFF"), or toggle ("TOGGLE" or omitted) the selected view frustum decoration.
265
+ * @beta
266
+ */
267
+ export class ToggleSelectedViewFrustumTool extends Tool {
268
+ static get minArgs() { return 0; }
269
+ static get maxArgs() { return 1; }
270
+ async run(enable) {
271
+ const vp = IModelApp.viewManager.selectedView;
272
+ if (undefined === vp || !vp.view.isSpatialView())
273
+ return false;
274
+ if (SelectedViewFrustumDecoration.toggle(vp, enable)) {
275
+ const remove = vp.onChangeView.addListener((_vp, prev) => {
276
+ if (!prev.hasSameCoordinates(vp.view)) {
277
+ SelectedViewFrustumDecoration.toggle(vp, false);
278
+ remove();
279
+ }
280
+ });
281
+ }
282
+ return true;
283
+ }
284
+ async parseAndRun(...args) {
285
+ const enable = parseToggle(args[0]);
286
+ if (typeof enable !== "string")
287
+ await this.run(enable);
288
+ return true;
289
+ }
290
+ }
291
+ ToggleSelectedViewFrustumTool.toolId = "ToggleSelectedViewFrustum";
292
+ class ShadowFrustumDecoration {
293
+ constructor(vp) {
294
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
295
+ this.useCachedDecorations = true;
296
+ this._targetVp = vp;
297
+ const removeDecorator = IModelApp.viewManager.addDecorator(this);
298
+ const removeOnRender = vp.onRender.addListener((_) => this.onRender());
299
+ this._cleanup = () => {
300
+ removeDecorator();
301
+ removeOnRender();
302
+ };
303
+ IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
304
+ }
305
+ stop() {
306
+ if (undefined !== this._cleanup) {
307
+ this._cleanup();
308
+ this._cleanup = undefined;
309
+ }
310
+ IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
311
+ }
312
+ onRender() {
313
+ const decorator = ShadowFrustumDecoration._instance;
314
+ if (undefined !== decorator) {
315
+ for (const vp of IModelApp.viewManager) {
316
+ if (vp !== this._targetVp)
317
+ vp.invalidateCachedDecorations(decorator);
318
+ }
319
+ }
320
+ }
321
+ decorate(context) {
322
+ const frustum = this._targetVp.target.debugControl.shadowFrustum;
323
+ if (undefined === frustum)
324
+ return;
325
+ const thisVp = context.viewport;
326
+ if (thisVp === this._targetVp || !thisVp.view.isSpatialView())
327
+ return;
328
+ const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
329
+ FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);
330
+ context.addDecorationFromBuilder(builder);
331
+ }
332
+ static toggle(vp, enabled) {
333
+ const instance = ShadowFrustumDecoration._instance;
334
+ if (undefined !== enabled) {
335
+ const alreadyEnabled = undefined !== instance;
336
+ if (enabled === alreadyEnabled)
337
+ return;
338
+ }
339
+ if (undefined === instance) {
340
+ ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);
341
+ }
342
+ else {
343
+ instance.stop();
344
+ ShadowFrustumDecoration._instance = undefined;
345
+ }
346
+ }
347
+ }
348
+ /** Toggle visualization of the selected viewport's shadow frustum in all other viewports.
349
+ * @beta
350
+ */
351
+ export class ToggleShadowFrustumTool extends Tool {
352
+ static get minArgs() { return 0; }
353
+ static get maxArgs() { return 1; }
354
+ async run(enable) {
355
+ const vp = IModelApp.viewManager.selectedView;
356
+ if (undefined !== vp && vp.view.isSpatialView())
357
+ ShadowFrustumDecoration.toggle(vp, enable);
358
+ return true;
359
+ }
360
+ async parseAndRun(...args) {
361
+ const enable = parseToggle(args[0]);
362
+ if (typeof enable !== "string")
363
+ await this.run(enable);
364
+ return true;
365
+ }
366
+ }
367
+ ToggleShadowFrustumTool.toolId = "ToggleShadowFrustum";
365
368
  //# sourceMappingURL=FrustumDecoration.js.map