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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/lib/cjs/ClipboardUtilities.d.ts +8 -8
  2. package/lib/cjs/ClipboardUtilities.js +26 -26
  3. package/lib/cjs/ClipboardUtilities.js.map +1 -1
  4. package/lib/cjs/FrontEndDevTools.d.ts +19 -19
  5. package/lib/cjs/FrontEndDevTools.js +219 -219
  6. package/lib/cjs/FrontEndDevTools.js.map +1 -1
  7. package/lib/cjs/effects/Convolution.d.ts +68 -68
  8. package/lib/cjs/effects/Convolution.js +165 -165
  9. package/lib/cjs/effects/Convolution.js.map +1 -1
  10. package/lib/cjs/effects/EffectTools.d.ts +33 -33
  11. package/lib/cjs/effects/EffectTools.js +68 -68
  12. package/lib/cjs/effects/EffectTools.js.map +1 -1
  13. package/lib/cjs/effects/Explosion.d.ts +12 -12
  14. package/lib/cjs/effects/Explosion.js +168 -168
  15. package/lib/cjs/effects/Explosion.js.map +1 -1
  16. package/lib/cjs/effects/FlipImage.d.ts +30 -30
  17. package/lib/cjs/effects/FlipImage.js +99 -99
  18. package/lib/cjs/effects/FlipImage.js.map +1 -1
  19. package/lib/cjs/effects/LensDistortion.d.ts +34 -34
  20. package/lib/cjs/effects/LensDistortion.js +109 -109
  21. package/lib/cjs/effects/LensDistortion.js.map +1 -1
  22. package/lib/cjs/effects/Random.d.ts +24 -24
  23. package/lib/cjs/effects/Random.js +49 -49
  24. package/lib/cjs/effects/Random.js.map +1 -1
  25. package/lib/cjs/effects/Saturation.d.ts +30 -30
  26. package/lib/cjs/effects/Saturation.js +85 -85
  27. package/lib/cjs/effects/Saturation.js.map +1 -1
  28. package/lib/cjs/effects/Snow.d.ts +76 -76
  29. package/lib/cjs/effects/Snow.js +187 -187
  30. package/lib/cjs/effects/Snow.js.map +1 -1
  31. package/lib/cjs/effects/Vignette.d.ts +39 -39
  32. package/lib/cjs/effects/Vignette.js +108 -108
  33. package/lib/cjs/effects/Vignette.js.map +1 -1
  34. package/lib/cjs/frontend-devtools.d.ts +82 -82
  35. package/lib/cjs/frontend-devtools.js +98 -98
  36. package/lib/cjs/frontend-devtools.js.map +1 -1
  37. package/lib/cjs/tools/AnimationIntervalTool.d.ts +15 -15
  38. package/lib/cjs/tools/AnimationIntervalTool.js +30 -30
  39. package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
  40. package/lib/cjs/tools/ChangeUnitsTool.d.ts +15 -15
  41. package/lib/cjs/tools/ChangeUnitsTool.js +41 -41
  42. package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
  43. package/lib/cjs/tools/ClipTools.d.ts +67 -67
  44. package/lib/cjs/tools/ClipTools.js +164 -164
  45. package/lib/cjs/tools/ClipTools.js.map +1 -1
  46. package/lib/cjs/tools/DisplayStyleTools.d.ts +145 -145
  47. package/lib/cjs/tools/DisplayStyleTools.js +370 -370
  48. package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
  49. package/lib/cjs/tools/EmphasizeElementsTool.d.ts +60 -60
  50. package/lib/cjs/tools/EmphasizeElementsTool.js +154 -154
  51. package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
  52. package/lib/cjs/tools/FrustumDecoration.d.ts +57 -57
  53. package/lib/cjs/tools/FrustumDecoration.d.ts.map +1 -1
  54. package/lib/cjs/tools/FrustumDecoration.js +374 -371
  55. package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
  56. package/lib/cjs/tools/InspectElementTool.d.ts +42 -42
  57. package/lib/cjs/tools/InspectElementTool.js +198 -198
  58. package/lib/cjs/tools/InspectElementTool.js.map +1 -1
  59. package/lib/cjs/tools/MapLayerTool.d.ts +257 -257
  60. package/lib/cjs/tools/MapLayerTool.js +499 -499
  61. package/lib/cjs/tools/MapLayerTool.js.map +1 -1
  62. package/lib/cjs/tools/MeasureTileLoadTime.d.ts +12 -12
  63. package/lib/cjs/tools/MeasureTileLoadTime.d.ts.map +1 -1
  64. package/lib/cjs/tools/MeasureTileLoadTime.js +63 -60
  65. package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
  66. package/lib/cjs/tools/ModelAppearanceTools.d.ts +86 -86
  67. package/lib/cjs/tools/ModelAppearanceTools.js +183 -183
  68. package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
  69. package/lib/cjs/tools/PlanProjectionTools.d.ts +40 -40
  70. package/lib/cjs/tools/PlanProjectionTools.js +149 -149
  71. package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
  72. package/lib/cjs/tools/PlanarMaskTools.d.ts +182 -182
  73. package/lib/cjs/tools/PlanarMaskTools.d.ts.map +1 -1
  74. package/lib/cjs/tools/PlanarMaskTools.js +393 -390
  75. package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
  76. package/lib/cjs/tools/ProjectExtents.d.ts +41 -41
  77. package/lib/cjs/tools/ProjectExtents.js +110 -110
  78. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  79. package/lib/cjs/tools/RealityModelTools.d.ts +116 -116
  80. package/lib/cjs/tools/RealityModelTools.js +281 -281
  81. package/lib/cjs/tools/RealityModelTools.js.map +1 -1
  82. package/lib/cjs/tools/RealityTransitionTool.d.ts +25 -25
  83. package/lib/cjs/tools/RealityTransitionTool.js +116 -116
  84. package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
  85. package/lib/cjs/tools/RenderSystemTools.d.ts +38 -38
  86. package/lib/cjs/tools/RenderSystemTools.js +70 -70
  87. package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
  88. package/lib/cjs/tools/RenderTargetTools.d.ts +100 -100
  89. package/lib/cjs/tools/RenderTargetTools.js +166 -166
  90. package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
  91. package/lib/cjs/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  92. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +30 -30
  93. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  94. package/lib/cjs/tools/SavedViews.d.ts +46 -46
  95. package/lib/cjs/tools/SavedViews.js +136 -136
  96. package/lib/cjs/tools/SavedViews.js.map +1 -1
  97. package/lib/cjs/tools/ScheduleScriptTools.d.ts +37 -37
  98. package/lib/cjs/tools/ScheduleScriptTools.js +159 -159
  99. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  100. package/lib/cjs/tools/SelectionTools.d.ts +28 -28
  101. package/lib/cjs/tools/SelectionTools.d.ts.map +1 -1
  102. package/lib/cjs/tools/SelectionTools.js +87 -87
  103. package/lib/cjs/tools/SelectionTools.js.map +1 -1
  104. package/lib/cjs/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  105. package/lib/cjs/tools/SetGpuMemoryLimitTool.js +33 -33
  106. package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
  107. package/lib/cjs/tools/SourceAspectIdTools.d.ts +40 -40
  108. package/lib/cjs/tools/SourceAspectIdTools.js +86 -86
  109. package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
  110. package/lib/cjs/tools/TileRequestDecoration.d.ts +12 -12
  111. package/lib/cjs/tools/TileRequestDecoration.js +83 -83
  112. package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
  113. package/lib/cjs/tools/TileTreeBoundsDecoration.d.ts +11 -11
  114. package/lib/cjs/tools/TileTreeBoundsDecoration.js +74 -74
  115. package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
  116. package/lib/cjs/tools/ToolTipProvider.d.ts +15 -15
  117. package/lib/cjs/tools/ToolTipProvider.js +66 -66
  118. package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
  119. package/lib/cjs/tools/ViewportTools.d.ts +218 -218
  120. package/lib/cjs/tools/ViewportTools.js +516 -516
  121. package/lib/cjs/tools/ViewportTools.js.map +1 -1
  122. package/lib/cjs/tools/parseArgs.d.ts +23 -23
  123. package/lib/cjs/tools/parseArgs.js +51 -51
  124. package/lib/cjs/tools/parseArgs.js.map +1 -1
  125. package/lib/cjs/tools/parseBoolean.d.ts +8 -8
  126. package/lib/cjs/tools/parseBoolean.js +26 -26
  127. package/lib/cjs/tools/parseBoolean.js.map +1 -1
  128. package/lib/cjs/tools/parseToggle.d.ts +8 -8
  129. package/lib/cjs/tools/parseToggle.js +25 -25
  130. package/lib/cjs/tools/parseToggle.js.map +1 -1
  131. package/lib/cjs/ui/Button.d.ts +29 -29
  132. package/lib/cjs/ui/Button.d.ts.map +1 -1
  133. package/lib/cjs/ui/Button.js +26 -26
  134. package/lib/cjs/ui/Button.js.map +1 -1
  135. package/lib/cjs/ui/CheckBox.d.ts +23 -23
  136. package/lib/cjs/ui/CheckBox.js +27 -27
  137. package/lib/cjs/ui/CheckBox.js.map +1 -1
  138. package/lib/cjs/ui/ColorInput.d.ts +27 -27
  139. package/lib/cjs/ui/ColorInput.d.ts.map +1 -1
  140. package/lib/cjs/ui/ColorInput.js +53 -53
  141. package/lib/cjs/ui/ColorInput.js.map +1 -1
  142. package/lib/cjs/ui/ComboBox.d.ts +28 -28
  143. package/lib/cjs/ui/ComboBox.js +42 -42
  144. package/lib/cjs/ui/ComboBox.js.map +1 -1
  145. package/lib/cjs/ui/DataList.d.ts +27 -27
  146. package/lib/cjs/ui/DataList.js +39 -39
  147. package/lib/cjs/ui/DataList.js.map +1 -1
  148. package/lib/cjs/ui/NestedMenu.d.ts +19 -19
  149. package/lib/cjs/ui/NestedMenu.d.ts.map +1 -1
  150. package/lib/cjs/ui/NestedMenu.js +46 -46
  151. package/lib/cjs/ui/NestedMenu.js.map +1 -1
  152. package/lib/cjs/ui/NumericInput.d.ts +34 -34
  153. package/lib/cjs/ui/NumericInput.d.ts.map +1 -1
  154. package/lib/cjs/ui/NumericInput.js +59 -59
  155. package/lib/cjs/ui/NumericInput.js.map +1 -1
  156. package/lib/cjs/ui/RadioBox.d.ts +28 -28
  157. package/lib/cjs/ui/RadioBox.js +76 -76
  158. package/lib/cjs/ui/RadioBox.js.map +1 -1
  159. package/lib/cjs/ui/Slider.d.ts +24 -24
  160. package/lib/cjs/ui/Slider.js +32 -32
  161. package/lib/cjs/ui/Slider.js.map +1 -1
  162. package/lib/cjs/ui/TextBox.d.ts +32 -32
  163. package/lib/cjs/ui/TextBox.js +56 -56
  164. package/lib/cjs/ui/TextBox.js.map +1 -1
  165. package/lib/cjs/widgets/DiagnosticsPanel.d.ts +37 -37
  166. package/lib/cjs/widgets/DiagnosticsPanel.js +81 -81
  167. package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
  168. package/lib/cjs/widgets/FpsTracker.d.ts +19 -19
  169. package/lib/cjs/widgets/FpsTracker.js +56 -56
  170. package/lib/cjs/widgets/FpsTracker.js.map +1 -1
  171. package/lib/cjs/widgets/GpuProfiler.d.ts +16 -16
  172. package/lib/cjs/widgets/GpuProfiler.js +192 -192
  173. package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
  174. package/lib/cjs/widgets/KeyinField.d.ts +61 -61
  175. package/lib/cjs/widgets/KeyinField.js +187 -187
  176. package/lib/cjs/widgets/KeyinField.js.map +1 -1
  177. package/lib/cjs/widgets/MemoryTracker.d.ts +27 -27
  178. package/lib/cjs/widgets/MemoryTracker.js +243 -243
  179. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  180. package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +15 -15
  181. package/lib/cjs/widgets/RenderCommandBreakdown.js +68 -68
  182. package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
  183. package/lib/cjs/widgets/TileMemoryBreakdown.d.ts +30 -30
  184. package/lib/cjs/widgets/TileMemoryBreakdown.js +204 -204
  185. package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
  186. package/lib/cjs/widgets/TileStatisticsTracker.d.ts +21 -21
  187. package/lib/cjs/widgets/TileStatisticsTracker.js +142 -142
  188. package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
  189. package/lib/cjs/widgets/ToolSettingsTracker.d.ts +9 -9
  190. package/lib/cjs/widgets/ToolSettingsTracker.d.ts.map +1 -1
  191. package/lib/cjs/widgets/ToolSettingsTracker.js +211 -181
  192. package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
  193. package/lib/esm/ClipboardUtilities.d.ts +8 -8
  194. package/lib/esm/ClipboardUtilities.js +22 -22
  195. package/lib/esm/ClipboardUtilities.js.map +1 -1
  196. package/lib/esm/FrontEndDevTools.d.ts +19 -19
  197. package/lib/esm/FrontEndDevTools.js +215 -215
  198. package/lib/esm/FrontEndDevTools.js.map +1 -1
  199. package/lib/esm/effects/Convolution.d.ts +68 -68
  200. package/lib/esm/effects/Convolution.js +155 -155
  201. package/lib/esm/effects/Convolution.js.map +1 -1
  202. package/lib/esm/effects/EffectTools.d.ts +33 -33
  203. package/lib/esm/effects/EffectTools.js +62 -62
  204. package/lib/esm/effects/EffectTools.js.map +1 -1
  205. package/lib/esm/effects/Explosion.d.ts +12 -12
  206. package/lib/esm/effects/Explosion.js +164 -164
  207. package/lib/esm/effects/Explosion.js.map +1 -1
  208. package/lib/esm/effects/FlipImage.d.ts +30 -30
  209. package/lib/esm/effects/FlipImage.js +94 -94
  210. package/lib/esm/effects/FlipImage.js.map +1 -1
  211. package/lib/esm/effects/LensDistortion.d.ts +34 -34
  212. package/lib/esm/effects/LensDistortion.js +104 -104
  213. package/lib/esm/effects/LensDistortion.js.map +1 -1
  214. package/lib/esm/effects/Random.d.ts +24 -24
  215. package/lib/esm/effects/Random.js +41 -41
  216. package/lib/esm/effects/Random.js.map +1 -1
  217. package/lib/esm/effects/Saturation.d.ts +30 -30
  218. package/lib/esm/effects/Saturation.js +80 -80
  219. package/lib/esm/effects/Saturation.js.map +1 -1
  220. package/lib/esm/effects/Snow.d.ts +76 -76
  221. package/lib/esm/effects/Snow.js +182 -182
  222. package/lib/esm/effects/Snow.js.map +1 -1
  223. package/lib/esm/effects/Vignette.d.ts +39 -39
  224. package/lib/esm/effects/Vignette.js +103 -103
  225. package/lib/esm/effects/Vignette.js.map +1 -1
  226. package/lib/esm/frontend-devtools.d.ts +82 -82
  227. package/lib/esm/frontend-devtools.js +86 -86
  228. package/lib/esm/frontend-devtools.js.map +1 -1
  229. package/lib/esm/tools/AnimationIntervalTool.d.ts +15 -15
  230. package/lib/esm/tools/AnimationIntervalTool.js +26 -26
  231. package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
  232. package/lib/esm/tools/ChangeUnitsTool.d.ts +15 -15
  233. package/lib/esm/tools/ChangeUnitsTool.js +37 -37
  234. package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
  235. package/lib/esm/tools/ClipTools.d.ts +67 -67
  236. package/lib/esm/tools/ClipTools.js +158 -158
  237. package/lib/esm/tools/ClipTools.js.map +1 -1
  238. package/lib/esm/tools/DisplayStyleTools.d.ts +145 -145
  239. package/lib/esm/tools/DisplayStyleTools.js +356 -356
  240. package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
  241. package/lib/esm/tools/EmphasizeElementsTool.d.ts +60 -60
  242. package/lib/esm/tools/EmphasizeElementsTool.js +145 -145
  243. package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
  244. package/lib/esm/tools/FrustumDecoration.d.ts +57 -57
  245. package/lib/esm/tools/FrustumDecoration.d.ts.map +1 -1
  246. package/lib/esm/tools/FrustumDecoration.js +367 -364
  247. package/lib/esm/tools/FrustumDecoration.js.map +1 -1
  248. package/lib/esm/tools/InspectElementTool.d.ts +42 -42
  249. package/lib/esm/tools/InspectElementTool.js +194 -194
  250. package/lib/esm/tools/InspectElementTool.js.map +1 -1
  251. package/lib/esm/tools/MapLayerTool.d.ts +257 -257
  252. package/lib/esm/tools/MapLayerTool.js +478 -478
  253. package/lib/esm/tools/MapLayerTool.js.map +1 -1
  254. package/lib/esm/tools/MeasureTileLoadTime.d.ts +12 -12
  255. package/lib/esm/tools/MeasureTileLoadTime.d.ts.map +1 -1
  256. package/lib/esm/tools/MeasureTileLoadTime.js +59 -56
  257. package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
  258. package/lib/esm/tools/ModelAppearanceTools.d.ts +86 -86
  259. package/lib/esm/tools/ModelAppearanceTools.js +172 -172
  260. package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
  261. package/lib/esm/tools/PlanProjectionTools.d.ts +40 -40
  262. package/lib/esm/tools/PlanProjectionTools.js +143 -143
  263. package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
  264. package/lib/esm/tools/PlanarMaskTools.d.ts +182 -182
  265. package/lib/esm/tools/PlanarMaskTools.d.ts.map +1 -1
  266. package/lib/esm/tools/PlanarMaskTools.js +377 -374
  267. package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
  268. package/lib/esm/tools/ProjectExtents.d.ts +41 -41
  269. package/lib/esm/tools/ProjectExtents.js +104 -104
  270. package/lib/esm/tools/ProjectExtents.js.map +1 -1
  271. package/lib/esm/tools/RealityModelTools.d.ts +116 -116
  272. package/lib/esm/tools/RealityModelTools.js +268 -268
  273. package/lib/esm/tools/RealityModelTools.js.map +1 -1
  274. package/lib/esm/tools/RealityTransitionTool.d.ts +25 -25
  275. package/lib/esm/tools/RealityTransitionTool.js +112 -112
  276. package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
  277. package/lib/esm/tools/RenderSystemTools.d.ts +38 -38
  278. package/lib/esm/tools/RenderSystemTools.js +63 -63
  279. package/lib/esm/tools/RenderSystemTools.js.map +1 -1
  280. package/lib/esm/tools/RenderTargetTools.d.ts +100 -100
  281. package/lib/esm/tools/RenderTargetTools.js +152 -152
  282. package/lib/esm/tools/RenderTargetTools.js.map +1 -1
  283. package/lib/esm/tools/ReportWebGLCompatibilityTool.d.ts +11 -11
  284. package/lib/esm/tools/ReportWebGLCompatibilityTool.js +26 -26
  285. package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  286. package/lib/esm/tools/SavedViews.d.ts +46 -46
  287. package/lib/esm/tools/SavedViews.js +128 -128
  288. package/lib/esm/tools/SavedViews.js.map +1 -1
  289. package/lib/esm/tools/ScheduleScriptTools.d.ts +37 -37
  290. package/lib/esm/tools/ScheduleScriptTools.js +153 -153
  291. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  292. package/lib/esm/tools/SelectionTools.d.ts +28 -28
  293. package/lib/esm/tools/SelectionTools.d.ts.map +1 -1
  294. package/lib/esm/tools/SelectionTools.js +82 -82
  295. package/lib/esm/tools/SelectionTools.js.map +1 -1
  296. package/lib/esm/tools/SetGpuMemoryLimitTool.d.ts +15 -15
  297. package/lib/esm/tools/SetGpuMemoryLimitTool.js +29 -29
  298. package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
  299. package/lib/esm/tools/SourceAspectIdTools.d.ts +40 -40
  300. package/lib/esm/tools/SourceAspectIdTools.js +80 -80
  301. package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
  302. package/lib/esm/tools/TileRequestDecoration.d.ts +12 -12
  303. package/lib/esm/tools/TileRequestDecoration.js +79 -79
  304. package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
  305. package/lib/esm/tools/TileTreeBoundsDecoration.d.ts +11 -11
  306. package/lib/esm/tools/TileTreeBoundsDecoration.js +70 -70
  307. package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
  308. package/lib/esm/tools/ToolTipProvider.d.ts +15 -15
  309. package/lib/esm/tools/ToolTipProvider.js +62 -62
  310. package/lib/esm/tools/ToolTipProvider.js.map +1 -1
  311. package/lib/esm/tools/ViewportTools.d.ts +218 -218
  312. package/lib/esm/tools/ViewportTools.js +492 -492
  313. package/lib/esm/tools/ViewportTools.js.map +1 -1
  314. package/lib/esm/tools/parseArgs.d.ts +23 -23
  315. package/lib/esm/tools/parseArgs.js +47 -47
  316. package/lib/esm/tools/parseArgs.js.map +1 -1
  317. package/lib/esm/tools/parseBoolean.d.ts +8 -8
  318. package/lib/esm/tools/parseBoolean.js +22 -22
  319. package/lib/esm/tools/parseBoolean.js.map +1 -1
  320. package/lib/esm/tools/parseToggle.d.ts +8 -8
  321. package/lib/esm/tools/parseToggle.js +21 -21
  322. package/lib/esm/tools/parseToggle.js.map +1 -1
  323. package/lib/esm/ui/Button.d.ts +29 -29
  324. package/lib/esm/ui/Button.d.ts.map +1 -1
  325. package/lib/esm/ui/Button.js +22 -22
  326. package/lib/esm/ui/Button.js.map +1 -1
  327. package/lib/esm/ui/CheckBox.d.ts +23 -23
  328. package/lib/esm/ui/CheckBox.js +23 -23
  329. package/lib/esm/ui/CheckBox.js.map +1 -1
  330. package/lib/esm/ui/ColorInput.d.ts +27 -27
  331. package/lib/esm/ui/ColorInput.d.ts.map +1 -1
  332. package/lib/esm/ui/ColorInput.js +48 -48
  333. package/lib/esm/ui/ColorInput.js.map +1 -1
  334. package/lib/esm/ui/ComboBox.d.ts +28 -28
  335. package/lib/esm/ui/ComboBox.js +38 -38
  336. package/lib/esm/ui/ComboBox.js.map +1 -1
  337. package/lib/esm/ui/DataList.d.ts +27 -27
  338. package/lib/esm/ui/DataList.js +34 -34
  339. package/lib/esm/ui/DataList.js.map +1 -1
  340. package/lib/esm/ui/NestedMenu.d.ts +19 -19
  341. package/lib/esm/ui/NestedMenu.d.ts.map +1 -1
  342. package/lib/esm/ui/NestedMenu.js +42 -42
  343. package/lib/esm/ui/NestedMenu.js.map +1 -1
  344. package/lib/esm/ui/NumericInput.d.ts +34 -34
  345. package/lib/esm/ui/NumericInput.d.ts.map +1 -1
  346. package/lib/esm/ui/NumericInput.js +54 -54
  347. package/lib/esm/ui/NumericInput.js.map +1 -1
  348. package/lib/esm/ui/RadioBox.d.ts +28 -28
  349. package/lib/esm/ui/RadioBox.js +72 -72
  350. package/lib/esm/ui/RadioBox.js.map +1 -1
  351. package/lib/esm/ui/Slider.d.ts +24 -24
  352. package/lib/esm/ui/Slider.js +28 -28
  353. package/lib/esm/ui/Slider.js.map +1 -1
  354. package/lib/esm/ui/TextBox.d.ts +32 -32
  355. package/lib/esm/ui/TextBox.js +52 -52
  356. package/lib/esm/ui/TextBox.js.map +1 -1
  357. package/lib/esm/widgets/DiagnosticsPanel.d.ts +37 -37
  358. package/lib/esm/widgets/DiagnosticsPanel.js +77 -77
  359. package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
  360. package/lib/esm/widgets/FpsTracker.d.ts +19 -19
  361. package/lib/esm/widgets/FpsTracker.js +52 -52
  362. package/lib/esm/widgets/FpsTracker.js.map +1 -1
  363. package/lib/esm/widgets/GpuProfiler.d.ts +16 -16
  364. package/lib/esm/widgets/GpuProfiler.js +188 -188
  365. package/lib/esm/widgets/GpuProfiler.js.map +1 -1
  366. package/lib/esm/widgets/KeyinField.d.ts +61 -61
  367. package/lib/esm/widgets/KeyinField.js +183 -183
  368. package/lib/esm/widgets/KeyinField.js.map +1 -1
  369. package/lib/esm/widgets/MemoryTracker.d.ts +27 -27
  370. package/lib/esm/widgets/MemoryTracker.js +238 -238
  371. package/lib/esm/widgets/MemoryTracker.js.map +1 -1
  372. package/lib/esm/widgets/RenderCommandBreakdown.d.ts +15 -15
  373. package/lib/esm/widgets/RenderCommandBreakdown.js +64 -64
  374. package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
  375. package/lib/esm/widgets/TileMemoryBreakdown.d.ts +30 -30
  376. package/lib/esm/widgets/TileMemoryBreakdown.js +200 -200
  377. package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
  378. package/lib/esm/widgets/TileStatisticsTracker.d.ts +21 -21
  379. package/lib/esm/widgets/TileStatisticsTracker.js +138 -138
  380. package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
  381. package/lib/esm/widgets/ToolSettingsTracker.d.ts +9 -9
  382. package/lib/esm/widgets/ToolSettingsTracker.d.ts.map +1 -1
  383. package/lib/esm/widgets/ToolSettingsTracker.js +207 -177
  384. package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
  385. package/lib/public/locales/en/FrontendDevTools.json +479 -479
  386. package/package.json +7 -7
@@ -1,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