@itwin/frontend-devtools 4.3.0-dev.22 → 4.3.0-dev.24

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/README.md CHANGED
@@ -345,6 +345,11 @@ These keysins control the planar masking of reality models.
345
345
  * "clear": Clear all clip colors
346
346
  * "inside `<color string>` | clear": Set or clear an inside clip color
347
347
  * "outside `<color string>` | clear": Set or clear an outside clip color
348
+ * `fdt clip intersection` - Specify or unspecify an intersection style to be applied to geometry intersecting the defined clip planes. Geometry at this intersection will be colorized with the defined color at the defined width. `<color string>` must be in one of the following forms: "rgb(255,0,0)", "rgba(255,0,0,255)", "rgb(100%,0%,0%)", "hsl(120,50%,50%)", "#rrbbgg", "blanchedAlmond" (see possible values from `ColorByName`; case insensitive). If no argument is specified, the most recently defined intersection style will be applied (or the default style if no style has been defined). Arguments can be:
349
+ * "off": Turn off intersection style
350
+ * "default": Apply default intersection style (color: white, width: 1 pixel)
351
+ * "color `<color string>`": define the color to apply to the intersection style
352
+ * "width `<number>`": define the number of pixels considered to be intersecting the clip plane
348
353
  * `fdt sourceId from elemId` and `fdt elemId from sourceId` - Converts between the Id of an element in the iModel and the corresponding object in the source document from which it originated. Outputs the result to IModelApp.notifications.
349
354
  * * `id=`: the source aspect Id or element Id.
350
355
  * * `copy=`: (optional) 1 to copy the resultant Id to the system clipboard.
