@itwin/frontend-devtools 5.0.0-dev.56 → 5.0.0-dev.58

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 (183) hide show
  1. package/lib/cjs/FrontEndDevTools.js +1 -1
  2. package/lib/cjs/FrontEndDevTools.js.map +1 -1
  3. package/lib/cjs/effects/Convolution.js +6 -6
  4. package/lib/cjs/effects/Convolution.js.map +1 -1
  5. package/lib/cjs/effects/EffectTools.js +2 -2
  6. package/lib/cjs/effects/EffectTools.js.map +1 -1
  7. package/lib/cjs/effects/Explosion.js +33 -21
  8. package/lib/cjs/effects/Explosion.js.map +1 -1
  9. package/lib/cjs/effects/FlipImage.js +2 -2
  10. package/lib/cjs/effects/FlipImage.js.map +1 -1
  11. package/lib/cjs/effects/LensDistortion.js +4 -4
  12. package/lib/cjs/effects/LensDistortion.js.map +1 -1
  13. package/lib/cjs/effects/Saturation.js +3 -3
  14. package/lib/cjs/effects/Saturation.js.map +1 -1
  15. package/lib/cjs/effects/Snow.js +15 -5
  16. package/lib/cjs/effects/Snow.js.map +1 -1
  17. package/lib/cjs/effects/Vignette.js +5 -5
  18. package/lib/cjs/effects/Vignette.js.map +1 -1
  19. package/lib/cjs/tools/AnimationIntervalTool.js +1 -1
  20. package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
  21. package/lib/cjs/tools/ChangeUnitsTool.js +1 -1
  22. package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
  23. package/lib/cjs/tools/ClipTools.js +6 -8
  24. package/lib/cjs/tools/ClipTools.js.map +1 -1
  25. package/lib/cjs/tools/DisplayStyleTools.js +21 -25
  26. package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
  27. package/lib/cjs/tools/EmphasizeElementsTool.js +7 -13
  28. package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
  29. package/lib/cjs/tools/FrustumDecoration.js +28 -9
  30. package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
  31. package/lib/cjs/tools/InspectElementTool.js +7 -6
  32. package/lib/cjs/tools/InspectElementTool.js.map +1 -1
  33. package/lib/cjs/tools/MapLayerTool.js +24 -20
  34. package/lib/cjs/tools/MapLayerTool.js.map +1 -1
  35. package/lib/cjs/tools/MeasureTileLoadTime.js +4 -1
  36. package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
  37. package/lib/cjs/tools/ModelAppearanceTools.js +9 -9
  38. package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
  39. package/lib/cjs/tools/PlanProjectionTools.js +8 -15
  40. package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
  41. package/lib/cjs/tools/PlanarMaskTools.js +20 -25
  42. package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
  43. package/lib/cjs/tools/ProjectExtents.js +6 -3
  44. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  45. package/lib/cjs/tools/RealityModelTools.js +10 -10
  46. package/lib/cjs/tools/RealityModelTools.js.map +1 -1
  47. package/lib/cjs/tools/RealityTransitionTool.js +1 -1
  48. package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
  49. package/lib/cjs/tools/RenderSystemTools.js +4 -3
  50. package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
  51. package/lib/cjs/tools/RenderTargetTools.js +15 -20
  52. package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
  53. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +1 -1
  54. package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  55. package/lib/cjs/tools/SavedViews.js +4 -7
  56. package/lib/cjs/tools/SavedViews.js.map +1 -1
  57. package/lib/cjs/tools/ScheduleScriptTools.d.ts.map +1 -1
  58. package/lib/cjs/tools/ScheduleScriptTools.js +11 -12
  59. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  60. package/lib/cjs/tools/SelectionTools.js +4 -6
  61. package/lib/cjs/tools/SelectionTools.js.map +1 -1
  62. package/lib/cjs/tools/SetGpuMemoryLimitTool.js +1 -1
  63. package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
  64. package/lib/cjs/tools/SourceAspectIdTools.js +2 -2
  65. package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
  66. package/lib/cjs/tools/TileRequestDecoration.js +6 -3
  67. package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
  68. package/lib/cjs/tools/TileTreeBoundsDecoration.js +5 -3
  69. package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
  70. package/lib/cjs/tools/ToolTipProvider.js +2 -1
  71. package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
  72. package/lib/cjs/tools/ViewportTools.js +22 -19
  73. package/lib/cjs/tools/ViewportTools.js.map +1 -1
  74. package/lib/cjs/widgets/DiagnosticsPanel.js +10 -0
  75. package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
  76. package/lib/cjs/widgets/FpsTracker.js +4 -0
  77. package/lib/cjs/widgets/FpsTracker.js.map +1 -1
  78. package/lib/cjs/widgets/GpuProfiler.js +88 -81
  79. package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
  80. package/lib/cjs/widgets/KeyinField.js +8 -1
  81. package/lib/cjs/widgets/KeyinField.js.map +1 -1
  82. package/lib/cjs/widgets/MemoryTracker.js +15 -3
  83. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  84. package/lib/cjs/widgets/RenderCommandBreakdown.js +5 -1
  85. package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
  86. package/lib/cjs/widgets/TileMemoryBreakdown.js +9 -7
  87. package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
  88. package/lib/cjs/widgets/TileStatisticsTracker.js +4 -1
  89. package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
  90. package/lib/cjs/widgets/ToolSettingsTracker.js +1 -1
  91. package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
  92. package/lib/esm/FrontEndDevTools.js +1 -1
  93. package/lib/esm/FrontEndDevTools.js.map +1 -1
  94. package/lib/esm/effects/Convolution.js +6 -6
  95. package/lib/esm/effects/Convolution.js.map +1 -1
  96. package/lib/esm/effects/EffectTools.js +2 -2
  97. package/lib/esm/effects/EffectTools.js.map +1 -1
  98. package/lib/esm/effects/Explosion.js +33 -21
  99. package/lib/esm/effects/Explosion.js.map +1 -1
  100. package/lib/esm/effects/FlipImage.js +2 -2
  101. package/lib/esm/effects/FlipImage.js.map +1 -1
  102. package/lib/esm/effects/LensDistortion.js +4 -4
  103. package/lib/esm/effects/LensDistortion.js.map +1 -1
  104. package/lib/esm/effects/Saturation.js +3 -3
  105. package/lib/esm/effects/Saturation.js.map +1 -1
  106. package/lib/esm/effects/Snow.js +15 -5
  107. package/lib/esm/effects/Snow.js.map +1 -1
  108. package/lib/esm/effects/Vignette.js +5 -5
  109. package/lib/esm/effects/Vignette.js.map +1 -1
  110. package/lib/esm/tools/AnimationIntervalTool.js +1 -1
  111. package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
  112. package/lib/esm/tools/ChangeUnitsTool.js +1 -1
  113. package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
  114. package/lib/esm/tools/ClipTools.js +6 -8
  115. package/lib/esm/tools/ClipTools.js.map +1 -1
  116. package/lib/esm/tools/DisplayStyleTools.js +21 -25
  117. package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
  118. package/lib/esm/tools/EmphasizeElementsTool.js +7 -13
  119. package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
  120. package/lib/esm/tools/FrustumDecoration.js +28 -9
  121. package/lib/esm/tools/FrustumDecoration.js.map +1 -1
  122. package/lib/esm/tools/InspectElementTool.js +7 -6
  123. package/lib/esm/tools/InspectElementTool.js.map +1 -1
  124. package/lib/esm/tools/MapLayerTool.js +24 -20
  125. package/lib/esm/tools/MapLayerTool.js.map +1 -1
  126. package/lib/esm/tools/MeasureTileLoadTime.js +4 -1
  127. package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
  128. package/lib/esm/tools/ModelAppearanceTools.js +9 -9
  129. package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
  130. package/lib/esm/tools/PlanProjectionTools.js +8 -15
  131. package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
  132. package/lib/esm/tools/PlanarMaskTools.js +20 -25
  133. package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
  134. package/lib/esm/tools/ProjectExtents.js +6 -3
  135. package/lib/esm/tools/ProjectExtents.js.map +1 -1
  136. package/lib/esm/tools/RealityModelTools.js +10 -10
  137. package/lib/esm/tools/RealityModelTools.js.map +1 -1
  138. package/lib/esm/tools/RealityTransitionTool.js +1 -1
  139. package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
  140. package/lib/esm/tools/RenderSystemTools.js +4 -3
  141. package/lib/esm/tools/RenderSystemTools.js.map +1 -1
  142. package/lib/esm/tools/RenderTargetTools.js +15 -20
  143. package/lib/esm/tools/RenderTargetTools.js.map +1 -1
  144. package/lib/esm/tools/ReportWebGLCompatibilityTool.js +1 -1
  145. package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
  146. package/lib/esm/tools/SavedViews.js +4 -7
  147. package/lib/esm/tools/SavedViews.js.map +1 -1
  148. package/lib/esm/tools/ScheduleScriptTools.d.ts.map +1 -1
  149. package/lib/esm/tools/ScheduleScriptTools.js +11 -12
  150. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  151. package/lib/esm/tools/SelectionTools.js +4 -6
  152. package/lib/esm/tools/SelectionTools.js.map +1 -1
  153. package/lib/esm/tools/SetGpuMemoryLimitTool.js +1 -1
  154. package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
  155. package/lib/esm/tools/SourceAspectIdTools.js +2 -2
  156. package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
  157. package/lib/esm/tools/TileRequestDecoration.js +6 -3
  158. package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
  159. package/lib/esm/tools/TileTreeBoundsDecoration.js +5 -3
  160. package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
  161. package/lib/esm/tools/ToolTipProvider.js +2 -1
  162. package/lib/esm/tools/ToolTipProvider.js.map +1 -1
  163. package/lib/esm/tools/ViewportTools.js +22 -19
  164. package/lib/esm/tools/ViewportTools.js.map +1 -1
  165. package/lib/esm/widgets/DiagnosticsPanel.js +10 -0
  166. package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
  167. package/lib/esm/widgets/FpsTracker.js +4 -0
  168. package/lib/esm/widgets/FpsTracker.js.map +1 -1
  169. package/lib/esm/widgets/GpuProfiler.js +88 -81
  170. package/lib/esm/widgets/GpuProfiler.js.map +1 -1
  171. package/lib/esm/widgets/KeyinField.js +8 -1
  172. package/lib/esm/widgets/KeyinField.js.map +1 -1
  173. package/lib/esm/widgets/MemoryTracker.js +15 -3
  174. package/lib/esm/widgets/MemoryTracker.js.map +1 -1
  175. package/lib/esm/widgets/RenderCommandBreakdown.js +5 -1
  176. package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
  177. package/lib/esm/widgets/TileMemoryBreakdown.js +9 -7
  178. package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
  179. package/lib/esm/widgets/TileStatisticsTracker.js +4 -1
  180. package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
  181. package/lib/esm/widgets/ToolSettingsTracker.js +1 -1
  182. package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
  183. package/package.json +6 -6
