@itwin/frontend-devtools 5.0.0-dev.8 → 5.0.0-dev.82
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 +46 -1
- package/lib/cjs/FrontEndDevTools.js +1 -1
- package/lib/cjs/FrontEndDevTools.js.map +1 -1
- package/lib/cjs/effects/Convolution.js +6 -6
- package/lib/cjs/effects/Convolution.js.map +1 -1
- package/lib/cjs/effects/EffectTools.js +2 -2
- package/lib/cjs/effects/EffectTools.js.map +1 -1
- package/lib/cjs/effects/Explosion.js +37 -25
- package/lib/cjs/effects/Explosion.js.map +1 -1
- package/lib/cjs/effects/FlipImage.js +2 -2
- package/lib/cjs/effects/FlipImage.js.map +1 -1
- package/lib/cjs/effects/LensDistortion.js +4 -4
- package/lib/cjs/effects/LensDistortion.js.map +1 -1
- package/lib/cjs/effects/Saturation.js +4 -4
- package/lib/cjs/effects/Saturation.js.map +1 -1
- package/lib/cjs/effects/Snow.d.ts +1 -1
- package/lib/cjs/effects/Snow.d.ts.map +1 -1
- package/lib/cjs/effects/Snow.js +19 -8
- package/lib/cjs/effects/Snow.js.map +1 -1
- package/lib/cjs/effects/Vignette.js +12 -12
- package/lib/cjs/effects/Vignette.js.map +1 -1
- package/lib/cjs/tools/AnimationIntervalTool.js +1 -1
- package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
- package/lib/cjs/tools/ChangeUnitsTool.js +1 -1
- package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
- package/lib/cjs/tools/ClipTools.js +6 -8
- package/lib/cjs/tools/ClipTools.js.map +1 -1
- package/lib/cjs/tools/DisplayStyleTools.js +21 -25
- package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
- package/lib/cjs/tools/EmphasizeElementsTool.js +7 -13
- package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
- package/lib/cjs/tools/FrustumDecoration.js +28 -9
- package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
- package/lib/cjs/tools/InspectElementTool.js +7 -6
- package/lib/cjs/tools/InspectElementTool.js.map +1 -1
- package/lib/cjs/tools/MapLayerTool.js +24 -20
- package/lib/cjs/tools/MapLayerTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTileLoadTime.js +4 -1
- package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
- package/lib/cjs/tools/ModelAppearanceTools.js +9 -9
- package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
- package/lib/cjs/tools/PlanProjectionTools.js +8 -15
- package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
- package/lib/cjs/tools/PlanarMaskTools.js +21 -26
- package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
- package/lib/cjs/tools/ProjectExtents.js +6 -3
- package/lib/cjs/tools/ProjectExtents.js.map +1 -1
- package/lib/cjs/tools/RealityModelTools.js +10 -10
- package/lib/cjs/tools/RealityModelTools.js.map +1 -1
- package/lib/cjs/tools/RealityTransitionTool.js +1 -1
- package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
- package/lib/cjs/tools/RenderSystemTools.js +4 -3
- package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
- package/lib/cjs/tools/RenderTargetTools.d.ts +1 -1
- package/lib/cjs/tools/RenderTargetTools.d.ts.map +1 -1
- package/lib/cjs/tools/RenderTargetTools.js +15 -20
- package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
- package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +1 -1
- package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
- package/lib/cjs/tools/SavedViews.js +4 -7
- package/lib/cjs/tools/SavedViews.js.map +1 -1
- package/lib/cjs/tools/ScheduleScriptTools.d.ts.map +1 -1
- package/lib/cjs/tools/ScheduleScriptTools.js +11 -12
- package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
- package/lib/cjs/tools/SelectionTools.js +4 -6
- package/lib/cjs/tools/SelectionTools.js.map +1 -1
- package/lib/cjs/tools/SetGpuMemoryLimitTool.js +1 -1
- package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
- package/lib/cjs/tools/SourceAspectIdTools.js +2 -2
- package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/cjs/tools/TileRequestDecoration.js +6 -3
- package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
- package/lib/cjs/tools/TileTreeBoundsDecoration.d.ts.map +1 -1
- package/lib/cjs/tools/TileTreeBoundsDecoration.js +8 -4
- package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
- package/lib/cjs/tools/ToolTipProvider.js +2 -1
- package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
- package/lib/cjs/tools/ViewportTools.js +22 -19
- package/lib/cjs/tools/ViewportTools.js.map +1 -1
- package/lib/cjs/widgets/DiagnosticsPanel.d.ts +1 -1
- package/lib/cjs/widgets/DiagnosticsPanel.d.ts.map +1 -1
- package/lib/cjs/widgets/DiagnosticsPanel.js +11 -1
- package/lib/cjs/widgets/DiagnosticsPanel.js.map +1 -1
- package/lib/cjs/widgets/FpsTracker.d.ts +1 -1
- package/lib/cjs/widgets/FpsTracker.d.ts.map +1 -1
- package/lib/cjs/widgets/FpsTracker.js +5 -1
- package/lib/cjs/widgets/FpsTracker.js.map +1 -1
- package/lib/cjs/widgets/GpuProfiler.d.ts +1 -1
- package/lib/cjs/widgets/GpuProfiler.d.ts.map +1 -1
- package/lib/cjs/widgets/GpuProfiler.js +89 -82
- package/lib/cjs/widgets/GpuProfiler.js.map +1 -1
- package/lib/cjs/widgets/KeyinField.js +8 -1
- package/lib/cjs/widgets/KeyinField.js.map +1 -1
- package/lib/cjs/widgets/MemoryTracker.d.ts +1 -1
- package/lib/cjs/widgets/MemoryTracker.d.ts.map +1 -1
- package/lib/cjs/widgets/MemoryTracker.js +16 -4
- package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
- package/lib/cjs/widgets/RenderCommandBreakdown.d.ts +1 -1
- package/lib/cjs/widgets/RenderCommandBreakdown.d.ts.map +1 -1
- package/lib/cjs/widgets/RenderCommandBreakdown.js +6 -2
- package/lib/cjs/widgets/RenderCommandBreakdown.js.map +1 -1
- package/lib/cjs/widgets/TileMemoryBreakdown.d.ts +1 -1
- package/lib/cjs/widgets/TileMemoryBreakdown.d.ts.map +1 -1
- package/lib/cjs/widgets/TileMemoryBreakdown.js +10 -8
- package/lib/cjs/widgets/TileMemoryBreakdown.js.map +1 -1
- package/lib/cjs/widgets/TileStatisticsTracker.d.ts +1 -1
- package/lib/cjs/widgets/TileStatisticsTracker.d.ts.map +1 -1
- package/lib/cjs/widgets/TileStatisticsTracker.js +5 -2
- package/lib/cjs/widgets/TileStatisticsTracker.js.map +1 -1
- package/lib/cjs/widgets/ToolSettingsTracker.d.ts +1 -1
- package/lib/cjs/widgets/ToolSettingsTracker.d.ts.map +1 -1
- package/lib/cjs/widgets/ToolSettingsTracker.js +2 -2
- package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
- package/lib/esm/FrontEndDevTools.js +1 -1
- package/lib/esm/FrontEndDevTools.js.map +1 -1
- package/lib/esm/effects/Convolution.js +6 -6
- package/lib/esm/effects/Convolution.js.map +1 -1
- package/lib/esm/effects/EffectTools.js +2 -2
- package/lib/esm/effects/EffectTools.js.map +1 -1
- package/lib/esm/effects/Explosion.js +37 -25
- package/lib/esm/effects/Explosion.js.map +1 -1
- package/lib/esm/effects/FlipImage.js +2 -2
- package/lib/esm/effects/FlipImage.js.map +1 -1
- package/lib/esm/effects/LensDistortion.js +4 -4
- package/lib/esm/effects/LensDistortion.js.map +1 -1
- package/lib/esm/effects/Saturation.js +4 -4
- package/lib/esm/effects/Saturation.js.map +1 -1
- package/lib/esm/effects/Snow.d.ts +1 -1
- package/lib/esm/effects/Snow.d.ts.map +1 -1
- package/lib/esm/effects/Snow.js +19 -8
- package/lib/esm/effects/Snow.js.map +1 -1
- package/lib/esm/effects/Vignette.js +12 -12
- package/lib/esm/effects/Vignette.js.map +1 -1
- package/lib/esm/tools/AnimationIntervalTool.js +1 -1
- package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
- package/lib/esm/tools/ChangeUnitsTool.js +1 -1
- package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
- package/lib/esm/tools/ClipTools.js +6 -8
- package/lib/esm/tools/ClipTools.js.map +1 -1
- package/lib/esm/tools/DisplayStyleTools.js +21 -25
- package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
- package/lib/esm/tools/EmphasizeElementsTool.js +7 -13
- package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
- package/lib/esm/tools/FrustumDecoration.js +28 -9
- package/lib/esm/tools/FrustumDecoration.js.map +1 -1
- package/lib/esm/tools/InspectElementTool.js +7 -6
- package/lib/esm/tools/InspectElementTool.js.map +1 -1
- package/lib/esm/tools/MapLayerTool.js +24 -20
- package/lib/esm/tools/MapLayerTool.js.map +1 -1
- package/lib/esm/tools/MeasureTileLoadTime.js +4 -1
- package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
- package/lib/esm/tools/ModelAppearanceTools.js +9 -9
- package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
- package/lib/esm/tools/PlanProjectionTools.js +8 -15
- package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
- package/lib/esm/tools/PlanarMaskTools.js +21 -26
- package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
- package/lib/esm/tools/ProjectExtents.js +6 -3
- package/lib/esm/tools/ProjectExtents.js.map +1 -1
- package/lib/esm/tools/RealityModelTools.js +10 -10
- package/lib/esm/tools/RealityModelTools.js.map +1 -1
- package/lib/esm/tools/RealityTransitionTool.js +1 -1
- package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
- package/lib/esm/tools/RenderSystemTools.js +4 -3
- package/lib/esm/tools/RenderSystemTools.js.map +1 -1
- package/lib/esm/tools/RenderTargetTools.d.ts +1 -1
- package/lib/esm/tools/RenderTargetTools.d.ts.map +1 -1
- package/lib/esm/tools/RenderTargetTools.js +15 -20
- package/lib/esm/tools/RenderTargetTools.js.map +1 -1
- package/lib/esm/tools/ReportWebGLCompatibilityTool.js +1 -1
- package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
- package/lib/esm/tools/SavedViews.js +4 -7
- package/lib/esm/tools/SavedViews.js.map +1 -1
- package/lib/esm/tools/ScheduleScriptTools.d.ts.map +1 -1
- package/lib/esm/tools/ScheduleScriptTools.js +11 -12
- package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
- package/lib/esm/tools/SelectionTools.js +4 -6
- package/lib/esm/tools/SelectionTools.js.map +1 -1
- package/lib/esm/tools/SetGpuMemoryLimitTool.js +1 -1
- package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
- package/lib/esm/tools/SourceAspectIdTools.js +2 -2
- package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/esm/tools/TileRequestDecoration.js +6 -3
- package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
- package/lib/esm/tools/TileTreeBoundsDecoration.d.ts.map +1 -1
- package/lib/esm/tools/TileTreeBoundsDecoration.js +8 -4
- package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
- package/lib/esm/tools/ToolTipProvider.js +2 -1
- package/lib/esm/tools/ToolTipProvider.js.map +1 -1
- package/lib/esm/tools/ViewportTools.js +22 -19
- package/lib/esm/tools/ViewportTools.js.map +1 -1
- package/lib/esm/widgets/DiagnosticsPanel.d.ts +1 -1
- package/lib/esm/widgets/DiagnosticsPanel.d.ts.map +1 -1
- package/lib/esm/widgets/DiagnosticsPanel.js +11 -1
- package/lib/esm/widgets/DiagnosticsPanel.js.map +1 -1
- package/lib/esm/widgets/FpsTracker.d.ts +1 -1
- package/lib/esm/widgets/FpsTracker.d.ts.map +1 -1
- package/lib/esm/widgets/FpsTracker.js +5 -1
- package/lib/esm/widgets/FpsTracker.js.map +1 -1
- package/lib/esm/widgets/GpuProfiler.d.ts +1 -1
- package/lib/esm/widgets/GpuProfiler.d.ts.map +1 -1
- package/lib/esm/widgets/GpuProfiler.js +89 -82
- package/lib/esm/widgets/GpuProfiler.js.map +1 -1
- package/lib/esm/widgets/KeyinField.js +8 -1
- package/lib/esm/widgets/KeyinField.js.map +1 -1
- package/lib/esm/widgets/MemoryTracker.d.ts +1 -1
- package/lib/esm/widgets/MemoryTracker.d.ts.map +1 -1
- package/lib/esm/widgets/MemoryTracker.js +16 -4
- package/lib/esm/widgets/MemoryTracker.js.map +1 -1
- package/lib/esm/widgets/RenderCommandBreakdown.d.ts +1 -1
- package/lib/esm/widgets/RenderCommandBreakdown.d.ts.map +1 -1
- package/lib/esm/widgets/RenderCommandBreakdown.js +6 -2
- package/lib/esm/widgets/RenderCommandBreakdown.js.map +1 -1
- package/lib/esm/widgets/TileMemoryBreakdown.d.ts +1 -1
- package/lib/esm/widgets/TileMemoryBreakdown.d.ts.map +1 -1
- package/lib/esm/widgets/TileMemoryBreakdown.js +10 -8
- package/lib/esm/widgets/TileMemoryBreakdown.js.map +1 -1
- package/lib/esm/widgets/TileStatisticsTracker.d.ts +1 -1
- package/lib/esm/widgets/TileStatisticsTracker.d.ts.map +1 -1
- package/lib/esm/widgets/TileStatisticsTracker.js +5 -2
- package/lib/esm/widgets/TileStatisticsTracker.js.map +1 -1
- package/lib/esm/widgets/ToolSettingsTracker.d.ts +1 -1
- package/lib/esm/widgets/ToolSettingsTracker.d.ts.map +1 -1
- package/lib/esm/widgets/ToolSettingsTracker.js +2 -2
- package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
# Change Log - @itwin/frontend-devtools
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 11 Mar 2025 15:27:53 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.10
|
|
6
|
+
Tue, 11 Mar 2025 15:25:11 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.9
|
|
11
|
+
Tue, 11 Mar 2025 05:17:33 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.10.8
|
|
16
|
+
Thu, 06 Mar 2025 14:13:37 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.10.7
|
|
21
|
+
Tue, 18 Feb 2025 17:27:03 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.10.6
|
|
26
|
+
Fri, 24 Jan 2025 08:02:40 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 4.10.5
|
|
31
|
+
Tue, 21 Jan 2025 21:56:45 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 4.10.4
|
|
36
|
+
Mon, 13 Jan 2025 14:06:43 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
39
|
+
|
|
40
|
+
## 4.10.3
|
|
41
|
+
Mon, 06 Jan 2025 14:00:13 GMT
|
|
42
|
+
|
|
43
|
+
_Version update only_
|
|
44
|
+
|
|
45
|
+
## 4.10.2
|
|
46
|
+
Thu, 21 Nov 2024 15:22:20 GMT
|
|
47
|
+
|
|
48
|
+
_Version update only_
|
|
4
49
|
|
|
5
50
|
## 4.10.1
|
|
6
51
|
Thu, 14 Nov 2024 18:11:00 GMT
|
|
@@ -48,6 +48,7 @@ const ToolTipProvider_1 = require("./tools/ToolTipProvider");
|
|
|
48
48
|
* @beta
|
|
49
49
|
*/
|
|
50
50
|
class FrontendDevTools {
|
|
51
|
+
static _initialized = false;
|
|
51
52
|
/** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.
|
|
52
53
|
* To initialize when starting up your app:
|
|
53
54
|
* ```ts
|
|
@@ -221,5 +222,4 @@ class FrontendDevTools {
|
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
exports.FrontendDevTools = FrontendDevTools;
|
|
224
|
-
FrontendDevTools._initialized = false;
|
|
225
225
|
//# sourceMappingURL=FrontEndDevTools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontEndDevTools.js","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiD;AACjD,uDAA+I;AAC/I,uDAAyD;AACzD,mDAAsD;AACtD,mDAAuE;AACvE,6DAAsF;AACtF,qDAA0E;AAC1E,yCAA4C;AAC5C,iDAAoE;AACpE,6DAGiC;AACjC,yDAK+B;AAC/B,yEAAsE;AACtE,6DAA0D;AAC1D,iDAAiH;AACjH,iEAGmC;AACnC,qEAAwH;AACxH,yEAEuC;AACvC,iEAA8H;AAC9H,mEAAgE;AAChE,uDAK8B;AAC9B,qEAAsE;AACtE,uEAGsC;AACtC,qEAAgJ;AAChJ,2DAAkE;AAClE,iEAGmC;AACnC,yEAAsE;AACtE,iEAA0G;AAC1G,iEAGmC;AACnC,uFAAoF;AACpF,mDAAoF;AACpF,2DAAsF;AACtF,yEAAsE;AACtE,qEAA+G;AAC/G,yEAAgF;AAChF,+EAAsF;AACtF,6DAA6D;AAE7D;;GAEG;AACH,MAAa,gBAAgB;IAG3B;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC5B,IAAI,IAAI,CAAC,YAAY;YACnB,OAAO;QAET,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,oCAAoC;QACpC,yBAAS,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE9D,MAAM,SAAS,GAAG,kBAAkB,CAAC;QACrC,MAAM,gBAAgB,GAAG,yBAAS,CAAC,YAAY,CAAC,iB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AyB;YACzB,uCAAmB;YACnB,0CAAsB;YACtB,6CAAyB;YACzB,yCAAqB;YACrB,oCAAgB;YAChB,iDAA6B;YAC7B,yCAAwB;YACxB,wCAAoB;YACpB,mDAAmC;YACnC,iDAA6B;YAC7B,2CAAuB;YACvB,oCAAgB;YAChB,uDAA+B;YAC/B,6DAAkC;YAClC,4CAA4B;YAC5B,oCAAkB;YAClB,kDAAkC;YAClC,kDAAkC;YAClC,yCAAyB;YACzB,sCAAkB;YAClB,2CAAuB;YACvB,4CAAwB;YACxB,4CAAwB;YACxB,2CAAuB;YACvB,gCAAoB;YACpB,gCAAiB;YACjB,6BAAe;YACf,uCAAuB;YACvB,4CAA4B;YAC5B,yBAAc;YACd,yBAAc;YACd,0CAAsB;YACtB,0CAAsB;YACtB,wCAAoB;YACpB,6CAAqB;YACrB,6CAAyB;YACzB,iDAA6B;YAC7B,mDAA+B;YAC/B,4CAAwB;YACxB,yCAAkB;YAClB,6CAAsB;YACtB,+CAAwB;YACxB,wCAAiB;YACjB,6CAAsB;YACtB,2CAAoB;YACpB,mDAA4B;YAC5B,wDAAoC;YACpC,oDAA6B;YAC7B,yCAAqB;YACrB,4CAAwB;YACxB,sDAAoC;YACpC,6CAA2B;YAC3B,6CAA2B;YAC3B,mDAAiC;YACjC,+CAA6B;YAC7B,uDAAqC;YACrC,wCAAsB;YACtB,8CAA4B;YAC5B,oDAAkC;YAClC,gDAA8B;YAC9B,wDAAsC;YACtC,+BAAa;YACb,2CAAuB;SACxB,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE3B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEO,MAAM,CAAC,QAAQ;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;;AAnLH,4CAoLC;AAnLgB,6BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\nimport { ExplosionEffect } from \"./effects/Explosion\";\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\nimport { SnowEffect } from \"./effects/Snow\";\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\nimport {\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\n} from \"./tools/PlanarMaskTools\";\nimport {\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\n ViewportTileSizeModifierTool,\n} from \"./tools/ViewportTools\";\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\nimport {\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\n} from \"./tools/DisplayStyleTools\";\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\nimport {\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\n} from \"./tools/EmphasizeElementsTool\";\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\nimport {\n AttachArcGISFeatureMapLayerByUrlTool,\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\n} from \"./tools/MapLayerTool\";\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\nimport {\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\n} from \"./tools/ModelAppearanceTools\";\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\nimport {\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\n} from \"./tools/RealityModelTools\";\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\nimport {\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\n} from \"./tools/RenderTargetTools\";\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\n\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\n * @beta\n */\nexport class FrontendDevTools {\n private static _initialized = false;\n\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\n * To initialize when starting up your app:\n * ```ts\n * IModelApp.startup();\n * await FrontendDevTools.initialize();\n * ```\n * @beta\n */\n public static async initialize(): Promise<void> {\n if (this._initialized)\n return;\n\n this._initialized = true;\n\n // clean up if we're being shut down\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\n\n const namespace = \"FrontendDevTools\";\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\n const tools = [\n AttachMapLayerTool,\n AttachMapOverlayTool,\n AttachModelMapLayerTool,\n AttachArcGISMapLayerByUrlTool,\n AttachArcGISFeatureMapLayerByUrlTool,\n AttachOgcApiFeaturesMapLayerTool,\n AttachWmsMapLayerByUrlTool,\n AttachWmtsMapLayerByUrlTool,\n AttachTileURLMapLayerByUrlTool,\n AnimationIntervalTool,\n ApplyRenderingStyleTool,\n ApplyViewByIdTool,\n ApplyViewTool,\n ChangeBackgroundColorTool,\n ChangeCameraTool,\n ChangeEmphasisSettingsTool,\n ChangeFlashSettingsTool,\n ChangeHiliteModeTool,\n ChangeHiliteSettingsTool,\n ChangePlanProjectionSettingsTool,\n ChangeUnitsTool,\n ChangeViewFlagsTool,\n ClearEffectsTool,\n ClearEmphasizedElementsTool,\n ClearIsolatedElementsTool,\n ClipColorTool,\n ClipIntersectionTool,\n CompileShadersTool,\n DefaultTileSizeModifierTool,\n DetachMapLayersTool,\n DumpPlanProjectionSettingsTool,\n DumpSelectionSetTool,\n EdgeDetectionEffect,\n EmbossEffect,\n ElementIdFromSourceAspectIdTool,\n EmphasizeSelectedElementsTool,\n EmphasizeVisibleElementsTool,\n ExplosionEffect,\n FadeOutTool,\n FlipImageConfig,\n FlipImageEffect,\n FreezeSceneTool,\n GaussianBlurEffect,\n InspectElementTool,\n IsolateSelectedElementsTool,\n LensDistortionConfig,\n LensDistortionEffect,\n LoseWebGLContextTool,\n MapLayerTransparencyTool,\n MapLayerVisibilityTool,\n MapLayerSubLayerVisibilityTool,\n MapLayerZoomTool,\n MapBaseColorTool,\n MapBaseTransparencyTool,\n MapBaseVisibilityTool,\n MeasureTileLoadTimeTool,\n OverrideSubCategoryTool,\n OverrideSubCategoryPriorityTool,\n QueryScheduleScriptTool,\n RealityTransitionTool,\n ReorderMapLayers,\n ReportWebGLCompatibilityTool,\n ReverseScheduleScriptTool,\n SaturationConfig,\n SaturationEffect,\n SaveRenderingStyleTool,\n SaveViewTool,\n SelectElementsByIdTool,\n SetAASamplesTool,\n SetAspectRatioSkewTool,\n SetScheduleScriptTool,\n ToggleVolClassIntersect,\n SetMapBaseTool,\n SharpenEffect,\n SharpnessEffect,\n ShowTileVolumesTool,\n SkyCubeTool,\n SkySphereTool,\n SnowEffect,\n SourceAspectIdFromElementIdTool,\n TestClipStyleTool,\n Toggle3dManipulationsTool,\n ToggleDrawingGraphicsTool,\n ToggleDPIForLODTool,\n ToggleDrapeFrustumTool,\n ToggleFrustumSnapshotTool,\n ToggleMaskFrustumTool,\n ToggleNormalMaps,\n TogglePrimitiveVisibilityTool,\n ToggleProjectExtentsTool,\n ToggleReadPixelsTool,\n ToggleSectionDrawingSpatialViewTool,\n ToggleSelectedViewFrustumTool,\n ToggleShadowFrustumTool,\n ToggleSkyboxTool,\n ToggleTileRequestDecorationTool,\n ToggleTileTreeBoundsDecorationTool,\n ToggleTileTreeReferencesTool,\n ToggleToolTipsTool,\n ToggleViewAttachmentBoundariesTool,\n ToggleViewAttachmentClipShapesTool,\n ToggleViewAttachmentsTool,\n ToggleWiremeshTool,\n ToggleRealityTileBounds,\n ToggleRealityTilePreload,\n ToggleRealityTileLogging,\n ToggleRealityTileFreeze,\n ToggleSectionCutTool,\n ToggleTerrainTool,\n UnsharpenEffect,\n ViewportAddRealityModel,\n ViewportTileSizeModifierTool,\n VignetteConfig,\n VignetteEffect,\n AttachRealityModelTool,\n DetachRealityModelTool,\n SaveRealityModelTool,\n SetGpuMemoryLimitTool,\n SetRealityModelLocateTool,\n SetRealityModelEmphasizedTool,\n SetRealityModelTransparencyTool,\n SetRealityModelColorTool,\n SetModelLocateTool,\n SetModelEmphasizedTool,\n SetModelTransparencyTool,\n SetModelColorTool,\n SetModelLineWeightTool,\n SetModelLineCodeTool,\n SetModelIgnoresMaterialsTool,\n ClearRealityModelAppearanceOverrides,\n ClearModelAppearanceOverrides,\n AttachCesiumAssetTool,\n ToggleOSMBuildingDisplay,\n SetHigherPriorityRealityModelMasking,\n SetMapHigherPriorityMasking,\n MaskRealityModelByModelTool,\n MaskRealityModelBySubCategoryTool,\n MaskRealityModelByElementTool,\n MaskRealityModelByExcludedElementTool,\n UnmaskRealityModelTool,\n MaskBackgroundMapByModelTool,\n MaskBackgroundMapBySubCategoryTool,\n MaskBackgroundMapByElementTool,\n MaskBackgroundMapByExcludedElementTool,\n UnmaskMapTool,\n WoWIgnoreBackgroundTool,\n ];\n\n for (const tool of tools)\n tool.register(namespace);\n\n return namespacePromise;\n }\n\n private static shutdown() {\n this._initialized = false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FrontEndDevTools.js","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiD;AACjD,uDAA+I;AAC/I,uDAAyD;AACzD,mDAAsD;AACtD,mDAAuE;AACvE,6DAAsF;AACtF,qDAA0E;AAC1E,yCAA4C;AAC5C,iDAAoE;AACpE,6DAGiC;AACjC,yDAK+B;AAC/B,yEAAsE;AACtE,6DAA0D;AAC1D,iDAAiH;AACjH,iEAGmC;AACnC,qEAAwH;AACxH,yEAEuC;AACvC,iEAA8H;AAC9H,mEAAgE;AAChE,uDAK8B;AAC9B,qEAAsE;AACtE,uEAGsC;AACtC,qEAAgJ;AAChJ,2DAAkE;AAClE,iEAGmC;AACnC,yEAAsE;AACtE,iEAA0G;AAC1G,iEAGmC;AACnC,uFAAoF;AACpF,mDAAoF;AACpF,2DAAsF;AACtF,yEAAsE;AACtE,qEAA+G;AAC/G,yEAAgF;AAChF,+EAAsF;AACtF,6DAA6D;AAE7D;;GAEG;AACH,MAAa,gBAAgB;IACnB,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAEpC;;;;;;;OAOG;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BAAa;YACb,2CAAuB;SACxB,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE3B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEO,MAAM,CAAC,QAAQ;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;;AAnLH,4CAoLC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\nimport { ExplosionEffect } from \"./effects/Explosion\";\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\nimport { SnowEffect } from \"./effects/Snow\";\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\nimport {\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\n} from \"./tools/PlanarMaskTools\";\nimport {\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\n ViewportTileSizeModifierTool,\n} from \"./tools/ViewportTools\";\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\nimport {\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\n} from \"./tools/DisplayStyleTools\";\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\nimport {\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\n} from \"./tools/EmphasizeElementsTool\";\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\nimport {\n AttachArcGISFeatureMapLayerByUrlTool,\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\n} from \"./tools/MapLayerTool\";\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\nimport {\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\n} from \"./tools/ModelAppearanceTools\";\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\nimport {\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\n} from \"./tools/RealityModelTools\";\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\nimport {\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\n} from \"./tools/RenderTargetTools\";\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\n\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\n * @beta\n */\nexport class FrontendDevTools {\n private static _initialized = false;\n\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\n * To initialize when starting up your app:\n * ```ts\n * IModelApp.startup();\n * await FrontendDevTools.initialize();\n * ```\n * @beta\n */\n public static async initialize(): Promise<void> {\n if (this._initialized)\n return;\n\n this._initialized = true;\n\n // clean up if we're being shut down\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\n\n const namespace = \"FrontendDevTools\";\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\n const tools = [\n AttachMapLayerTool,\n AttachMapOverlayTool,\n AttachModelMapLayerTool,\n AttachArcGISMapLayerByUrlTool,\n AttachArcGISFeatureMapLayerByUrlTool,\n AttachOgcApiFeaturesMapLayerTool,\n AttachWmsMapLayerByUrlTool,\n AttachWmtsMapLayerByUrlTool,\n AttachTileURLMapLayerByUrlTool,\n AnimationIntervalTool,\n ApplyRenderingStyleTool,\n ApplyViewByIdTool,\n ApplyViewTool,\n ChangeBackgroundColorTool,\n ChangeCameraTool,\n ChangeEmphasisSettingsTool,\n ChangeFlashSettingsTool,\n ChangeHiliteModeTool,\n ChangeHiliteSettingsTool,\n ChangePlanProjectionSettingsTool,\n ChangeUnitsTool,\n ChangeViewFlagsTool,\n ClearEffectsTool,\n ClearEmphasizedElementsTool,\n ClearIsolatedElementsTool,\n ClipColorTool,\n ClipIntersectionTool,\n CompileShadersTool,\n DefaultTileSizeModifierTool,\n DetachMapLayersTool,\n DumpPlanProjectionSettingsTool,\n DumpSelectionSetTool,\n EdgeDetectionEffect,\n EmbossEffect,\n ElementIdFromSourceAspectIdTool,\n EmphasizeSelectedElementsTool,\n EmphasizeVisibleElementsTool,\n ExplosionEffect,\n FadeOutTool,\n FlipImageConfig,\n FlipImageEffect,\n FreezeSceneTool,\n GaussianBlurEffect,\n InspectElementTool,\n IsolateSelectedElementsTool,\n LensDistortionConfig,\n LensDistortionEffect,\n LoseWebGLContextTool,\n MapLayerTransparencyTool,\n MapLayerVisibilityTool,\n MapLayerSubLayerVisibilityTool,\n MapLayerZoomTool,\n MapBaseColorTool,\n MapBaseTransparencyTool,\n MapBaseVisibilityTool,\n MeasureTileLoadTimeTool,\n OverrideSubCategoryTool,\n OverrideSubCategoryPriorityTool,\n QueryScheduleScriptTool,\n RealityTransitionTool,\n ReorderMapLayers,\n ReportWebGLCompatibilityTool,\n ReverseScheduleScriptTool,\n SaturationConfig,\n SaturationEffect,\n SaveRenderingStyleTool,\n SaveViewTool,\n SelectElementsByIdTool,\n SetAASamplesTool,\n SetAspectRatioSkewTool,\n SetScheduleScriptTool,\n ToggleVolClassIntersect,\n SetMapBaseTool,\n SharpenEffect,\n SharpnessEffect,\n ShowTileVolumesTool,\n SkyCubeTool,\n SkySphereTool,\n SnowEffect,\n SourceAspectIdFromElementIdTool,\n TestClipStyleTool,\n Toggle3dManipulationsTool,\n ToggleDrawingGraphicsTool,\n ToggleDPIForLODTool,\n ToggleDrapeFrustumTool,\n ToggleFrustumSnapshotTool,\n ToggleMaskFrustumTool,\n ToggleNormalMaps,\n TogglePrimitiveVisibilityTool,\n ToggleProjectExtentsTool,\n ToggleReadPixelsTool,\n ToggleSectionDrawingSpatialViewTool,\n ToggleSelectedViewFrustumTool,\n ToggleShadowFrustumTool,\n ToggleSkyboxTool,\n ToggleTileRequestDecorationTool,\n ToggleTileTreeBoundsDecorationTool,\n ToggleTileTreeReferencesTool,\n ToggleToolTipsTool,\n ToggleViewAttachmentBoundariesTool,\n ToggleViewAttachmentClipShapesTool,\n ToggleViewAttachmentsTool,\n ToggleWiremeshTool,\n ToggleRealityTileBounds,\n ToggleRealityTilePreload,\n ToggleRealityTileLogging,\n ToggleRealityTileFreeze,\n ToggleSectionCutTool,\n ToggleTerrainTool,\n UnsharpenEffect,\n ViewportAddRealityModel,\n ViewportTileSizeModifierTool,\n VignetteConfig,\n VignetteEffect,\n AttachRealityModelTool,\n DetachRealityModelTool,\n SaveRealityModelTool,\n SetGpuMemoryLimitTool,\n SetRealityModelLocateTool,\n SetRealityModelEmphasizedTool,\n SetRealityModelTransparencyTool,\n SetRealityModelColorTool,\n SetModelLocateTool,\n SetModelEmphasizedTool,\n SetModelTransparencyTool,\n SetModelColorTool,\n SetModelLineWeightTool,\n SetModelLineCodeTool,\n SetModelIgnoresMaterialsTool,\n ClearRealityModelAppearanceOverrides,\n ClearModelAppearanceOverrides,\n AttachCesiumAssetTool,\n ToggleOSMBuildingDisplay,\n SetHigherPriorityRealityModelMasking,\n SetMapHigherPriorityMasking,\n MaskRealityModelByModelTool,\n MaskRealityModelBySubCategoryTool,\n MaskRealityModelByElementTool,\n MaskRealityModelByExcludedElementTool,\n UnmaskRealityModelTool,\n MaskBackgroundMapByModelTool,\n MaskBackgroundMapBySubCategoryTool,\n MaskBackgroundMapByElementTool,\n MaskBackgroundMapByExcludedElementTool,\n UnmaskMapTool,\n WoWIgnoreBackgroundTool,\n ];\n\n for (const tool of tools)\n tool.register(namespace);\n\n return namespacePromise;\n }\n\n private static shutdown() {\n this._initialized = false;\n }\n}\n"]}
|
|
@@ -77,6 +77,7 @@ exports.ConvolutionEffect = ConvolutionEffect;
|
|
|
77
77
|
* @beta
|
|
78
78
|
*/
|
|
79
79
|
class GaussianBlurEffect extends ConvolutionEffect {
|
|
80
|
+
static toolId = "GaussianBlurEffect";
|
|
80
81
|
get effectName() { return "blur"; }
|
|
81
82
|
get matrix() {
|
|
82
83
|
return [
|
|
@@ -87,11 +88,11 @@ class GaussianBlurEffect extends ConvolutionEffect {
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
exports.GaussianBlurEffect = GaussianBlurEffect;
|
|
90
|
-
GaussianBlurEffect.toolId = "GaussianBlurEffect";
|
|
91
91
|
/** Adds a screen-space unsharpen effect to the selected Viewport.
|
|
92
92
|
* @beta
|
|
93
93
|
*/
|
|
94
94
|
class UnsharpenEffect extends ConvolutionEffect {
|
|
95
|
+
static toolId = "UnsharpenEffect";
|
|
95
96
|
get effectName() { return "unsharpen"; }
|
|
96
97
|
get matrix() {
|
|
97
98
|
return [
|
|
@@ -102,11 +103,11 @@ class UnsharpenEffect extends ConvolutionEffect {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
exports.UnsharpenEffect = UnsharpenEffect;
|
|
105
|
-
UnsharpenEffect.toolId = "UnsharpenEffect";
|
|
106
106
|
/** Adds a screen-space emboss effect to the selected Viewport.
|
|
107
107
|
* @beta
|
|
108
108
|
*/
|
|
109
109
|
class EmbossEffect extends ConvolutionEffect {
|
|
110
|
+
static toolId = "EmbossEffect";
|
|
110
111
|
get effectName() { return "emboss"; }
|
|
111
112
|
get matrix() {
|
|
112
113
|
return [
|
|
@@ -117,11 +118,11 @@ class EmbossEffect extends ConvolutionEffect {
|
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
exports.EmbossEffect = EmbossEffect;
|
|
120
|
-
EmbossEffect.toolId = "EmbossEffect";
|
|
121
121
|
/** Adds a screen-space sharpen effect to the selected Viewport.
|
|
122
122
|
* @beta
|
|
123
123
|
*/
|
|
124
124
|
class SharpenEffect extends ConvolutionEffect {
|
|
125
|
+
static toolId = "SharpenEffect";
|
|
125
126
|
get effectName() { return "sharpen"; }
|
|
126
127
|
get matrix() {
|
|
127
128
|
return [
|
|
@@ -132,11 +133,11 @@ class SharpenEffect extends ConvolutionEffect {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
exports.SharpenEffect = SharpenEffect;
|
|
135
|
-
SharpenEffect.toolId = "SharpenEffect";
|
|
136
136
|
/** Adds a screen-space sharpness effect to the selected Viewport.
|
|
137
137
|
* @beta
|
|
138
138
|
*/
|
|
139
139
|
class SharpnessEffect extends ConvolutionEffect {
|
|
140
|
+
static toolId = "SharpnessEffect";
|
|
140
141
|
get effectName() { return "sharpness"; }
|
|
141
142
|
get matrix() {
|
|
142
143
|
return [
|
|
@@ -147,11 +148,11 @@ class SharpnessEffect extends ConvolutionEffect {
|
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
exports.SharpnessEffect = SharpnessEffect;
|
|
150
|
-
SharpnessEffect.toolId = "SharpnessEffect";
|
|
151
151
|
/** Adds a screen-space edge-detection effect to the selected Viewport.
|
|
152
152
|
* @beta
|
|
153
153
|
*/
|
|
154
154
|
class EdgeDetectionEffect extends ConvolutionEffect {
|
|
155
|
+
static toolId = "EdgeDetectionEffect";
|
|
155
156
|
get effectName() { return "edgedetect"; }
|
|
156
157
|
get matrix() {
|
|
157
158
|
return [
|
|
@@ -162,5 +163,4 @@ class EdgeDetectionEffect extends ConvolutionEffect {
|
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
exports.EdgeDetectionEffect = EdgeDetectionEffect;
|
|
165
|
-
EdgeDetectionEffect.toolId = "EdgeDetectionEffect";
|
|
166
166
|
//# sourceMappingURL=Convolution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Convolution.js","sourceRoot":"","sources":["../../../src/effects/Convolution.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA0F;AAC1F,+CAA8C;AAE9C;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,2BAAa;IACpD,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAIlD,IAAc,wBAAwB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAEzD,IAAc,MAAM;QAClB,OAAO;YACL,2FAA2F;YAC3F,MAAM,EAAE;;;UAGJ;YACJ,kFAAkF;YAClF,QAAQ,EAAE;;;;;;;;;;;;;;UAcN;SACL,CAAC;IACJ,CAAC;IAES,YAAY,CAAC,OAAiC;QACtD,iDAAiD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,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACR,CAAC,EAAE,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;;AATH,oCAUC;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,iBAAiB;IAC3C,MAAM,CAAU,MAAM,GAAG,eAAe,CAAC;IAChD,IAAc,UAAU,KAAK,OAAO,SAAS,CAAC,CAAC,CAAC;IAChD,IAAc,MAAM;QAClB,OAAO;YACL,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACR,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACT,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;;AATH,sCAUC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,iBAAiB;IAC7C,MAAM,CAAU,MAAM,GAAG,iBAAiB,CAAC;IAClD,IAAc,UAAU,KAAK,OAAO,WAAW,CAAC,CAAC,CAAC;IAClD,IAAc,MAAM;QAClB,OAAO;YACL,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACR,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACT,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;;AATH,0CAUC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,iBAAiB;IACjD,MAAM,CAAU,MAAM,GAAG,qBAAqB,CAAC;IACtD,IAAc,UAAU,KAAK,OAAO,YAAY,CAAC,CAAC,CAAC;IACnD,IAAc,MAAM;QAClB,OAAO;YACL,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACR,CAAC,EAAE,CAAC,EAAE,CAAC;YACP,CAAC,EAAE,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;;AATH,kDAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Effects\n */\n\nimport { ScreenSpaceEffectBuilder, UniformType, VaryingType } from \"@itwin/core-frontend\";\nimport { AddEffectTool } from \"./EffectTools\";\n\n/** Adds one of a collection of \"convolution kernels\" that alter a [Viewport]($frontend)'s image by blending neighboring pixels.\n * Based on https://webglfundamentals.org/webgl/lessons/webgl-image-processing-continued.html\n * @beta\n */\nexport abstract class ConvolutionEffect extends AddEffectTool {\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 0; }\n\n protected abstract get matrix(): number[];\n\n protected get textureCoordFromPosition() { return true; }\n\n protected get source() {\n return {\n // The vertex shader simply computes the texture coordinate for use in the fragment shader.\n vertex: `\n void effectMain(vec4 pos) {\n v_texCoord = textureCoordFromPosition(pos);\n }`,\n // The fragment shader samples the pixel and its neighbors and applies the kernel.\n fragment: `\n vec4 effectMain() {\n vec2 onePixel = vec2(1.0, 1.0) / u_textureSize;\n vec4 colorSum =\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2(-1, -1)) * u_kernel[0] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 0, -1)) * u_kernel[1] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 1, -1)) * u_kernel[2] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2(-1, 0)) * u_kernel[3] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 0, 0)) * u_kernel[4] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 1, 0)) * u_kernel[5] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2(-1, 1)) * u_kernel[6] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 0, 1)) * u_kernel[7] +\n TEXTURE(u_diffuse, v_texCoord + onePixel * vec2( 1, 1)) * u_kernel[8] ;\n return vec4((colorSum / u_kernelWeight).rgb, 1);\n }`,\n };\n }\n\n protected defineEffect(builder: ScreenSpaceEffectBuilder): void {\n // Define the varying for the texture coordinate.\n builder.addVarying(\"v_texCoord\", VaryingType.Vec2);\n\n // Hook up the uniforms.\n const matrix = this.matrix;\n builder.addUniform({\n name: \"u_textureSize\",\n type: UniformType.Vec2,\n bind: (uniform, context) => {\n const rect = context.viewport.viewRect;\n uniform.setUniform2fv([rect.width, rect.height]);\n },\n });\n builder.addUniformArray({\n name: \"u_kernel\",\n type: UniformType.Float,\n length: matrix.length,\n bind: (uniform) => uniform.setUniform1fv(matrix),\n });\n\n let weight = matrix.reduce((prev, curr) => prev + curr);\n if (weight <= 0)\n weight = 1;\n\n builder.addUniform({\n name: \"u_kernelWeight\",\n type: UniformType.Float,\n bind: (uniform) => uniform.setUniform1f(weight),\n });\n }\n}\n\n/** Adds a gaussian blur screen-space effect to the selected Viewport.\n * @beta\n */\nexport class GaussianBlurEffect extends ConvolutionEffect {\n public static override toolId = \"GaussianBlurEffect\";\n protected get effectName() { return \"blur\"; }\n protected get matrix() {\n return [\n 0.045, 0.122, 0.045,\n 0.122, 0.332, 0.122,\n 0.045, 0.122, 0.045,\n ];\n }\n}\n\n/** Adds a screen-space unsharpen effect to the selected Viewport.\n * @beta\n */\nexport class UnsharpenEffect extends ConvolutionEffect {\n public static override toolId = \"UnsharpenEffect\";\n protected get effectName() { return \"unsharpen\"; }\n protected get matrix() {\n return [\n -1, -1, -1,\n -1, 9, -1,\n -1, -1, -1,\n ];\n }\n}\n\n/** Adds a screen-space emboss effect to the selected Viewport.\n * @beta\n */\nexport class EmbossEffect extends ConvolutionEffect {\n public static override toolId = \"EmbossEffect\";\n protected get effectName() { return \"emboss\"; }\n protected get matrix() {\n return [\n -2, -1, 0,\n -1, 1, 1,\n 0, 1, 2,\n ];\n }\n}\n\n/** Adds a screen-space sharpen effect to the selected Viewport.\n * @beta\n */\nexport class SharpenEffect extends ConvolutionEffect {\n public static override toolId = \"SharpenEffect\";\n protected get effectName() { return \"sharpen\"; }\n protected get matrix() {\n return [\n 0, -1, 0,\n -1, 5, -1,\n 0, -1, 0,\n ];\n }\n}\n\n/** Adds a screen-space sharpness effect to the selected Viewport.\n * @beta\n */\nexport class SharpnessEffect extends ConvolutionEffect {\n public static override toolId = \"SharpnessEffect\";\n protected get effectName() { return \"sharpness\"; }\n protected get matrix() {\n return [\n 0, -1, 0,\n -1, 5, -1,\n 0, -1, 0,\n ];\n }\n}\n\n/** Adds a screen-space edge-detection effect to the selected Viewport.\n * @beta\n */\nexport class EdgeDetectionEffect extends ConvolutionEffect {\n public static override toolId = \"EdgeDetectionEffect\";\n protected get effectName() { return \"edgedetect\"; }\n protected get matrix() {\n return [\n -5, 0, 0,\n 0, 0, 0,\n 0, 0, 5,\n ];\n }\n}\n"]}
|
|
@@ -15,6 +15,7 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
15
15
|
* @beta
|
|
16
16
|
*/
|
|
17
17
|
class AddEffectTool extends core_frontend_1.Tool {
|
|
18
|
+
static _registeredEffects = new Set();
|
|
18
19
|
async run() {
|
|
19
20
|
// Avoid conflicts with the names of other registered screen-space effects.
|
|
20
21
|
const name = `fdt ${this.effectName}`;
|
|
@@ -37,11 +38,11 @@ class AddEffectTool extends core_frontend_1.Tool {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
exports.AddEffectTool = AddEffectTool;
|
|
40
|
-
AddEffectTool._registeredEffects = new Set();
|
|
41
41
|
/** Removes all screen-space effects from the selected viewport.
|
|
42
42
|
* @beta
|
|
43
43
|
*/
|
|
44
44
|
class ClearEffectsTool extends core_frontend_1.Tool {
|
|
45
|
+
static toolId = "ClearEffects";
|
|
45
46
|
static get minArgs() { return 0; }
|
|
46
47
|
static get maxArgs() { return 0; }
|
|
47
48
|
async run() {
|
|
@@ -50,7 +51,6 @@ class ClearEffectsTool extends core_frontend_1.Tool {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
exports.ClearEffectsTool = ClearEffectsTool;
|
|
53
|
-
ClearEffectsTool.toolId = "ClearEffects";
|
|
54
54
|
/** Requests that any viewport to which the specified effect has been applied redraw its contents.
|
|
55
55
|
* Used by tools like [[VignetteConfig]] to update the view after the effect parameters are modified.
|
|
56
56
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EffectTools.js","sourceRoot":"","sources":["../../../src/effects/EffectTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAkEH,8DASC;AAzED,sDAA6C;AAC7C,wDAE8B;AAE9B;;GAEG;AACH,MAAsB,aAAc,SAAQ,oBAAI;
|
|
1
|
+
{"version":3,"file":"EffectTools.js","sourceRoot":"","sources":["../../../src/effects/EffectTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAkEH,8DASC;AAzED,sDAA6C;AAC7C,wDAE8B;AAE9B;;GAEG;AACH,MAAsB,aAAc,SAAQ,oBAAI;IACtC,MAAM,CAAU,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;IAW/C,KAAK,CAAC,GAAG;QACvB,2EAA2E;QAC3E,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,uBAAuB;YACvB,MAAM,OAAO,GAAG,yBAAS,CAAC,YAAY,CAAC,8BAA8B,CAAC;gBACpE,IAAI;gBACJ,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;gBACvD,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YAEH,IAAA,qBAAM,EAAC,SAAS,KAAK,OAAO,CAAC,CAAC;YAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC3B,OAAO,CAAC,MAAM,EAAE,CAAC;YAEjB,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,EAAE;YACJ,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC;;AAnCH,sCAoCC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,oBAAI;IACjC,MAAM,CAAU,MAAM,GAAG,cAAc,CAAC;IACxC,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG;QACvB,yBAAS,CAAC,WAAW,CAAC,YAAY,EAAE,wBAAwB,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;;AARH,4CASC;AAED;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,UAAkB;IAC1D,KAAK,MAAM,EAAE,IAAI,yBAAS,CAAC,WAAW,EAAE,CAAC;QACvC,KAAK,MAAM,YAAY,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAC;YACjD,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;gBAChC,EAAE,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Effects\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport {\n IModelApp, ScreenSpaceEffectBuilder, ScreenSpaceEffectSource, Tool,\n} from \"@itwin/core-frontend\";\n\n/** Adds a screen-space effect to the selected viewport.\n * @beta\n */\nexport abstract class AddEffectTool extends Tool {\n private static readonly _registeredEffects = new Set<string>();\n\n /** Name of effect as used in keyins like `fdt effect add`. Ideally one word. */\n protected abstract get effectName(): string;\n /** vertex, fragment, and optional sampleSourcePixel GLSL snippets. */\n protected abstract get source(): ScreenSpaceEffectSource;\n /** Whether the fragment shader should include built-in `textureCoordFromPosition` function. */\n protected abstract get textureCoordFromPosition(): boolean;\n /** Add uniforms, varyings, etc. */\n protected abstract defineEffect(builder: ScreenSpaceEffectBuilder): void;\n\n public override async run(): Promise<boolean> {\n // Avoid conflicts with the names of other registered screen-space effects.\n const name = `fdt ${this.effectName}`;\n if (!AddEffectTool._registeredEffects.has(name)) {\n // Register the effect.\n const builder = IModelApp.renderSystem.createScreenSpaceEffectBuilder({\n name,\n textureCoordFromPosition: this.textureCoordFromPosition,\n source: this.source,\n });\n\n assert(undefined !== builder);\n this.defineEffect(builder);\n builder.finish();\n\n AddEffectTool._registeredEffects.add(name);\n }\n\n const vp = IModelApp.viewManager.selectedView;\n if (vp)\n vp.addScreenSpaceEffect(name);\n\n return true;\n }\n}\n\n/** Removes all screen-space effects from the selected viewport.\n * @beta\n */\nexport class ClearEffectsTool extends Tool {\n public static override toolId = \"ClearEffects\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 0; }\n\n public override async run(): Promise<boolean> {\n IModelApp.viewManager.selectedView?.removeScreenSpaceEffects();\n return true;\n }\n}\n\n/** Requests that any viewport to which the specified effect has been applied redraw its contents.\n * Used by tools like [[VignetteConfig]] to update the view after the effect parameters are modified.\n * @beta\n */\nexport function refreshViewportsForEffect(effectName: string): void {\n for (const vp of IModelApp.viewManager) {\n for (const vpEffectName of vp.screenSpaceEffects) {\n if (vpEffectName === effectName) {\n vp.requestRedraw();\n break;\n }\n }\n }\n}\n"]}
|
|
@@ -14,14 +14,22 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
14
14
|
const Random_1 = require("./Random");
|
|
15
15
|
/** Represents one particle in the system. */
|
|
16
16
|
class Particle {
|
|
17
|
+
/** Current position in the particle system's local coordinate space. */
|
|
18
|
+
position;
|
|
19
|
+
/** Current velocity in meters per second. */
|
|
20
|
+
velocity;
|
|
21
|
+
/** Current age in seconds, incremented each frame. */
|
|
22
|
+
age = 0;
|
|
23
|
+
/** Maximum age in seconds. When `this.age` exceeds `this.lifetime`, the particle expires. */
|
|
24
|
+
lifetime;
|
|
25
|
+
/** Particle size in meters. */
|
|
26
|
+
size;
|
|
27
|
+
/** Particle transparency in [0..255]. */
|
|
28
|
+
transparency = 0;
|
|
17
29
|
get x() { return this.position.x; }
|
|
18
30
|
get y() { return this.position.y; }
|
|
19
31
|
get z() { return this.position.z; }
|
|
20
32
|
constructor(position, velocity, lifetime, size) {
|
|
21
|
-
/** Current age in seconds, incremented each frame. */
|
|
22
|
-
this.age = 0;
|
|
23
|
-
/** Particle transparency in [0..255]. */
|
|
24
|
-
this.transparency = 0;
|
|
25
33
|
this.position = position;
|
|
26
34
|
this.velocity = velocity;
|
|
27
35
|
this.lifetime = lifetime;
|
|
@@ -33,16 +41,14 @@ class Particle {
|
|
|
33
41
|
* Each particle is emitted from the center of the sphere with random velocity toward the surface of the sphere.
|
|
34
42
|
*/
|
|
35
43
|
class ParticleEmitter {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.numParticlesRange = core_geometry_1.Range1d.createXX(1600, 2200);
|
|
45
|
-
}
|
|
44
|
+
/** Range from which each particle's initial speed in meters per second will be selected. */
|
|
45
|
+
speedRange = core_geometry_1.Range1d.createXX(1, 2);
|
|
46
|
+
/** Range from which each particle's lifetime in seconds will be selected. */
|
|
47
|
+
lifetimeRange = core_geometry_1.Range1d.createXX(5, 10);
|
|
48
|
+
/** Range from which each particle's size in meters will be selected. */
|
|
49
|
+
sizeRange = core_geometry_1.Range1d.createXX(0.2, 1.0);
|
|
50
|
+
/** Range from which the number of particles emitted will be selected. */
|
|
51
|
+
numParticlesRange = core_geometry_1.Range1d.createXX(1600, 2200);
|
|
46
52
|
/** Emit an explosion of particles from the center of the sphere. */
|
|
47
53
|
emit() {
|
|
48
54
|
const particles = [];
|
|
@@ -59,26 +65,33 @@ class ParticleEmitter {
|
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
class ParticleSystem {
|
|
68
|
+
_origin;
|
|
69
|
+
_pickableId;
|
|
70
|
+
_emitter = new ParticleEmitter();
|
|
71
|
+
_numEmissions;
|
|
72
|
+
_texture;
|
|
73
|
+
_lastUpdateTime;
|
|
74
|
+
_particles = [];
|
|
75
|
+
_scratchVector3d = new core_geometry_1.Vector3d();
|
|
76
|
+
_dispose;
|
|
77
|
+
/** Acceleration in Z applied to particles, in meters per second squared. */
|
|
78
|
+
gravity = -3;
|
|
79
|
+
static numEmissionsRange = core_geometry_1.Range1d.createXX(1, 5);
|
|
62
80
|
constructor(texture, iModel, numEmissions) {
|
|
63
|
-
this._emitter = new ParticleEmitter();
|
|
64
|
-
this._particles = [];
|
|
65
|
-
this._scratchVector3d = new core_geometry_1.Vector3d();
|
|
66
|
-
/** Acceleration in Z applied to particles, in meters per second squared. */
|
|
67
|
-
this.gravity = -3;
|
|
68
81
|
this._texture = texture;
|
|
69
82
|
this._pickableId = iModel.transientIds.getNext();
|
|
70
83
|
this._numEmissions = numEmissions;
|
|
71
84
|
this._lastUpdateTime = Date.now();
|
|
72
85
|
this._origin = (0, Random_1.randomPositionInRange)(iModel.projectExtents);
|
|
73
|
-
this._dispose = iModel.onClose.addListener(() => this.dispose());
|
|
86
|
+
this._dispose = iModel.onClose.addListener(() => this[Symbol.dispose]());
|
|
74
87
|
}
|
|
75
|
-
dispose() {
|
|
88
|
+
[Symbol.dispose]() {
|
|
76
89
|
if (this._dispose) {
|
|
77
90
|
this._dispose();
|
|
78
91
|
this._dispose = undefined;
|
|
79
92
|
}
|
|
80
93
|
core_frontend_1.IModelApp.viewManager.dropDecorator(this);
|
|
81
|
-
this._texture.dispose();
|
|
94
|
+
this._texture[Symbol.dispose]();
|
|
82
95
|
}
|
|
83
96
|
update() {
|
|
84
97
|
const now = Date.now();
|
|
@@ -89,7 +102,7 @@ class ParticleSystem {
|
|
|
89
102
|
if (numParticles === 0) {
|
|
90
103
|
this._numEmissions--;
|
|
91
104
|
if (this._numEmissions < 0)
|
|
92
|
-
this.dispose();
|
|
105
|
+
this[Symbol.dispose]();
|
|
93
106
|
else
|
|
94
107
|
this._particles = this._emitter.emit();
|
|
95
108
|
return;
|
|
@@ -151,11 +164,11 @@ class ParticleSystem {
|
|
|
151
164
|
core_frontend_1.IModelApp.viewManager.addDecorator(new ParticleSystem(texture, iModel, (0, Random_1.randomIntegerInRange)(this.numEmissionsRange)));
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
|
-
ParticleSystem.numEmissionsRange = core_geometry_1.Range1d.createXX(1, 5);
|
|
155
167
|
/** This tool applies an explosion particle effect used for testing [ParticleCollectionBuilder]($frontend).
|
|
156
168
|
* @beta
|
|
157
169
|
*/
|
|
158
170
|
class ExplosionEffect extends core_frontend_1.Tool {
|
|
171
|
+
static toolId = "ExplosionEffect";
|
|
159
172
|
/** This method runs the tool, applying an explosion particle effect. */
|
|
160
173
|
async run() {
|
|
161
174
|
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
@@ -165,5 +178,4 @@ class ExplosionEffect extends core_frontend_1.Tool {
|
|
|
165
178
|
}
|
|
166
179
|
}
|
|
167
180
|
exports.ExplosionEffect = ExplosionEffect;
|
|
168
|
-
ExplosionEffect.toolId = "ExplosionEffect";
|
|
169
181
|
//# sourceMappingURL=Explosion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explosion.js","sourceRoot":"","sources":["../../../src/effects/Explosion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAkE;AAClE,oDAAwE;AACxE,wDAE8B;AAC9B,qCAAwG;AAExG,6CAA6C;AAC7C,MAAM,QAAQ;IAcZ,IAAW,CAAC,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;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CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,AAAzB,CAA0B;AA6G3D;;GAEG;AACH,MAAa,eAAgB,SAAQ,oBAAI;IAGvC,wEAAwE;IACxD,KAAK,CAAC,GAAG;QACvB,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,EAAE;YACJ,MAAM,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IACd,CAAC;;AAVH,0CAWC;AAVwB,sBAAM,GAAG,iBAAiB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Effects\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Range1d, Vector3d } from \"@itwin/core-geometry\";\nimport { RenderTexture, TextureTransparency } from \"@itwin/core-common\";\nimport {\n DecorateContext, GraphicType, HitDetail, imageElementFromUrl, IModelApp, IModelConnection, ParticleCollectionBuilder, ParticleProps, Tool,\n} from \"@itwin/core-frontend\";\nimport { randomFloat, randomFloatInRange, randomIntegerInRange, randomPositionInRange } from \"./Random\";\n\n/** Represents one particle in the system. */\nclass Particle implements ParticleProps {\n /** Current position in the particle system's local coordinate space. */\n public readonly position: Point3d;\n /** Current velocity in meters per second. */\n public readonly velocity: Vector3d;\n /** Current age in seconds, incremented each frame. */\n public age = 0;\n /** Maximum age in seconds. When `this.age` exceeds `this.lifetime`, the particle expires. */\n public readonly lifetime: number;\n /** Particle size in meters. */\n public size: number;\n /** Particle transparency in [0..255]. */\n public transparency = 0;\n\n public get x() { return this.position.x; }\n public get y() { return this.position.y; }\n public get z() { return this.position.z; }\n\n public constructor(position: Point3d, velocity: Vector3d, lifetime: number, size: number) {\n this.position = position;\n this.velocity = velocity;\n this.lifetime = lifetime;\n this.size = size;\n }\n\n public get isExpired() { return this.age >= this.lifetime; }\n}\n\n/** Emits particles in a sphere with its center at the origin.\n * Each particle is emitted from the center of the sphere with random velocity toward the surface of the sphere.\n */\nclass ParticleEmitter {\n /** Range from which each particle's initial speed in meters per second will be selected. */\n public readonly speedRange = Range1d.createXX(1, 2);\n /** Range from which each particle's lifetime in seconds will be selected. */\n public readonly lifetimeRange = Range1d.createXX(5, 10);\n /** Range from which each particle's size in meters will be selected. */\n public readonly sizeRange = Range1d.createXX(0.2, 1.0);\n /** Range from which the number of particles emitted will be selected. */\n public numParticlesRange = Range1d.createXX(1600, 2200);\n\n /** Emit an explosion of particles from the center of the sphere. */\n public emit(): Particle[] {\n const particles = [];\n const numParticles = randomIntegerInRange(this.numParticlesRange);\n for (let i = 0; i < numParticles; i++) {\n const velocity = new Vector3d(randomFloat(-1.0, 1.0), randomFloat(-1.0, 1.0), randomFloat(-1.0, 1.0));\n velocity.normalizeInPlace();\n velocity.scaleInPlace(randomFloatInRange(this.speedRange));\n\n const lifetime = randomFloatInRange(this.lifetimeRange);\n const size = randomFloatInRange(this.sizeRange);\n particles.push(new Particle(new Point3d(0, 0, 0), velocity, lifetime, size));\n }\n\n return particles;\n }\n}\n\nclass ParticleSystem {\n private readonly _origin: Point3d;\n private readonly _pickableId: Id64String;\n private readonly _emitter = new ParticleEmitter();\n private _numEmissions: number;\n private readonly _texture: RenderTexture;\n private _lastUpdateTime: number;\n private _particles: Particle[] = [];\n private readonly _scratchVector3d = new Vector3d();\n private _dispose?: VoidFunction;\n /** Acceleration in Z applied to particles, in meters per second squared. */\n public gravity = -3;\n\n public static numEmissionsRange = Range1d.createXX(1, 5);\n\n public constructor(texture: RenderTexture, iModel: IModelConnection, numEmissions: number) {\n this._texture = texture;\n this._pickableId = iModel.transientIds.getNext();\n this._numEmissions = numEmissions;\n this._lastUpdateTime = Date.now();\n\n this._origin = randomPositionInRange(iModel.projectExtents);\n\n this._dispose = iModel.onClose.addListener(() => this.dispose());\n }\n\n public dispose(): void {\n if (this._dispose) {\n this._dispose();\n this._dispose = undefined;\n }\n\n IModelApp.viewManager.dropDecorator(this);\n this._texture.dispose();\n }\n\n public update(): void {\n const now = Date.now();\n let deltaMillis = now - this._lastUpdateTime;\n deltaMillis = Math.min(100, deltaMillis);\n this._lastUpdateTime = now;\n\n let numParticles = this._particles.length;\n if (numParticles === 0) {\n this._numEmissions--;\n if (this._numEmissions < 0)\n this.dispose();\n else\n this._particles = this._emitter.emit();\n\n return;\n }\n\n const elapsedSeconds = deltaMillis / 1000;\n for (let i = 0; i < numParticles; i++) {\n const particle = this._particles[i];\n this.updateParticle(particle, elapsedSeconds);\n if (particle.isExpired) {\n this._particles[i] = this._particles[numParticles - 1];\n --i;\n --numParticles;\n }\n }\n\n this._particles.length = numParticles;\n }\n\n private updateParticle(particle: Particle, elapsedSeconds: number): void {\n const velocity = particle.velocity.clone(this._scratchVector3d);\n velocity.scale(elapsedSeconds, velocity);\n velocity.z += elapsedSeconds * this.gravity;\n particle.position.addInPlace(velocity);\n particle.transparency = 255 * (particle.age / particle.lifetime);\n\n particle.age += elapsedSeconds;\n }\n\n public decorate(context: DecorateContext): void {\n if (!context.viewport.view.isSpatialView())\n return;\n\n this.update();\n\n const builder = ParticleCollectionBuilder.create({\n viewport: context.viewport,\n texture: this._texture,\n size: (this._emitter.sizeRange.high - this._emitter.sizeRange.low) / 2,\n transparency: 0,\n origin: this._origin,\n pickableId: this._pickableId,\n });\n\n for (const particle of this._particles)\n builder.addParticle(particle);\n\n const graphic = builder.finish();\n if (graphic) {\n context.addDecoration(GraphicType.WorldDecoration, graphic);\n context.viewport.onRender.addOnce((vp) => vp.invalidateDecorations());\n }\n }\n\n public testDecorationHit(id: Id64String): boolean {\n return id === this._pickableId;\n }\n\n public async getDecorationToolTip(_hit: HitDetail): Promise<HTMLElement | string> {\n return \"Explosion effect\";\n }\n\n public static async addDecorator(iModel: IModelConnection): Promise<void> {\n // Note: The decorator takes ownership of the texture, and disposes of it when the decorator is disposed.\n const image = await imageElementFromUrl(`${IModelApp.publicPath}sprites/particle_explosion.png`);\n const texture = IModelApp.renderSystem.createTexture({\n ownership: \"external\",\n image: { source: image, transparency: TextureTransparency.Mixed },\n });\n if (texture)\n IModelApp.viewManager.addDecorator(new ParticleSystem(texture, iModel, randomIntegerInRange(this.numEmissionsRange)));\n }\n}\n\n/** This tool applies an explosion particle effect used for testing [ParticleCollectionBuilder]($frontend).\n * @beta\n */\nexport class ExplosionEffect extends Tool {\n public static override toolId = \"ExplosionEffect\";\n\n /** This method runs the tool, applying an explosion particle effect. */\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp)\n await ParticleSystem.addDecorator(vp.iModel);\n\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Explosion.js","sourceRoot":"","sources":["../../../src/effects/Explosion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAkE;AAClE,oDAAwE;AACxE,wDAE8B;AAC9B,qCAAwG;AAExG,6CAA6C;AAC7C,MAAM,QAAQ;IACZ,wEAAwE;IACxD,QAAQ,CAAU;IAClC,6CAA6C;IAC7B,QAAQ,CAAW;IACnC,sDAAsD;IAC/C,GAAG,GAAG,CAAC,CAAC;IACf,6FAA6F;IAC7E,QAAQ,CAAS;IACjC,+BAA+B;IACxB,IAAI,CAAS;IACpB,yCAAyC;IAClC,YAAY,GAAG,CAAC,CAAC;IAExB,IAAW,CAAC,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,IAAW,CAAC,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,IAAW,CAAC,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1C,YAAmB,QAAiB,EAAE,QAAkB,EAAE,QAAgB,EAAE,IAAY;QACtF,IAAI,CAAC,QAAQ,GA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CAAC,GAAG;QACvB,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,EAAE;YACJ,MAAM,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IACd,CAAC;;AAVH,0CAWC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Effects\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Range1d, Vector3d } from \"@itwin/core-geometry\";\nimport { RenderTexture, TextureTransparency } from \"@itwin/core-common\";\nimport {\n DecorateContext, GraphicType, HitDetail, imageElementFromUrl, IModelApp, IModelConnection, ParticleCollectionBuilder, ParticleProps, Tool,\n} from \"@itwin/core-frontend\";\nimport { randomFloat, randomFloatInRange, randomIntegerInRange, randomPositionInRange } from \"./Random\";\n\n/** Represents one particle in the system. */\nclass Particle implements ParticleProps {\n /** Current position in the particle system's local coordinate space. */\n public readonly position: Point3d;\n /** Current velocity in meters per second. */\n public readonly velocity: Vector3d;\n /** Current age in seconds, incremented each frame. */\n public age = 0;\n /** Maximum age in seconds. When `this.age` exceeds `this.lifetime`, the particle expires. */\n public readonly lifetime: number;\n /** Particle size in meters. */\n public size: number;\n /** Particle transparency in [0..255]. */\n public transparency = 0;\n\n public get x() { return this.position.x; }\n public get y() { return this.position.y; }\n public get z() { return this.position.z; }\n\n public constructor(position: Point3d, velocity: Vector3d, lifetime: number, size: number) {\n this.position = position;\n this.velocity = velocity;\n this.lifetime = lifetime;\n this.size = size;\n }\n\n public get isExpired() { return this.age >= this.lifetime; }\n}\n\n/** Emits particles in a sphere with its center at the origin.\n * Each particle is emitted from the center of the sphere with random velocity toward the surface of the sphere.\n */\nclass ParticleEmitter {\n /** Range from which each particle's initial speed in meters per second will be selected. */\n public readonly speedRange = Range1d.createXX(1, 2);\n /** Range from which each particle's lifetime in seconds will be selected. */\n public readonly lifetimeRange = Range1d.createXX(5, 10);\n /** Range from which each particle's size in meters will be selected. */\n public readonly sizeRange = Range1d.createXX(0.2, 1.0);\n /** Range from which the number of particles emitted will be selected. */\n public numParticlesRange = Range1d.createXX(1600, 2200);\n\n /** Emit an explosion of particles from the center of the sphere. */\n public emit(): Particle[] {\n const particles = [];\n const numParticles = randomIntegerInRange(this.numParticlesRange);\n for (let i = 0; i < numParticles; i++) {\n const velocity = new Vector3d(randomFloat(-1.0, 1.0), randomFloat(-1.0, 1.0), randomFloat(-1.0, 1.0));\n velocity.normalizeInPlace();\n velocity.scaleInPlace(randomFloatInRange(this.speedRange));\n\n const lifetime = randomFloatInRange(this.lifetimeRange);\n const size = randomFloatInRange(this.sizeRange);\n particles.push(new Particle(new Point3d(0, 0, 0), velocity, lifetime, size));\n }\n\n return particles;\n }\n}\n\nclass ParticleSystem {\n private readonly _origin: Point3d;\n private readonly _pickableId: Id64String;\n private readonly _emitter = new ParticleEmitter();\n private _numEmissions: number;\n private readonly _texture: RenderTexture;\n private _lastUpdateTime: number;\n private _particles: Particle[] = [];\n private readonly _scratchVector3d = new Vector3d();\n private _dispose?: VoidFunction;\n /** Acceleration in Z applied to particles, in meters per second squared. */\n public gravity = -3;\n\n public static numEmissionsRange = Range1d.createXX(1, 5);\n\n public constructor(texture: RenderTexture, iModel: IModelConnection, numEmissions: number) {\n this._texture = texture;\n this._pickableId = iModel.transientIds.getNext();\n this._numEmissions = numEmissions;\n this._lastUpdateTime = Date.now();\n\n this._origin = randomPositionInRange(iModel.projectExtents);\n\n this._dispose = iModel.onClose.addListener(() => this[Symbol.dispose]());\n }\n\n public [Symbol.dispose](): void {\n if (this._dispose) {\n this._dispose();\n this._dispose = undefined;\n }\n\n IModelApp.viewManager.dropDecorator(this);\n this._texture[Symbol.dispose]();\n }\n\n public update(): void {\n const now = Date.now();\n let deltaMillis = now - this._lastUpdateTime;\n deltaMillis = Math.min(100, deltaMillis);\n this._lastUpdateTime = now;\n\n let numParticles = this._particles.length;\n if (numParticles === 0) {\n this._numEmissions--;\n if (this._numEmissions < 0)\n this[Symbol.dispose]();\n else\n this._particles = this._emitter.emit();\n\n return;\n }\n\n const elapsedSeconds = deltaMillis / 1000;\n for (let i = 0; i < numParticles; i++) {\n const particle = this._particles[i];\n this.updateParticle(particle, elapsedSeconds);\n if (particle.isExpired) {\n this._particles[i] = this._particles[numParticles - 1];\n --i;\n --numParticles;\n }\n }\n\n this._particles.length = numParticles;\n }\n\n private updateParticle(particle: Particle, elapsedSeconds: number): void {\n const velocity = particle.velocity.clone(this._scratchVector3d);\n velocity.scale(elapsedSeconds, velocity);\n velocity.z += elapsedSeconds * this.gravity;\n particle.position.addInPlace(velocity);\n particle.transparency = 255 * (particle.age / particle.lifetime);\n\n particle.age += elapsedSeconds;\n }\n\n public decorate(context: DecorateContext): void {\n if (!context.viewport.view.isSpatialView())\n return;\n\n this.update();\n\n const builder = ParticleCollectionBuilder.create({\n viewport: context.viewport,\n texture: this._texture,\n size: (this._emitter.sizeRange.high - this._emitter.sizeRange.low) / 2,\n transparency: 0,\n origin: this._origin,\n pickableId: this._pickableId,\n });\n\n for (const particle of this._particles)\n builder.addParticle(particle);\n\n const graphic = builder.finish();\n if (graphic) {\n context.addDecoration(GraphicType.WorldDecoration, graphic);\n context.viewport.onRender.addOnce((vp) => vp.invalidateDecorations());\n }\n }\n\n public testDecorationHit(id: Id64String): boolean {\n return id === this._pickableId;\n }\n\n public async getDecorationToolTip(_hit: HitDetail): Promise<HTMLElement | string> {\n return \"Explosion effect\";\n }\n\n public static async addDecorator(iModel: IModelConnection): Promise<void> {\n // Note: The decorator takes ownership of the texture, and disposes of it when the decorator is disposed.\n const image = await imageElementFromUrl(`${IModelApp.publicPath}sprites/particle_explosion.png`);\n const texture = IModelApp.renderSystem.createTexture({\n ownership: \"external\",\n image: { source: image, transparency: TextureTransparency.Mixed },\n });\n if (texture)\n IModelApp.viewManager.addDecorator(new ParticleSystem(texture, iModel, randomIntegerInRange(this.numEmissionsRange)));\n }\n}\n\n/** This tool applies an explosion particle effect used for testing [ParticleCollectionBuilder]($frontend).\n * @beta\n */\nexport class ExplosionEffect extends Tool {\n public static override toolId = \"ExplosionEffect\";\n\n /** This method runs the tool, applying an explosion particle effect. */\n public override async run(): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (vp)\n await ParticleSystem.addDecorator(vp.iModel);\n\n return true;\n }\n}\n"]}
|
|
@@ -19,6 +19,7 @@ let flipColor = false;
|
|
|
19
19
|
* @beta
|
|
20
20
|
*/
|
|
21
21
|
class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
+
static toolId = "FlipImageEffect";
|
|
22
23
|
get effectName() { return "flip"; }
|
|
23
24
|
get textureCoordFromPosition() { return true; }
|
|
24
25
|
get source() {
|
|
@@ -76,11 +77,11 @@ class FlipImageEffect extends EffectTools_1.AddEffectTool {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
exports.FlipImageEffect = FlipImageEffect;
|
|
79
|
-
FlipImageEffect.toolId = "FlipImageEffect";
|
|
80
80
|
/** Configure the [[FlipImageEffect]].
|
|
81
81
|
* @beta
|
|
82
82
|
*/
|
|
83
83
|
class FlipImageConfig extends core_frontend_1.Tool {
|
|
84
|
+
static toolId = "FlipImageConfig";
|
|
84
85
|
static get minArgs() { return 0; }
|
|
85
86
|
static get maxArgs() { return 3; }
|
|
86
87
|
async run(horizontal, vertical, color) {
|
|
@@ -96,5 +97,4 @@ class FlipImageConfig extends core_frontend_1.Tool {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
exports.FlipImageConfig = FlipImageConfig;
|
|
99
|
-
FlipImageConfig.toolId = "FlipImageConfig";
|
|
100
100
|
//# sourceMappingURL=FlipImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlipImage.js","sourceRoot":"","sources":["../../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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;;AAjBH,0CAkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Effects\n */\n\nimport { ScreenSpaceEffectBuilder, Tool, UniformType, VaryingType } from \"@itwin/core-frontend\";\nimport { parseArgs } from \"../tools/parseArgs\";\nimport { AddEffectTool, refreshViewportsForEffect } from \"./EffectTools\";\n\nlet flipHorizontal = false;\nlet flipVertical = false;\nlet flipColor = false;\n\n/** An extremely simple and mostly useless effect intended to demonstrate the basics of creating a screen-space effect.\n * It flips the Viewport's image on the x and/or y axis, and/or inverts the color of each pixel.\n * @beta\n */\nexport class FlipImageEffect extends AddEffectTool {\n public static override toolId = \"FlipImageEffect\";\n\n protected get effectName() { return \"flip\"; }\n protected get textureCoordFromPosition() { return true; }\n\n protected get source() {\n return {\n // Compute texture coordinate for use in fragment shader.\n vertex: `\n void effectMain(vec4 pos) {\n vec2 uv = textureCoordFromPosition(pos);\n if (u_flipHorizontal)\n uv.x = 1.0 - uv.x;\n\n if (u_flipVertical)\n uv.y = 1.0 - uv.y;\n\n v_uv = uv;\n }`,\n // Sample the original image to flip on x and/or y axis, then invert its color.\n fragment: `\n vec4 effectMain() {\n vec4 color = sampleSourcePixel();\n if (u_flipColor) {\n color.r = 1.0 - color.r;\n color.g = 1.0 - color.g;\n color.b = 1.0 - color.b;\n }\n\n return color;\n }`,\n // Because we're moving pixels around, we must tell the render system where the source pixel was originally located - otherwise\n // element locate will not work correctly.\n sampleSourcePixel: \"return TEXTURE(u_diffuse, v_uv);\",\n };\n }\n\n protected defineEffect(builder: ScreenSpaceEffectBuilder): void {\n // Don't bother applying the effect if nothing is to be flipped.\n builder.shouldApply = (_context) => flipHorizontal || flipVertical || flipColor;\n\n // Define the varying for the texture coordinate.\n builder.addVarying(\"v_uv\", VaryingType.Vec2);\n\n // Hook up the uniforms.\n builder.addUniform({\n name: \"u_flipHorizontal\",\n type: UniformType.Bool,\n bind: (uniform, _context) => uniform.setUniform1i(flipHorizontal ? 1 : 0),\n });\n builder.addUniform({\n name: \"u_flipVertical\",\n type: UniformType.Bool,\n bind: (uniform, _context) => uniform.setUniform1i(flipVertical ? 1 : 0),\n });\n builder.addUniform({\n name: \"u_flipColor\",\n type: UniformType.Bool,\n bind: (uniform, _context) => uniform.setUniform1i(flipColor ? 1 : 0),\n });\n }\n}\n\n/** Configure the [[FlipImageEffect]].\n * @beta\n */\nexport class FlipImageConfig extends Tool {\n public static override toolId = \"FlipImageConfig\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 3; }\n\n public override async run(horizontal?: boolean, vertical?: boolean, color?: boolean): Promise<boolean> {\n flipHorizontal = !!horizontal;\n flipVertical = !!vertical;\n flipColor = !!color;\n\n refreshViewportsForEffect(\"fdt flip\");\n return true;\n }\n\n public override async parseAndRun(...input: string[]): Promise<boolean> {\n const args = parseArgs(input);\n return this.run(args.getBoolean(\"h\"), args.getBoolean(\"v\"), args.getBoolean(\"c\"));\n }\n}\n"]}
|
|
@@ -19,6 +19,7 @@ const parseArgs_1 = require("../tools/parseArgs");
|
|
|
19
19
|
* @beta
|
|
20
20
|
*/
|
|
21
21
|
class LensDistortionEffect extends EffectTools_1.AddEffectTool {
|
|
22
|
+
static toolId = "LensDistortionEffect";
|
|
22
23
|
get effectName() { return "lensdistortion"; }
|
|
23
24
|
get textureCoordFromPosition() { return true; }
|
|
24
25
|
get source() {
|
|
@@ -85,13 +86,15 @@ class LensDistortionEffect extends EffectTools_1.AddEffectTool {
|
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
exports.LensDistortionEffect = LensDistortionEffect;
|
|
88
|
-
LensDistortionEffect.toolId = "LensDistortionEffect";
|
|
89
89
|
/** Configures the [[LensDistortionEffect]].
|
|
90
90
|
* @beta
|
|
91
91
|
*/
|
|
92
92
|
class LensDistortionConfig extends core_frontend_1.Tool {
|
|
93
|
+
static toolId = "LensDistortionConfig";
|
|
93
94
|
static get minArgs() { return 0; }
|
|
94
95
|
static get maxArgs() { return 2; }
|
|
96
|
+
static strength = 0.5;
|
|
97
|
+
static cylindricalRatio = 0.5;
|
|
95
98
|
async run(strength, ratio) {
|
|
96
99
|
LensDistortionConfig.strength = strength ?? 0.5;
|
|
97
100
|
LensDistortionConfig.cylindricalRatio = ratio ?? 0.5;
|
|
@@ -104,7 +107,4 @@ class LensDistortionConfig extends core_frontend_1.Tool {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
exports.LensDistortionConfig = LensDistortionConfig;
|
|
107
|
-
LensDistortionConfig.toolId = "LensDistortionConfig";
|
|
108
|
-
LensDistortionConfig.strength = 0.5;
|
|
109
|
-
LensDistortionConfig.cylindricalRatio = 0.5;
|
|
110
110
|
//# sourceMappingURL=LensDistortion.js.map
|