@itwin/frontend-devtools 5.5.0-dev.1 → 5.5.0-dev.4
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 +6 -1
- package/README.md +1 -0
- package/lib/cjs/FrontEndDevTools.d.ts.map +1 -1
- package/lib/cjs/FrontEndDevTools.js +2 -0
- package/lib/cjs/FrontEndDevTools.js.map +1 -1
- package/lib/cjs/tools/ViewDefinitionDecorator.d.ts +12 -0
- package/lib/cjs/tools/ViewDefinitionDecorator.d.ts.map +1 -0
- package/lib/cjs/tools/ViewDefinitionDecorator.js +115 -0
- package/lib/cjs/tools/ViewDefinitionDecorator.js.map +1 -0
- package/lib/esm/FrontEndDevTools.d.ts.map +1 -1
- package/lib/esm/FrontEndDevTools.js +2 -0
- package/lib/esm/FrontEndDevTools.js.map +1 -1
- package/lib/esm/tools/ViewDefinitionDecorator.d.ts +12 -0
- package/lib/esm/tools/ViewDefinitionDecorator.d.ts.map +1 -0
- package/lib/esm/tools/ViewDefinitionDecorator.js +111 -0
- package/lib/esm/tools/ViewDefinitionDecorator.js.map +1 -0
- package/lib/public/locales/en/FrontendDevTools.json +3 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/frontend-devtools
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 02 Dec 2025 23:11:57 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.4.0
|
|
6
|
+
Tue, 02 Dec 2025 21:22:25 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 5.3.3
|
|
6
11
|
Thu, 20 Nov 2025 22:30:37 GMT
|
package/README.md
CHANGED
|
@@ -78,6 +78,7 @@ The key-ins below enable, disable, or toggle a specific feature. They take at mo
|
|
|
78
78
|
* `fdt toggle reality preload` - Toggles the display of preloaded reality tile bounding boxes.
|
|
79
79
|
* `fdt toggle reality freeze` - Toggles the freezing of reality tile loading, when the reality tiles are frozen new reality tiles are not downloaded or purged.
|
|
80
80
|
* `fdt toggle reality logging` - Toggle the logging of reality tile loading and selection diagnostics to the console.
|
|
81
|
+
* `fdt toggle viewdef bounds` - Toggles the display of frustum decorations that represent the extents of the current ViewDefinition. For SectionDrawing, this also displays decorations for the associated SpatialView.
|
|
81
82
|
* `fdt reality bounds` - Toggle the display of bounding boxes for reality tiles.
|
|
82
83
|
* `fdt set building display` Toggle the display of the worldwide OpenStreetMap worldwide buildingslayer by attaching or displaying as a reality model in the current viewport. The OSM buildings are aggregated and supplied from Cesium Ion <https://cesium.com/content/cesium-osm-buildings/>. The first argument is required on|off - the second optional argument is a value for transparency between 0 and 1.
|
|
83
84
|
* `fdt wow ignore background` Toggle whether the background color needs to be white for white-on-white reversal to apply.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;AAmEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
|
|
@@ -44,6 +44,7 @@ const SourceAspectIdTools_1 = require("./tools/SourceAspectIdTools");
|
|
|
44
44
|
const TileRequestDecoration_1 = require("./tools/TileRequestDecoration");
|
|
45
45
|
const TileTreeBoundsDecoration_1 = require("./tools/TileTreeBoundsDecoration");
|
|
46
46
|
const ToolTipProvider_1 = require("./tools/ToolTipProvider");
|
|
47
|
+
const ViewDefinitionDecorator_1 = require("./tools/ViewDefinitionDecorator");
|
|
47
48
|
/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].
|
|
48
49
|
* @beta
|
|
49
50
|
*/
|
|
@@ -168,6 +169,7 @@ class FrontendDevTools {
|
|
|
168
169
|
ViewportTools_1.ToggleViewAttachmentBoundariesTool,
|
|
169
170
|
ViewportTools_1.ToggleViewAttachmentClipShapesTool,
|
|
170
171
|
ViewportTools_1.ToggleViewAttachmentsTool,
|
|
172
|
+
ViewDefinitionDecorator_1.ViewDefinitionDecorationTool,
|
|
171
173
|
DisplayStyleTools_1.ToggleWiremeshTool,
|
|
172
174
|
RenderTargetTools_1.ToggleRealityTileBounds,
|
|
173
175
|
RenderTargetTools_1.ToggleRealityTilePreload,
|
|
@@ -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;IACnB,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAEpC;;;;;;;O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tC,+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":["/*---------------------------------------------------------------------------------------------\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 Utilities\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\r\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\r\nimport { ExplosionEffect } from \"./effects/Explosion\";\r\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\r\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\r\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\r\nimport { SnowEffect } from \"./effects/Snow\";\r\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\r\nimport {\r\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\r\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\r\n} from \"./tools/PlanarMaskTools\";\r\nimport {\r\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\r\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\r\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n} from \"./tools/ViewportTools\";\r\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\r\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\r\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\r\nimport {\r\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\r\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\r\n} from \"./tools/DisplayStyleTools\";\r\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\r\nimport {\r\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\r\n} from \"./tools/EmphasizeElementsTool\";\r\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\r\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\r\nimport {\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\r\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\r\n} from \"./tools/MapLayerTool\";\r\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\r\nimport {\r\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\r\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\r\n} from \"./tools/ModelAppearanceTools\";\r\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\r\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\r\nimport {\r\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\r\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\r\n} from \"./tools/RealityModelTools\";\r\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\r\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\r\nimport {\r\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\r\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\r\n} from \"./tools/RenderTargetTools\";\r\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\r\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\r\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\r\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\r\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\r\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\r\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\r\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\r\n\r\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\r\n * @beta\r\n */\r\nexport class FrontendDevTools {\r\n private static _initialized = false;\r\n\r\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\r\n * To initialize when starting up your app:\r\n * ```ts\r\n * IModelApp.startup();\r\n * await FrontendDevTools.initialize();\r\n * ```\r\n * @beta\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (this._initialized)\r\n return;\r\n\r\n this._initialized = true;\r\n\r\n // clean up if we're being shut down\r\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\r\n\r\n const namespace = \"FrontendDevTools\";\r\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\r\n const tools = [\r\n AttachMapLayerTool,\r\n AttachMapOverlayTool,\r\n AttachModelMapLayerTool,\r\n AttachArcGISMapLayerByUrlTool,\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachOgcApiFeaturesMapLayerTool,\r\n AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool,\r\n AttachTileURLMapLayerByUrlTool,\r\n AnimationIntervalTool,\r\n ApplyRenderingStyleTool,\r\n ApplyViewByIdTool,\r\n ApplyViewTool,\r\n ChangeBackgroundColorTool,\r\n ChangeCameraTool,\r\n ChangeEmphasisSettingsTool,\r\n ChangeFlashSettingsTool,\r\n ChangeHiliteModeTool,\r\n ChangeHiliteSettingsTool,\r\n ChangePlanProjectionSettingsTool,\r\n ChangeUnitsTool,\r\n ChangeViewFlagsTool,\r\n ClearEffectsTool,\r\n ClearEmphasizedElementsTool,\r\n ClearIsolatedElementsTool,\r\n ClipColorTool,\r\n ClipIntersectionTool,\r\n CompileShadersTool,\r\n DefaultTileSizeModifierTool,\r\n DetachMapLayersTool,\r\n DumpPlanProjectionSettingsTool,\r\n DumpSelectionSetTool,\r\n EdgeDetectionEffect,\r\n EmbossEffect,\r\n ElementIdFromSourceAspectIdTool,\r\n EmphasizeSelectedElementsTool,\r\n EmphasizeVisibleElementsTool,\r\n ExplosionEffect,\r\n FadeOutTool,\r\n FlipImageConfig,\r\n FlipImageEffect,\r\n FreezeSceneTool,\r\n GaussianBlurEffect,\r\n InspectElementTool,\r\n IsolateSelectedElementsTool,\r\n LensDistortionConfig,\r\n LensDistortionEffect,\r\n LoseWebGLContextTool,\r\n MapLayerTransparencyTool,\r\n MapLayerVisibilityTool,\r\n MapLayerSubLayerVisibilityTool,\r\n MapLayerZoomTool,\r\n MapBaseColorTool,\r\n MapBaseTransparencyTool,\r\n MapBaseVisibilityTool,\r\n MeasureTileLoadTimeTool,\r\n OverrideSubCategoryTool,\r\n OverrideSubCategoryPriorityTool,\r\n QueryScheduleScriptTool,\r\n RealityTransitionTool,\r\n ReorderMapLayers,\r\n ReportWebGLCompatibilityTool,\r\n ReverseScheduleScriptTool,\r\n SaturationConfig,\r\n SaturationEffect,\r\n SaveRenderingStyleTool,\r\n SaveViewTool,\r\n SelectElementsByIdTool,\r\n SetAASamplesTool,\r\n SetAspectRatioSkewTool,\r\n SetScheduleScriptTool,\r\n ToggleVolClassIntersect,\r\n SetMapBaseTool,\r\n SharpenEffect,\r\n SharpnessEffect,\r\n ShowTileVolumesTool,\r\n SkyCubeTool,\r\n SkySphereTool,\r\n SnowEffect,\r\n SourceAspectIdFromElementIdTool,\r\n TestClipStyleTool,\r\n Toggle3dManipulationsTool,\r\n ToggleDrawingGraphicsTool,\r\n ToggleDPIForLODTool,\r\n ToggleDrapeFrustumTool,\r\n ToggleFrustumSnapshotTool,\r\n ToggleMaskFrustumTool,\r\n ToggleNormalMaps,\r\n TogglePrimitiveVisibilityTool,\r\n ToggleProjectExtentsTool,\r\n ToggleReadPixelsTool,\r\n ToggleSectionDrawingSpatialViewTool,\r\n ToggleSelectedViewFrustumTool,\r\n ToggleShadowFrustumTool,\r\n ToggleSkyboxTool,\r\n ToggleTileRequestDecorationTool,\r\n ToggleTileTreeBoundsDecorationTool,\r\n ToggleTileTreeReferencesTool,\r\n ToggleToolTipsTool,\r\n ToggleViewAttachmentBoundariesTool,\r\n ToggleViewAttachmentClipShapesTool,\r\n ToggleViewAttachmentsTool,\r\n ToggleWiremeshTool,\r\n ToggleRealityTileBounds,\r\n ToggleRealityTilePreload,\r\n ToggleRealityTileLogging,\r\n ToggleRealityTileFreeze,\r\n ToggleSectionCutTool,\r\n ToggleTerrainTool,\r\n UnsharpenEffect,\r\n ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n VignetteConfig,\r\n VignetteEffect,\r\n AttachRealityModelTool,\r\n DetachRealityModelTool,\r\n SaveRealityModelTool,\r\n SetGpuMemoryLimitTool,\r\n SetRealityModelLocateTool,\r\n SetRealityModelEmphasizedTool,\r\n SetRealityModelTransparencyTool,\r\n SetRealityModelColorTool,\r\n SetModelLocateTool,\r\n SetModelEmphasizedTool,\r\n SetModelTransparencyTool,\r\n SetModelColorTool,\r\n SetModelLineWeightTool,\r\n SetModelLineCodeTool,\r\n SetModelIgnoresMaterialsTool,\r\n ClearRealityModelAppearanceOverrides,\r\n ClearModelAppearanceOverrides,\r\n AttachCesiumAssetTool,\r\n ToggleOSMBuildingDisplay,\r\n SetHigherPriorityRealityModelMasking,\r\n SetMapHigherPriorityMasking,\r\n MaskRealityModelByModelTool,\r\n MaskRealityModelBySubCategoryTool,\r\n MaskRealityModelByElementTool,\r\n MaskRealityModelByExcludedElementTool,\r\n UnmaskRealityModelTool,\r\n MaskBackgroundMapByModelTool,\r\n MaskBackgroundMapBySubCategoryTool,\r\n MaskBackgroundMapByElementTool,\r\n MaskBackgroundMapByExcludedElementTool,\r\n UnmaskMapTool,\r\n WoWIgnoreBackgroundTool,\r\n ];\r\n\r\n for (const tool of tools)\r\n tool.register(namespace);\r\n\r\n return namespacePromise;\r\n }\r\n\r\n private static shutdown() {\r\n this._initialized = false;\r\n }\r\n}\r\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;AAC7D,6EAA+E;AAE/E;;GAEG;AACH,MAAa,gBAAgB;IACnB,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAEpC;;;;;;;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,GAA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AAiB;YACjB,yCAAyB;YACzB,yCAAyB;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,sDAA4B;YAC5B,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;;AApLH,4CAqLC","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 Utilities\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\r\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\r\nimport { ExplosionEffect } from \"./effects/Explosion\";\r\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\r\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\r\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\r\nimport { SnowEffect } from \"./effects/Snow\";\r\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\r\nimport {\r\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\r\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\r\n} from \"./tools/PlanarMaskTools\";\r\nimport {\r\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\r\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\r\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n} from \"./tools/ViewportTools\";\r\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\r\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\r\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\r\nimport {\r\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\r\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\r\n} from \"./tools/DisplayStyleTools\";\r\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\r\nimport {\r\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\r\n} from \"./tools/EmphasizeElementsTool\";\r\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\r\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\r\nimport {\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\r\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\r\n} from \"./tools/MapLayerTool\";\r\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\r\nimport {\r\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\r\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\r\n} from \"./tools/ModelAppearanceTools\";\r\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\r\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\r\nimport {\r\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\r\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\r\n} from \"./tools/RealityModelTools\";\r\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\r\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\r\nimport {\r\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\r\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\r\n} from \"./tools/RenderTargetTools\";\r\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\r\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\r\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\r\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\r\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\r\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\r\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\r\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\r\nimport { ViewDefinitionDecorationTool } from \"./tools/ViewDefinitionDecorator\";\r\n\r\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\r\n * @beta\r\n */\r\nexport class FrontendDevTools {\r\n private static _initialized = false;\r\n\r\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\r\n * To initialize when starting up your app:\r\n * ```ts\r\n * IModelApp.startup();\r\n * await FrontendDevTools.initialize();\r\n * ```\r\n * @beta\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (this._initialized)\r\n return;\r\n\r\n this._initialized = true;\r\n\r\n // clean up if we're being shut down\r\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\r\n\r\n const namespace = \"FrontendDevTools\";\r\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\r\n const tools = [\r\n AttachMapLayerTool,\r\n AttachMapOverlayTool,\r\n AttachModelMapLayerTool,\r\n AttachArcGISMapLayerByUrlTool,\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachOgcApiFeaturesMapLayerTool,\r\n AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool,\r\n AttachTileURLMapLayerByUrlTool,\r\n AnimationIntervalTool,\r\n ApplyRenderingStyleTool,\r\n ApplyViewByIdTool,\r\n ApplyViewTool,\r\n ChangeBackgroundColorTool,\r\n ChangeCameraTool,\r\n ChangeEmphasisSettingsTool,\r\n ChangeFlashSettingsTool,\r\n ChangeHiliteModeTool,\r\n ChangeHiliteSettingsTool,\r\n ChangePlanProjectionSettingsTool,\r\n ChangeUnitsTool,\r\n ChangeViewFlagsTool,\r\n ClearEffectsTool,\r\n ClearEmphasizedElementsTool,\r\n ClearIsolatedElementsTool,\r\n ClipColorTool,\r\n ClipIntersectionTool,\r\n CompileShadersTool,\r\n DefaultTileSizeModifierTool,\r\n DetachMapLayersTool,\r\n DumpPlanProjectionSettingsTool,\r\n DumpSelectionSetTool,\r\n EdgeDetectionEffect,\r\n EmbossEffect,\r\n ElementIdFromSourceAspectIdTool,\r\n EmphasizeSelectedElementsTool,\r\n EmphasizeVisibleElementsTool,\r\n ExplosionEffect,\r\n FadeOutTool,\r\n FlipImageConfig,\r\n FlipImageEffect,\r\n FreezeSceneTool,\r\n GaussianBlurEffect,\r\n InspectElementTool,\r\n IsolateSelectedElementsTool,\r\n LensDistortionConfig,\r\n LensDistortionEffect,\r\n LoseWebGLContextTool,\r\n MapLayerTransparencyTool,\r\n MapLayerVisibilityTool,\r\n MapLayerSubLayerVisibilityTool,\r\n MapLayerZoomTool,\r\n MapBaseColorTool,\r\n MapBaseTransparencyTool,\r\n MapBaseVisibilityTool,\r\n MeasureTileLoadTimeTool,\r\n OverrideSubCategoryTool,\r\n OverrideSubCategoryPriorityTool,\r\n QueryScheduleScriptTool,\r\n RealityTransitionTool,\r\n ReorderMapLayers,\r\n ReportWebGLCompatibilityTool,\r\n ReverseScheduleScriptTool,\r\n SaturationConfig,\r\n SaturationEffect,\r\n SaveRenderingStyleTool,\r\n SaveViewTool,\r\n SelectElementsByIdTool,\r\n SetAASamplesTool,\r\n SetAspectRatioSkewTool,\r\n SetScheduleScriptTool,\r\n ToggleVolClassIntersect,\r\n SetMapBaseTool,\r\n SharpenEffect,\r\n SharpnessEffect,\r\n ShowTileVolumesTool,\r\n SkyCubeTool,\r\n SkySphereTool,\r\n SnowEffect,\r\n SourceAspectIdFromElementIdTool,\r\n TestClipStyleTool,\r\n Toggle3dManipulationsTool,\r\n ToggleDrawingGraphicsTool,\r\n ToggleDPIForLODTool,\r\n ToggleDrapeFrustumTool,\r\n ToggleFrustumSnapshotTool,\r\n ToggleMaskFrustumTool,\r\n ToggleNormalMaps,\r\n TogglePrimitiveVisibilityTool,\r\n ToggleProjectExtentsTool,\r\n ToggleReadPixelsTool,\r\n ToggleSectionDrawingSpatialViewTool,\r\n ToggleSelectedViewFrustumTool,\r\n ToggleShadowFrustumTool,\r\n ToggleSkyboxTool,\r\n ToggleTileRequestDecorationTool,\r\n ToggleTileTreeBoundsDecorationTool,\r\n ToggleTileTreeReferencesTool,\r\n ToggleToolTipsTool,\r\n ToggleViewAttachmentBoundariesTool,\r\n ToggleViewAttachmentClipShapesTool,\r\n ToggleViewAttachmentsTool,\r\n ViewDefinitionDecorationTool,\r\n ToggleWiremeshTool,\r\n ToggleRealityTileBounds,\r\n ToggleRealityTilePreload,\r\n ToggleRealityTileLogging,\r\n ToggleRealityTileFreeze,\r\n ToggleSectionCutTool,\r\n ToggleTerrainTool,\r\n UnsharpenEffect,\r\n ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n VignetteConfig,\r\n VignetteEffect,\r\n AttachRealityModelTool,\r\n DetachRealityModelTool,\r\n SaveRealityModelTool,\r\n SetGpuMemoryLimitTool,\r\n SetRealityModelLocateTool,\r\n SetRealityModelEmphasizedTool,\r\n SetRealityModelTransparencyTool,\r\n SetRealityModelColorTool,\r\n SetModelLocateTool,\r\n SetModelEmphasizedTool,\r\n SetModelTransparencyTool,\r\n SetModelColorTool,\r\n SetModelLineWeightTool,\r\n SetModelLineCodeTool,\r\n SetModelIgnoresMaterialsTool,\r\n ClearRealityModelAppearanceOverrides,\r\n ClearModelAppearanceOverrides,\r\n AttachCesiumAssetTool,\r\n ToggleOSMBuildingDisplay,\r\n SetHigherPriorityRealityModelMasking,\r\n SetMapHigherPriorityMasking,\r\n MaskRealityModelByModelTool,\r\n MaskRealityModelBySubCategoryTool,\r\n MaskRealityModelByElementTool,\r\n MaskRealityModelByExcludedElementTool,\r\n UnmaskRealityModelTool,\r\n MaskBackgroundMapByModelTool,\r\n MaskBackgroundMapBySubCategoryTool,\r\n MaskBackgroundMapByElementTool,\r\n MaskBackgroundMapByExcludedElementTool,\r\n UnmaskMapTool,\r\n WoWIgnoreBackgroundTool,\r\n ];\r\n\r\n for (const tool of tools)\r\n tool.register(namespace);\r\n\r\n return namespacePromise;\r\n }\r\n\r\n private static shutdown() {\r\n this._initialized = false;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tool } from "@itwin/core-frontend";
|
|
2
|
+
/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export declare class ViewDefinitionDecorationTool extends Tool {
|
|
6
|
+
static toolId: string;
|
|
7
|
+
static get minArgs(): number;
|
|
8
|
+
static get maxArgs(): number;
|
|
9
|
+
run(enable?: boolean): Promise<boolean>;
|
|
10
|
+
parseAndRun(...args: string[]): Promise<boolean>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ViewDefinitionDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewDefinitionDecorator.d.ts","sourceRoot":"","sources":["../../../src/tools/ViewDefinitionDecorator.ts"],"names":[],"mappings":"AAUA,OAAO,EAAgF,IAAI,EAAsB,MAAM,sBAAsB,CAAC;AAmG9I;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,IAAI;IACpD,OAAuB,MAAM,SAAkC;IAC/D,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ViewDefinitionDecorationTool = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Tools
|
|
10
|
+
*/
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
+
const parseToggle_1 = require("./parseToggle");
|
|
14
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
15
|
+
const core_geometry_1 = require("@itwin/core-geometry");
|
|
16
|
+
class ViewDefinitionDecoration {
|
|
17
|
+
static _instance;
|
|
18
|
+
_removeMe;
|
|
19
|
+
constructor() {
|
|
20
|
+
this._removeMe = core_frontend_1.IModelApp.viewManager.addDecorator(this);
|
|
21
|
+
}
|
|
22
|
+
stop() {
|
|
23
|
+
if (this._removeMe) {
|
|
24
|
+
this._removeMe();
|
|
25
|
+
this._removeMe = undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
_viewId;
|
|
29
|
+
_loading = false;
|
|
30
|
+
_preloadedFrustum = [];
|
|
31
|
+
async getFrustumForViewId(iModel, viewId, transform = core_geometry_1.Transform.createIdentity()) {
|
|
32
|
+
return iModel.views.load(viewId).then((result) => {
|
|
33
|
+
// Use the view extents/delta
|
|
34
|
+
let vector;
|
|
35
|
+
if (result.is2d())
|
|
36
|
+
vector = core_geometry_1.Vector2d.create(result.delta.x, result.delta.y);
|
|
37
|
+
else
|
|
38
|
+
vector = core_geometry_1.Vector2d.create(result.getExtents().x, result.getExtents().y);
|
|
39
|
+
// create a viewport to the size of the extents to ensure the aspect is correct.
|
|
40
|
+
const vp = core_frontend_1.OffScreenViewport.create({ view: result, viewRect: new core_frontend_1.ViewRect(0, 0, vector.x, vector.y) });
|
|
41
|
+
const frustum = vp.getFrustum();
|
|
42
|
+
this._preloadedFrustum.push(frustum.transformBy(transform));
|
|
43
|
+
}).catch((err) => { core_bentley_1.Logger.logException("FrontendDevTools", err); });
|
|
44
|
+
}
|
|
45
|
+
preload(viewport) {
|
|
46
|
+
this._loading = true;
|
|
47
|
+
const iModel = viewport.iModel;
|
|
48
|
+
const view = viewport.view;
|
|
49
|
+
const viewId = view.id;
|
|
50
|
+
const loadPromises = [];
|
|
51
|
+
loadPromises.push(this.getFrustumForViewId(iModel, viewId));
|
|
52
|
+
if (view.isDrawingView() && view.sectionDrawingInfo.spatialView)
|
|
53
|
+
loadPromises.push(this.getFrustumForViewId(iModel, view.sectionDrawingInfo.spatialView, view.sectionDrawingInfo.drawingToSpatialTransform.inverse()));
|
|
54
|
+
void Promise.all(loadPromises).finally(() => {
|
|
55
|
+
core_frontend_1.IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
|
|
56
|
+
this._viewId = viewId;
|
|
57
|
+
this._loading = false;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
|
|
61
|
+
useCachedDecorations = true;
|
|
62
|
+
decorate(context) {
|
|
63
|
+
if (context.viewport.view.id !== this._viewId && !this._loading) {
|
|
64
|
+
this._preloadedFrustum.length = 0;
|
|
65
|
+
// just clear the decoration if the view is not from a view definition
|
|
66
|
+
if (core_bentley_1.Id64.isValidId64(context.viewport.view.id))
|
|
67
|
+
this.preload(context.viewport);
|
|
68
|
+
}
|
|
69
|
+
const builder = context.createGraphicBuilder(core_frontend_1.GraphicType.WorldDecoration);
|
|
70
|
+
const purple = core_common_1.ColorDef.fromString("#800080");
|
|
71
|
+
// The current view's frustum is at the end of the array.
|
|
72
|
+
builder.setSymbology(purple, purple, 5, core_common_1.LinePixels.Code0);
|
|
73
|
+
const endIndex = this._preloadedFrustum.length - 1;
|
|
74
|
+
const currentFrustum = this._preloadedFrustum[endIndex];
|
|
75
|
+
if (currentFrustum)
|
|
76
|
+
builder.addFrustum(currentFrustum);
|
|
77
|
+
// Add other frustums.
|
|
78
|
+
builder.setSymbology(purple, purple, 4, core_common_1.LinePixels.Code2);
|
|
79
|
+
const remainingFrustums = this._preloadedFrustum.slice(0, endIndex);
|
|
80
|
+
remainingFrustums.forEach((frustum) => builder.addFrustum(frustum));
|
|
81
|
+
context.addDecorationFromBuilder(builder);
|
|
82
|
+
}
|
|
83
|
+
static toggle(enabled) {
|
|
84
|
+
const instance = ViewDefinitionDecoration._instance;
|
|
85
|
+
if (undefined !== enabled && (undefined !== instance) === enabled)
|
|
86
|
+
return;
|
|
87
|
+
if (undefined === instance) {
|
|
88
|
+
ViewDefinitionDecoration._instance = new ViewDefinitionDecoration();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
instance.stop();
|
|
92
|
+
ViewDefinitionDecoration._instance = undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.
|
|
97
|
+
* @beta
|
|
98
|
+
*/
|
|
99
|
+
class ViewDefinitionDecorationTool extends core_frontend_1.Tool {
|
|
100
|
+
static toolId = "ViewDefinitionDecorationTool";
|
|
101
|
+
static get minArgs() { return 0; }
|
|
102
|
+
static get maxArgs() { return 1; }
|
|
103
|
+
async run(enable) {
|
|
104
|
+
ViewDefinitionDecoration.toggle(enable);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
async parseAndRun(...args) {
|
|
108
|
+
const enable = (0, parseToggle_1.parseToggle)(args[0]);
|
|
109
|
+
if (typeof enable !== "string")
|
|
110
|
+
await this.run(enable);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.ViewDefinitionDecorationTool = ViewDefinitionDecorationTool;
|
|
115
|
+
//# sourceMappingURL=ViewDefinitionDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewDefinitionDecorator.js","sourceRoot":"","sources":["../../../src/tools/ViewDefinitionDecorator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,oDAAmE;AACnE,wDAA8I;AAC9I,+CAA4C;AAC5C,sDAA+D;AAC/D,wDAA2D;AAE3D,MAAM,wBAAwB;IACpB,MAAM,CAAC,SAAS,CAA4B;IAC5C,SAAS,CAAc;IAE/B;QACE,IAAI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AAQ,CAAC,KAAK,OAAO;YAC/D,OAAO;QAET,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,wBAAwB,CAAC,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChB,wBAAwB,CAAC,SAAS,GAAG,SAAS,CAAC;QACjD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAa,4BAA6B,SAAQ,oBAAI;IAC7C,MAAM,CAAU,MAAM,GAAG,8BAA8B,CAAC;IACxD,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAhBH,oEAiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport { ColorDef, Frustum, LinePixels } from \"@itwin/core-common\";\r\nimport { DecorateContext, GraphicType, IModelApp, IModelConnection, OffScreenViewport, Tool, Viewport, ViewRect } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { Id64, Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { Transform, Vector2d } from \"@itwin/core-geometry\";\r\n\r\nclass ViewDefinitionDecoration {\r\n private static _instance?: ViewDefinitionDecoration;\r\n private _removeMe?: () => void;\r\n\r\n private constructor() {\r\n this._removeMe = IModelApp.viewManager.addDecorator(this);\r\n }\r\n\r\n private stop() {\r\n if (this._removeMe) {\r\n this._removeMe();\r\n this._removeMe = undefined;\r\n }\r\n }\r\n\r\n private _viewId?: Id64String;\r\n private _loading: boolean = false;\r\n private _preloadedFrustum: Frustum[] = [];\r\n\r\n private async getFrustumForViewId(iModel: IModelConnection, viewId: Id64String, transform: Transform = Transform.createIdentity()): Promise<void> {\r\n return iModel.views.load(viewId).then((result) => {\r\n // Use the view extents/delta\r\n let vector: Vector2d;\r\n if (result.is2d()) vector = Vector2d.create(result.delta.x, result.delta.y);\r\n else vector = Vector2d.create(result.getExtents().x, result.getExtents().y);\r\n // create a viewport to the size of the extents to ensure the aspect is correct.\r\n const vp = OffScreenViewport.create({ view: result, viewRect: new ViewRect(0,0,vector.x,vector.y) });\r\n const frustum = vp.getFrustum();\r\n this._preloadedFrustum.push(frustum.transformBy(transform));\r\n\r\n }).catch((err: unknown) => { Logger.logException(\"FrontendDevTools\", err)});\r\n }\r\n\r\n public preload(viewport: Viewport) {\r\n this._loading = true;\r\n const iModel = viewport.iModel;\r\n const view = viewport.view;\r\n const viewId = view.id;\r\n\r\n const loadPromises: Promise<void>[] = [];\r\n loadPromises.push(this.getFrustumForViewId(iModel, viewId));\r\n\r\n if (view.isDrawingView() && view.sectionDrawingInfo.spatialView)\r\n loadPromises.push(this.getFrustumForViewId(iModel, view.sectionDrawingInfo.spatialView, view.sectionDrawingInfo.drawingToSpatialTransform.inverse()));\r\n\r\n void Promise.all(loadPromises).finally(() => {\r\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\r\n this._viewId = viewId;\r\n this._loading = false;\r\n });\r\n }\r\n\r\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\r\n public readonly useCachedDecorations = true;\r\n\r\n public decorate(context: DecorateContext): void {\r\n if (context.viewport.view.id !== this._viewId && !this._loading) {\r\n this._preloadedFrustum.length = 0;\r\n // just clear the decoration if the view is not from a view definition\r\n if (Id64.isValidId64(context.viewport.view.id))\r\n this.preload(context.viewport);\r\n }\r\n\r\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\r\n const purple = ColorDef.fromString(\"#800080\");\r\n\r\n // The current view's frustum is at the end of the array.\r\n builder.setSymbology(purple, purple, 5, LinePixels.Code0);\r\n const endIndex = this._preloadedFrustum.length - 1;\r\n const currentFrustum = this._preloadedFrustum[endIndex];\r\n if (currentFrustum) builder.addFrustum(currentFrustum);\r\n\r\n // Add other frustums.\r\n builder.setSymbology(purple, purple, 4, LinePixels.Code2);\r\n const remainingFrustums = this._preloadedFrustum.slice(0, endIndex);\r\n remainingFrustums.forEach((frustum) => builder.addFrustum(frustum));\r\n\r\n context.addDecorationFromBuilder(builder);\r\n }\r\n\r\n public static toggle(enabled?: boolean): void {\r\n const instance = ViewDefinitionDecoration._instance;\r\n if (undefined !== enabled && (undefined !== instance) === enabled)\r\n return;\r\n\r\n if (undefined === instance) {\r\n ViewDefinitionDecoration._instance = new ViewDefinitionDecoration();\r\n } else {\r\n instance.stop();\r\n ViewDefinitionDecoration._instance = undefined;\r\n }\r\n }\r\n}\r\n\r\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\r\n * @beta\r\n */\r\nexport class ViewDefinitionDecorationTool extends Tool {\r\n public static override toolId = \"ViewDefinitionDecorationTool\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n public override async run(enable?: boolean): Promise<boolean> {\r\n ViewDefinitionDecoration.toggle(enable);\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;AAmEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
|
|
@@ -41,6 +41,7 @@ import { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from
|
|
|
41
41
|
import { ToggleTileRequestDecorationTool } from "./tools/TileRequestDecoration";
|
|
42
42
|
import { ToggleTileTreeBoundsDecorationTool } from "./tools/TileTreeBoundsDecoration";
|
|
43
43
|
import { ToggleToolTipsTool } from "./tools/ToolTipProvider";
|
|
44
|
+
import { ViewDefinitionDecorationTool } from "./tools/ViewDefinitionDecorator";
|
|
44
45
|
/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].
|
|
45
46
|
* @beta
|
|
46
47
|
*/
|
|
@@ -165,6 +166,7 @@ export class FrontendDevTools {
|
|
|
165
166
|
ToggleViewAttachmentBoundariesTool,
|
|
166
167
|
ToggleViewAttachmentClipShapesTool,
|
|
167
168
|
ToggleViewAttachmentsTool,
|
|
169
|
+
ViewDefinitionDecorationTool,
|
|
168
170
|
ToggleWiremeshTool,
|
|
169
171
|
ToggleRealityTileBounds,
|
|
170
172
|
ToggleRealityTilePreload,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontEndDevTools.js","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F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gBAAgB,CAAC;IAC1B,CAAC;IAEO,MAAM,CAAC,QAAQ;QACrB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\r\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\r\nimport { ExplosionEffect } from \"./effects/Explosion\";\r\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\r\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\r\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\r\nimport { SnowEffect } from \"./effects/Snow\";\r\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\r\nimport {\r\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\r\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\r\n} from \"./tools/PlanarMaskTools\";\r\nimport {\r\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\r\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\r\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n} from \"./tools/ViewportTools\";\r\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\r\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\r\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\r\nimport {\r\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\r\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\r\n} from \"./tools/DisplayStyleTools\";\r\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\r\nimport {\r\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\r\n} from \"./tools/EmphasizeElementsTool\";\r\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\r\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\r\nimport {\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\r\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\r\n} from \"./tools/MapLayerTool\";\r\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\r\nimport {\r\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\r\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\r\n} from \"./tools/ModelAppearanceTools\";\r\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\r\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\r\nimport {\r\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\r\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\r\n} from \"./tools/RealityModelTools\";\r\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\r\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\r\nimport {\r\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\r\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\r\n} from \"./tools/RenderTargetTools\";\r\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\r\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\r\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\r\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\r\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\r\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\r\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\r\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\r\n\r\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\r\n * @beta\r\n */\r\nexport class FrontendDevTools {\r\n private static _initialized = false;\r\n\r\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\r\n * To initialize when starting up your app:\r\n * ```ts\r\n * IModelApp.startup();\r\n * await FrontendDevTools.initialize();\r\n * ```\r\n * @beta\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (this._initialized)\r\n return;\r\n\r\n this._initialized = true;\r\n\r\n // clean up if we're being shut down\r\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\r\n\r\n const namespace = \"FrontendDevTools\";\r\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\r\n const tools = [\r\n AttachMapLayerTool,\r\n AttachMapOverlayTool,\r\n AttachModelMapLayerTool,\r\n AttachArcGISMapLayerByUrlTool,\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachOgcApiFeaturesMapLayerTool,\r\n AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool,\r\n AttachTileURLMapLayerByUrlTool,\r\n AnimationIntervalTool,\r\n ApplyRenderingStyleTool,\r\n ApplyViewByIdTool,\r\n ApplyViewTool,\r\n ChangeBackgroundColorTool,\r\n ChangeCameraTool,\r\n ChangeEmphasisSettingsTool,\r\n ChangeFlashSettingsTool,\r\n ChangeHiliteModeTool,\r\n ChangeHiliteSettingsTool,\r\n ChangePlanProjectionSettingsTool,\r\n ChangeUnitsTool,\r\n ChangeViewFlagsTool,\r\n ClearEffectsTool,\r\n ClearEmphasizedElementsTool,\r\n ClearIsolatedElementsTool,\r\n ClipColorTool,\r\n ClipIntersectionTool,\r\n CompileShadersTool,\r\n DefaultTileSizeModifierTool,\r\n DetachMapLayersTool,\r\n DumpPlanProjectionSettingsTool,\r\n DumpSelectionSetTool,\r\n EdgeDetectionEffect,\r\n EmbossEffect,\r\n ElementIdFromSourceAspectIdTool,\r\n EmphasizeSelectedElementsTool,\r\n EmphasizeVisibleElementsTool,\r\n ExplosionEffect,\r\n FadeOutTool,\r\n FlipImageConfig,\r\n FlipImageEffect,\r\n FreezeSceneTool,\r\n GaussianBlurEffect,\r\n InspectElementTool,\r\n IsolateSelectedElementsTool,\r\n LensDistortionConfig,\r\n LensDistortionEffect,\r\n LoseWebGLContextTool,\r\n MapLayerTransparencyTool,\r\n MapLayerVisibilityTool,\r\n MapLayerSubLayerVisibilityTool,\r\n MapLayerZoomTool,\r\n MapBaseColorTool,\r\n MapBaseTransparencyTool,\r\n MapBaseVisibilityTool,\r\n MeasureTileLoadTimeTool,\r\n OverrideSubCategoryTool,\r\n OverrideSubCategoryPriorityTool,\r\n QueryScheduleScriptTool,\r\n RealityTransitionTool,\r\n ReorderMapLayers,\r\n ReportWebGLCompatibilityTool,\r\n ReverseScheduleScriptTool,\r\n SaturationConfig,\r\n SaturationEffect,\r\n SaveRenderingStyleTool,\r\n SaveViewTool,\r\n SelectElementsByIdTool,\r\n SetAASamplesTool,\r\n SetAspectRatioSkewTool,\r\n SetScheduleScriptTool,\r\n ToggleVolClassIntersect,\r\n SetMapBaseTool,\r\n SharpenEffect,\r\n SharpnessEffect,\r\n ShowTileVolumesTool,\r\n SkyCubeTool,\r\n SkySphereTool,\r\n SnowEffect,\r\n SourceAspectIdFromElementIdTool,\r\n TestClipStyleTool,\r\n Toggle3dManipulationsTool,\r\n ToggleDrawingGraphicsTool,\r\n ToggleDPIForLODTool,\r\n ToggleDrapeFrustumTool,\r\n ToggleFrustumSnapshotTool,\r\n ToggleMaskFrustumTool,\r\n ToggleNormalMaps,\r\n TogglePrimitiveVisibilityTool,\r\n ToggleProjectExtentsTool,\r\n ToggleReadPixelsTool,\r\n ToggleSectionDrawingSpatialViewTool,\r\n ToggleSelectedViewFrustumTool,\r\n ToggleShadowFrustumTool,\r\n ToggleSkyboxTool,\r\n ToggleTileRequestDecorationTool,\r\n ToggleTileTreeBoundsDecorationTool,\r\n ToggleTileTreeReferencesTool,\r\n ToggleToolTipsTool,\r\n ToggleViewAttachmentBoundariesTool,\r\n ToggleViewAttachmentClipShapesTool,\r\n ToggleViewAttachmentsTool,\r\n ToggleWiremeshTool,\r\n ToggleRealityTileBounds,\r\n ToggleRealityTilePreload,\r\n ToggleRealityTileLogging,\r\n ToggleRealityTileFreeze,\r\n ToggleSectionCutTool,\r\n ToggleTerrainTool,\r\n UnsharpenEffect,\r\n ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n VignetteConfig,\r\n VignetteEffect,\r\n AttachRealityModelTool,\r\n DetachRealityModelTool,\r\n SaveRealityModelTool,\r\n SetGpuMemoryLimitTool,\r\n SetRealityModelLocateTool,\r\n SetRealityModelEmphasizedTool,\r\n SetRealityModelTransparencyTool,\r\n SetRealityModelColorTool,\r\n SetModelLocateTool,\r\n SetModelEmphasizedTool,\r\n SetModelTransparencyTool,\r\n SetModelColorTool,\r\n SetModelLineWeightTool,\r\n SetModelLineCodeTool,\r\n SetModelIgnoresMaterialsTool,\r\n ClearRealityModelAppearanceOverrides,\r\n ClearModelAppearanceOverrides,\r\n AttachCesiumAssetTool,\r\n ToggleOSMBuildingDisplay,\r\n SetHigherPriorityRealityModelMasking,\r\n SetMapHigherPriorityMasking,\r\n MaskRealityModelByModelTool,\r\n MaskRealityModelBySubCategoryTool,\r\n MaskRealityModelByElementTool,\r\n MaskRealityModelByExcludedElementTool,\r\n UnmaskRealityModelTool,\r\n MaskBackgroundMapByModelTool,\r\n MaskBackgroundMapBySubCategoryTool,\r\n MaskBackgroundMapByElementTool,\r\n MaskBackgroundMapByExcludedElementTool,\r\n UnmaskMapTool,\r\n WoWIgnoreBackgroundTool,\r\n ];\r\n\r\n for (const tool of tools)\r\n tool.register(namespace);\r\n\r\n return namespacePromise;\r\n }\r\n\r\n private static shutdown() {\r\n this._initialized = false;\r\n }\r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AA4B;YAC5B,kCAAkC;YAClC,8BAA8B;YAC9B,sCAAsC;YACtC,aAAa;YACb,uBAAuB;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","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 Utilities\r\n */\r\n\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { EdgeDetectionEffect, EmbossEffect, GaussianBlurEffect, SharpenEffect, SharpnessEffect, UnsharpenEffect } from \"./effects/Convolution\";\r\nimport { ClearEffectsTool } from \"./effects/EffectTools\";\r\nimport { ExplosionEffect } from \"./effects/Explosion\";\r\nimport { FlipImageConfig, FlipImageEffect } from \"./effects/FlipImage\";\r\nimport { LensDistortionConfig, LensDistortionEffect } from \"./effects/LensDistortion\";\r\nimport { SaturationConfig, SaturationEffect } from \"./effects/Saturation\";\r\nimport { SnowEffect } from \"./effects/Snow\";\r\nimport { VignetteConfig, VignetteEffect } from \"./effects/Vignette\";\r\nimport {\r\n MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool, MaskBackgroundMapByModelTool, MaskBackgroundMapBySubCategoryTool, MaskRealityModelByElementTool, MaskRealityModelByExcludedElementTool,\r\n MaskRealityModelByModelTool, MaskRealityModelBySubCategoryTool, SetHigherPriorityRealityModelMasking, SetMapHigherPriorityMasking, UnmaskMapTool, UnmaskRealityModelTool,\r\n} from \"./tools/PlanarMaskTools\";\r\nimport {\r\n ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool,\r\n FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool,\r\n ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n} from \"./tools/ViewportTools\";\r\nimport { AnimationIntervalTool } from \"./tools/AnimationIntervalTool\";\r\nimport { ChangeUnitsTool } from \"./tools/ChangeUnitsTool\";\r\nimport { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from \"./tools/ClipTools\";\r\nimport {\r\n ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool,\r\n SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool,\r\n} from \"./tools/DisplayStyleTools\";\r\nimport { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from \"./tools/ScheduleScriptTools\";\r\nimport {\r\n ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool,\r\n} from \"./tools/EmphasizeElementsTool\";\r\nimport { ToggleFrustumSnapshotTool, ToggleSelectedViewFrustumTool, ToggleShadowFrustumTool } from \"./tools/FrustumDecoration\";\r\nimport { InspectElementTool } from \"./tools/InspectElementTool\";\r\nimport {\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachArcGISMapLayerByUrlTool, AttachMapLayerTool, AttachMapOverlayTool, AttachModelMapLayerTool, AttachOgcApiFeaturesMapLayerTool, AttachTileURLMapLayerByUrlTool, AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool, DetachMapLayersTool, MapBaseColorTool, MapBaseTransparencyTool, MapBaseVisibilityTool, MapLayerSubLayerVisibilityTool,\r\n MapLayerTransparencyTool, MapLayerVisibilityTool, MapLayerZoomTool, ReorderMapLayers, SetMapBaseTool, ToggleTerrainTool,\r\n} from \"./tools/MapLayerTool\";\r\nimport { MeasureTileLoadTimeTool } from \"./tools/MeasureTileLoadTime\";\r\nimport {\r\n ClearModelAppearanceOverrides, SetModelColorTool, SetModelEmphasizedTool, SetModelIgnoresMaterialsTool, SetModelLineCodeTool,\r\n SetModelLineWeightTool, SetModelLocateTool, SetModelTransparencyTool,\r\n} from \"./tools/ModelAppearanceTools\";\r\nimport { ChangePlanProjectionSettingsTool, DumpPlanProjectionSettingsTool, OverrideSubCategoryPriorityTool } from \"./tools/PlanProjectionTools\";\r\nimport { ToggleProjectExtentsTool } from \"./tools/ProjectExtents\";\r\nimport {\r\n AttachCesiumAssetTool, AttachRealityModelTool, ClearRealityModelAppearanceOverrides, DetachRealityModelTool, SaveRealityModelTool,\r\n SetRealityModelColorTool, SetRealityModelEmphasizedTool, SetRealityModelLocateTool, SetRealityModelTransparencyTool, ToggleOSMBuildingDisplay,\r\n} from \"./tools/RealityModelTools\";\r\nimport { RealityTransitionTool } from \"./tools/RealityTransitionTool\";\r\nimport { CompileShadersTool, LoseWebGLContextTool, ToggleDPIForLODTool } from \"./tools/RenderSystemTools\";\r\nimport {\r\n SetAASamplesTool, ToggleDrapeFrustumTool, ToggleMaskFrustumTool, ToggleNormalMaps, TogglePrimitiveVisibilityTool, ToggleReadPixelsTool, ToggleRealityTileBounds, ToggleRealityTileFreeze,\r\n ToggleRealityTileLogging, ToggleRealityTilePreload, ToggleVolClassIntersect,\r\n} from \"./tools/RenderTargetTools\";\r\nimport { ReportWebGLCompatibilityTool } from \"./tools/ReportWebGLCompatibilityTool\";\r\nimport { ApplyViewByIdTool, ApplyViewTool, SaveViewTool } from \"./tools/SavedViews\";\r\nimport { DumpSelectionSetTool, SelectElementsByIdTool } from \"./tools/SelectionTools\";\r\nimport { SetGpuMemoryLimitTool } from \"./tools/SetGpuMemoryLimitTool\";\r\nimport { ElementIdFromSourceAspectIdTool, SourceAspectIdFromElementIdTool } from \"./tools/SourceAspectIdTools\";\r\nimport { ToggleTileRequestDecorationTool } from \"./tools/TileRequestDecoration\";\r\nimport { ToggleTileTreeBoundsDecorationTool } from \"./tools/TileTreeBoundsDecoration\";\r\nimport { ToggleToolTipsTool } from \"./tools/ToolTipProvider\";\r\nimport { ViewDefinitionDecorationTool } from \"./tools/ViewDefinitionDecorator\";\r\n\r\n/** Entry-point for the package. Before using the package you *must* call [[FrontendDevTools.initialize]].\r\n * @beta\r\n */\r\nexport class FrontendDevTools {\r\n private static _initialized = false;\r\n\r\n /** Call this before using the package (e.g., before instantiating any of its widgets or attempting to use any of its tools.\r\n * To initialize when starting up your app:\r\n * ```ts\r\n * IModelApp.startup();\r\n * await FrontendDevTools.initialize();\r\n * ```\r\n * @beta\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (this._initialized)\r\n return;\r\n\r\n this._initialized = true;\r\n\r\n // clean up if we're being shut down\r\n IModelApp.onBeforeShutdown.addListener(() => this.shutdown());\r\n\r\n const namespace = \"FrontendDevTools\";\r\n const namespacePromise = IModelApp.localization.registerNamespace(namespace);\r\n const tools = [\r\n AttachMapLayerTool,\r\n AttachMapOverlayTool,\r\n AttachModelMapLayerTool,\r\n AttachArcGISMapLayerByUrlTool,\r\n AttachArcGISFeatureMapLayerByUrlTool,\r\n AttachOgcApiFeaturesMapLayerTool,\r\n AttachWmsMapLayerByUrlTool,\r\n AttachWmtsMapLayerByUrlTool,\r\n AttachTileURLMapLayerByUrlTool,\r\n AnimationIntervalTool,\r\n ApplyRenderingStyleTool,\r\n ApplyViewByIdTool,\r\n ApplyViewTool,\r\n ChangeBackgroundColorTool,\r\n ChangeCameraTool,\r\n ChangeEmphasisSettingsTool,\r\n ChangeFlashSettingsTool,\r\n ChangeHiliteModeTool,\r\n ChangeHiliteSettingsTool,\r\n ChangePlanProjectionSettingsTool,\r\n ChangeUnitsTool,\r\n ChangeViewFlagsTool,\r\n ClearEffectsTool,\r\n ClearEmphasizedElementsTool,\r\n ClearIsolatedElementsTool,\r\n ClipColorTool,\r\n ClipIntersectionTool,\r\n CompileShadersTool,\r\n DefaultTileSizeModifierTool,\r\n DetachMapLayersTool,\r\n DumpPlanProjectionSettingsTool,\r\n DumpSelectionSetTool,\r\n EdgeDetectionEffect,\r\n EmbossEffect,\r\n ElementIdFromSourceAspectIdTool,\r\n EmphasizeSelectedElementsTool,\r\n EmphasizeVisibleElementsTool,\r\n ExplosionEffect,\r\n FadeOutTool,\r\n FlipImageConfig,\r\n FlipImageEffect,\r\n FreezeSceneTool,\r\n GaussianBlurEffect,\r\n InspectElementTool,\r\n IsolateSelectedElementsTool,\r\n LensDistortionConfig,\r\n LensDistortionEffect,\r\n LoseWebGLContextTool,\r\n MapLayerTransparencyTool,\r\n MapLayerVisibilityTool,\r\n MapLayerSubLayerVisibilityTool,\r\n MapLayerZoomTool,\r\n MapBaseColorTool,\r\n MapBaseTransparencyTool,\r\n MapBaseVisibilityTool,\r\n MeasureTileLoadTimeTool,\r\n OverrideSubCategoryTool,\r\n OverrideSubCategoryPriorityTool,\r\n QueryScheduleScriptTool,\r\n RealityTransitionTool,\r\n ReorderMapLayers,\r\n ReportWebGLCompatibilityTool,\r\n ReverseScheduleScriptTool,\r\n SaturationConfig,\r\n SaturationEffect,\r\n SaveRenderingStyleTool,\r\n SaveViewTool,\r\n SelectElementsByIdTool,\r\n SetAASamplesTool,\r\n SetAspectRatioSkewTool,\r\n SetScheduleScriptTool,\r\n ToggleVolClassIntersect,\r\n SetMapBaseTool,\r\n SharpenEffect,\r\n SharpnessEffect,\r\n ShowTileVolumesTool,\r\n SkyCubeTool,\r\n SkySphereTool,\r\n SnowEffect,\r\n SourceAspectIdFromElementIdTool,\r\n TestClipStyleTool,\r\n Toggle3dManipulationsTool,\r\n ToggleDrawingGraphicsTool,\r\n ToggleDPIForLODTool,\r\n ToggleDrapeFrustumTool,\r\n ToggleFrustumSnapshotTool,\r\n ToggleMaskFrustumTool,\r\n ToggleNormalMaps,\r\n TogglePrimitiveVisibilityTool,\r\n ToggleProjectExtentsTool,\r\n ToggleReadPixelsTool,\r\n ToggleSectionDrawingSpatialViewTool,\r\n ToggleSelectedViewFrustumTool,\r\n ToggleShadowFrustumTool,\r\n ToggleSkyboxTool,\r\n ToggleTileRequestDecorationTool,\r\n ToggleTileTreeBoundsDecorationTool,\r\n ToggleTileTreeReferencesTool,\r\n ToggleToolTipsTool,\r\n ToggleViewAttachmentBoundariesTool,\r\n ToggleViewAttachmentClipShapesTool,\r\n ToggleViewAttachmentsTool,\r\n ViewDefinitionDecorationTool,\r\n ToggleWiremeshTool,\r\n ToggleRealityTileBounds,\r\n ToggleRealityTilePreload,\r\n ToggleRealityTileLogging,\r\n ToggleRealityTileFreeze,\r\n ToggleSectionCutTool,\r\n ToggleTerrainTool,\r\n UnsharpenEffect,\r\n ViewportAddRealityModel,\r\n ViewportTileSizeModifierTool,\r\n VignetteConfig,\r\n VignetteEffect,\r\n AttachRealityModelTool,\r\n DetachRealityModelTool,\r\n SaveRealityModelTool,\r\n SetGpuMemoryLimitTool,\r\n SetRealityModelLocateTool,\r\n SetRealityModelEmphasizedTool,\r\n SetRealityModelTransparencyTool,\r\n SetRealityModelColorTool,\r\n SetModelLocateTool,\r\n SetModelEmphasizedTool,\r\n SetModelTransparencyTool,\r\n SetModelColorTool,\r\n SetModelLineWeightTool,\r\n SetModelLineCodeTool,\r\n SetModelIgnoresMaterialsTool,\r\n ClearRealityModelAppearanceOverrides,\r\n ClearModelAppearanceOverrides,\r\n AttachCesiumAssetTool,\r\n ToggleOSMBuildingDisplay,\r\n SetHigherPriorityRealityModelMasking,\r\n SetMapHigherPriorityMasking,\r\n MaskRealityModelByModelTool,\r\n MaskRealityModelBySubCategoryTool,\r\n MaskRealityModelByElementTool,\r\n MaskRealityModelByExcludedElementTool,\r\n UnmaskRealityModelTool,\r\n MaskBackgroundMapByModelTool,\r\n MaskBackgroundMapBySubCategoryTool,\r\n MaskBackgroundMapByElementTool,\r\n MaskBackgroundMapByExcludedElementTool,\r\n UnmaskMapTool,\r\n WoWIgnoreBackgroundTool,\r\n ];\r\n\r\n for (const tool of tools)\r\n tool.register(namespace);\r\n\r\n return namespacePromise;\r\n }\r\n\r\n private static shutdown() {\r\n this._initialized = false;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tool } from "@itwin/core-frontend";
|
|
2
|
+
/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export declare class ViewDefinitionDecorationTool extends Tool {
|
|
6
|
+
static toolId: string;
|
|
7
|
+
static get minArgs(): number;
|
|
8
|
+
static get maxArgs(): number;
|
|
9
|
+
run(enable?: boolean): Promise<boolean>;
|
|
10
|
+
parseAndRun(...args: string[]): Promise<boolean>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ViewDefinitionDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewDefinitionDecorator.d.ts","sourceRoot":"","sources":["../../../src/tools/ViewDefinitionDecorator.ts"],"names":[],"mappings":"AAUA,OAAO,EAAgF,IAAI,EAAsB,MAAM,sBAAsB,CAAC;AAmG9I;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,IAAI;IACpD,OAAuB,MAAM,SAAkC;IAC/D,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Tools
|
|
7
|
+
*/
|
|
8
|
+
import { ColorDef, LinePixels } from "@itwin/core-common";
|
|
9
|
+
import { GraphicType, IModelApp, OffScreenViewport, Tool, ViewRect } from "@itwin/core-frontend";
|
|
10
|
+
import { parseToggle } from "./parseToggle";
|
|
11
|
+
import { Id64, Logger } from "@itwin/core-bentley";
|
|
12
|
+
import { Transform, Vector2d } from "@itwin/core-geometry";
|
|
13
|
+
class ViewDefinitionDecoration {
|
|
14
|
+
static _instance;
|
|
15
|
+
_removeMe;
|
|
16
|
+
constructor() {
|
|
17
|
+
this._removeMe = IModelApp.viewManager.addDecorator(this);
|
|
18
|
+
}
|
|
19
|
+
stop() {
|
|
20
|
+
if (this._removeMe) {
|
|
21
|
+
this._removeMe();
|
|
22
|
+
this._removeMe = undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_viewId;
|
|
26
|
+
_loading = false;
|
|
27
|
+
_preloadedFrustum = [];
|
|
28
|
+
async getFrustumForViewId(iModel, viewId, transform = Transform.createIdentity()) {
|
|
29
|
+
return iModel.views.load(viewId).then((result) => {
|
|
30
|
+
// Use the view extents/delta
|
|
31
|
+
let vector;
|
|
32
|
+
if (result.is2d())
|
|
33
|
+
vector = Vector2d.create(result.delta.x, result.delta.y);
|
|
34
|
+
else
|
|
35
|
+
vector = Vector2d.create(result.getExtents().x, result.getExtents().y);
|
|
36
|
+
// create a viewport to the size of the extents to ensure the aspect is correct.
|
|
37
|
+
const vp = OffScreenViewport.create({ view: result, viewRect: new ViewRect(0, 0, vector.x, vector.y) });
|
|
38
|
+
const frustum = vp.getFrustum();
|
|
39
|
+
this._preloadedFrustum.push(frustum.transformBy(transform));
|
|
40
|
+
}).catch((err) => { Logger.logException("FrontendDevTools", err); });
|
|
41
|
+
}
|
|
42
|
+
preload(viewport) {
|
|
43
|
+
this._loading = true;
|
|
44
|
+
const iModel = viewport.iModel;
|
|
45
|
+
const view = viewport.view;
|
|
46
|
+
const viewId = view.id;
|
|
47
|
+
const loadPromises = [];
|
|
48
|
+
loadPromises.push(this.getFrustumForViewId(iModel, viewId));
|
|
49
|
+
if (view.isDrawingView() && view.sectionDrawingInfo.spatialView)
|
|
50
|
+
loadPromises.push(this.getFrustumForViewId(iModel, view.sectionDrawingInfo.spatialView, view.sectionDrawingInfo.drawingToSpatialTransform.inverse()));
|
|
51
|
+
void Promise.all(loadPromises).finally(() => {
|
|
52
|
+
IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
|
|
53
|
+
this._viewId = viewId;
|
|
54
|
+
this._loading = false;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
|
|
58
|
+
useCachedDecorations = true;
|
|
59
|
+
decorate(context) {
|
|
60
|
+
if (context.viewport.view.id !== this._viewId && !this._loading) {
|
|
61
|
+
this._preloadedFrustum.length = 0;
|
|
62
|
+
// just clear the decoration if the view is not from a view definition
|
|
63
|
+
if (Id64.isValidId64(context.viewport.view.id))
|
|
64
|
+
this.preload(context.viewport);
|
|
65
|
+
}
|
|
66
|
+
const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);
|
|
67
|
+
const purple = ColorDef.fromString("#800080");
|
|
68
|
+
// The current view's frustum is at the end of the array.
|
|
69
|
+
builder.setSymbology(purple, purple, 5, LinePixels.Code0);
|
|
70
|
+
const endIndex = this._preloadedFrustum.length - 1;
|
|
71
|
+
const currentFrustum = this._preloadedFrustum[endIndex];
|
|
72
|
+
if (currentFrustum)
|
|
73
|
+
builder.addFrustum(currentFrustum);
|
|
74
|
+
// Add other frustums.
|
|
75
|
+
builder.setSymbology(purple, purple, 4, LinePixels.Code2);
|
|
76
|
+
const remainingFrustums = this._preloadedFrustum.slice(0, endIndex);
|
|
77
|
+
remainingFrustums.forEach((frustum) => builder.addFrustum(frustum));
|
|
78
|
+
context.addDecorationFromBuilder(builder);
|
|
79
|
+
}
|
|
80
|
+
static toggle(enabled) {
|
|
81
|
+
const instance = ViewDefinitionDecoration._instance;
|
|
82
|
+
if (undefined !== enabled && (undefined !== instance) === enabled)
|
|
83
|
+
return;
|
|
84
|
+
if (undefined === instance) {
|
|
85
|
+
ViewDefinitionDecoration._instance = new ViewDefinitionDecoration();
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
instance.stop();
|
|
89
|
+
ViewDefinitionDecoration._instance = undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.
|
|
94
|
+
* @beta
|
|
95
|
+
*/
|
|
96
|
+
export class ViewDefinitionDecorationTool extends Tool {
|
|
97
|
+
static toolId = "ViewDefinitionDecorationTool";
|
|
98
|
+
static get minArgs() { return 0; }
|
|
99
|
+
static get maxArgs() { return 1; }
|
|
100
|
+
async run(enable) {
|
|
101
|
+
ViewDefinitionDecoration.toggle(enable);
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
async parseAndRun(...args) {
|
|
105
|
+
const enable = parseToggle(args[0]);
|
|
106
|
+
if (typeof enable !== "string")
|
|
107
|
+
await this.run(enable);
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=ViewDefinitionDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewDefinitionDecorator.js","sourceRoot":"","sources":["../../../src/tools/ViewDefinitionDecorator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAW,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAmB,WAAW,EAAE,SAAS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;QACpE,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;QAEpE,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAiB;QACpC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,SAAS,CAAC;QACpD,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,KAAK,OAAO;YAC/D,OAAO;QAET,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,wBAAwB,CAAC,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChB,wBAAwB,CAAC,SAAS,GAAG,SAAS,CAAC;QACjD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,IAAI;IAC7C,MAAM,CAAU,MAAM,GAAG,8BAA8B,CAAC;IACxD,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Tools\r\n */\r\n\r\nimport { ColorDef, Frustum, LinePixels } from \"@itwin/core-common\";\r\nimport { DecorateContext, GraphicType, IModelApp, IModelConnection, OffScreenViewport, Tool, Viewport, ViewRect } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { Id64, Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { Transform, Vector2d } from \"@itwin/core-geometry\";\r\n\r\nclass ViewDefinitionDecoration {\r\n private static _instance?: ViewDefinitionDecoration;\r\n private _removeMe?: () => void;\r\n\r\n private constructor() {\r\n this._removeMe = IModelApp.viewManager.addDecorator(this);\r\n }\r\n\r\n private stop() {\r\n if (this._removeMe) {\r\n this._removeMe();\r\n this._removeMe = undefined;\r\n }\r\n }\r\n\r\n private _viewId?: Id64String;\r\n private _loading: boolean = false;\r\n private _preloadedFrustum: Frustum[] = [];\r\n\r\n private async getFrustumForViewId(iModel: IModelConnection, viewId: Id64String, transform: Transform = Transform.createIdentity()): Promise<void> {\r\n return iModel.views.load(viewId).then((result) => {\r\n // Use the view extents/delta\r\n let vector: Vector2d;\r\n if (result.is2d()) vector = Vector2d.create(result.delta.x, result.delta.y);\r\n else vector = Vector2d.create(result.getExtents().x, result.getExtents().y);\r\n // create a viewport to the size of the extents to ensure the aspect is correct.\r\n const vp = OffScreenViewport.create({ view: result, viewRect: new ViewRect(0,0,vector.x,vector.y) });\r\n const frustum = vp.getFrustum();\r\n this._preloadedFrustum.push(frustum.transformBy(transform));\r\n\r\n }).catch((err: unknown) => { Logger.logException(\"FrontendDevTools\", err)});\r\n }\r\n\r\n public preload(viewport: Viewport) {\r\n this._loading = true;\r\n const iModel = viewport.iModel;\r\n const view = viewport.view;\r\n const viewId = view.id;\r\n\r\n const loadPromises: Promise<void>[] = [];\r\n loadPromises.push(this.getFrustumForViewId(iModel, viewId));\r\n\r\n if (view.isDrawingView() && view.sectionDrawingInfo.spatialView)\r\n loadPromises.push(this.getFrustumForViewId(iModel, view.sectionDrawingInfo.spatialView, view.sectionDrawingInfo.drawingToSpatialTransform.inverse()));\r\n\r\n void Promise.all(loadPromises).finally(() => {\r\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\r\n this._viewId = viewId;\r\n this._loading = false;\r\n });\r\n }\r\n\r\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\r\n public readonly useCachedDecorations = true;\r\n\r\n public decorate(context: DecorateContext): void {\r\n if (context.viewport.view.id !== this._viewId && !this._loading) {\r\n this._preloadedFrustum.length = 0;\r\n // just clear the decoration if the view is not from a view definition\r\n if (Id64.isValidId64(context.viewport.view.id))\r\n this.preload(context.viewport);\r\n }\r\n\r\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\r\n const purple = ColorDef.fromString(\"#800080\");\r\n\r\n // The current view's frustum is at the end of the array.\r\n builder.setSymbology(purple, purple, 5, LinePixels.Code0);\r\n const endIndex = this._preloadedFrustum.length - 1;\r\n const currentFrustum = this._preloadedFrustum[endIndex];\r\n if (currentFrustum) builder.addFrustum(currentFrustum);\r\n\r\n // Add other frustums.\r\n builder.setSymbology(purple, purple, 4, LinePixels.Code2);\r\n const remainingFrustums = this._preloadedFrustum.slice(0, endIndex);\r\n remainingFrustums.forEach((frustum) => builder.addFrustum(frustum));\r\n\r\n context.addDecorationFromBuilder(builder);\r\n }\r\n\r\n public static toggle(enabled?: boolean): void {\r\n const instance = ViewDefinitionDecoration._instance;\r\n if (undefined !== enabled && (undefined !== instance) === enabled)\r\n return;\r\n\r\n if (undefined === instance) {\r\n ViewDefinitionDecoration._instance = new ViewDefinitionDecoration();\r\n } else {\r\n instance.stop();\r\n ViewDefinitionDecoration._instance = undefined;\r\n }\r\n }\r\n}\r\n\r\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\r\n * @beta\r\n */\r\nexport class ViewDefinitionDecorationTool extends Tool {\r\n public static override toolId = \"ViewDefinitionDecorationTool\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n public override async run(enable?: boolean): Promise<boolean> {\r\n ViewDefinitionDecoration.toggle(enable);\r\n return true;\r\n }\r\n\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n const enable = parseToggle(args[0]);\r\n if (typeof enable !== \"string\")\r\n await this.run(enable);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/frontend-devtools",
|
|
3
|
-
"version": "5.5.0-dev.
|
|
3
|
+
"version": "5.5.0-dev.4",
|
|
4
4
|
"description": "Debug menu and supporting UI widgets",
|
|
5
5
|
"main": "lib/cjs/frontend-devtools.js",
|
|
6
6
|
"module": "lib/esm/frontend-devtools.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"file-saver": "^2.0.2",
|
|
27
|
-
"@itwin/core-
|
|
28
|
-
"@itwin/core-
|
|
29
|
-
"@itwin/core-
|
|
30
|
-
"@itwin/core-
|
|
27
|
+
"@itwin/core-bentley": "5.5.0-dev.4",
|
|
28
|
+
"@itwin/core-common": "5.5.0-dev.4",
|
|
29
|
+
"@itwin/core-frontend": "5.5.0-dev.4",
|
|
30
|
+
"@itwin/core-geometry": "5.5.0-dev.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"eslint": "^9.31.0",
|
|
37
37
|
"rimraf": "^6.0.1",
|
|
38
38
|
"typescript": "~5.6.2",
|
|
39
|
-
"@itwin/build-tools": "5.5.0-dev.
|
|
39
|
+
"@itwin/build-tools": "5.5.0-dev.4"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm",
|