@@ -17,6 +17,15 @@ import { parseToggle } from "./parseToggle";
17
17
  * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.
18
18
  */
19
19
  class FrustumDecoration {
20
+ _options;
21
+ _worldFrustum;
22
+ _adjustedWorldFrustum;
23
+ _preloadFrustum;
24
+ _npcFrustum;
25
+ _worldToNpcMap;
26
+ _eyePoint;
27
+ _focalPlane;
28
+ _isCameraOn;
20
29
  constructor(vp, view, _options) {
21
30
  this._options = _options;
22
31
  this._worldFrustum = vp.getFrustum(CoordSystem.World, false);
@@ -125,15 +134,17 @@ class FrustumDecoration {
125
134
  * @beta
126
135
  */
127
136
  export class FrustumDecorator {
137
+ _decoration;
128
138
  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
139
  this._decoration = FrustumDecoration.create(vp, options);
132
140
  }
141
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
142
+ useCachedDecorations = true;
133
143
  decorate(context) {
134
144
  if (undefined !== this._decoration)
135
145
  this._decoration.decorate(context);
136
146
  }
147
+ static _instance;
137
148
  /** Add the decoration to the specified viewport. */
138
149
  static enable(vp, options) {
139
150
  FrustumDecorator.disable();
@@ -154,7 +165,7 @@ export class FrustumDecorator {
154
165
  * @beta
155
166
  */
156
167
  export class ToggleFrustumSnapshotTool extends Tool {
157
- static { this.toolId = "ToggleFrustumSnapshot"; }
168
+ static toolId = "ToggleFrustumSnapshot";
158
169
  static get minArgs() { return 0; }
159
170
  static get maxArgs() { return 2; }
160
171
  async run(enable, showPreloadFrustum, showBackgroundIntersections) {
@@ -194,10 +205,15 @@ export class ToggleFrustumSnapshotTool extends Tool {
194
205
  * Only useful when more than one spatial viewport is open.
195
206
  */
196
207
  class SelectedViewFrustumDecoration {
208
+ _options;
209
+ static _decorator;
210
+ _targetVp;
211
+ _removeDecorationListener;
212
+ _removeViewChangedListener;
213
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
214
+ useCachedDecorations = true;
197
215
  constructor(vp, _options) {
198
216
  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
217
  this._targetVp = vp;
202
218
  this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);
203
219
  this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method
@@ -265,7 +281,7 @@ class SelectedViewFrustumDecoration {
265
281
  * @beta
266
282
  */
267
283
  export class ToggleSelectedViewFrustumTool extends Tool {
268
- static { this.toolId = "ToggleSelectedViewFrustum"; }
284
+ static toolId = "ToggleSelectedViewFrustum";
269
285
  static get minArgs() { return 0; }
270
286
  static get maxArgs() { return 1; }
271
287
  async run(enable) {
@@ -290,9 +306,12 @@ export class ToggleSelectedViewFrustumTool extends Tool {
290
306
  }
291
307
  }
292
308
  class ShadowFrustumDecoration {
309
+ static _instance;
310
+ _targetVp;
311
+ _cleanup;
312
+ /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
313
+ useCachedDecorations = true;
293
314
  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
315
  this._targetVp = vp;
297
316
  const removeDecorator = IModelApp.viewManager.addDecorator(this);
298
317
  const removeOnRender = vp.onRender.addListener((_) => this.onRender());
@@ -349,7 +368,7 @@ class ShadowFrustumDecoration {
349
368
  * @beta
350
369
  */
351
370
  export class ToggleShadowFrustumTool extends Tool {
352
- static { this.toolId = "ToggleShadowFrustum"; }
371
+ static toolId = "ToggleShadowFrustum";
353
372
  static get minArgs() { return 0; }
354
373
  static get maxArgs() { return 1; }
355
374
  async run(enable) {
@@ -1 +1 @@
1
- {"version":3,"file":"FrustumDecoration.js","sourceRoot":"","sources":["../../../src/tools/FrustumDecoration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAS,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAW,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EACL,WAAW,EAA8C,WAAW,EAAE,SAAS,EAAE,IAAI,GACtF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C;;;;;;GA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AAQ,EAAE,CAAC;YAC3B,uBAAuB,CAAC,SAAS,GAAG,IAAI,uBAAuB,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChB,uBAAuB,CAAC,SAAS,GAAG,SAAS,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI;aACxB,WAAM,GAAG,qBAAqB,CAAC;IAC/C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;YAC7C,uBAAuB,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Map4d, Point3d } from \"@itwin/core-geometry\";\nimport { ColorByName, ColorDef, Frustum, LinePixels, Npc } from \"@itwin/core-common\";\nimport {\n CoordSystem, DecorateContext, Decorator, GraphicBuilder, GraphicType, IModelApp, Tool, Viewport, ViewState, ViewState3d,\n} from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\ninterface FrustumDecorationOptions {\n showPreloadFrustum?: boolean;\n showBackgroundIntersections?: boolean;\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n */\nclass FrustumDecoration {\n private readonly _worldFrustum: Frustum;\n private readonly _adjustedWorldFrustum: Frustum;\n private readonly _preloadFrustum: Frustum;\n private readonly _npcFrustum: Frustum;\n private readonly _worldToNpcMap: Map4d;\n private readonly _eyePoint: Point3d;\n private readonly _focalPlane: number;\n private readonly _isCameraOn: boolean;\n\n private constructor(vp: Viewport, view: ViewState3d, private readonly _options?: FrustumDecorationOptions) {\n this._worldFrustum = vp.getFrustum(CoordSystem.World, false);\n this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);\n this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();\n this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);\n this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();\n this._eyePoint = view.camera.getEyePoint().clone();\n this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;\n this._isCameraOn = vp.isCameraOn;\n }\n\n public static create(vp: Viewport, options?: FrustumDecorationOptions): FrustumDecoration | undefined {\n const view = vp.view.isSpatialView() ? vp.view : undefined;\n return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;\n }\n\n public decorate(context: DecorateContext): void {\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._isCameraOn)\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);\n\n FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n const options = this._options;\n if (options !== undefined) {\n if (options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);\n\n if (options?.showBackgroundIntersections) {\n const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();\n if (backgroundMapGeometry)\n backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);\n }\n }\n context.addDecorationFromBuilder(builder);\n }\n\n public static drawPreloadFrustum(builder: GraphicBuilder, frustum: Frustum) {\n const preloadColor = ColorDef.create(ColorByName.coral);\n builder.setSymbology(preloadColor, preloadColor, 1, LinePixels.Code2);\n builder.addFrustum(frustum);\n }\n\n public static drawFrustumBox(builder: GraphicBuilder, frustum: Frustum, adjustedBox: boolean, vp: Viewport): void {\n const backPts = this.getPlanePts(frustum.points, false); // back plane\n const frontPts = this.getPlanePts(frustum.points, true); // front plane\n\n const bgColor = vp.view.backgroundColor;\n const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);\n const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);\n const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);\n const edgeWeight = adjustedBox ? 2 : 1;\n const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;\n\n // Back plane\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(backPts);\n\n // Front plane\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(frontPts);\n\n // Bottom edge\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 0));\n builder.addLineString(this.getEdgePts(backPts, frontPts, 1));\n\n // Top edge\n builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 2));\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 3));\n }\n\n private static getEdgePts(startPts: Point3d[], endPts: Point3d[], index: number): Point3d[] {\n return [\n startPts[index],\n endPts[index],\n ];\n }\n\n private static getPlanePts(frustPts: Point3d[], front: boolean): Point3d[] {\n const baseIndex = front ? Npc._001 : Npc._000;\n const planePts = [\n frustPts[baseIndex + Npc._000],\n frustPts[baseIndex + Npc._100],\n frustPts[baseIndex + Npc._110],\n frustPts[baseIndex + Npc._010],\n ];\n\n planePts.push(planePts[0]);\n return planePts;\n }\n\n public static drawEyePositionAndFocalPlane(builder: GraphicBuilder, npcFrustum: Frustum, worldToNpcMap: Map4d, eyePoint: Point3d, focusPlaneNpc: number, vp: Viewport): void {\n // Eye position...\n const contrastColor = vp.getContrastToBackgroundColor();\n builder.setSymbology(contrastColor, ColorDef.black, 8);\n builder.addPointString([eyePoint]);\n\n // Focal plane...\n const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);\n const focalPtsWorld: Point3d[] = [];\n for (const npcPt of focalPtsNpc)\n focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));\n worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);\n\n const bgColor = vp.view.backgroundColor;\n const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);\n const focalTransColor = focalPlaneColor.withTransparency(100);\n builder.setSymbology(focalPlaneColor, focalTransColor, 2);\n builder.addLineString(focalPtsWorld);\n builder.addShape(focalPtsWorld);\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n * @beta\n */\nexport class FrustumDecorator implements Decorator {\n private readonly _decoration?: FrustumDecoration;\n\n private constructor(vp: Viewport, options?: FrustumDecorationOptions) {\n this._decoration = FrustumDecoration.create(vp, options);\n }\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n if (undefined !== this._decoration)\n this._decoration.decorate(context);\n }\n\n private static _instance?: FrustumDecorator;\n\n /** Add the decoration to the specified viewport. */\n public static enable(vp: Viewport, options?: FrustumDecorationOptions): void {\n FrustumDecorator.disable();\n FrustumDecorator._instance = new FrustumDecorator(vp, options);\n IModelApp.viewManager.addDecorator(FrustumDecorator._instance);\n }\n\n /** Remove the decoration from the specified viewport. */\n public static disable(): void {\n const instance = FrustumDecorator._instance;\n if (undefined !== instance) {\n IModelApp.viewManager.dropDecorator(instance);\n FrustumDecorator._instance = undefined;\n }\n }\n\n public static get isEnabled() { return undefined !== FrustumDecorator._instance; }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the [[FrustumDecorator]].\n * @beta\n */\nexport class ToggleFrustumSnapshotTool extends Tool {\n public static override toolId = \"ToggleFrustumSnapshot\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n\n public override async run(enable?: boolean, showPreloadFrustum?: boolean, showBackgroundIntersections?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (undefined === enable)\n enable = !FrustumDecorator.isEnabled;\n\n if (enable !== FrustumDecorator.isEnabled) {\n if (enable) {\n FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });\n vp.onChangeView.addOnce(() => FrustumDecorator.disable());\n } else {\n FrustumDecorator.disable();\n }\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n let showPreload, showBackgroundIntersections, enable;\n for (const arg of args) {\n if (arg === \"preload\")\n showPreload = true;\n else if (arg === \"background\")\n showBackgroundIntersections = true;\n else\n enable = parseToggle(arg);\n }\n\n if (typeof enable !== \"string\")\n await this.run(enable, showPreload, showBackgroundIntersections);\n\n return true;\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.\n * Only useful when more than one spatial viewport is open.\n */\nclass SelectedViewFrustumDecoration {\n private static _decorator?: SelectedViewFrustumDecoration;\n protected _targetVp: Viewport;\n protected _removeDecorationListener?: () => void;\n protected _removeViewChangedListener?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport, private _options?: FrustumDecorationOptions) {\n this._targetVp = vp;\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n protected stop(): void {\n if (this._removeDecorationListener) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n if (this._removeViewChangedListener) {\n this._removeViewChangedListener();\n this._removeViewChangedListener = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onViewChanged(targetVp: Viewport): void {\n if (targetVp !== this._targetVp)\n return;\n const decorator = SelectedViewFrustumDecoration._decorator;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._targetVp.isCameraOn) {\n const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);\n const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);\n }\n\n const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);\n const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);\n\n FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n if (this._options && this._options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());\n\n context.addDecorationFromBuilder(builder);\n }\n\n // Returns true if decoration becomes enabled.\n public static toggle(vp: Viewport, enabled?: boolean): boolean {\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;\n if (enabled === alreadyEnabled)\n return alreadyEnabled;\n }\n\n if (undefined === SelectedViewFrustumDecoration._decorator) {\n SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);\n return true;\n } else {\n SelectedViewFrustumDecoration._decorator.stop();\n SelectedViewFrustumDecoration._decorator = undefined;\n return false;\n }\n }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the selected view frustum decoration.\n * @beta\n */\nexport class ToggleSelectedViewFrustumTool extends Tool {\n public static override toolId = \"ToggleSelectedViewFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n if (SelectedViewFrustumDecoration.toggle(vp, enable)) {\n const remove = vp.onChangeView.addListener((_vp: Viewport, prev: ViewState) => {\n if (!prev.hasSameCoordinates(vp.view)) {\n SelectedViewFrustumDecoration.toggle(vp, false);\n remove();\n }\n });\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\nclass ShadowFrustumDecoration {\n private static _instance?: ShadowFrustumDecoration;\n private _targetVp: Viewport;\n private _cleanup?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport) {\n this._targetVp = vp;\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\n const removeOnRender = vp.onRender.addListener((_) => this.onRender());\n this._cleanup = () => {\n removeDecorator();\n removeOnRender();\n };\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onRender(): void {\n const decorator = ShadowFrustumDecoration._instance;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const frustum = this._targetVp.target.debugControl!.shadowFrustum;\n if (undefined === frustum)\n return;\n\n const thisVp = context.viewport;\n if (thisVp === this._targetVp || !thisVp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(vp: Viewport, enabled?: boolean): void {\n const instance = ShadowFrustumDecoration._instance;\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== instance;\n if (enabled === alreadyEnabled)\n return;\n }\n\n if (undefined === instance) {\n ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);\n } else {\n instance.stop();\n ShadowFrustumDecoration._instance = undefined;\n }\n }\n}\n\n/** Toggle visualization of the selected viewport's shadow frustum in all other viewports.\n * @beta\n */\nexport class ToggleShadowFrustumTool extends Tool {\n public static override toolId = \"ToggleShadowFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp && vp.view.isSpatialView())\n ShadowFrustumDecoration.toggle(vp, enable);\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"FrustumDecoration.js","sourceRoot":"","sources":["../../../src/tools/FrustumDecoration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAS,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAW,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EACL,WAAW,EAA8C,WAAW,EAAE,SAAS,EAAE,IAAI,GACtF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C;;;;;;GAMG;AACH,MAAM,iBAAiB;IAUiD;IATrD,aAAa,CAAU;IACvB,qBAAqB,CAAU;IAC/B,eAAe,CAAU;IACzB,WAAW,CAAU;IACrB,cAAc,CAAQ;IACtB,SAAS,CAAU;IACnB,WAAW,CAAS;IACpB,WAAW,CAAU;IAEtC,YAAoB,EAAY,EAAE,IAAiB,EAAmB,QAAmC;QAAnC,aAAQ,GAAR,QAAQ,CAA2B;QACvG,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7D,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpE,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC,YAAY,CAAC,iBAAiB,EAAE,C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I,EAAE,CAAC;YAChB,uBAAuB,CAAC,SAAS,GAAG,SAAS,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI;IACxC,MAAM,CAAU,MAAM,GAAG,qBAAqB,CAAC;IAC/C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;YAC7C,uBAAuB,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Map4d, Point3d } from \"@itwin/core-geometry\";\nimport { ColorByName, ColorDef, Frustum, LinePixels, Npc } from \"@itwin/core-common\";\nimport {\n CoordSystem, DecorateContext, Decorator, GraphicBuilder, GraphicType, IModelApp, Tool, Viewport, ViewState, ViewState3d,\n} from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\ninterface FrustumDecorationOptions {\n showPreloadFrustum?: boolean;\n showBackgroundIntersections?: boolean;\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n */\nclass FrustumDecoration {\n private readonly _worldFrustum: Frustum;\n private readonly _adjustedWorldFrustum: Frustum;\n private readonly _preloadFrustum: Frustum;\n private readonly _npcFrustum: Frustum;\n private readonly _worldToNpcMap: Map4d;\n private readonly _eyePoint: Point3d;\n private readonly _focalPlane: number;\n private readonly _isCameraOn: boolean;\n\n private constructor(vp: Viewport, view: ViewState3d, private readonly _options?: FrustumDecorationOptions) {\n this._worldFrustum = vp.getFrustum(CoordSystem.World, false);\n this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);\n this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();\n this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);\n this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();\n this._eyePoint = view.camera.getEyePoint().clone();\n this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;\n this._isCameraOn = vp.isCameraOn;\n }\n\n public static create(vp: Viewport, options?: FrustumDecorationOptions): FrustumDecoration | undefined {\n const view = vp.view.isSpatialView() ? vp.view : undefined;\n return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;\n }\n\n public decorate(context: DecorateContext): void {\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._isCameraOn)\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);\n\n FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n const options = this._options;\n if (options !== undefined) {\n if (options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);\n\n if (options?.showBackgroundIntersections) {\n const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();\n if (backgroundMapGeometry)\n backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);\n }\n }\n context.addDecorationFromBuilder(builder);\n }\n\n public static drawPreloadFrustum(builder: GraphicBuilder, frustum: Frustum) {\n const preloadColor = ColorDef.create(ColorByName.coral);\n builder.setSymbology(preloadColor, preloadColor, 1, LinePixels.Code2);\n builder.addFrustum(frustum);\n }\n\n public static drawFrustumBox(builder: GraphicBuilder, frustum: Frustum, adjustedBox: boolean, vp: Viewport): void {\n const backPts = this.getPlanePts(frustum.points, false); // back plane\n const frontPts = this.getPlanePts(frustum.points, true); // front plane\n\n const bgColor = vp.view.backgroundColor;\n const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);\n const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);\n const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);\n const edgeWeight = adjustedBox ? 2 : 1;\n const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;\n\n // Back plane\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(backPts);\n\n // Front plane\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(frontPts);\n\n // Bottom edge\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 0));\n builder.addLineString(this.getEdgePts(backPts, frontPts, 1));\n\n // Top edge\n builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 2));\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 3));\n }\n\n private static getEdgePts(startPts: Point3d[], endPts: Point3d[], index: number): Point3d[] {\n return [\n startPts[index],\n endPts[index],\n ];\n }\n\n private static getPlanePts(frustPts: Point3d[], front: boolean): Point3d[] {\n const baseIndex = front ? Npc._001 : Npc._000;\n const planePts = [\n frustPts[baseIndex + Npc._000],\n frustPts[baseIndex + Npc._100],\n frustPts[baseIndex + Npc._110],\n frustPts[baseIndex + Npc._010],\n ];\n\n planePts.push(planePts[0]);\n return planePts;\n }\n\n public static drawEyePositionAndFocalPlane(builder: GraphicBuilder, npcFrustum: Frustum, worldToNpcMap: Map4d, eyePoint: Point3d, focusPlaneNpc: number, vp: Viewport): void {\n // Eye position...\n const contrastColor = vp.getContrastToBackgroundColor();\n builder.setSymbology(contrastColor, ColorDef.black, 8);\n builder.addPointString([eyePoint]);\n\n // Focal plane...\n const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);\n const focalPtsWorld: Point3d[] = [];\n for (const npcPt of focalPtsNpc)\n focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));\n worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);\n\n const bgColor = vp.view.backgroundColor;\n const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);\n const focalTransColor = focalPlaneColor.withTransparency(100);\n builder.setSymbology(focalPlaneColor, focalTransColor, 2);\n builder.addLineString(focalPtsWorld);\n builder.addShape(focalPtsWorld);\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n * @beta\n */\nexport class FrustumDecorator implements Decorator {\n private readonly _decoration?: FrustumDecoration;\n\n private constructor(vp: Viewport, options?: FrustumDecorationOptions) {\n this._decoration = FrustumDecoration.create(vp, options);\n }\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n if (undefined !== this._decoration)\n this._decoration.decorate(context);\n }\n\n private static _instance?: FrustumDecorator;\n\n /** Add the decoration to the specified viewport. */\n public static enable(vp: Viewport, options?: FrustumDecorationOptions): void {\n FrustumDecorator.disable();\n FrustumDecorator._instance = new FrustumDecorator(vp, options);\n IModelApp.viewManager.addDecorator(FrustumDecorator._instance);\n }\n\n /** Remove the decoration from the specified viewport. */\n public static disable(): void {\n const instance = FrustumDecorator._instance;\n if (undefined !== instance) {\n IModelApp.viewManager.dropDecorator(instance);\n FrustumDecorator._instance = undefined;\n }\n }\n\n public static get isEnabled() { return undefined !== FrustumDecorator._instance; }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the [[FrustumDecorator]].\n * @beta\n */\nexport class ToggleFrustumSnapshotTool extends Tool {\n public static override toolId = \"ToggleFrustumSnapshot\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n\n public override async run(enable?: boolean, showPreloadFrustum?: boolean, showBackgroundIntersections?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (undefined === enable)\n enable = !FrustumDecorator.isEnabled;\n\n if (enable !== FrustumDecorator.isEnabled) {\n if (enable) {\n FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });\n vp.onChangeView.addOnce(() => FrustumDecorator.disable());\n } else {\n FrustumDecorator.disable();\n }\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n let showPreload, showBackgroundIntersections, enable;\n for (const arg of args) {\n if (arg === \"preload\")\n showPreload = true;\n else if (arg === \"background\")\n showBackgroundIntersections = true;\n else\n enable = parseToggle(arg);\n }\n\n if (typeof enable !== \"string\")\n await this.run(enable, showPreload, showBackgroundIntersections);\n\n return true;\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.\n * Only useful when more than one spatial viewport is open.\n */\nclass SelectedViewFrustumDecoration {\n private static _decorator?: SelectedViewFrustumDecoration;\n protected _targetVp: Viewport;\n protected _removeDecorationListener?: () => void;\n protected _removeViewChangedListener?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport, private _options?: FrustumDecorationOptions) {\n this._targetVp = vp;\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n protected stop(): void {\n if (this._removeDecorationListener) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n if (this._removeViewChangedListener) {\n this._removeViewChangedListener();\n this._removeViewChangedListener = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onViewChanged(targetVp: Viewport): void {\n if (targetVp !== this._targetVp)\n return;\n const decorator = SelectedViewFrustumDecoration._decorator;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._targetVp.isCameraOn) {\n const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);\n const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);\n }\n\n const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);\n const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);\n\n FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n if (this._options && this._options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());\n\n context.addDecorationFromBuilder(builder);\n }\n\n // Returns true if decoration becomes enabled.\n public static toggle(vp: Viewport, enabled?: boolean): boolean {\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;\n if (enabled === alreadyEnabled)\n return alreadyEnabled;\n }\n\n if (undefined === SelectedViewFrustumDecoration._decorator) {\n SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);\n return true;\n } else {\n SelectedViewFrustumDecoration._decorator.stop();\n SelectedViewFrustumDecoration._decorator = undefined;\n return false;\n }\n }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the selected view frustum decoration.\n * @beta\n */\nexport class ToggleSelectedViewFrustumTool extends Tool {\n public static override toolId = \"ToggleSelectedViewFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n if (SelectedViewFrustumDecoration.toggle(vp, enable)) {\n const remove = vp.onChangeView.addListener((_vp: Viewport, prev: ViewState) => {\n if (!prev.hasSameCoordinates(vp.view)) {\n SelectedViewFrustumDecoration.toggle(vp, false);\n remove();\n }\n });\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\nclass ShadowFrustumDecoration {\n private static _instance?: ShadowFrustumDecoration;\n private _targetVp: Viewport;\n private _cleanup?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport) {\n this._targetVp = vp;\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\n const removeOnRender = vp.onRender.addListener((_) => this.onRender());\n this._cleanup = () => {\n removeDecorator();\n removeOnRender();\n };\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onRender(): void {\n const decorator = ShadowFrustumDecoration._instance;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const frustum = this._targetVp.target.debugControl!.shadowFrustum;\n if (undefined === frustum)\n return;\n\n const thisVp = context.viewport;\n if (thisVp === this._targetVp || !thisVp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(vp: Viewport, enabled?: boolean): void {\n const instance = ShadowFrustumDecoration._instance;\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== instance;\n if (enabled === alreadyEnabled)\n return;\n }\n\n if (undefined === instance) {\n ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);\n } else {\n instance.stop();\n ShadowFrustumDecoration._instance = undefined;\n }\n }\n}\n\n/** Toggle visualization of the selected viewport's shadow frustum in all other viewports.\n * @beta\n */\nexport class ToggleShadowFrustumTool extends Tool {\n public static override toolId = \"ToggleShadowFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp && vp.view.isSpatialView())\n ShadowFrustumDecoration.toggle(vp, enable);\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n"]}
@@ -22,16 +22,17 @@ import { parseArgs } from "./parseArgs";
22
22
  * @beta
23
23
  */
24
24
  export class InspectElementTool extends PrimitiveTool {
25
- static { this.toolId = "InspectElement"; }
25
+ static toolId = "InspectElement";
26
26
  static get minArgs() { return 0; }
27
27
  static get maxArgs() { return 6; }
28
+ _options = {};
29
+ _elementIds;
30
+ _modal = false;
31
+ _useSelection = false;
32
+ _doCopy = false;
33
+ _explodeParts = false;
28
34
  constructor(options, elementIds) {
29
35
  super();
30
- this._options = {};
31
- this._modal = false;
32
- this._useSelection = false;
33
- this._doCopy = false;
34
- this._explodeParts = false;
35
36
  if (undefined !== options)
36
37
  this._options = { ...options };
37
38
  this._elementIds = elementIds;
@@ -1 +1 @@
1
- {"version":3,"file":"InspectElementTool.js","sourceRoot":"","sources":["../../../src/tools/InspectElementTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAyB,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAA0B,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EACU,SAAS,EAAE,YAAY,EAAa,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EACpI,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,GAC3D,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;aAC5B,WAAM,GAAG,gBAAgB,AA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,CAAC;QAErG,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEtB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { BentleyError, Id64, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { GeometrySummaryOptions, GeometrySummaryVerbosity, IModelReadRpcInterface } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, CoreTools, EventHandled, HitDetail, IModelApp, LocateFilterStatus, LocateResponse, MessageBoxIconType, MessageBoxType,\n NotifyMessageDetails, OutputMessagePriority, PrimitiveTool,\n} from \"@itwin/core-frontend\";\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Creates a readable text summary of a geometric element or geometry part. The keyin takes the following arguments, all of which are optional:\n * - `id=elementId,elementId,elementId` comma-separated list of element Ids where each `elementId` is a hexadecimal element Id such as \"0x12cb\";\n * - `symbology=0|1` where 1 indicates detailed symbology information should be included in the output;\n * - `placement=0|1` where 1 indicates detailed geometric element placement should be included; and\n * - `verbosity=0|1|2` controlling the verbosity of the output for each geometric primitive in the geometry stream. Higher values = more detailed information. Note verbosity=2 can produce megabytes of data for certain types of geometric primitives like large meshes.\n * - `modal=0|1` where 1 indicates the output should appear in a modal dialog.\n * - `copy=0|1` where 1 indicates the output should be copied to the clipboard. Defaults to true.\n * - `refs=0|1` where 1 indicates that for geometry parts a list of all elements referencing that part should be included in the output. This is extremely computationally expensive.\n * If no id is specified, the tool runs in interactive mode: first operating upon the selection set (if any), then allowing the user to select additional elements.\n * @beta\n */\nexport class InspectElementTool extends PrimitiveTool {\n public static override toolId = \"InspectElement\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 6; }\n\n private _options: GeometrySummaryOptions = {};\n private _elementIds?: Id64String[];\n private _modal = false;\n private _useSelection = false;\n private _doCopy = false;\n private _explodeParts = false;\n\n constructor(options?: GeometrySummaryOptions, elementIds?: Id64String[]) {\n super();\n if (undefined !== options)\n this._options = { ...options };\n\n this._elementIds = elementIds;\n }\n\n private setupAndPromptForNextAction(): void {\n this._useSelection = (undefined !== this.targetView && this.targetView.iModel.selectionSet.isActive);\n if (!this._useSelection)\n IModelApp.accuSnap.enableLocate(true);\n\n this.showPrompt();\n }\n\n private showPrompt(): void {\n CoreTools.outputPromptByKey(this._useSelection ? \"ElementSet.Prompts.ConfirmSelection\" : \"ElementSet.Prompts.IdentifyElement\");\n }\n\n public override autoLockTarget(): void { }\n\n public override requireWriteableTarget(): boolean { return false; }\n\n public override async onUnsuspend() {\n this.showPrompt();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n if (undefined !== this._elementIds)\n this.process(this._elementIds).then(async () => {\n await this.onReinitialize();\n }).catch((err) => {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, err.toString()));\n });\n else {\n this.setupAndPromptForNextAction();\n }\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (this._useSelection) {\n if (undefined !== ev.viewport) {\n const ids: Id64Array = [];\n ev.viewport.iModel.selectionSet.elements.forEach((id) => {\n if (!Id64.isInvalid(id) && !Id64.isTransient(id))\n ids.push(id);\n });\n\n if (0 === ids.length)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.NotSupportedElmType\")));\n else\n await this.process(ids);\n\n await this.onReinitialize();\n return EventHandled.Yes;\n }\n }\n\n const hit = await IModelApp.locateManager.doLocate(new LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);\n if (undefined === hit || !hit.isElementHit)\n return EventHandled.No;\n\n await this.process([hit.sourceId]);\n this.setupAndPromptForNextAction();\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onReinitialize() {\n if (this._useSelection || undefined !== this._elementIds) {\n await this.exitTool();\n } else {\n await this.onRestartTool();\n }\n }\n\n public async onRestartTool() {\n const tool = new InspectElementTool();\n if (!await tool.run())\n return this.exitTool();\n }\n\n public override async filterHit(hit: HitDetail, _out: LocateResponse): Promise<LocateFilterStatus> {\n return hit.isElementHit ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n private async process(elementIds: Id64String[]) {\n const request = {\n elementIds,\n options: this._options,\n };\n let messageDetails: NotifyMessageDetails;\n try {\n let str = await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n if (this._explodeParts) {\n const regex = /^part id: (0x[a-f0-9]+)/gm;\n const partIds = new Set<string>();\n let match;\n while (null !== (match = regex.exec(str)))\n partIds.add(match[1]);\n\n if (partIds.size > 0) {\n request.elementIds = Array.from(partIds);\n str += `\\npart ids: ${JSON.stringify(request.elementIds)}\\n`;\n str += await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n }\n }\n\n if (this._doCopy)\n copyStringToClipboard(str);\n\n const brief = `Summary ${this._doCopy ? \"copied to clipboard.\" : \"complete.\"}`;\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Info, brief, str);\n\n if (this._modal) {\n const div = document.createElement(\"div\");\n const appendText = (toAppend: string) => {\n const txt = document.createElement(\"div\");\n txt.innerText = toAppend;\n div.append(txt);\n };\n\n const lines = str.split(\"\\n\");\n const maxLines = 30;\n let curLine = 0;\n for (const line of lines) {\n appendText(line);\n if (++curLine > maxLines) {\n appendText(\"...\");\n break;\n }\n }\n\n await IModelApp.notifications.openMessageBox(MessageBoxType.Ok, div, MessageBoxIconType.Information);\n }\n } catch (err) {\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Error, \"Error occurred while generating summary\", BentleyError.getErrorMessage(err));\n }\n\n IModelApp.notifications.outputMessage(messageDetails);\n }\n\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\n const args = parseArgs(inputArgs);\n const ids = args.get(\"i\");\n if (undefined !== ids)\n this._elementIds = ids.split(\",\");\n\n const verbosity = args.getInteger(\"v\");\n if (undefined !== verbosity) {\n switch (verbosity) {\n case 0:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Basic;\n break;\n case 1:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Detailed;\n break;\n case 2:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Full;\n break;\n }\n }\n\n const symbology = args.getBoolean(\"s\");\n if (undefined !== symbology)\n this._options.verboseSymbology = symbology;\n\n const placement = args.getBoolean(\"p\");\n if (undefined !== placement)\n this._options.includePlacement = placement;\n\n const parts = args.getBoolean(\"r\");\n if (true === parts && undefined !== IModelApp.viewManager.selectedView)\n this._options.includePartReferences = IModelApp.viewManager.selectedView.view.is3d() ? \"3d\" : \"2d\";\n\n const modal = args.getBoolean(\"m\");\n if (undefined !== modal)\n this._modal = modal;\n\n const doCopy = args.getBoolean(\"c\");\n if (undefined !== doCopy)\n this._doCopy = doCopy;\n\n this._explodeParts = true === args.getBoolean(\"e\");\n\n return this.run();\n }\n}\n"]}
1
+ {"version":3,"file":"InspectElementTool.js","sourceRoot":"","sources":["../../../src/tools/InspectElementTool.ts"],"names":[],"mappings":"AAAA;;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;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAE7C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAE7C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,KAAK,IAAI,SAAS,KAAK,SAAS,CAAC,WAAW,CAAC,YAAY;YACpE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAErG,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEtB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { BentleyError, Id64, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { GeometrySummaryOptions, GeometrySummaryVerbosity, IModelReadRpcInterface } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, CoreTools, EventHandled, HitDetail, IModelApp, LocateFilterStatus, LocateResponse, MessageBoxIconType, MessageBoxType,\n NotifyMessageDetails, OutputMessagePriority, PrimitiveTool,\n} from \"@itwin/core-frontend\";\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Creates a readable text summary of a geometric element or geometry part. The keyin takes the following arguments, all of which are optional:\n * - `id=elementId,elementId,elementId` comma-separated list of element Ids where each `elementId` is a hexadecimal element Id such as \"0x12cb\";\n * - `symbology=0|1` where 1 indicates detailed symbology information should be included in the output;\n * - `placement=0|1` where 1 indicates detailed geometric element placement should be included; and\n * - `verbosity=0|1|2` controlling the verbosity of the output for each geometric primitive in the geometry stream. Higher values = more detailed information. Note verbosity=2 can produce megabytes of data for certain types of geometric primitives like large meshes.\n * - `modal=0|1` where 1 indicates the output should appear in a modal dialog.\n * - `copy=0|1` where 1 indicates the output should be copied to the clipboard. Defaults to true.\n * - `refs=0|1` where 1 indicates that for geometry parts a list of all elements referencing that part should be included in the output. This is extremely computationally expensive.\n * If no id is specified, the tool runs in interactive mode: first operating upon the selection set (if any), then allowing the user to select additional elements.\n * @beta\n */\nexport class InspectElementTool extends PrimitiveTool {\n public static override toolId = \"InspectElement\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 6; }\n\n private _options: GeometrySummaryOptions = {};\n private _elementIds?: Id64String[];\n private _modal = false;\n private _useSelection = false;\n private _doCopy = false;\n private _explodeParts = false;\n\n constructor(options?: GeometrySummaryOptions, elementIds?: Id64String[]) {\n super();\n if (undefined !== options)\n this._options = { ...options };\n\n this._elementIds = elementIds;\n }\n\n private setupAndPromptForNextAction(): void {\n this._useSelection = (undefined !== this.targetView && this.targetView.iModel.selectionSet.isActive);\n if (!this._useSelection)\n IModelApp.accuSnap.enableLocate(true);\n\n this.showPrompt();\n }\n\n private showPrompt(): void {\n CoreTools.outputPromptByKey(this._useSelection ? \"ElementSet.Prompts.ConfirmSelection\" : \"ElementSet.Prompts.IdentifyElement\");\n }\n\n public override autoLockTarget(): void { }\n\n public override requireWriteableTarget(): boolean { return false; }\n\n public override async onUnsuspend() {\n this.showPrompt();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n if (undefined !== this._elementIds)\n this.process(this._elementIds).then(async () => {\n await this.onReinitialize();\n }).catch((err) => {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, err.toString()));\n });\n else {\n this.setupAndPromptForNextAction();\n }\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (this._useSelection) {\n if (undefined !== ev.viewport) {\n const ids: Id64Array = [];\n ev.viewport.iModel.selectionSet.elements.forEach((id) => {\n if (!Id64.isInvalid(id) && !Id64.isTransient(id))\n ids.push(id);\n });\n\n if (0 === ids.length)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.NotSupportedElmType\")));\n else\n await this.process(ids);\n\n await this.onReinitialize();\n return EventHandled.Yes;\n }\n }\n\n const hit = await IModelApp.locateManager.doLocate(new LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);\n if (undefined === hit || !hit.isElementHit)\n return EventHandled.No;\n\n await this.process([hit.sourceId]);\n this.setupAndPromptForNextAction();\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onReinitialize() {\n if (this._useSelection || undefined !== this._elementIds) {\n await this.exitTool();\n } else {\n await this.onRestartTool();\n }\n }\n\n public async onRestartTool() {\n const tool = new InspectElementTool();\n if (!await tool.run())\n return this.exitTool();\n }\n\n public override async filterHit(hit: HitDetail, _out: LocateResponse): Promise<LocateFilterStatus> {\n return hit.isElementHit ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n private async process(elementIds: Id64String[]) {\n const request = {\n elementIds,\n options: this._options,\n };\n let messageDetails: NotifyMessageDetails;\n try {\n let str = await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n if (this._explodeParts) {\n const regex = /^part id: (0x[a-f0-9]+)/gm;\n const partIds = new Set<string>();\n let match;\n while (null !== (match = regex.exec(str)))\n partIds.add(match[1]);\n\n if (partIds.size > 0) {\n request.elementIds = Array.from(partIds);\n str += `\\npart ids: ${JSON.stringify(request.elementIds)}\\n`;\n str += await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n }\n }\n\n if (this._doCopy)\n copyStringToClipboard(str);\n\n const brief = `Summary ${this._doCopy ? \"copied to clipboard.\" : \"complete.\"}`;\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Info, brief, str);\n\n if (this._modal) {\n const div = document.createElement(\"div\");\n const appendText = (toAppend: string) => {\n const txt = document.createElement(\"div\");\n txt.innerText = toAppend;\n div.append(txt);\n };\n\n const lines = str.split(\"\\n\");\n const maxLines = 30;\n let curLine = 0;\n for (const line of lines) {\n appendText(line);\n if (++curLine > maxLines) {\n appendText(\"...\");\n break;\n }\n }\n\n await IModelApp.notifications.openMessageBox(MessageBoxType.Ok, div, MessageBoxIconType.Information);\n }\n } catch (err) {\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Error, \"Error occurred while generating summary\", BentleyError.getErrorMessage(err));\n }\n\n IModelApp.notifications.outputMessage(messageDetails);\n }\n\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\n const args = parseArgs(inputArgs);\n const ids = args.get(\"i\");\n if (undefined !== ids)\n this._elementIds = ids.split(\",\");\n\n const verbosity = args.getInteger(\"v\");\n if (undefined !== verbosity) {\n switch (verbosity) {\n case 0:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Basic;\n break;\n case 1:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Detailed;\n break;\n case 2:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Full;\n break;\n }\n }\n\n const symbology = args.getBoolean(\"s\");\n if (undefined !== symbology)\n this._options.verboseSymbology = symbology;\n\n const placement = args.getBoolean(\"p\");\n if (undefined !== placement)\n this._options.includePlacement = placement;\n\n const parts = args.getBoolean(\"r\");\n if (true === parts && undefined !== IModelApp.viewManager.selectedView)\n this._options.includePartReferences = IModelApp.viewManager.selectedView.view.is3d() ? \"3d\" : \"2d\";\n\n const modal = args.getBoolean(\"m\");\n if (undefined !== modal)\n this._modal = modal;\n\n const doCopy = args.getBoolean(\"c\");\n if (undefined !== doCopy)\n this._doCopy = doCopy;\n\n this._explodeParts = true === args.getBoolean(\"e\");\n\n return this.run();\n }\n}\n"]}
@@ -8,6 +8,8 @@ import { parseBoolean } from "./parseBoolean";
8
8
  import { parseToggle } from "./parseToggle";
9
9
  /** Base class for attaching map layer tool. */
10
10
  class AttachMapLayerBaseTool extends Tool {
11
+ _isBackground;
12
+ _isBase;
11
13
  constructor(_isBackground = true, _isBase = false) {
12
14
  super();
13
15
  this._isBackground = _isBackground;
@@ -59,9 +61,10 @@ class AttachMapLayerBaseTool extends Tool {
59
61
  * @beta
60
62
  */
61
63
  export class AttachModelMapLayerTool extends Tool {
64
+ _formatId;
62
65
  static get minArgs() { return 0; }
63
66
  static get maxArgs() { return 1; }
64
- static { this.toolId = "AttachModelMapLayerTool"; }
67
+ static toolId = "AttachModelMapLayerTool";
65
68
  constructor(_formatId) {
66
69
  super();
67
70
  this._formatId = _formatId;
@@ -92,6 +95,7 @@ export class AttachModelMapLayerTool extends Tool {
92
95
  }
93
96
  /** Attach a map layer from URL base class. */
94
97
  class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
98
+ _formatId;
95
99
  static get minArgs() { return 1; }
96
100
  static get maxArgs() { return 4; }
97
101
  constructor(_formatId) {
@@ -115,7 +119,7 @@ class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
115
119
  * @beta
116
120
  */
117
121
  export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
118
- static { this.toolId = "AttachWmsMapLayerTool"; }
122
+ static toolId = "AttachWmsMapLayerTool";
119
123
  constructor() { super("WMS"); }
120
124
  /** This method runs the tool, attaching a WMS map layer from a given URL.
121
125
  * @param args contains url, name, userName, password in array order
@@ -128,7 +132,7 @@ export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
128
132
  * @beta
129
133
  */
130
134
  export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
131
- static { this.toolId = "AttachWmtsMapLayerTool"; }
135
+ static toolId = "AttachWmtsMapLayerTool";
132
136
  constructor() { super("WMTS"); }
133
137
  /** This method runs the tool, attaching a WMTS map layer from a given URL.
134
138
  * @param args contains url, name, userName, password in array order
@@ -141,35 +145,35 @@ export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
141
145
  * @beta
142
146
  */
143
147
  export class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
144
- static { this.toolId = "AttachArcGISMapLayerTool"; }
148
+ static toolId = "AttachArcGISMapLayerTool";
145
149
  constructor() { super("ArcGIS"); }
146
150
  }
147
151
  /** This tool attaches an ArcGIS map layer from a given URL.
148
152
  * @beta
149
153
  */
150
154
  export class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
151
- static { this.toolId = "AttachArcGISFeatureMapLayerTool"; }
155
+ static toolId = "AttachArcGISFeatureMapLayerTool";
152
156
  constructor() { super("ArcGISFeature"); }
153
157
  }
154
158
  /** This tool attaches an ArcGIS map layer from a given URL.
155
159
  * @beta
156
160
  */
157
161
  export class AttachOgcApiFeaturesMapLayerTool extends AttachMapLayerByURLBaseTool {
158
- static { this.toolId = "AttachOgcApiFeaturesMapLayerTool"; }
162
+ static toolId = "AttachOgcApiFeaturesMapLayerTool";
159
163
  constructor() { super("OgcApiFeatures"); }
160
164
  }
161
165
  /** This tool attaches a map layer from a given tile URL.
162
166
  * @beta
163
167
  */
164
168
  export class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
165
- static { this.toolId = "AttachTileURLMapLayerTool"; }
169
+ static toolId = "AttachTileURLMapLayerTool";
166
170
  constructor() { super("TileURL"); }
167
171
  }
168
172
  /** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).
169
173
  * @beta
170
174
  */
171
175
  export class AttachMapLayerTool extends AttachMapLayerBaseTool {
172
- static { this.toolId = "AttachMapLayerTool"; }
176
+ static toolId = "AttachMapLayerTool";
173
177
  static get minArgs() { return 1; }
174
178
  static get maxArgs() { return 1; }
175
179
  /** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.
@@ -199,7 +203,7 @@ export class AttachMapLayerTool extends AttachMapLayerBaseTool {
199
203
  * @beta
200
204
  */
201
205
  export class AttachMapOverlayTool extends AttachMapLayerTool {
202
- static { this.toolId = "AttachMapOverlayTool"; }
206
+ static toolId = "AttachMapOverlayTool";
203
207
  constructor() {
204
208
  super();
205
209
  this._isBackground = false;
@@ -209,7 +213,7 @@ export class AttachMapOverlayTool extends AttachMapLayerTool {
209
213
  * @beta
210
214
  */
211
215
  export class SetMapBaseTool extends AttachMapLayerTool {
212
- static { this.toolId = "SetMapBaseTool"; }
216
+ static toolId = "SetMapBaseTool";
213
217
  constructor() {
214
218
  super();
215
219
  this._isBase = true;
@@ -219,7 +223,7 @@ export class SetMapBaseTool extends AttachMapLayerTool {
219
223
  * @beta
220
224
  */
221
225
  export class DetachMapLayersTool extends Tool {
222
- static { this.toolId = "DetachMapLayersTool"; }
226
+ static toolId = "DetachMapLayersTool";
223
227
  static get minArgs() { return 0; }
224
228
  static get maxArgs() { return 0; }
225
229
  async parseAndRun(..._args) {
@@ -243,7 +247,7 @@ function parseLayerIndex(args) {
243
247
  * @beta
244
248
  */
245
249
  export class MapLayerVisibilityTool extends Tool {
246
- static { this.toolId = "SetMapLayerVisibility"; }
250
+ static toolId = "SetMapLayerVisibility";
247
251
  static get minArgs() { return 1; }
248
252
  static get maxArgs() { return 2; }
249
253
  /** This method runs the tool, setting the visibility of a map layer.
@@ -277,7 +281,7 @@ export class MapLayerVisibilityTool extends Tool {
277
281
  * @beta
278
282
  */
279
283
  export class ReorderMapLayers extends Tool {
280
- static { this.toolId = "ReorderMapLayers"; }
284
+ static toolId = "ReorderMapLayers";
281
285
  static get minArgs() { return 0; }
282
286
  static get maxArgs() { return 2; }
283
287
  /** This method runs the tool, reordering the map layers.
@@ -306,7 +310,7 @@ export class ReorderMapLayers extends Tool {
306
310
  * @beta
307
311
  */
308
312
  export class MapLayerTransparencyTool extends Tool {
309
- static { this.toolId = "SetMapLayerTransparency"; }
313
+ static toolId = "SetMapLayerTransparency";
310
314
  static get minArgs() { return 1; }
311
315
  static get maxArgs() { return 2; }
312
316
  /** This method runs the tool, setting the transparency of a map layer.
@@ -336,7 +340,7 @@ export class MapLayerTransparencyTool extends Tool {
336
340
  * @beta
337
341
  */
338
342
  export class MapLayerSubLayerVisibilityTool extends Tool {
339
- static { this.toolId = "SetMapSubLayerVisibility"; }
343
+ static toolId = "SetMapSubLayerVisibility";
340
344
  static get minArgs() { return 1; }
341
345
  static get maxArgs() { return 2; }
342
346
  /** This method runs the tool, setting the visibility of a map sublayer.
@@ -365,7 +369,7 @@ export class MapLayerSubLayerVisibilityTool extends Tool {
365
369
  * @beta
366
370
  */
367
371
  export class MapLayerZoomTool extends Tool {
368
- static { this.toolId = "MapLayerZoom"; }
372
+ static toolId = "MapLayerZoom";
369
373
  static get minArgs() { return 0; }
370
374
  static get maxArgs() { return 1; }
371
375
  /** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.
@@ -391,7 +395,7 @@ export class MapLayerZoomTool extends Tool {
391
395
  * @beta
392
396
  */
393
397
  export class ToggleTerrainTool extends Tool {
394
- static { this.toolId = "ToggleTerrain"; }
398
+ static toolId = "ToggleTerrain";
395
399
  static get minArgs() { return 0; }
396
400
  static get maxArgs() { return 1; }
397
401
  /** This method runs the tool, changing whether to apply terrain heights to the map.
@@ -420,7 +424,7 @@ export class ToggleTerrainTool extends Tool {
420
424
  * @beta
421
425
  */
422
426
  export class MapBaseColorTool extends Tool {
423
- static { this.toolId = "SetMapBaseColorTool"; }
427
+ static toolId = "SetMapBaseColorTool";
424
428
  static get minArgs() { return 3; }
425
429
  static get maxArgs() { return 3; }
426
430
  /** This method runs the tool, changing the color of the base map.
@@ -448,7 +452,7 @@ export class MapBaseColorTool extends Tool {
448
452
  * @beta
449
453
  */
450
454
  export class MapBaseTransparencyTool extends Tool {
451
- static { this.toolId = "SetMapBaseTransparencyTool"; }
455
+ static toolId = "SetMapBaseTransparencyTool";
452
456
  static get minArgs() { return 1; }
453
457
  static get maxArgs() { return 1; }
454
458
  /** This method runs the tool, changing the transparency of the base map.
@@ -474,7 +478,7 @@ export class MapBaseTransparencyTool extends Tool {
474
478
  * @beta
475
479
  */
476
480
  export class MapBaseVisibilityTool extends Tool {
477
- static { this.toolId = "SetMapBaseVisibilityTool"; }
481
+ static toolId = "SetMapBaseVisibilityTool";
478
482
  static get minArgs() { return 1; }
479
483
  static get maxArgs() { return 1; }
480
484
  /** This method runs the tool, changing the visibility of the base map.