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