@itwin/frontend-devtools 4.0.0-dev.7 → 4.0.0-dev.70
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 +11 -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.js +507 -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.d.ts.map +1 -1
- package/lib/cjs/tools/SourceAspectIdTools.js +86 -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.js +504 -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.d.ts.map +1 -1
- package/lib/esm/tools/SourceAspectIdTools.js +82 -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 +12 -12
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Effects
|
|
3
|
-
*/
|
|
4
|
-
import { ScreenSpaceEffectBuilder, Tool } from "@itwin/core-frontend";
|
|
5
|
-
import { AddEffectTool } from "./EffectTools";
|
|
6
|
-
/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.
|
|
7
|
-
* It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.
|
|
8
|
-
* @beta
|
|
9
|
-
*/
|
|
10
|
-
export declare class FlipImageEffect extends AddEffectTool {
|
|
11
|
-
static toolId: string;
|
|
12
|
-
protected get effectName(): string;
|
|
13
|
-
protected get textureCoordFromPosition(): boolean;
|
|
14
|
-
protected get source(): {
|
|
15
|
-
vertex: string;
|
|
16
|
-
fragment: string;
|
|
17
|
-
sampleSourcePixel: string;
|
|
18
|
-
};
|
|
19
|
-
protected defineEffect(builder: ScreenSpaceEffectBuilder): void;
|
|
20
|
-
}
|
|
21
|
-
/** Configure the [[FlipImageEffect]].
|
|
22
|
-
* @beta
|
|
23
|
-
*/
|
|
24
|
-
export declare class FlipImageConfig extends Tool {
|
|
25
|
-
static toolId: string;
|
|
26
|
-
static get minArgs(): number;
|
|
27
|
-
static get maxArgs(): number;
|
|
28
|
-
run(horizontal?: boolean, vertical?: boolean, color?: boolean): Promise<boolean>;
|
|
29
|
-
parseAndRun(...input: string[]): Promise<boolean>;
|
|
30
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Effects
|
|
3
|
+
*/
|
|
4
|
+
import { ScreenSpaceEffectBuilder, Tool } from "@itwin/core-frontend";
|
|
5
|
+
import { AddEffectTool } from "./EffectTools";
|
|
6
|
+
/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.
|
|
7
|
+
* It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class FlipImageEffect extends AddEffectTool {
|
|
11
|
+
static toolId: string;
|
|
12
|
+
protected get effectName(): string;
|
|
13
|
+
protected get textureCoordFromPosition(): boolean;
|
|
14
|
+
protected get source(): {
|
|
15
|
+
vertex: string;
|
|
16
|
+
fragment: string;
|
|
17
|
+
sampleSourcePixel: string;
|
|
18
|
+
};
|
|
19
|
+
protected defineEffect(builder: ScreenSpaceEffectBuilder): void;
|
|
20
|
+
}
|
|
21
|
+
/** Configure the [[FlipImageEffect]].
|
|
22
|
+
* @beta
|
|
23
|
+
*/
|
|
24
|
+
export declare class FlipImageConfig extends Tool {
|
|
25
|
+
static toolId: string;
|
|
26
|
+
static get minArgs(): number;
|
|
27
|
+
static get maxArgs(): number;
|
|
28
|
+
run(horizontal?: boolean, vertical?: boolean, color?: boolean): Promise<boolean>;
|
|
29
|
+
parseAndRun(...input: string[]): Promise<boolean>;
|
|
30
|
+
}
|
|
31
31
|
//# sourceMappingURL=FlipImage.d.ts.map
|
|
@@ -1,29 +1,29 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Effects
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.FlipImageConfig = exports.FlipImageEffect = void 0;
|
|
11
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
12
|
-
const parseArgs_1 = require("../tools/parseArgs");
|
|
13
|
-
const EffectTools_1 = require("./EffectTools");
|
|
14
|
-
let flipHorizontal = false;
|
|
15
|
-
let flipVertical = false;
|
|
16
|
-
let flipColor = false;
|
|
17
|
-
/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.
|
|
18
|
-
* It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.
|
|
19
|
-
* @beta
|
|
20
|
-
*/
|
|
21
|
-
class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
-
get effectName() { return "flip"; }
|
|
23
|
-
get textureCoordFromPosition() { return true; }
|
|
24
|
-
get source() {
|
|
25
|
-
return {
|
|
26
|
-
// Compute texture coordinate for use in fragment shader.
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Effects
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.FlipImageConfig = exports.FlipImageEffect = void 0;
|
|
11
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
12
|
+
const parseArgs_1 = require("../tools/parseArgs");
|
|
13
|
+
const EffectTools_1 = require("./EffectTools");
|
|
14
|
+
let flipHorizontal = false;
|
|
15
|
+
let flipVertical = false;
|
|
16
|
+
let flipColor = false;
|
|
17
|
+
/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.
|
|
18
|
+
* It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
+
get effectName() { return "flip"; }
|
|
23
|
+
get textureCoordFromPosition() { return true; }
|
|
24
|
+
get source() {
|
|
25
|
+
return {
|
|
26
|
+
// Compute texture coordinate for use in fragment shader.
|
|
27
27
|
vertex: `
|
|
28
28
|
void effectMain(vec4 pos) {
|
|
29
29
|
vec2 uv = textureCoordFromPosition(pos);
|
|
@@ -34,8 +34,8 @@ class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
|
34
34
|
uv.y = 1.0 - uv.y;
|
|
35
35
|
|
|
36
36
|
v_uv = uv;
|
|
37
|
-
}`,
|
|
38
|
-
// Sample the original image to flip on x and/or y axis, then invert its color.
|
|
37
|
+
}`,
|
|
38
|
+
// Sample the original image to flip on x and/or y axis, then invert its color.
|
|
39
39
|
fragment: `
|
|
40
40
|
vec4 effectMain() {
|
|
41
41
|
vec4 color = sampleSourcePixel();
|
|
@@ -46,55 +46,55 @@ class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
return color;
|
|
49
|
-
}`,
|
|
50
|
-
// Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise
|
|
51
|
-
// element locate will not work correctly.
|
|
52
|
-
sampleSourcePixel: "return TEXTURE(u_diffuse, v_uv);",
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
defineEffect(builder) {
|
|
56
|
-
// Don't bother applying the effect if nothing is to be flipped.
|
|
57
|
-
builder.shouldApply = (_context) => flipHorizontal || flipVertical || flipColor;
|
|
58
|
-
// Define the varying for the texture coordinate.
|
|
59
|
-
builder.addVarying("v_uv", core_frontend_1.VaryingType.Vec2);
|
|
60
|
-
// Hook up the uniforms.
|
|
61
|
-
builder.addUniform({
|
|
62
|
-
name: "u_flipHorizontal",
|
|
63
|
-
type: core_frontend_1.UniformType.Bool,
|
|
64
|
-
bind: (uniform, _context) => uniform.setUniform1i(flipHorizontal ? 1 : 0),
|
|
65
|
-
});
|
|
66
|
-
builder.addUniform({
|
|
67
|
-
name: "u_flipVertical",
|
|
68
|
-
type: core_frontend_1.UniformType.Bool,
|
|
69
|
-
bind: (uniform, _context) => uniform.setUniform1i(flipVertical ? 1 : 0),
|
|
70
|
-
});
|
|
71
|
-
builder.addUniform({
|
|
72
|
-
name: "u_flipColor",
|
|
73
|
-
type: core_frontend_1.UniformType.Bool,
|
|
74
|
-
bind: (uniform, _context) => uniform.setUniform1i(flipColor ? 1 : 0),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
FlipImageEffect
|
|
80
|
-
/** Configure the [[FlipImageEffect]].
|
|
81
|
-
* @beta
|
|
82
|
-
*/
|
|
83
|
-
class FlipImageConfig extends core_frontend_1.Tool {
|
|
84
|
-
static get minArgs() { return 0; }
|
|
85
|
-
static get maxArgs() { return 3; }
|
|
86
|
-
async run(horizontal, vertical, color) {
|
|
87
|
-
flipHorizontal = !!horizontal;
|
|
88
|
-
flipVertical = !!vertical;
|
|
89
|
-
flipColor = !!color;
|
|
90
|
-
(0, EffectTools_1.refreshViewportsForEffect)("fdt flip");
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
async parseAndRun(...input) {
|
|
94
|
-
const args = (0, parseArgs_1.parseArgs)(input);
|
|
95
|
-
return this.run(args.getBoolean("h"), args.getBoolean("v"), args.getBoolean("c"));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
FlipImageConfig
|
|
49
|
+
}`,
|
|
50
|
+
// Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise
|
|
51
|
+
// element locate will not work correctly.
|
|
52
|
+
sampleSourcePixel: "return TEXTURE(u_diffuse, v_uv);",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
defineEffect(builder) {
|
|
56
|
+
// Don't bother applying the effect if nothing is to be flipped.
|
|
57
|
+
builder.shouldApply = (_context) => flipHorizontal || flipVertical || flipColor;
|
|
58
|
+
// Define the varying for the texture coordinate.
|
|
59
|
+
builder.addVarying("v_uv", core_frontend_1.VaryingType.Vec2);
|
|
60
|
+
// Hook up the uniforms.
|
|
61
|
+
builder.addUniform({
|
|
62
|
+
name: "u_flipHorizontal",
|
|
63
|
+
type: core_frontend_1.UniformType.Bool,
|
|
64
|
+
bind: (uniform, _context) => uniform.setUniform1i(flipHorizontal ? 1 : 0),
|
|
65
|
+
});
|
|
66
|
+
builder.addUniform({
|
|
67
|
+
name: "u_flipVertical",
|
|
68
|
+
type: core_frontend_1.UniformType.Bool,
|
|
69
|
+
bind: (uniform, _context) => uniform.setUniform1i(flipVertical ? 1 : 0),
|
|
70
|
+
});
|
|
71
|
+
builder.addUniform({
|
|
72
|
+
name: "u_flipColor",
|
|
73
|
+
type: core_frontend_1.UniformType.Bool,
|
|
74
|
+
bind: (uniform, _context) => uniform.setUniform1i(flipColor ? 1 : 0),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
FlipImageEffect.toolId = "FlipImageEffect";
|
|
79
|
+
exports.FlipImageEffect = FlipImageEffect;
|
|
80
|
+
/** Configure the [[FlipImageEffect]].
|
|
81
|
+
* @beta
|
|
82
|
+
*/
|
|
83
|
+
class FlipImageConfig extends core_frontend_1.Tool {
|
|
84
|
+
static get minArgs() { return 0; }
|
|
85
|
+
static get maxArgs() { return 3; }
|
|
86
|
+
async run(horizontal, vertical, color) {
|
|
87
|
+
flipHorizontal = !!horizontal;
|
|
88
|
+
flipVertical = !!vertical;
|
|
89
|
+
flipColor = !!color;
|
|
90
|
+
(0, EffectTools_1.refreshViewportsForEffect)("fdt flip");
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
async parseAndRun(...input) {
|
|
94
|
+
const args = (0, parseArgs_1.parseArgs)(input);
|
|
95
|
+
return this.run(args.getBoolean("h"), args.getBoolean("v"), args.getBoolean("c"));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
FlipImageConfig.toolId = "FlipImageConfig";
|
|
99
|
+
exports.FlipImageConfig = FlipImageConfig;
|
|
100
100
|
//# sourceMappingURL=FlipImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlipImage.js","sourceRoot":"","sources":["../../../src/effects/FlipImage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAgG;AAChG,kDAA+C;AAC/C,+CAAyE;AAEzE,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB;;;GAGG;AACH,MAAa,eAAgB,SAAQ,2BAAa;IAGhD,IAAc,UAAU,KAAK,OAAO,MAAM,CAAC,CAAC,CAAC;IAC7C,IAAc,wBAAwB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAEzD,IAAc,MAAM;QAClB,OAAO;YACL,yDAAyD;YACzD,MAAM,EAAE;;;;;;;;;;UAUJ;YACJ,+EAA+E;YAC/E,QAAQ,EAAE;;;;;;;;;;UAUN;YACJ,+HAA+H;YAC/H,0CAA0C;YAC1C,iBAAiB,EAAE,kCAAkC;SACtD,CAAC;IACJ,CAAC;IAES,YAAY,CAAC,OAAiC;QACtD,gEAAgE;QAChE,OAAO,CAAC,WAAW,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,cAAc,IAAI,YAAY,IAAI,SAAS,CAAC;QAEhF,iDAAiD;QACjD,OAAO,CAAC,UAA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AC,CAAC,CAAC,CAAC,CAAC;SACrE,CAAC,CAAC;IACL,CAAC;;AA5DsB,sBAAM,GAAG,iBAAiB,CAAC;AADvC,0CAAe;AAgE5B;;GAEG;AACH,MAAa,eAAgB,SAAQ,oBAAI;IAEhC,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,UAAoB,EAAE,QAAkB,EAAE,KAAe;QACjF,cAAc,GAAG,CAAC,CAAC,UAAU,CAAC;QAC9B,YAAY,GAAG,CAAC,CAAC,QAAQ,CAAC;QAC1B,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC;QAEpB,IAAA,uCAAyB,EAAC,UAAU,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,KAAe;QAClD,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,CAAC;;AAhBsB,sBAAM,GAAG,iBAAiB,CAAC;AADvC,0CAAe","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/** @packageDocumentation\r\n * @module Effects\r\n */\r\n\r\nimport { ScreenSpaceEffectBuilder, Tool, UniformType, VaryingType } from \"@itwin/core-frontend\";\r\nimport { parseArgs } from \"../tools/parseArgs\";\r\nimport { AddEffectTool, refreshViewportsForEffect } from \"./EffectTools\";\r\n\r\nlet flipHorizontal = false;\r\nlet flipVertical = false;\r\nlet flipColor = false;\r\n\r\n/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.\r\n * It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.\r\n * @beta\r\n */\r\nexport class FlipImageEffect extends AddEffectTool {\r\n public static override toolId = \"FlipImageEffect\";\r\n\r\n protected get effectName() { return \"flip\"; }\r\n protected get textureCoordFromPosition() { return true; }\r\n\r\n protected get source() {\r\n return {\r\n // Compute texture coordinate for use in fragment shader.\r\n vertex: `\r\n void effectMain(vec4 pos) {\r\n vec2 uv = textureCoordFromPosition(pos);\r\n if (u_flipHorizontal)\r\n uv.x = 1.0 - uv.x;\r\n\r\n if (u_flipVertical)\r\n uv.y = 1.0 - uv.y;\r\n\r\n v_uv = uv;\r\n }`,\r\n // Sample the original image to flip on x and/or y axis, then invert its color.\r\n fragment: `\r\n vec4 effectMain() {\r\n vec4 color = sampleSourcePixel();\r\n if (u_flipColor) {\r\n color.r = 1.0 - color.r;\r\n color.g = 1.0 - color.g;\r\n color.b = 1.0 - color.b;\r\n }\r\n\r\n return color;\r\n }`,\r\n // Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise\r\n // element locate will not work correctly.\r\n sampleSourcePixel: \"return TEXTURE(u_diffuse, v_uv);\",\r\n };\r\n }\r\n\r\n protected defineEffect(builder: ScreenSpaceEffectBuilder): void {\r\n // Don't bother applying the effect if nothing is to be flipped.\r\n builder.shouldApply = (_context) => flipHorizontal || flipVertical || flipColor;\r\n\r\n // Define the varying for the texture coordinate.\r\n builder.addVarying(\"v_uv\", VaryingType.Vec2);\r\n\r\n // Hook up the uniforms.\r\n builder.addUniform({\r\n name: \"u_flipHorizontal\",\r\n type: UniformType.Bool,\r\n bind: (uniform, _context) => uniform.setUniform1i(flipHorizontal ? 1 : 0),\r\n });\r\n builder.addUniform({\r\n name: \"u_flipVertical\",\r\n type: UniformType.Bool,\r\n bind: (uniform, _context) => uniform.setUniform1i(flipVertical ? 1 : 0),\r\n });\r\n builder.addUniform({\r\n name: \"u_flipColor\",\r\n type: UniformType.Bool,\r\n bind: (uniform, _context) => uniform.setUniform1i(flipColor ? 1 : 0),\r\n });\r\n }\r\n}\r\n\r\n/** Configure the [[FlipImageEffect]].\r\n * @beta\r\n */\r\nexport class FlipImageConfig extends Tool {\r\n public static override toolId = \"FlipImageConfig\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 3; }\r\n\r\n public override async run(horizontal?: boolean, vertical?: boolean, color?: boolean): Promise<boolean> {\r\n flipHorizontal = !!horizontal;\r\n flipVertical = !!vertical;\r\n flipColor = !!color;\r\n\r\n refreshViewportsForEffect(\"fdt flip\");\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...input: string[]): Promise<boolean> {\r\n const args = parseArgs(input);\r\n return this.run(args.getBoolean(\"h\"), args.getBoolean(\"v\"), args.getBoolean(\"c\"));\r\n }\r\n}\r\n"]}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Effects
|
|
3
|
-
*/
|
|
4
|
-
import { ScreenSpaceEffectBuilder, Tool } from "@itwin/core-frontend";
|
|
5
|
-
import { AddEffectTool } from "./EffectTools";
|
|
6
|
-
/** Adds a screen-space effect to the selected [[Viewport]] to simulate the lens distortion produced by real-world cameras with very wide fields of view.
|
|
7
|
-
* Based on https://www.decarpentier.nl/lens-distortion
|
|
8
|
-
* The effect is improved considerably by enabling anti-aliasing (e.g., via [RenderSystem.Options.antialiasSamples]($frontend) at startup, or using the `fdt aasamples` key-in`).
|
|
9
|
-
* @note Because this effect applies a non-linear transform to each pixel, operations like snapping to geometry will not work properly. Element locate will work however - @see [ScreenSpaceEffectSource.sampleSourcePixel]($frontend).
|
|
10
|
-
* @beta
|
|
11
|
-
*/
|
|
12
|
-
export declare class LensDistortionEffect extends AddEffectTool {
|
|
13
|
-
static toolId: string;
|
|
14
|
-
protected get effectName(): string;
|
|
15
|
-
protected get textureCoordFromPosition(): boolean;
|
|
16
|
-
protected get source(): {
|
|
17
|
-
vertex: string;
|
|
18
|
-
fragment: string;
|
|
19
|
-
sampleSourcePixel: string;
|
|
20
|
-
};
|
|
21
|
-
protected defineEffect(builder: ScreenSpaceEffectBuilder): void;
|
|
22
|
-
}
|
|
23
|
-
/** Configures the [[LensDistortionEffect]].
|
|
24
|
-
* @beta
|
|
25
|
-
*/
|
|
26
|
-
export declare class LensDistortionConfig extends Tool {
|
|
27
|
-
static toolId: string;
|
|
28
|
-
static get minArgs(): number;
|
|
29
|
-
static get maxArgs(): number;
|
|
30
|
-
static strength: number;
|
|
31
|
-
static cylindricalRatio: number;
|
|
32
|
-
run(strength?: number, ratio?: number): Promise<boolean>;
|
|
33
|
-
parseAndRun(...input: string[]): Promise<boolean>;
|
|
34
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Effects
|
|
3
|
+
*/
|
|
4
|
+
import { ScreenSpaceEffectBuilder, Tool } from "@itwin/core-frontend";
|
|
5
|
+
import { AddEffectTool } from "./EffectTools";
|
|
6
|
+
/** Adds a screen-space effect to the selected [[Viewport]] to simulate the lens distortion produced by real-world cameras with very wide fields of view.
|
|
7
|
+
* Based on https://www.decarpentier.nl/lens-distortion
|
|
8
|
+
* The effect is improved considerably by enabling anti-aliasing (e.g., via [RenderSystem.Options.antialiasSamples]($frontend) at startup, or using the `fdt aasamples` key-in`).
|
|
9
|
+
* @note Because this effect applies a non-linear transform to each pixel, operations like snapping to geometry will not work properly. Element locate will work however - @see [ScreenSpaceEffectSource.sampleSourcePixel]($frontend).
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare class LensDistortionEffect extends AddEffectTool {
|
|
13
|
+
static toolId: string;
|
|
14
|
+
protected get effectName(): string;
|
|
15
|
+
protected get textureCoordFromPosition(): boolean;
|
|
16
|
+
protected get source(): {
|
|
17
|
+
vertex: string;
|
|
18
|
+
fragment: string;
|
|
19
|
+
sampleSourcePixel: string;
|
|
20
|
+
};
|
|
21
|
+
protected defineEffect(builder: ScreenSpaceEffectBuilder): void;
|
|
22
|
+
}
|
|
23
|
+
/** Configures the [[LensDistortionEffect]].
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
export declare class LensDistortionConfig extends Tool {
|
|
27
|
+
static toolId: string;
|
|
28
|
+
static get minArgs(): number;
|
|
29
|
+
static get maxArgs(): number;
|
|
30
|
+
static strength: number;
|
|
31
|
+
static cylindricalRatio: number;
|
|
32
|
+
run(strength?: number, ratio?: number): Promise<boolean>;
|
|
33
|
+
parseAndRun(...input: string[]): Promise<boolean>;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=LensDistortion.d.ts.map
|
|
@@ -1,28 +1,28 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Effects
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.LensDistortionConfig = exports.LensDistortionEffect = void 0;
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
-
const EffectTools_1 = require("./EffectTools");
|
|
14
|
-
const parseArgs_1 = require("../tools/parseArgs");
|
|
15
|
-
/** Adds a screen-space effect to the selected [[Viewport]] to simulate the lens distortion produced by real-world cameras with very wide fields of view.
|
|
16
|
-
* Based on https://www.decarpentier.nl/lens-distortion
|
|
17
|
-
* The effect is improved considerably by enabling anti-aliasing (e.g., via [RenderSystem.Options.antialiasSamples]($frontend) at startup, or using the `fdt aasamples` key-in`).
|
|
18
|
-
* @note Because this effect applies a non-linear transform to each pixel, operations like snapping to geometry will not work properly. Element locate will work however - @see [ScreenSpaceEffectSource.sampleSourcePixel]($frontend).
|
|
19
|
-
* @beta
|
|
20
|
-
*/
|
|
21
|
-
class LensDistortionEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
-
get effectName() { return "lensdistortion"; }
|
|
23
|
-
get textureCoordFromPosition() { return true; }
|
|
24
|
-
get source() {
|
|
25
|
-
return {
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Effects
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.LensDistortionConfig = exports.LensDistortionEffect = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
+
const EffectTools_1 = require("./EffectTools");
|
|
14
|
+
const parseArgs_1 = require("../tools/parseArgs");
|
|
15
|
+
/** Adds a screen-space effect to the selected [[Viewport]] to simulate the lens distortion produced by real-world cameras with very wide fields of view.
|
|
16
|
+
* Based on https://www.decarpentier.nl/lens-distortion
|
|
17
|
+
* The effect is improved considerably by enabling anti-aliasing (e.g., via [RenderSystem.Options.antialiasSamples]($frontend) at startup, or using the `fdt aasamples` key-in`).
|
|
18
|
+
* @note Because this effect applies a non-linear transform to each pixel, operations like snapping to geometry will not work properly. Element locate will work however - @see [ScreenSpaceEffectSource.sampleSourcePixel]($frontend).
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
class LensDistortionEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
+
get effectName() { return "lensdistortion"; }
|
|
23
|
+
get textureCoordFromPosition() { return true; }
|
|
24
|
+
get source() {
|
|
25
|
+
return {
|
|
26
26
|
vertex: `
|
|
27
27
|
void effectMain(vec4 position) {
|
|
28
28
|
vec2 uv = textureCoordFromPosition(position);
|
|
@@ -38,73 +38,73 @@ class LensDistortionEffect extends EffectTools_1.AddEffectTool {
|
|
|
38
38
|
vUVDot = sqrt(ny) * vec2(cylAspectRatio, 1.0) * signedUV;
|
|
39
39
|
vUV = vec3(0.5, 0.5, 1.0) * z + vec3(-0.5, -0.5, 0.0);
|
|
40
40
|
vUV.xy += uv;
|
|
41
|
-
}`,
|
|
42
|
-
// We simply shift pixels - we don't alter their colors.
|
|
41
|
+
}`,
|
|
42
|
+
// We simply shift pixels - we don't alter their colors.
|
|
43
43
|
fragment: `
|
|
44
44
|
vec4 effectMain() {
|
|
45
45
|
return sampleSourcePixel();
|
|
46
|
-
}`,
|
|
47
|
-
// Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise
|
|
48
|
-
// element locate will not work correctly.
|
|
46
|
+
}`,
|
|
47
|
+
// Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise
|
|
48
|
+
// element locate will not work correctly.
|
|
49
49
|
sampleSourcePixel: `
|
|
50
50
|
vec3 uv = dot(vUVDot, vUVDot) * vec3(-0.5, -0.5, -1.0) + vUV;
|
|
51
51
|
return TEXTURE_PROJ(u_diffuse, uv);
|
|
52
|
-
`,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
defineEffect(builder) {
|
|
56
|
-
// Lens distortion is only applicable to views with the camera enabled.
|
|
57
|
-
builder.shouldApply = (context) => context.viewport.isCameraOn;
|
|
58
|
-
builder.addVarying("vUV", core_frontend_1.VaryingType.Vec3);
|
|
59
|
-
builder.addVarying("vUVDot", core_frontend_1.VaryingType.Vec2);
|
|
60
|
-
builder.addUniform({
|
|
61
|
-
name: "strength",
|
|
62
|
-
type: core_frontend_1.UniformType.Float,
|
|
63
|
-
bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.strength),
|
|
64
|
-
});
|
|
65
|
-
builder.addUniform({
|
|
66
|
-
name: "cylindricalRatio",
|
|
67
|
-
type: core_frontend_1.UniformType.Float,
|
|
68
|
-
bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.cylindricalRatio),
|
|
69
|
-
});
|
|
70
|
-
builder.addUniform({
|
|
71
|
-
name: "aspectRatio",
|
|
72
|
-
type: core_frontend_1.UniformType.Float,
|
|
73
|
-
bind: (uniform, context) => uniform.setUniform1f(context.viewport.viewRect.aspect),
|
|
74
|
-
});
|
|
75
|
-
builder.addUniform({
|
|
76
|
-
name: "height",
|
|
77
|
-
type: core_frontend_1.UniformType.Float,
|
|
78
|
-
bind: (uniform, context) => {
|
|
79
|
-
(0, core_bentley_1.assert)(context.viewport.view.is3d() && context.viewport.view.isCameraOn);
|
|
80
|
-
const fov = context.viewport.view.camera.lens.radians;
|
|
81
|
-
const height = Math.tan(fov / 2) / context.viewport.viewRect.aspect;
|
|
82
|
-
uniform.setUniform1f(height);
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
LensDistortionEffect
|
|
89
|
-
/** Configures the [[LensDistortionEffect]].
|
|
90
|
-
* @beta
|
|
91
|
-
*/
|
|
92
|
-
class LensDistortionConfig extends core_frontend_1.Tool {
|
|
93
|
-
static get minArgs() { return 0; }
|
|
94
|
-
static get maxArgs() { return 2; }
|
|
95
|
-
async run(strength, ratio) {
|
|
96
|
-
LensDistortionConfig.strength = strength
|
|
97
|
-
LensDistortionConfig.cylindricalRatio = ratio
|
|
98
|
-
(0, EffectTools_1.refreshViewportsForEffect)("fdt lensdistortion");
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
async parseAndRun(...input) {
|
|
102
|
-
const args = (0, parseArgs_1.parseArgs)(input);
|
|
103
|
-
return this.run(args.getFloat("s"), args.getFloat("r"));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
LensDistortionConfig.
|
|
108
|
-
LensDistortionConfig.
|
|
109
|
-
LensDistortionConfig
|
|
52
|
+
`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
defineEffect(builder) {
|
|
56
|
+
// Lens distortion is only applicable to views with the camera enabled.
|
|
57
|
+
builder.shouldApply = (context) => context.viewport.isCameraOn;
|
|
58
|
+
builder.addVarying("vUV", core_frontend_1.VaryingType.Vec3);
|
|
59
|
+
builder.addVarying("vUVDot", core_frontend_1.VaryingType.Vec2);
|
|
60
|
+
builder.addUniform({
|
|
61
|
+
name: "strength",
|
|
62
|
+
type: core_frontend_1.UniformType.Float,
|
|
63
|
+
bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.strength),
|
|
64
|
+
});
|
|
65
|
+
builder.addUniform({
|
|
66
|
+
name: "cylindricalRatio",
|
|
67
|
+
type: core_frontend_1.UniformType.Float,
|
|
68
|
+
bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.cylindricalRatio),
|
|
69
|
+
});
|
|
70
|
+
builder.addUniform({
|
|
71
|
+
name: "aspectRatio",
|
|
72
|
+
type: core_frontend_1.UniformType.Float,
|
|
73
|
+
bind: (uniform, context) => uniform.setUniform1f(context.viewport.viewRect.aspect),
|
|
74
|
+
});
|
|
75
|
+
builder.addUniform({
|
|
76
|
+
name: "height",
|
|
77
|
+
type: core_frontend_1.UniformType.Float,
|
|
78
|
+
bind: (uniform, context) => {
|
|
79
|
+
(0, core_bentley_1.assert)(context.viewport.view.is3d() && context.viewport.view.isCameraOn);
|
|
80
|
+
const fov = context.viewport.view.camera.lens.radians;
|
|
81
|
+
const height = Math.tan(fov / 2) / context.viewport.viewRect.aspect;
|
|
82
|
+
uniform.setUniform1f(height);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
LensDistortionEffect.toolId = "LensDistortionEffect";
|
|
88
|
+
exports.LensDistortionEffect = LensDistortionEffect;
|
|
89
|
+
/** Configures the [[LensDistortionEffect]].
|
|
90
|
+
* @beta
|
|
91
|
+
*/
|
|
92
|
+
class LensDistortionConfig extends core_frontend_1.Tool {
|
|
93
|
+
static get minArgs() { return 0; }
|
|
94
|
+
static get maxArgs() { return 2; }
|
|
95
|
+
async run(strength, ratio) {
|
|
96
|
+
LensDistortionConfig.strength = strength ?? 0.5;
|
|
97
|
+
LensDistortionConfig.cylindricalRatio = ratio ?? 0.5;
|
|
98
|
+
(0, EffectTools_1.refreshViewportsForEffect)("fdt lensdistortion");
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
async parseAndRun(...input) {
|
|
102
|
+
const args = (0, parseArgs_1.parseArgs)(input);
|
|
103
|
+
return this.run(args.getFloat("s"), args.getFloat("r"));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
LensDistortionConfig.toolId = "LensDistortionConfig";
|
|
107
|
+
LensDistortionConfig.strength = 0.5;
|
|
108
|
+
LensDistortionConfig.cylindricalRatio = 0.5;
|
|
109
|
+
exports.LensDistortionConfig = LensDistortionConfig;
|
|
110
110
|
//# sourceMappingURL=LensDistortion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LensDistortion.js","sourceRoot":"","sources":["../../../src/effects/LensDistortion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,wDAAgG;AAChG,+CAAyE;AACzE,kDAA+C;AAE/C;;;;;GAKG;AACH,MAAa,oBAAqB,SAAQ,2BAAa;IAGrD,IAAc,UAAU,KAAK,OAAO,gBAAgB,CAAC,CAAC,CAAC;IACvD,IAAc,wBAAwB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAEzD,IAAc,MAAM;QAClB,OAAO;YACL,MAAM,EAAE;;;;;;;;;;;;;;;UAeJ;YACJ,wDAAwD;YACxD,QAAQ,EAAE;;;UAGN;YACJ,+HAA+H;YAC/H,0CAA0C;YAC1C,iBAAiB,EAAE;;;OAGlB;SACF,CAAC;IACJ,CAAC;IAES,YAAY,CAAC,OA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AEG;AACH,MAAa,oBAAqB,SAAQ,oBAAI;IAErC,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAKlC,KAAK,CAAC,GAAG,CAAC,QAAiB,EAAE,KAAc;QACzD,oBAAoB,CAAC,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC;QAChD,oBAAoB,CAAC,gBAAgB,GAAG,KAAK,IAAI,GAAG,CAAC;QACrD,IAAA,uCAAyB,EAAC,oBAAoB,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,KAAe;QAClD,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;;AAjBsB,2BAAM,GAAG,sBAAsB,CAAC;AAIzC,6BAAQ,GAAG,GAAG,CAAC;AACf,qCAAgB,GAAG,GAAG,CAAC;AAN1B,oDAAoB","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/** @packageDocumentation\r\n * @module Effects\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { ScreenSpaceEffectBuilder, Tool, UniformType, VaryingType } from \"@itwin/core-frontend\";\r\nimport { AddEffectTool, refreshViewportsForEffect } from \"./EffectTools\";\r\nimport { parseArgs } from \"../tools/parseArgs\";\r\n\r\n/** Adds a screen-space effect to the selected [[Viewport]] to simulate the lens distortion produced by real-world cameras with very wide fields of view.\r\n * Based on https://www.decarpentier.nl/lens-distortion\r\n * The effect is improved considerably by enabling anti-aliasing (e.g., via [RenderSystem.Options.antialiasSamples]($frontend) at startup, or using the `fdt aasamples` key-in`).\r\n * @note Because this effect applies a non-linear transform to each pixel, operations like snapping to geometry will not work properly. Element locate will work however - @see [ScreenSpaceEffectSource.sampleSourcePixel]($frontend).\r\n * @beta\r\n */\r\nexport class LensDistortionEffect extends AddEffectTool {\r\n public static override toolId = \"LensDistortionEffect\";\r\n\r\n protected get effectName() { return \"lensdistortion\"; }\r\n protected get textureCoordFromPosition() { return true; }\r\n\r\n protected get source() {\r\n return {\r\n vertex: `\r\n void effectMain(vec4 position) {\r\n vec2 uv = textureCoordFromPosition(position);\r\n float scaledHeight = strength * height;\r\n float cylAspectRatio = aspectRatio * cylindricalRatio;\r\n float aspectDiagSq = aspectRatio * aspectRatio + 1.0;\r\n float diagSq = scaledHeight * scaledHeight * aspectDiagSq;\r\n vec2 signedUV = (2.0 * uv + vec2(-1.0, -1.0));\r\n\r\n float z = 0.5 * sqrt(diagSq + 1.0) + 0.5;\r\n float ny = (z - 1.0) / (cylAspectRatio * cylAspectRatio + 1.0);\r\n\r\n vUVDot = sqrt(ny) * vec2(cylAspectRatio, 1.0) * signedUV;\r\n vUV = vec3(0.5, 0.5, 1.0) * z + vec3(-0.5, -0.5, 0.0);\r\n vUV.xy += uv;\r\n }`,\r\n // We simply shift pixels - we don't alter their colors.\r\n fragment: `\r\n vec4 effectMain() {\r\n return sampleSourcePixel();\r\n }`,\r\n // Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise\r\n // element locate will not work correctly.\r\n sampleSourcePixel: `\r\n vec3 uv = dot(vUVDot, vUVDot) * vec3(-0.5, -0.5, -1.0) + vUV;\r\n return TEXTURE_PROJ(u_diffuse, uv);\r\n `,\r\n };\r\n }\r\n\r\n protected defineEffect(builder: ScreenSpaceEffectBuilder): void {\r\n // Lens distortion is only applicable to views with the camera enabled.\r\n builder.shouldApply = (context) => context.viewport.isCameraOn;\r\n\r\n builder.addVarying(\"vUV\", VaryingType.Vec3);\r\n builder.addVarying(\"vUVDot\", VaryingType.Vec2);\r\n\r\n builder.addUniform({\r\n name: \"strength\",\r\n type: UniformType.Float,\r\n bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.strength),\r\n });\r\n builder.addUniform({\r\n name: \"cylindricalRatio\",\r\n type: UniformType.Float,\r\n bind: (uniform) => uniform.setUniform1f(LensDistortionConfig.cylindricalRatio),\r\n });\r\n builder.addUniform({\r\n name: \"aspectRatio\",\r\n type: UniformType.Float,\r\n bind: (uniform, context) => uniform.setUniform1f(context.viewport.viewRect.aspect),\r\n });\r\n builder.addUniform({\r\n name: \"height\",\r\n type: UniformType.Float,\r\n bind: (uniform, context) => {\r\n assert(context.viewport.view.is3d() && context.viewport.view.isCameraOn);\r\n const fov = context.viewport.view.camera.lens.radians;\r\n const height = Math.tan(fov / 2) / context.viewport.viewRect.aspect;\r\n uniform.setUniform1f(height);\r\n },\r\n });\r\n }\r\n}\r\n\r\n/** Configures the [[LensDistortionEffect]].\r\n * @beta\r\n */\r\nexport class LensDistortionConfig extends Tool {\r\n public static override toolId = \"LensDistortionConfig\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n public static strength = 0.5;\r\n public static cylindricalRatio = 0.5;\r\n\r\n public override async run(strength?: number, ratio?: number): Promise<boolean> {\r\n LensDistortionConfig.strength = strength ?? 0.5;\r\n LensDistortionConfig.cylindricalRatio = ratio ?? 0.5;\r\n refreshViewportsForEffect(\"fdt lensdistortion\");\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...input: string[]): Promise<boolean> {\r\n const args = parseArgs(input);\r\n return this.run(args.getFloat(\"s\"), args.getFloat(\"r\"));\r\n }\r\n}\r\n"]}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Effects
|
|
3
|
-
*/
|
|
4
|
-
import { Point3d, Range1d, Range3d } from "@itwin/core-geometry";
|
|
5
|
-
/** Generate integer in [min, max].
|
|
6
|
-
* @beta
|
|
7
|
-
*/
|
|
8
|
-
export declare function randomInteger(min: number, max: number): number;
|
|
9
|
-
/** Generate random integer in [range.low, range.high].
|
|
10
|
-
* @beta
|
|
11
|
-
*/
|
|
12
|
-
export declare function randomIntegerInRange(range: Range1d): number;
|
|
13
|
-
/** Generate random floating-point number in [min, max).
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
export declare function randomFloat(min: number, max: number): number;
|
|
17
|
-
/** Generate random floating-point number in [range.low, range.high).
|
|
18
|
-
* @beta
|
|
19
|
-
*/
|
|
20
|
-
export declare function randomFloatInRange(range: Range1d): number;
|
|
21
|
-
/** Generate a random position in the specified range.
|
|
22
|
-
* @beta
|
|
23
|
-
*/
|
|
24
|
-
export declare function randomPositionInRange(range: Range3d): Point3d;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Effects
|
|
3
|
+
*/
|
|
4
|
+
import { Point3d, Range1d, Range3d } from "@itwin/core-geometry";
|
|
5
|
+
/** Generate integer in [min, max].
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare function randomInteger(min: number, max: number): number;
|
|
9
|
+
/** Generate random integer in [range.low, range.high].
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare function randomIntegerInRange(range: Range1d): number;
|
|
13
|
+
/** Generate random floating-point number in [min, max).
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export declare function randomFloat(min: number, max: number): number;
|
|
17
|
+
/** Generate random floating-point number in [range.low, range.high).
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
export declare function randomFloatInRange(range: Range1d): number;
|
|
21
|
+
/** Generate a random position in the specified range.
|
|
22
|
+
* @beta
|
|
23
|
+
*/
|
|
24
|
+
export declare function randomPositionInRange(range: Range3d): Point3d;
|
|
25
25
|
//# sourceMappingURL=Random.d.ts.map
|