@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,154 +1,155 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Tools
|
|
7
|
-
*/
|
|
8
|
-
import { assert, CompressedId64Set } from "@itwin/core-bentley";
|
|
9
|
-
import { RenderSchedule, } from "@itwin/core-common";
|
|
10
|
-
import { copyStringToClipboard } from "../ClipboardUtilities";
|
|
11
|
-
import { parseArgs } from "./parseArgs";
|
|
12
|
-
import { DisplayStyleTool } from "./DisplayStyleTools";
|
|
13
|
-
/** Query the schedule script JSON from an element.
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this._action = "copy";
|
|
20
|
-
this._includeElementIds = false;
|
|
21
|
-
this._countElementIds = false;
|
|
22
|
-
this._expandElementIds = false;
|
|
23
|
-
}
|
|
24
|
-
static get minArgs() { return 0; }
|
|
25
|
-
static get maxArgs() { return 3; }
|
|
26
|
-
async parse(input, vp) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this._sourceId
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (props.
|
|
63
|
-
script =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
elem.elementIds = elemIds
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
assert(undefined !==
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
reverseTimeline(elemTimeline.
|
|
114
|
-
reverseTimeline(elemTimeline.
|
|
115
|
-
reverseTimeline(elemTimeline.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
ReverseScheduleScriptTool
|
|
130
|
-
/** A tool that changes or removes the [RenderSchedule.Script]($common) associated with the selected [Viewport]($frontend).
|
|
131
|
-
* @beta
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
static get minArgs() { return 0; }
|
|
135
|
-
static get maxArgs() { return 1; }
|
|
136
|
-
async parse(args) {
|
|
137
|
-
if (args.length === 0)
|
|
138
|
-
return true; // clear schedule script.
|
|
139
|
-
try {
|
|
140
|
-
this._script = RenderSchedule.Script.fromJSON(JSON.parse(args[0]));
|
|
141
|
-
}
|
|
142
|
-
catch (ex) {
|
|
143
|
-
if (ex instanceof Error)
|
|
144
|
-
alert(ex.toString());
|
|
145
|
-
}
|
|
146
|
-
return undefined !== this._script;
|
|
147
|
-
}
|
|
148
|
-
async execute(vp) {
|
|
149
|
-
vp.displayStyle.scheduleScript = this._script;
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
SetScheduleScriptTool.toolId = "SetScheduleScript";
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Tools
|
|
7
|
+
*/
|
|
8
|
+
import { assert, CompressedId64Set } from "@itwin/core-bentley";
|
|
9
|
+
import { RenderSchedule, } from "@itwin/core-common";
|
|
10
|
+
import { copyStringToClipboard } from "../ClipboardUtilities";
|
|
11
|
+
import { parseArgs } from "./parseArgs";
|
|
12
|
+
import { DisplayStyleTool } from "./DisplayStyleTools";
|
|
13
|
+
/** Query the schedule script JSON from an element.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
class QueryScheduleScriptTool extends DisplayStyleTool {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this._action = "copy";
|
|
20
|
+
this._includeElementIds = false;
|
|
21
|
+
this._countElementIds = false;
|
|
22
|
+
this._expandElementIds = false;
|
|
23
|
+
}
|
|
24
|
+
static get minArgs() { return 0; }
|
|
25
|
+
static get maxArgs() { return 3; }
|
|
26
|
+
async parse(input, vp) {
|
|
27
|
+
const args = parseArgs(input);
|
|
28
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
29
|
+
this._sourceId = args.get("i") ?? vp.displayStyle.scheduleScriptReference?.sourceId;
|
|
30
|
+
if (!this._sourceId)
|
|
31
|
+
return false;
|
|
32
|
+
const action = args.get("a") ?? "";
|
|
33
|
+
this._action = action.length > 0 && "b" === action[0].toLowerCase() ? "break" : "copy";
|
|
34
|
+
this._includeElementIds = this._countElementIds = this._expandElementIds = false;
|
|
35
|
+
const ids = args.get("e");
|
|
36
|
+
if (ids && ids.length > 0) {
|
|
37
|
+
switch (ids[0].toLowerCase()) {
|
|
38
|
+
case "i":
|
|
39
|
+
this._includeElementIds = true;
|
|
40
|
+
break;
|
|
41
|
+
case "c":
|
|
42
|
+
this._includeElementIds = this._countElementIds = true;
|
|
43
|
+
break;
|
|
44
|
+
case "e":
|
|
45
|
+
this._includeElementIds = this._expandElementIds = true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
async execute(vp) {
|
|
52
|
+
if (!this._sourceId || !this._action)
|
|
53
|
+
return false;
|
|
54
|
+
const opts = {
|
|
55
|
+
displayStyle: { omitScheduleScriptElementIds: !this._includeElementIds },
|
|
56
|
+
renderTimeline: { omitScriptElementIds: !this._includeElementIds },
|
|
57
|
+
};
|
|
58
|
+
let script;
|
|
59
|
+
const props = await vp.iModel.elements.loadProps(this._sourceId, opts);
|
|
60
|
+
if (props.script)
|
|
61
|
+
script = JSON.parse(props.script.script);
|
|
62
|
+
else if (props.jsonProperties?.styles?.scheduleScript)
|
|
63
|
+
script = props.jsonProperties.styles.scheduleScript;
|
|
64
|
+
if (!script)
|
|
65
|
+
return false;
|
|
66
|
+
if (this._countElementIds || this._expandElementIds) {
|
|
67
|
+
for (const model of script) {
|
|
68
|
+
for (const elem of model.elementTimelines) {
|
|
69
|
+
const elemIds = typeof elem.elementIds === "string" ? CompressedId64Set.decompressArray(elem.elementIds) : elem.elementIds;
|
|
70
|
+
if (this._countElementIds)
|
|
71
|
+
elem.elementIds = elemIds.length;
|
|
72
|
+
else
|
|
73
|
+
elem.elementIds = elemIds;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (this._action === "break")
|
|
78
|
+
debugger; // eslint-disable-line no-debugger
|
|
79
|
+
else
|
|
80
|
+
copyStringToClipboard(JSON.stringify(script, null, 2));
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
QueryScheduleScriptTool.toolId = "QueryScheduleScript";
|
|
85
|
+
export { QueryScheduleScriptTool };
|
|
86
|
+
function reverseTimeline(timeline, accept) {
|
|
87
|
+
if (!timeline)
|
|
88
|
+
return;
|
|
89
|
+
const len = timeline.length;
|
|
90
|
+
for (let i = 0; i < len; i++) {
|
|
91
|
+
const timeEntry = timeline.getEntry(i);
|
|
92
|
+
const valueEntry = timeline.getEntry(len - i - 1);
|
|
93
|
+
assert(undefined !== timeEntry);
|
|
94
|
+
assert(undefined !== valueEntry);
|
|
95
|
+
accept(timeEntry.time, valueEntry);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** A tool that modifies the [RenderSchedule.Script]($common), if any, associated with the selected [Viewport]($frontend) such that the entries in each
|
|
99
|
+
* of its [RenderSchedule.ElementTimeline]($common)s are reversed.
|
|
100
|
+
* @beta
|
|
101
|
+
*/
|
|
102
|
+
class ReverseScheduleScriptTool extends DisplayStyleTool {
|
|
103
|
+
async execute(vp) {
|
|
104
|
+
const script = vp?.displayStyle.scheduleScript;
|
|
105
|
+
if (!script || script.modelTimelines.some((x) => x.omitsElementIds))
|
|
106
|
+
return false;
|
|
107
|
+
const builder = new RenderSchedule.ScriptBuilder();
|
|
108
|
+
for (const modelTimeline of script.modelTimelines) {
|
|
109
|
+
const modelBuilder = builder.addModelTimeline(modelTimeline.modelId);
|
|
110
|
+
for (const elemTimeline of modelTimeline.elementTimelines) {
|
|
111
|
+
const elemBuilder = modelBuilder.addElementTimeline(elemTimeline.elementIds);
|
|
112
|
+
reverseTimeline(elemTimeline.visibility, (time, entry) => elemBuilder.addVisibility(time, entry.value, entry.interpolation));
|
|
113
|
+
reverseTimeline(elemTimeline.color, (time, entry) => elemBuilder.addColor(time, entry.value, entry.interpolation));
|
|
114
|
+
reverseTimeline(elemTimeline.transform, (time, entry) => elemBuilder.addTransform(time, entry.value, entry.components, entry.interpolation));
|
|
115
|
+
reverseTimeline(elemTimeline.cuttingPlane, (time, entry) => elemBuilder.addCuttingPlane(time, entry.value, entry.interpolation));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const scriptProps = builder.finish();
|
|
119
|
+
const newScript = RenderSchedule.Script.fromJSON(scriptProps);
|
|
120
|
+
assert(undefined !== newScript);
|
|
121
|
+
vp.displayStyle.scheduleScript = newScript;
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
async parse() {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
ReverseScheduleScriptTool.toolId = "ReverseScheduleScript";
|
|
129
|
+
export { ReverseScheduleScriptTool };
|
|
130
|
+
/** A tool that changes or removes the [RenderSchedule.Script]($common) associated with the selected [Viewport]($frontend).
|
|
131
|
+
* @beta
|
|
132
|
+
*/
|
|
133
|
+
class SetScheduleScriptTool extends DisplayStyleTool {
|
|
134
|
+
static get minArgs() { return 0; }
|
|
135
|
+
static get maxArgs() { return 1; }
|
|
136
|
+
async parse(args) {
|
|
137
|
+
if (args.length === 0)
|
|
138
|
+
return true; // clear schedule script.
|
|
139
|
+
try {
|
|
140
|
+
this._script = RenderSchedule.Script.fromJSON(JSON.parse(args[0]));
|
|
141
|
+
}
|
|
142
|
+
catch (ex) {
|
|
143
|
+
if (ex instanceof Error)
|
|
144
|
+
alert(ex.toString());
|
|
145
|
+
}
|
|
146
|
+
return undefined !== this._script;
|
|
147
|
+
}
|
|
148
|
+
async execute(vp) {
|
|
149
|
+
vp.displayStyle.scheduleScript = this._script;
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
SetScheduleScriptTool.toolId = "SetScheduleScript";
|
|
154
|
+
export { SetScheduleScriptTool };
|
|
154
155
|
//# sourceMappingURL=ScheduleScriptTools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleScriptTools.js","sourceRoot":"","sources":["../../../src/tools/ScheduleScriptTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACe,cAAc,GACnC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,gBAAgB;IAA7D;;QAEU,YAAO,GAAqB,MAAM,CAAC;QACnC,uBAAkB,GAAG,KAAK,CAAC;QAC3B,qBAAgB,GAAG,KAAK,CAAC;QACzB,sBAAiB,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,CAAC,WAAW,CAAC,CAAC;QAC9D,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;QAEhC,EAAE,CAAC,YAAY,CAAC,cAAc,GAAG,SAAS,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;;AA7BsB,gCAAM,GAAG,uBAAuB,CAAC;AAgC1D;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IAElD,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAIlC,KAAK,CAAC,KAAK,CAAC,IAAc;QACxC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YACnB,OAAO,IAAI,CAAC,CAAC,yBAAyB;QAExC,IAAI;YACF,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACpE;QAAC,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,YAAY,KAAK;gBACrB,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxB;QAED,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC;IACpC,CAAC;IAEe,KAAK,CAAC,OAAO,CAAC,EAAY;QACxC,EAAE,CAAC,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;;AAvBsB,4BAAM,GAAG,mBAAmB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport { assert, CompressedId64Set } from \"@itwin/core-bentley\";\r\nimport {\r\n ElementLoadOptions, RenderSchedule, RenderTimelineProps,\r\n} from \"@itwin/core-common\";\r\nimport { Viewport } from \"@itwin/core-frontend\";\r\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\r\nimport { parseArgs } from \"./parseArgs\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** Query the schedule script JSON from an element.\r\n * @beta\r\n */\r\nexport class QueryScheduleScriptTool extends DisplayStyleTool {\r\n private _sourceId?: string;\r\n private _action: \"copy\" | \"break\" = \"copy\";\r\n private _includeElementIds = false;\r\n private _countElementIds = false;\r\n private _expandElementIds = false;\r\n\r\n public static override toolId = \"QueryScheduleScript\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 3; }\r\n\r\n public async parse(input: string[], vp: Viewport) {\r\n const args = parseArgs(input);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n this._sourceId = args.get(\"i\") ?? vp.displayStyle.scheduleScriptReference?.sourceId;\r\n if (!this._sourceId)\r\n return false;\r\n\r\n const action = args.get(\"a\") ?? \"\";\r\n this._action = action.length > 0 && \"b\" === action[0].toLowerCase() ? \"break\" : \"copy\";\r\n\r\n this._includeElementIds = this._countElementIds = this._expandElementIds = false;\r\n const ids = args.get(\"e\");\r\n if (ids && ids.length > 0) {\r\n switch (ids[0].toLowerCase()) {\r\n case \"i\":\r\n this._includeElementIds = true;\r\n break;\r\n case \"c\":\r\n this._includeElementIds = this._countElementIds = true;\r\n break;\r\n case \"e\":\r\n this._includeElementIds = this._expandElementIds = true;\r\n break;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public async execute(vp: Viewport) {\r\n if (!this._sourceId || !this._action)\r\n return false;\r\n\r\n const opts: ElementLoadOptions = {\r\n displayStyle: { omitScheduleScriptElementIds: !this._includeElementIds },\r\n renderTimeline: { omitScriptElementIds: !this._includeElementIds },\r\n };\r\n\r\n let script;\r\n const props = await vp.iModel.elements.loadProps(this._sourceId, opts) as any;\r\n if (props.script)\r\n script = JSON.parse((props.script as RenderTimelineProps).script) as RenderSchedule.ScriptProps;\r\n else if (props.jsonProperties?.styles?.scheduleScript)\r\n script = props.jsonProperties.styles.scheduleScript as RenderSchedule.ScriptProps;\r\n\r\n if (!script)\r\n return false;\r\n\r\n if (this._countElementIds || this._expandElementIds) {\r\n for (const model of script) {\r\n for (const elem of model.elementTimelines) {\r\n const elemIds = typeof elem.elementIds === \"string\" ? CompressedId64Set.decompressArray(elem.elementIds) : elem.elementIds;\r\n if (this._countElementIds)\r\n elem.elementIds = elemIds.length as any;\r\n else\r\n elem.elementIds = elemIds;\r\n }\r\n }\r\n }\r\n\r\n if (this._action === \"break\")\r\n debugger; // eslint-disable-line no-debugger\r\n else\r\n copyStringToClipboard(JSON.stringify(script, null, 2));\r\n\r\n return true;\r\n }\r\n}\r\n\r\ninterface Timeline<Entry extends RenderSchedule.TimelineEntry> {\r\n readonly length: number;\r\n getEntry(index: number): Entry | undefined;\r\n}\r\n\r\nfunction reverseTimeline<Entry extends RenderSchedule.TimelineEntry>(timeline: Timeline<Entry> | undefined, accept: (time: number, entry: Entry) => void): void {\r\n if (!timeline)\r\n return;\r\n\r\n const len = timeline.length;\r\n for (let i = 0; i < len; i++) {\r\n const timeEntry = timeline.getEntry(i);\r\n const valueEntry = timeline.getEntry(len - i - 1);\r\n assert(undefined !== timeEntry);\r\n assert(undefined !== valueEntry);\r\n accept(timeEntry.time, valueEntry);\r\n }\r\n}\r\n\r\n/** A tool that modifies the [RenderSchedule.Script]($common), if any, associated with the selected [Viewport]($frontend) such that the entries in each\r\n * of its [RenderSchedule.ElementTimeline]($common)s are reversed.\r\n * @beta\r\n */\r\nexport class ReverseScheduleScriptTool extends DisplayStyleTool {\r\n public static override toolId = \"ReverseScheduleScript\";\r\n\r\n public override async execute(vp: Viewport): Promise<boolean> {\r\n const script = vp?.displayStyle.scheduleScript;\r\n if (!script || script.modelTimelines.some((x) => x.omitsElementIds))\r\n return false;\r\n\r\n const builder = new RenderSchedule.ScriptBuilder();\r\n for (const modelTimeline of script.modelTimelines) {\r\n const modelBuilder = builder.addModelTimeline(modelTimeline.modelId);\r\n for (const elemTimeline of modelTimeline.elementTimelines) {\r\n const elemBuilder = modelBuilder.addElementTimeline(elemTimeline.elementIds);\r\n reverseTimeline(elemTimeline.visibility, (time, entry) => elemBuilder.addVisibility(time, entry.value, entry.interpolation));\r\n reverseTimeline(elemTimeline.color, (time, entry) => elemBuilder.addColor(time, entry.value, entry.interpolation));\r\n reverseTimeline(elemTimeline.transform, (time, entry) => elemBuilder.addTransform(time, entry.value, entry.components, entry.interpolation));\r\n reverseTimeline(elemTimeline.cuttingPlane, (time, entry) => elemBuilder.addCuttingPlane(time, entry.value, entry.interpolation));\r\n }\r\n }\r\n\r\n const scriptProps = builder.finish();\r\n const newScript = RenderSchedule.Script.fromJSON(scriptProps);\r\n assert(undefined !== newScript);\r\n\r\n vp.displayStyle.scheduleScript = newScript;\r\n return true;\r\n }\r\n\r\n public async parse() {\r\n return true;\r\n }\r\n}\r\n\r\n/** A tool that changes or removes the [RenderSchedule.Script]($common) associated with the selected [Viewport]($frontend).\r\n * @beta\r\n */\r\nexport class SetScheduleScriptTool extends DisplayStyleTool {\r\n public static override toolId = \"SetScheduleScript\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n private _script?: RenderSchedule.Script;\r\n\r\n public override async parse(args: string[]): Promise<boolean> {\r\n if (args.length === 0)\r\n return true; // clear schedule script.\r\n\r\n try {\r\n this._script = RenderSchedule.Script.fromJSON(JSON.parse(args[0]));\r\n } catch (ex) {\r\n if (ex instanceof Error)\r\n alert(ex.toString());\r\n }\r\n\r\n return undefined !== this._script;\r\n }\r\n\r\n public override async execute(vp: Viewport): Promise<boolean> {\r\n vp.displayStyle.scheduleScript = this._script;\r\n return true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"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,EAAE;YACX,IAAI,EAAE,YAAY,KAAK;gBACrB,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxB;QAED,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC;IACpC,CAAC;IAEe,KAAK,CAAC,OAAO,CAAC,EAAY;QACxC,EAAE,CAAC,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;;AAvBsB,4BAAM,GAAG,mBAAmB,CAAC;SADzC,qBAAqB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport { assert, CompressedId64Set } from \"@itwin/core-bentley\";\r\nimport {\r\n ElementLoadOptions, RenderSchedule, RenderTimelineProps,\r\n} from \"@itwin/core-common\";\r\nimport { Viewport } from \"@itwin/core-frontend\";\r\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\r\nimport { parseArgs } from \"./parseArgs\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** Query the schedule script JSON from an element.\r\n * @beta\r\n */\r\nexport class QueryScheduleScriptTool extends DisplayStyleTool {\r\n private _sourceId?: string;\r\n private _action: \"copy\" | \"break\" = \"copy\";\r\n private _includeElementIds = false;\r\n private _countElementIds = false;\r\n private _expandElementIds = false;\r\n\r\n public static override toolId = \"QueryScheduleScript\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 3; }\r\n\r\n public async parse(input: string[], vp: Viewport) {\r\n const args = parseArgs(input);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n this._sourceId = args.get(\"i\") ?? vp.displayStyle.scheduleScriptReference?.sourceId;\r\n if (!this._sourceId)\r\n return false;\r\n\r\n const action = args.get(\"a\") ?? \"\";\r\n this._action = action.length > 0 && \"b\" === action[0].toLowerCase() ? \"break\" : \"copy\";\r\n\r\n this._includeElementIds = this._countElementIds = this._expandElementIds = false;\r\n const ids = args.get(\"e\");\r\n if (ids && ids.length > 0) {\r\n switch (ids[0].toLowerCase()) {\r\n case \"i\":\r\n this._includeElementIds = true;\r\n break;\r\n case \"c\":\r\n this._includeElementIds = this._countElementIds = true;\r\n break;\r\n case \"e\":\r\n this._includeElementIds = this._expandElementIds = true;\r\n break;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public async execute(vp: Viewport) {\r\n if (!this._sourceId || !this._action)\r\n return false;\r\n\r\n const opts: ElementLoadOptions = {\r\n displayStyle: { omitScheduleScriptElementIds: !this._includeElementIds },\r\n renderTimeline: { omitScriptElementIds: !this._includeElementIds },\r\n };\r\n\r\n let script;\r\n const props = await vp.iModel.elements.loadProps(this._sourceId, opts) as any;\r\n if (props.script)\r\n script = JSON.parse((props.script as RenderTimelineProps).script) as RenderSchedule.ScriptProps;\r\n else if (props.jsonProperties?.styles?.scheduleScript)\r\n script = props.jsonProperties.styles.scheduleScript as RenderSchedule.ScriptProps;\r\n\r\n if (!script)\r\n return false;\r\n\r\n if (this._countElementIds || this._expandElementIds) {\r\n for (const model of script) {\r\n for (const elem of model.elementTimelines) {\r\n const elemIds = typeof elem.elementIds === \"string\" ? CompressedId64Set.decompressArray(elem.elementIds) : elem.elementIds;\r\n if (this._countElementIds)\r\n elem.elementIds = elemIds.length as any;\r\n else\r\n elem.elementIds = elemIds;\r\n }\r\n }\r\n }\r\n\r\n if (this._action === \"break\")\r\n debugger; // eslint-disable-line no-debugger\r\n else\r\n copyStringToClipboard(JSON.stringify(script, null, 2));\r\n\r\n return true;\r\n }\r\n}\r\n\r\ninterface Timeline<Entry extends RenderSchedule.TimelineEntry> {\r\n readonly length: number;\r\n getEntry(index: number): Entry | undefined;\r\n}\r\n\r\nfunction reverseTimeline<Entry extends RenderSchedule.TimelineEntry>(timeline: Timeline<Entry> | undefined, accept: (time: number, entry: Entry) => void): void {\r\n if (!timeline)\r\n return;\r\n\r\n const len = timeline.length;\r\n for (let i = 0; i < len; i++) {\r\n const timeEntry = timeline.getEntry(i);\r\n const valueEntry = timeline.getEntry(len - i - 1);\r\n assert(undefined !== timeEntry);\r\n assert(undefined !== valueEntry);\r\n accept(timeEntry.time, valueEntry);\r\n }\r\n}\r\n\r\n/** A tool that modifies the [RenderSchedule.Script]($common), if any, associated with the selected [Viewport]($frontend) such that the entries in each\r\n * of its [RenderSchedule.ElementTimeline]($common)s are reversed.\r\n * @beta\r\n */\r\nexport class ReverseScheduleScriptTool extends DisplayStyleTool {\r\n public static override toolId = \"ReverseScheduleScript\";\r\n\r\n public override async execute(vp: Viewport): Promise<boolean> {\r\n const script = vp?.displayStyle.scheduleScript;\r\n if (!script || script.modelTimelines.some((x) => x.omitsElementIds))\r\n return false;\r\n\r\n const builder = new RenderSchedule.ScriptBuilder();\r\n for (const modelTimeline of script.modelTimelines) {\r\n const modelBuilder = builder.addModelTimeline(modelTimeline.modelId);\r\n for (const elemTimeline of modelTimeline.elementTimelines) {\r\n const elemBuilder = modelBuilder.addElementTimeline(elemTimeline.elementIds);\r\n reverseTimeline(elemTimeline.visibility, (time, entry) => elemBuilder.addVisibility(time, entry.value, entry.interpolation));\r\n reverseTimeline(elemTimeline.color, (time, entry) => elemBuilder.addColor(time, entry.value, entry.interpolation));\r\n reverseTimeline(elemTimeline.transform, (time, entry) => elemBuilder.addTransform(time, entry.value, entry.components, entry.interpolation));\r\n reverseTimeline(elemTimeline.cuttingPlane, (time, entry) => elemBuilder.addCuttingPlane(time, entry.value, entry.interpolation));\r\n }\r\n }\r\n\r\n const scriptProps = builder.finish();\r\n const newScript = RenderSchedule.Script.fromJSON(scriptProps);\r\n assert(undefined !== newScript);\r\n\r\n vp.displayStyle.scheduleScript = newScript;\r\n return true;\r\n }\r\n\r\n public async parse() {\r\n return true;\r\n }\r\n}\r\n\r\n/** A tool that changes or removes the [RenderSchedule.Script]($common) associated with the selected [Viewport]($frontend).\r\n * @beta\r\n */\r\nexport class SetScheduleScriptTool extends DisplayStyleTool {\r\n public static override toolId = \"SetScheduleScript\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n private _script?: RenderSchedule.Script;\r\n\r\n public override async parse(args: string[]): Promise<boolean> {\r\n if (args.length === 0)\r\n return true; // clear schedule script.\r\n\r\n try {\r\n this._script = RenderSchedule.Script.fromJSON(JSON.parse(args[0]));\r\n } catch (ex) {\r\n if (ex instanceof Error)\r\n alert(ex.toString());\r\n }\r\n\r\n return undefined !== this._script;\r\n }\r\n\r\n public override async execute(vp: Viewport): Promise<boolean> {\r\n vp.displayStyle.scheduleScript = this._script;\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Tools
|
|
3
|
-
*/
|
|
4
|
-
import { Id64Arg } from "@itwin/core-bentley";
|
|
5
|
-
import { Tool } from "@itwin/core-frontend";
|
|
6
|
-
/** Replaces the contents of the selection set with the set of element Ids specified.
|
|
7
|
-
* Element Ids are separated by whitespace.
|
|
8
|
-
* @beta
|
|
9
|
-
*/
|
|
10
|
-
export declare class SelectElementsByIdTool extends Tool {
|
|
11
|
-
static toolId: string;
|
|
12
|
-
static get minArgs(): number;
|
|
13
|
-
static get maxArgs(): undefined;
|
|
14
|
-
run(ids?: Id64Arg): Promise<boolean>;
|
|
15
|
-
parseAndRun(...args: string[]): Promise<boolean>;
|
|
16
|
-
}
|
|
17
|
-
/** A tool that outputs the Ids of the elements in the [SelectionSet]($frontend) of the [IModelConnection]($frontend) associated with the selected [Viewport]($frontend).
|
|
18
|
-
* @beta
|
|
19
|
-
*/
|
|
20
|
-
export declare class DumpSelectionSetTool extends Tool {
|
|
21
|
-
static toolId: string;
|
|
22
|
-
static get minArgs(): number;
|
|
23
|
-
static get maxArgs(): number;
|
|
24
|
-
private _format;
|
|
25
|
-
private _copy?;
|
|
26
|
-
run(): Promise<boolean>;
|
|
27
|
-
parseAndRun(...input: string[]): Promise<boolean>;
|
|
28
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Tools
|
|
3
|
+
*/
|
|
4
|
+
import { Id64Arg } from "@itwin/core-bentley";
|
|
5
|
+
import { Tool } from "@itwin/core-frontend";
|
|
6
|
+
/** Replaces the contents of the selection set with the set of element Ids specified.
|
|
7
|
+
* Element Ids are separated by whitespace.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class SelectElementsByIdTool extends Tool {
|
|
11
|
+
static toolId: string;
|
|
12
|
+
static get minArgs(): number;
|
|
13
|
+
static get maxArgs(): undefined;
|
|
14
|
+
run(ids?: Id64Arg): Promise<boolean>;
|
|
15
|
+
parseAndRun(...args: string[]): Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/** A tool that outputs the Ids of the elements in the [SelectionSet]($frontend) of the [IModelConnection]($frontend) associated with the selected [Viewport]($frontend).
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
export declare class DumpSelectionSetTool extends Tool {
|
|
21
|
+
static toolId: string;
|
|
22
|
+
static get minArgs(): number;
|
|
23
|
+
static get maxArgs(): number;
|
|
24
|
+
private _format;
|
|
25
|
+
private _copy?;
|
|
26
|
+
run(): Promise<boolean>;
|
|
27
|
+
parseAndRun(...input: string[]): Promise<boolean>;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=SelectionTools.d.ts.map
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Tools
|
|
7
|
-
*/
|
|
8
|
-
import { CompressedId64Set, OrderedId64Iterable } from "@itwin/core-bentley";
|
|
9
|
-
import { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool } from "@itwin/core-frontend";
|
|
10
|
-
import { copyStringToClipboard } from "../ClipboardUtilities";
|
|
11
|
-
import { parseArgs } from "./parseArgs";
|
|
12
|
-
/** Replaces the contents of the selection set with the set of element Ids specified.
|
|
13
|
-
* Element Ids are separated by whitespace.
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
static get minArgs() { return 1; }
|
|
18
|
-
static get maxArgs() { return undefined; }
|
|
19
|
-
async run(ids) {
|
|
20
|
-
const vp = IModelApp.viewManager.selectedView;
|
|
21
|
-
if (undefined !== vp && undefined !== ids)
|
|
22
|
-
vp.iModel.selectionSet.replace(ids);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
async parseAndRun(...args) {
|
|
26
|
-
return this.run(args);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
SelectElementsByIdTool.toolId = "SelectElementsById";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
static get
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Tools
|
|
7
|
+
*/
|
|
8
|
+
import { CompressedId64Set, OrderedId64Iterable } from "@itwin/core-bentley";
|
|
9
|
+
import { IModelApp, NotifyMessageDetails, OutputMessagePriority, Tool } from "@itwin/core-frontend";
|
|
10
|
+
import { copyStringToClipboard } from "../ClipboardUtilities";
|
|
11
|
+
import { parseArgs } from "./parseArgs";
|
|
12
|
+
/** Replaces the contents of the selection set with the set of element Ids specified.
|
|
13
|
+
* Element Ids are separated by whitespace.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
class SelectElementsByIdTool extends Tool {
|
|
17
|
+
static get minArgs() { return 1; }
|
|
18
|
+
static get maxArgs() { return undefined; }
|
|
19
|
+
async run(ids) {
|
|
20
|
+
const vp = IModelApp.viewManager.selectedView;
|
|
21
|
+
if (undefined !== vp && undefined !== ids)
|
|
22
|
+
vp.iModel.selectionSet.replace(ids);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
async parseAndRun(...args) {
|
|
26
|
+
return this.run(args);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
SelectElementsByIdTool.toolId = "SelectElementsById";
|
|
30
|
+
export { SelectElementsByIdTool };
|
|
31
|
+
/** A tool that outputs the Ids of the elements in the [SelectionSet]($frontend) of the [IModelConnection]($frontend) associated with the selected [Viewport]($frontend).
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
class DumpSelectionSetTool extends Tool {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
this._format = "list";
|
|
38
|
+
}
|
|
39
|
+
static get minArgs() { return 0; }
|
|
40
|
+
static get maxArgs() { return 2; }
|
|
41
|
+
async run() {
|
|
42
|
+
const vp = IModelApp.viewManager.selectedView;
|
|
43
|
+
if (!vp)
|
|
44
|
+
return false;
|
|
45
|
+
const elems = Array.from(vp.iModel.selectionSet.elements);
|
|
46
|
+
OrderedId64Iterable.sortArray(elems);
|
|
47
|
+
let output;
|
|
48
|
+
switch (this._format) {
|
|
49
|
+
case "compressed":
|
|
50
|
+
output = CompressedId64Set.compressArray(elems);
|
|
51
|
+
break;
|
|
52
|
+
case "json":
|
|
53
|
+
output = JSON.stringify(elems);
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
output = elems.join(" ");
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
if (this._copy)
|
|
60
|
+
copyStringToClipboard(output);
|
|
61
|
+
const brief = `Selection set dumped${this._copy ? " to clipboard" : ""}.`;
|
|
62
|
+
const details = new NotifyMessageDetails(OutputMessagePriority.Info, brief, output);
|
|
63
|
+
IModelApp.notifications.outputMessage(details);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
async parseAndRun(...input) {
|
|
67
|
+
const args = parseArgs(input);
|
|
68
|
+
this._copy = args.getBoolean("c");
|
|
69
|
+
const formatArg = args.get("f");
|
|
70
|
+
if (formatArg) {
|
|
71
|
+
switch (formatArg[0].toLowerCase()) {
|
|
72
|
+
case "j":
|
|
73
|
+
this._format = "json";
|
|
74
|
+
break;
|
|
75
|
+
case "c":
|
|
76
|
+
this._format = "compressed";
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return this.run();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
DumpSelectionSetTool.toolId = "DumpSelectionSet";
|
|
84
|
+
export { DumpSelectionSetTool };
|
|
83
85
|
//# sourceMappingURL=SelectionTools.js.map
|