@@ -1 +1 @@
1
- {"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;AAkEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAmK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
1
+ {"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;AAkEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
@@ -90,6 +90,7 @@ class FrontendDevTools {
90
90
  EmphasizeElementsTool_1.ClearEmphasizedElementsTool,
91
91
  EmphasizeElementsTool_1.ClearIsolatedElementsTool,
92
92
  ClipTools_1.ClipColorTool,
93
+ ClipTools_1.ClipIntersectionTool,
93
94
  RenderSystemTools_1.CompileShadersTool,
94
95
  ViewportTools_1.DefaultTileSizeModifierTool,
95
96
  MapLayerTool_1.DetachMapLayersTool,
@@ -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,iDAA2F;AAC3F,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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B,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;;AA/Kc,6BAAY,GAAG,KAAK,CAAC;AADzB,4CAAgB","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, 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, 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, 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 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 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 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
+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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;;AAhLc,6BAAY,GAAG,KAAK,CAAC;AADzB,4CAAgB","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, 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, 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 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 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"]}
@@ -37,6 +37,46 @@ export declare class ClipColorTool extends Tool {
37
37
  */
38
38
  parseAndRun(...args: string[]): Promise<boolean>;
39
39
  }
40
+ /** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.
41
+ * Arguments can be:
42
+ * - off
43
+ * - default
44
+ * - color <color string>
45
+ * - width <number>
46
+ * <color string> must be in one of the following forms:
47
+ * "rgb(255,0,0)"
48
+ * "rgba(255,0,0,255)"
49
+ * "rgb(100%,0%,0%)"
50
+ * "hsl(120,50%,50%)"
51
+ * "#rrbbgg"
52
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
53
+ * @see [ColorDef]
54
+ * @beta
55
+ */
56
+ export declare class ClipIntersectionTool extends Tool {
57
+ static toolId: string;
58
+ static get minArgs(): number;
59
+ static get maxArgs(): number;
60
+ private _toggleIntersectionStyle;
61
+ private _defaultClipIntersection;
62
+ private setClipIntersection;
63
+ /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.
64
+ * Arguments can be:
65
+ * - off
66
+ * - default
67
+ * - color <color string>
68
+ * - width <number>
69
+ * <color string> must be in one of the following forms:
70
+ * "rgb(255,0,0)"
71
+ * "rgba(255,0,0,255)"
72
+ * "rgb(100%,0%,0%)"
73
+ * "hsl(120,50%,50%)"
74
+ * "#rrbbgg"
75
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
76
+ * @beta
77
+ */
78
+ parseAndRun(...args: string[]): Promise<boolean>;
79
+ }
40
80
  /** Controls a view state's view details' flag for producing cut geometry for a clip style.
41
81
  * @beta
42
82
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ClipTools.d.ts","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAYA,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,IAAI;IACrC,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;IASpB;;;;;;;;;;;;;OAaG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAcvE;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,IAAI;IAC5C,OAAuB,MAAM,SAAsB;IACnD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD;;OAEG;IACmB,GAAG,CAAC,kBAAkB,CAAC,EAAE,OAAO,GAA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AE,GAAG,OAAO,CAAC,OAAO,CAAC;CAevE;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,IAAI;IAC5C,OAAuB,MAAM,SAAsB;IACnD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD;;OAEG;IACmB,GAAG,CAAC,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBzE;;OAEG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,SAAS,CAAS;IAE1B,cAAuB,SAAS,YAAmB;cAEnC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;cAKvC,OAAO,CAAC,EAAE,EAAE,QAAQ;CA+BrC"}
@@ -4,7 +4,7 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TestClipStyleTool = exports.ToggleSectionCutTool = exports.ClipColorTool = void 0;
7
+ exports.TestClipStyleTool = exports.ToggleSectionCutTool = exports.ClipIntersectionTool = exports.ClipColorTool = void 0;
8
8
  /** @packageDocumentation
9
9
  * @module Tools
10
10
  */
@@ -75,6 +75,94 @@ class ClipColorTool extends core_frontend_1.Tool {
75
75
  }
76
76
  ClipColorTool.toolId = "ClipColorTool";
77
77
  exports.ClipColorTool = ClipColorTool;
78
+ /** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.
79
+ * Arguments can be:
80
+ * - off
81
+ * - default
82
+ * - color <color string>
83
+ * - width <number>
84
+ * <color string> must be in one of the following forms:
85
+ * "rgb(255,0,0)"
86
+ * "rgba(255,0,0,255)"
87
+ * "rgb(100%,0%,0%)"
88
+ * "hsl(120,50%,50%)"
89
+ * "#rrbbgg"
90
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
91
+ * @see [ColorDef]
92
+ * @beta
93
+ */
94
+ class ClipIntersectionTool extends core_frontend_1.Tool {
95
+ static get minArgs() { return 0; }
96
+ static get maxArgs() { return 4; }
97
+ _toggleIntersectionStyle(toggle) {
98
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
99
+ if (undefined !== vp) {
100
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
101
+ props.colorizeIntersection = toggle;
102
+ vp.displayStyle.settings.clipStyle = core_common_1.ClipStyle.fromJSON(props);
103
+ }
104
+ }
105
+ _defaultClipIntersection() {
106
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
107
+ if (undefined !== vp) {
108
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
109
+ if (!props.intersectionStyle) {
110
+ props.intersectionStyle = core_common_1.ClipIntersectionStyle.defaults;
111
+ }
112
+ else {
113
+ props.intersectionStyle.color = core_common_1.RgbColor.fromColorDef(core_common_1.ColorDef.white);
114
+ props.intersectionStyle.width = 1;
115
+ }
116
+ vp.displayStyle.settings.clipStyle = core_common_1.ClipStyle.fromJSON(props);
117
+ }
118
+ }
119
+ setClipIntersection(colStr, width) {
120
+ const vp = core_frontend_1.IModelApp.viewManager.selectedView;
121
+ if (vp) {
122
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
123
+ if (!props.intersectionStyle) {
124
+ props.intersectionStyle = core_common_1.ClipIntersectionStyle.defaults;
125
+ }
126
+ if (colStr) {
127
+ props.intersectionStyle.color = core_common_1.RgbColor.fromColorDef(core_common_1.ColorDef.fromString(colStr));
128
+ }
129
+ if (width) {
130
+ props.intersectionStyle.width = width;
131
+ }
132
+ vp.displayStyle.settings.clipStyle = core_common_1.ClipStyle.fromJSON(props);
133
+ }
134
+ }
135
+ /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.
136
+ * Arguments can be:
137
+ * - off
138
+ * - default
139
+ * - color <color string>
140
+ * - width <number>
141
+ * <color string> must be in one of the following forms:
142
+ * "rgb(255,0,0)"
143
+ * "rgba(255,0,0,255)"
144
+ * "rgb(100%,0%,0%)"
145
+ * "hsl(120,50%,50%)"
146
+ * "#rrbbgg"
147
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
148
+ * @beta
149
+ */
150
+ async parseAndRun(...args) {
151
+ if (args[0] === "off") {
152
+ this._toggleIntersectionStyle(false);
153
+ return true;
154
+ }
155
+ this._toggleIntersectionStyle(true);
156
+ if (args[0] === "default") {
157
+ this._defaultClipIntersection();
158
+ return true;
159
+ }
160
+ args[0] === "color" ? this.setClipIntersection(args[1], +args[3]) : this.setClipIntersection(args[3], +args[1]);
161
+ return true;
162
+ }
163
+ }
164
+ ClipIntersectionTool.toolId = "ClipIntersectionTool";
165
+ exports.ClipIntersectionTool = ClipIntersectionTool;
78
166
  /** Controls a view state's view details' flag for producing cut geometry for a clip style.
79
167
  * @beta
80
168
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,oDAE4B;AAC5B,wDAAiE;AACjE,+CAA4C;AAC5C,iDAA8C;AAC9C,2DAAuD;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAa,aAAc,SAAQ,oBAAI;IAE9B,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1C,gBAAgB;QACtB,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,EAAE;YACpB,MAAM,KA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CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,AAAlB,CAAmB;AADrC,8CAAiB","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 {\r\n ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\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\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected async parse(args: string[]): Promise<boolean> {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected async execute(vp: Viewport) {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools/Clip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,EAAE;YAClB,KAAK,CAAC,QAAQ,GAAG;gBACf,SAAS,EAAE;oBACT,UAAU,EAAE,wBAAU,CAAC,WAAW;oBAClC,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,KAAK;iBACnB;gBACD,UAAU,EAAE;oBACV,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;oBAC/B,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,yBAAW,CAAC,IAAI;wBACvB,OAAO,EAAE,wBAAU,CAAC,KAAK;wBACzB,KAAK,EAAE,CAAC;qBACT;iBACF;aACF,CAAC;SACH;QAED,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,GAAG,uBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,AAAlB,CAAmB;AADrC,8CAAiB","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 {\r\n ClipIntersectionStyle, ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.\r\n * Arguments can be:\r\n * - off\r\n * - default\r\n * - color <color string>\r\n * - width <number>\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipIntersectionTool extends Tool {\r\n public static override toolId = \"ClipIntersectionTool\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 4; }\r\n\r\n private _toggleIntersectionStyle(toggle: boolean) {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.colorizeIntersection = toggle;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private _defaultClipIntersection() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n if (!props.intersectionStyle) {\r\n props.intersectionStyle = ClipIntersectionStyle.defaults;\r\n } else {\r\n props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.white);\r\n props.intersectionStyle.width = 1;\r\n }\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipIntersection(colStr: string, width: number) {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n\r\n if (!props.intersectionStyle) {\r\n props.intersectionStyle = ClipIntersectionStyle.defaults;\r\n }\r\n if (colStr) {\r\n props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n }\r\n if (width) {\r\n props.intersectionStyle.width = width;\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.\r\n * Arguments can be:\r\n * - off\r\n * - default\r\n * - color <color string>\r\n * - width <number>\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (args[0] === \"off\") {\r\n this._toggleIntersectionStyle(false);\r\n return true;\r\n }\r\n\r\n this._toggleIntersectionStyle(true);\r\n if (args[0] === \"default\") {\r\n this._defaultClipIntersection();\r\n return true;\r\n }\r\n\r\n args[0] === \"color\" ? this.setClipIntersection(args[1], +args[3]) : this.setClipIntersection(args[3], +args[1]);\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\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\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected async parse(args: string[]): Promise<boolean> {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected async execute(vp: Viewport) {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\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;AAkEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAmK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
1
+ {"version":3,"file":"FrontEndDevTools.d.ts","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAIA;;GAEG;AAkEH;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;;;;;;OAOG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoK/C,OAAO,CAAC,MAAM,CAAC,QAAQ;CAGxB"}
@@ -18,7 +18,7 @@ import { MaskBackgroundMapByElementTool, MaskBackgroundMapByExcludedElementTool,
18
18
  import { ChangeCameraTool, ChangeEmphasisSettingsTool, ChangeFlashSettingsTool, ChangeHiliteModeTool, ChangeHiliteSettingsTool, DefaultTileSizeModifierTool, FadeOutTool, FreezeSceneTool, SetAspectRatioSkewTool, ShowTileVolumesTool, Toggle3dManipulationsTool, ToggleDrawingGraphicsTool, ToggleSectionDrawingSpatialViewTool, ToggleTileTreeReferencesTool, ToggleViewAttachmentBoundariesTool, ToggleViewAttachmentClipShapesTool, ToggleViewAttachmentsTool, ViewportAddRealityModel, ViewportTileSizeModifierTool, } from "./tools/ViewportTools";
19
19
  import { AnimationIntervalTool } from "./tools/AnimationIntervalTool";
20
20
  import { ChangeUnitsTool } from "./tools/ChangeUnitsTool";
21
- import { ClipColorTool, TestClipStyleTool, ToggleSectionCutTool } from "./tools/ClipTools";
21
+ import { ClipColorTool, ClipIntersectionTool, TestClipStyleTool, ToggleSectionCutTool } from "./tools/ClipTools";
22
22
  import { ApplyRenderingStyleTool, ChangeBackgroundColorTool, ChangeViewFlagsTool, OverrideSubCategoryTool, SaveRenderingStyleTool, SkyCubeTool, SkySphereTool, ToggleSkyboxTool, ToggleWiremeshTool, WoWIgnoreBackgroundTool, } from "./tools/DisplayStyleTools";
23
23
  import { QueryScheduleScriptTool, ReverseScheduleScriptTool, SetScheduleScriptTool } from "./tools/ScheduleScriptTools";
24
24
  import { ClearEmphasizedElementsTool, ClearIsolatedElementsTool, EmphasizeSelectedElementsTool, EmphasizeVisibleElementsTool, IsolateSelectedElementsTool, } from "./tools/EmphasizeElementsTool";
@@ -87,6 +87,7 @@ class FrontendDevTools {
87
87
  ClearEmphasizedElementsTool,
88
88
  ClearIsolatedElementsTool,
89
89
  ClipColorTool,
90
+ ClipIntersectionTool,
90
91
  CompileShadersTool,
91
92
  DefaultTileSizeModifierTool,
92
93
  DetachMapLayersTool,
@@ -1 +1 @@
1
- {"version":3,"file":"FrontEndDevTools.js","sourceRoot":"","sources":["../../src/FrontEndDevTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/I,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc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B;YACpB,qBAAqB;YACrB,yBAAyB;YACzB,6BAA6B;YAC7B,+BAA+B;YAC/B,wBAAwB;YACxB,kBAAkB;YAClB,sBAAsB;YACtB,wBAAwB;YACxB,iBAAiB;YACjB,sBAAsB;YACtB,oBAAoB;YACpB,4BAA4B;YAC5B,oCAAoC;YACpC,6BAA6B;YAC7B,qBAAqB;YACrB,wBAAwB;YACxB,oCAAoC;YACpC,2BAA2B;YAC3B,2BAA2B;YAC3B,iCAAiC;YACjC,6BAA6B;YAC7B,qCAAqC;YACrC,sBAAsB;YACtB,4BAA4B;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;;AA/Kc,6BAAY,GAAG,KAAK,CAAC;SADzB,gBAAgB","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, 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, 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, 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 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 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 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,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/I,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,8BAA8B,EAAE,sCAAsC,EAAE,4BAA4B,EAAE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AAwB;YACxB,kBAAkB;YAClB,sBAAsB;YACtB,wBAAwB;YACxB,iBAAiB;YACjB,sBAAsB;YACtB,oBAAoB;YACpB,4BAA4B;YAC5B,oCAAoC;YACpC,6BAA6B;YAC7B,qBAAqB;YACrB,wBAAwB;YACxB,oCAAoC;YACpC,2BAA2B;YAC3B,2BAA2B;YAC3B,iCAAiC;YACjC,6BAA6B;YAC7B,qCAAqC;YACrC,sBAAsB;YACtB,4BAA4B;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;;AAhLc,6BAAY,GAAG,KAAK,CAAC;SADzB,gBAAgB","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, 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, 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 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 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"]}
@@ -37,6 +37,46 @@ export declare class ClipColorTool extends Tool {
37
37
  */
38
38
  parseAndRun(...args: string[]): Promise<boolean>;
39
39
  }
40
+ /** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.
41
+ * Arguments can be:
42
+ * - off
43
+ * - default
44
+ * - color <color string>
45
+ * - width <number>
46
+ * <color string> must be in one of the following forms:
47
+ * "rgb(255,0,0)"
48
+ * "rgba(255,0,0,255)"
49
+ * "rgb(100%,0%,0%)"
50
+ * "hsl(120,50%,50%)"
51
+ * "#rrbbgg"
52
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
53
+ * @see [ColorDef]
54
+ * @beta
55
+ */
56
+ export declare class ClipIntersectionTool extends Tool {
57
+ static toolId: string;
58
+ static get minArgs(): number;
59
+ static get maxArgs(): number;
60
+ private _toggleIntersectionStyle;
61
+ private _defaultClipIntersection;
62
+ private setClipIntersection;
63
+ /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.
64
+ * Arguments can be:
65
+ * - off
66
+ * - default
67
+ * - color <color string>
68
+ * - width <number>
69
+ * <color string> must be in one of the following forms:
70
+ * "rgb(255,0,0)"
71
+ * "rgba(255,0,0,255)"
72
+ * "rgb(100%,0%,0%)"
73
+ * "hsl(120,50%,50%)"
74
+ * "#rrbbgg"
75
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
76
+ * @beta
77
+ */
78
+ parseAndRun(...args: string[]): Promise<boolean>;
79
+ }
40
80
  /** Controls a view state's view details' flag for producing cut geometry for a clip style.
41
81
  * @beta
42
82
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ClipTools.d.ts","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAYA,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,IAAI;IACrC,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;IASpB;;;;;;;;;;;;;OAaG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAcvE;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,IAAI;IAC5C,OAAuB,MAAM,SAAsB;IACnD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD;;OAEG;IACmB,GAAG,CAAC,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBzE;;OAEG;IACmB,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,SAAS,CAAS;IAE1B,cAAuB,SAAS,YAAmB;cAEnC,KAAK,CAAC,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AC,OAAO,CAAC;CAOvE;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,OAAuB,MAAM,SAAmB;IAChD,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAElD,OAAO,CAAC,SAAS,CAAS;IAE1B,cAAuB,SAAS,YAAmB;cAEnC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;cAKvC,OAAO,CAAC,EAAE,EAAE,QAAQ;CA+BrC"}
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module Tools
7
7
  */
8
- import { ClipStyle, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor, } from "@itwin/core-common";
8
+ import { ClipIntersectionStyle, ClipStyle, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor, } from "@itwin/core-common";
9
9
  import { IModelApp, Tool } from "@itwin/core-frontend";
10
10
  import { parseToggle } from "./parseToggle";
11
11
  import { parseBoolean } from "./parseBoolean";
@@ -72,6 +72,94 @@ class ClipColorTool extends Tool {
72
72
  }
73
73
  ClipColorTool.toolId = "ClipColorTool";
74
74
  export { ClipColorTool };
75
+ /** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.
76
+ * Arguments can be:
77
+ * - off
78
+ * - default
79
+ * - color <color string>
80
+ * - width <number>
81
+ * <color string> must be in one of the following forms:
82
+ * "rgb(255,0,0)"
83
+ * "rgba(255,0,0,255)"
84
+ * "rgb(100%,0%,0%)"
85
+ * "hsl(120,50%,50%)"
86
+ * "#rrbbgg"
87
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
88
+ * @see [ColorDef]
89
+ * @beta
90
+ */
91
+ class ClipIntersectionTool extends Tool {
92
+ static get minArgs() { return 0; }
93
+ static get maxArgs() { return 4; }
94
+ _toggleIntersectionStyle(toggle) {
95
+ const vp = IModelApp.viewManager.selectedView;
96
+ if (undefined !== vp) {
97
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
98
+ props.colorizeIntersection = toggle;
99
+ vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);
100
+ }
101
+ }
102
+ _defaultClipIntersection() {
103
+ const vp = IModelApp.viewManager.selectedView;
104
+ if (undefined !== vp) {
105
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
106
+ if (!props.intersectionStyle) {
107
+ props.intersectionStyle = ClipIntersectionStyle.defaults;
108
+ }
109
+ else {
110
+ props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.white);
111
+ props.intersectionStyle.width = 1;
112
+ }
113
+ vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);
114
+ }
115
+ }
116
+ setClipIntersection(colStr, width) {
117
+ const vp = IModelApp.viewManager.selectedView;
118
+ if (vp) {
119
+ const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};
120
+ if (!props.intersectionStyle) {
121
+ props.intersectionStyle = ClipIntersectionStyle.defaults;
122
+ }
123
+ if (colStr) {
124
+ props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.fromString(colStr));
125
+ }
126
+ if (width) {
127
+ props.intersectionStyle.width = width;
128
+ }
129
+ vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);
130
+ }
131
+ }
132
+ /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.
133
+ * Arguments can be:
134
+ * - off
135
+ * - default
136
+ * - color <color string>
137
+ * - width <number>
138
+ * <color string> must be in one of the following forms:
139
+ * "rgb(255,0,0)"
140
+ * "rgba(255,0,0,255)"
141
+ * "rgb(100%,0%,0%)"
142
+ * "hsl(120,50%,50%)"
143
+ * "#rrbbgg"
144
+ * "blanchedAlmond" (see possible values from [[ColorByName]]). Case insensitive.
145
+ * @beta
146
+ */
147
+ async parseAndRun(...args) {
148
+ if (args[0] === "off") {
149
+ this._toggleIntersectionStyle(false);
150
+ return true;
151
+ }
152
+ this._toggleIntersectionStyle(true);
153
+ if (args[0] === "default") {
154
+ this._defaultClipIntersection();
155
+ return true;
156
+ }
157
+ args[0] === "color" ? this.setClipIntersection(args[1], +args[3]) : this.setClipIntersection(args[3], +args[1]);
158
+ return true;
159
+ }
160
+ }
161
+ ClipIntersectionTool.toolId = "ClipIntersectionTool";
162
+ export { ClipIntersectionTool };
75
163
  /** Controls a view state's view details' flag for producing cut geometry for a clip style.
76
164
  * @beta
77
165
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EACL,SAAS,EAAkB,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,GACnF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAa,aAAc,SAAQ,IAAI;IAE9B,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1C,gBAAgB;QACtB,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,EAAE;YACpB,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;YAChE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;YACnD,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,GAAG,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AAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAIlD,IAAuB,SAAS,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAEzC,KAAK,CAAC,KAAK,CAAC,IAAc;QAClC,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,EAAY;QAClC,MAAM,KAAK,GAAmB,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;QAC3D,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,KAAK,CAAC,QAAQ,GAAG;gBACf,SAAS,EAAE;oBACT,UAAU,EAAE,UAAU,CAAC,WAAW;oBAClC,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,KAAK;iBACnB;gBACD,UAAU,EAAE;oBACV,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;oBAC/B,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,WAAW,CAAC,IAAI;wBACvB,OAAO,EAAE,UAAU,CAAC,KAAK;wBACzB,KAAK,EAAE,CAAC;qBACT;iBACF;aACF,CAAC;SACH;QAED,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,AAAlB,CAAmB;SADrC,iBAAiB","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 {\r\n ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\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\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected async parse(args: string[]): Promise<boolean> {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected async execute(vp: Viewport) {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ClipTools.js","sourceRoot":"","sources":["../../../src/tools/ClipTools.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EACL,qBAAqB,EAAE,SAAS,EAAkB,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,GAC1G,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAY,MAAM,sBAAsB,C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KAAK,CAAC,QAAQ,GAAG;gBACf,SAAS,EAAE;oBACT,UAAU,EAAE,UAAU,CAAC,WAAW;oBAClC,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,KAAK;iBACnB;gBACD,UAAU,EAAE;oBACV,GAAG,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;oBAC/B,YAAY,EAAE,GAAG;oBACjB,YAAY,EAAE,IAAI;iBACnB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,WAAW,CAAC,IAAI;wBACvB,OAAO,EAAE,UAAU,CAAC,KAAK;wBACzB,KAAK,EAAE,CAAC;qBACT;iBACF;aACF,CAAC;SACH;QAED,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,EAAE,CAAC,oBAAoB,EAAE,CAAC;QAC1B,EAAE,CAAC,iCAAiC,EAAE,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CsB,wBAAM,GAAG,eAAe,AAAlB,CAAmB;SADrC,iBAAiB","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 {\r\n ClipIntersectionStyle, ClipStyle, ClipStyleProps, ColorByName, ColorDef, LinePixels, RenderMode, RgbColor,\r\n} from \"@itwin/core-common\";\r\nimport { IModelApp, Tool, Viewport } from \"@itwin/core-frontend\";\r\nimport { parseToggle } from \"./parseToggle\";\r\nimport { parseBoolean } from \"./parseBoolean\";\r\nimport { DisplayStyleTool } from \"./DisplayStyleTools\";\r\n\r\n/** This tool specifies or un-specifies a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipColorTool extends Tool {\r\n public static override toolId = \"ClipColorTool\";\r\n public static override get minArgs() { return 1; }\r\n public static override get maxArgs() { return 2; }\r\n\r\n private _clearClipColors() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.insideColor = props.outsideColor = undefined;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipColor(colStr: string, which: \"insideColor\" | \"outsideColor\") {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props[which] = colStr === \"clear\" ? undefined : RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a clip color to use for pixels inside or outside the clip region.\r\n * Arguments can be:\r\n * - clear\r\n * - inside <color string> | clear\r\n * - outside <color string> | clear\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (1 === args.length) {\r\n if (args[0] === \"clear\")\r\n this._clearClipColors();\r\n\r\n return true;\r\n }\r\n\r\n const which = args[0];\r\n if (which === \"inside\" || which === \"outside\")\r\n this.setClipColor(args[1], \"inside\" === which ? \"insideColor\" : \"outsideColor\");\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** This tool specifies or un-specifies a color and width to use for pixels within the specified width of a clip plane.\r\n * Arguments can be:\r\n * - off\r\n * - default\r\n * - color <color string>\r\n * - width <number>\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @see [ColorDef]\r\n * @beta\r\n */\r\nexport class ClipIntersectionTool extends Tool {\r\n public static override toolId = \"ClipIntersectionTool\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 4; }\r\n\r\n private _toggleIntersectionStyle(toggle: boolean) {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n props.colorizeIntersection = toggle;\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private _defaultClipIntersection() {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (undefined !== vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n if (!props.intersectionStyle) {\r\n props.intersectionStyle = ClipIntersectionStyle.defaults;\r\n } else {\r\n props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.white);\r\n props.intersectionStyle.width = 1;\r\n }\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n private setClipIntersection(colStr: string, width: number) {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const props = vp.displayStyle.settings.clipStyle.toJSON() ?? {};\r\n\r\n if (!props.intersectionStyle) {\r\n props.intersectionStyle = ClipIntersectionStyle.defaults;\r\n }\r\n if (colStr) {\r\n props.intersectionStyle.color = RgbColor.fromColorDef(ColorDef.fromString(colStr));\r\n }\r\n if (width) {\r\n props.intersectionStyle.width = width;\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n }\r\n }\r\n\r\n /** This runs the tool using the given arguments, specifying or unspecifying a color and width to use for pixels within the specified width of a clip plane.\r\n * Arguments can be:\r\n * - off\r\n * - default\r\n * - color <color string>\r\n * - width <number>\r\n * <color string> must be in one of the following forms:\r\n * \"rgb(255,0,0)\"\r\n * \"rgba(255,0,0,255)\"\r\n * \"rgb(100%,0%,0%)\"\r\n * \"hsl(120,50%,50%)\"\r\n * \"#rrbbgg\"\r\n * \"blanchedAlmond\" (see possible values from [[ColorByName]]). Case insensitive.\r\n * @beta\r\n */\r\n public override async parseAndRun(...args: string[]): Promise<boolean> {\r\n if (args[0] === \"off\") {\r\n this._toggleIntersectionStyle(false);\r\n return true;\r\n }\r\n\r\n this._toggleIntersectionStyle(true);\r\n if (args[0] === \"default\") {\r\n this._defaultClipIntersection();\r\n return true;\r\n }\r\n\r\n args[0] === \"color\" ? this.setClipIntersection(args[1], +args[3]) : this.setClipIntersection(args[3], +args[1]);\r\n return true;\r\n }\r\n}\r\n\r\n/** Controls a view state's view details' flag for producing cut geometry for a clip style.\r\n * @beta\r\n */\r\nexport class ToggleSectionCutTool extends Tool {\r\n public static override toolId = \"ToggleSectionCut\";\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 1; }\r\n\r\n /** This method runs the tool, controlling a view state's view details' flag for producing cut geometry for a clip style.\r\n * @param produceCutGeometry whether to produce cut geometry\r\n */\r\n public override async run(produceCutGeometry?: boolean): Promise<boolean> {\r\n const vp = IModelApp.viewManager.selectedView;\r\n if (vp) {\r\n const style = vp.view.displayStyle.settings.clipStyle;\r\n produceCutGeometry = produceCutGeometry ?? !style.produceCutGeometry;\r\n if (produceCutGeometry !== style.produceCutGeometry) {\r\n const json = {\r\n ...vp.view.displayStyle.settings.clipStyle.toJSON(),\r\n produceCutGeometry,\r\n };\r\n\r\n vp.view.displayStyle.settings.clipStyle = ClipStyle.fromJSON(json);\r\n vp.invalidateScene();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Executes this tool's run method with args[0] containing `produceCutGeometry`.\r\n * @see [[run]]\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\r\n/** Simple tool that toggles a hard-coded clip style overriding various aspects of the cut geometry appearance.\r\n * @beta\r\n */\r\nexport class TestClipStyleTool extends DisplayStyleTool {\r\n public static override toolId = \"TestClipStyle\";\r\n public static override get maxArgs() { return 1; }\r\n public static override get minArgs() { return 1; }\r\n\r\n private _useStyle = false;\r\n\r\n protected override get require3d() { return true; }\r\n\r\n protected async parse(args: string[]): Promise<boolean> {\r\n this._useStyle = parseBoolean(args[0]) ?? false;\r\n return true;\r\n }\r\n\r\n protected async execute(vp: Viewport) {\r\n const props: ClipStyleProps = { produceCutGeometry: true };\r\n if (this._useStyle) {\r\n props.cutStyle = {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n visibleEdges: true,\r\n hiddenEdges: false,\r\n },\r\n appearance: {\r\n rgb: { r: 0xff, g: 0x7f, b: 0 },\r\n transparency: 0.5,\r\n nonLocatable: true,\r\n },\r\n hiddenLine: {\r\n visible: {\r\n ovrColor: true,\r\n color: ColorByName.blue,\r\n pattern: LinePixels.Solid,\r\n width: 3,\r\n },\r\n },\r\n };\r\n }\r\n\r\n vp.displayStyle.settings.clipStyle = ClipStyle.fromJSON(props);\r\n vp.invalidateRenderPlan();\r\n vp.setFeatureOverrideProviderChanged();\r\n\r\n return true;\r\n }\r\n}\r\n"]}
@@ -174,6 +174,9 @@
174
174
  "ClipColorTool": {
175
175
  "keyin": "fdt clip color"
176
176
  },
177
+ "ClipIntersectionTool": {
178
+ "keyin": "fdt clip intersection"
179
+ },
177
180
  "TestClipStyle": {
178
181
  "keyin": "fdt test clip style"
179
182
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/frontend-devtools",
3
- "version": "4.3.0-dev.22",
3
+ "version": "4.3.0-dev.24",
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-bentley": "4.3.0-dev.22",
28
- "@itwin/core-common": "4.3.0-dev.22",
29
- "@itwin/core-frontend": "4.3.0-dev.22",
30
- "@itwin/core-geometry": "4.3.0-dev.22"
27
+ "@itwin/core-bentley": "4.3.0-dev.24",
28
+ "@itwin/core-geometry": "4.3.0-dev.24",
29
+ "@itwin/core-common": "4.3.0-dev.24",
30
+ "@itwin/core-frontend": "4.3.0-dev.24"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@itwin/eslint-plugin": "4.0.0-dev.44",
@@ -37,7 +37,7 @@
37
37
  "eslint": "^8.44.0",
38
38
  "rimraf": "^3.0.2",
39
39
  "typescript": "~5.0.2",
40
- "@itwin/build-tools": "4.3.0-dev.22"
40
+ "@itwin/build-tools": "4.3.0-dev.24"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm",