@itwin/frontend-devtools 5.0.0-dev.32 → 5.0.0-dev.34
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/lib/cjs/FrontEndDevTools.js +1 -1
- package/lib/cjs/FrontEndDevTools.js.map +1 -1
- package/lib/cjs/effects/Convolution.js +6 -6
- package/lib/cjs/effects/Convolution.js.map +1 -1
- package/lib/cjs/effects/EffectTools.js +2 -2
- package/lib/cjs/effects/EffectTools.js.map +1 -1
- package/lib/cjs/effects/Explosion.js +2 -2
- package/lib/cjs/effects/Explosion.js.map +1 -1
- package/lib/cjs/effects/FlipImage.js +2 -2
- package/lib/cjs/effects/FlipImage.js.map +1 -1
- package/lib/cjs/effects/LensDistortion.js +4 -4
- package/lib/cjs/effects/LensDistortion.js.map +1 -1
- package/lib/cjs/effects/Saturation.js +4 -4
- package/lib/cjs/effects/Saturation.js.map +1 -1
- package/lib/cjs/effects/Snow.js +2 -2
- package/lib/cjs/effects/Snow.js.map +1 -1
- package/lib/cjs/effects/Vignette.js +12 -12
- package/lib/cjs/effects/Vignette.js.map +1 -1
- package/lib/cjs/tools/AnimationIntervalTool.js +1 -1
- package/lib/cjs/tools/AnimationIntervalTool.js.map +1 -1
- package/lib/cjs/tools/ChangeUnitsTool.js +1 -1
- package/lib/cjs/tools/ChangeUnitsTool.js.map +1 -1
- package/lib/cjs/tools/ClipTools.js +4 -4
- package/lib/cjs/tools/ClipTools.js.map +1 -1
- package/lib/cjs/tools/DisplayStyleTools.js +10 -10
- package/lib/cjs/tools/DisplayStyleTools.js.map +1 -1
- package/lib/cjs/tools/EmphasizeElementsTool.js +5 -5
- package/lib/cjs/tools/EmphasizeElementsTool.js.map +1 -1
- package/lib/cjs/tools/FrustumDecoration.js +3 -3
- package/lib/cjs/tools/FrustumDecoration.js.map +1 -1
- package/lib/cjs/tools/InspectElementTool.js +1 -1
- package/lib/cjs/tools/InspectElementTool.js.map +1 -1
- package/lib/cjs/tools/MapLayerTool.js +20 -20
- package/lib/cjs/tools/MapLayerTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTileLoadTime.js +1 -1
- package/lib/cjs/tools/MeasureTileLoadTime.js.map +1 -1
- package/lib/cjs/tools/ModelAppearanceTools.js +9 -9
- package/lib/cjs/tools/ModelAppearanceTools.js.map +1 -1
- package/lib/cjs/tools/PlanProjectionTools.js +3 -3
- package/lib/cjs/tools/PlanProjectionTools.js.map +1 -1
- package/lib/cjs/tools/PlanarMaskTools.js +12 -12
- package/lib/cjs/tools/PlanarMaskTools.js.map +1 -1
- package/lib/cjs/tools/ProjectExtents.js +1 -1
- package/lib/cjs/tools/ProjectExtents.js.map +1 -1
- package/lib/cjs/tools/RealityModelTools.js +10 -10
- package/lib/cjs/tools/RealityModelTools.js.map +1 -1
- package/lib/cjs/tools/RealityTransitionTool.js +1 -1
- package/lib/cjs/tools/RealityTransitionTool.js.map +1 -1
- package/lib/cjs/tools/RenderSystemTools.js +3 -3
- package/lib/cjs/tools/RenderSystemTools.js.map +1 -1
- package/lib/cjs/tools/RenderTargetTools.js +11 -11
- package/lib/cjs/tools/RenderTargetTools.js.map +1 -1
- package/lib/cjs/tools/ReportWebGLCompatibilityTool.js +1 -1
- package/lib/cjs/tools/ReportWebGLCompatibilityTool.js.map +1 -1
- package/lib/cjs/tools/SavedViews.js +3 -3
- package/lib/cjs/tools/SavedViews.js.map +1 -1
- package/lib/cjs/tools/ScheduleScriptTools.js +3 -3
- package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
- package/lib/cjs/tools/SelectionTools.js +2 -2
- package/lib/cjs/tools/SelectionTools.js.map +1 -1
- package/lib/cjs/tools/SetGpuMemoryLimitTool.js +1 -1
- package/lib/cjs/tools/SetGpuMemoryLimitTool.js.map +1 -1
- package/lib/cjs/tools/SourceAspectIdTools.js +2 -2
- package/lib/cjs/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/cjs/tools/TileRequestDecoration.js +1 -1
- package/lib/cjs/tools/TileRequestDecoration.js.map +1 -1
- package/lib/cjs/tools/TileTreeBoundsDecoration.js +1 -1
- package/lib/cjs/tools/TileTreeBoundsDecoration.js.map +1 -1
- package/lib/cjs/tools/ToolTipProvider.js +1 -1
- package/lib/cjs/tools/ToolTipProvider.js.map +1 -1
- package/lib/cjs/tools/ViewportTools.js +19 -19
- package/lib/cjs/tools/ViewportTools.js.map +1 -1
- package/lib/cjs/widgets/ToolSettingsTracker.js +1 -1
- package/lib/cjs/widgets/ToolSettingsTracker.js.map +1 -1
- package/lib/esm/FrontEndDevTools.js +1 -1
- package/lib/esm/FrontEndDevTools.js.map +1 -1
- package/lib/esm/effects/Convolution.js +6 -6
- package/lib/esm/effects/Convolution.js.map +1 -1
- package/lib/esm/effects/EffectTools.js +2 -2
- package/lib/esm/effects/EffectTools.js.map +1 -1
- package/lib/esm/effects/Explosion.js +2 -2
- package/lib/esm/effects/Explosion.js.map +1 -1
- package/lib/esm/effects/FlipImage.js +2 -2
- package/lib/esm/effects/FlipImage.js.map +1 -1
- package/lib/esm/effects/LensDistortion.js +4 -4
- package/lib/esm/effects/LensDistortion.js.map +1 -1
- package/lib/esm/effects/Saturation.js +4 -4
- package/lib/esm/effects/Saturation.js.map +1 -1
- package/lib/esm/effects/Snow.js +2 -2
- package/lib/esm/effects/Snow.js.map +1 -1
- package/lib/esm/effects/Vignette.js +12 -12
- package/lib/esm/effects/Vignette.js.map +1 -1
- package/lib/esm/tools/AnimationIntervalTool.js +1 -1
- package/lib/esm/tools/AnimationIntervalTool.js.map +1 -1
- package/lib/esm/tools/ChangeUnitsTool.js +1 -1
- package/lib/esm/tools/ChangeUnitsTool.js.map +1 -1
- package/lib/esm/tools/ClipTools.js +4 -4
- package/lib/esm/tools/ClipTools.js.map +1 -1
- package/lib/esm/tools/DisplayStyleTools.js +10 -10
- package/lib/esm/tools/DisplayStyleTools.js.map +1 -1
- package/lib/esm/tools/EmphasizeElementsTool.js +5 -5
- package/lib/esm/tools/EmphasizeElementsTool.js.map +1 -1
- package/lib/esm/tools/FrustumDecoration.js +3 -3
- package/lib/esm/tools/FrustumDecoration.js.map +1 -1
- package/lib/esm/tools/InspectElementTool.js +1 -1
- package/lib/esm/tools/InspectElementTool.js.map +1 -1
- package/lib/esm/tools/MapLayerTool.js +20 -20
- package/lib/esm/tools/MapLayerTool.js.map +1 -1
- package/lib/esm/tools/MeasureTileLoadTime.js +1 -1
- package/lib/esm/tools/MeasureTileLoadTime.js.map +1 -1
- package/lib/esm/tools/ModelAppearanceTools.js +9 -9
- package/lib/esm/tools/ModelAppearanceTools.js.map +1 -1
- package/lib/esm/tools/PlanProjectionTools.js +3 -3
- package/lib/esm/tools/PlanProjectionTools.js.map +1 -1
- package/lib/esm/tools/PlanarMaskTools.js +12 -12
- package/lib/esm/tools/PlanarMaskTools.js.map +1 -1
- package/lib/esm/tools/ProjectExtents.js +1 -1
- package/lib/esm/tools/ProjectExtents.js.map +1 -1
- package/lib/esm/tools/RealityModelTools.js +10 -10
- package/lib/esm/tools/RealityModelTools.js.map +1 -1
- package/lib/esm/tools/RealityTransitionTool.js +1 -1
- package/lib/esm/tools/RealityTransitionTool.js.map +1 -1
- package/lib/esm/tools/RenderSystemTools.js +3 -3
- package/lib/esm/tools/RenderSystemTools.js.map +1 -1
- package/lib/esm/tools/RenderTargetTools.js +11 -11
- package/lib/esm/tools/RenderTargetTools.js.map +1 -1
- package/lib/esm/tools/ReportWebGLCompatibilityTool.js +1 -1
- package/lib/esm/tools/ReportWebGLCompatibilityTool.js.map +1 -1
- package/lib/esm/tools/SavedViews.js +3 -3
- package/lib/esm/tools/SavedViews.js.map +1 -1
- package/lib/esm/tools/ScheduleScriptTools.js +3 -3
- package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
- package/lib/esm/tools/SelectionTools.js +2 -2
- package/lib/esm/tools/SelectionTools.js.map +1 -1
- package/lib/esm/tools/SetGpuMemoryLimitTool.js +1 -1
- package/lib/esm/tools/SetGpuMemoryLimitTool.js.map +1 -1
- package/lib/esm/tools/SourceAspectIdTools.js +2 -2
- package/lib/esm/tools/SourceAspectIdTools.js.map +1 -1
- package/lib/esm/tools/TileRequestDecoration.js +1 -1
- package/lib/esm/tools/TileRequestDecoration.js.map +1 -1
- package/lib/esm/tools/TileTreeBoundsDecoration.js +1 -1
- package/lib/esm/tools/TileTreeBoundsDecoration.js.map +1 -1
- package/lib/esm/tools/ToolTipProvider.js +1 -1
- package/lib/esm/tools/ToolTipProvider.js.map +1 -1
- package/lib/esm/tools/ViewportTools.js +19 -19
- package/lib/esm/tools/ViewportTools.js.map +1 -1
- package/lib/esm/widgets/ToolSettingsTracker.js +1 -1
- package/lib/esm/widgets/ToolSettingsTracker.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmphasizeElementsTool.js","sourceRoot":"","sources":["../../../src/tools/EmphasizeElementsTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA+C,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,IAAI;IACtD,IAAc,WAAW,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IACrD,IAAc,UAAU,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAGrC,KAAK,CAAC,GAAG,CAAC,KAAY;QACpC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE;YAClB,OAAO,IAAI,CAAC;QAEd,IAAI,IAAI,CAAC,UAAU;YACjB,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE9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OAAO,CAAC,SAAS,CAAC;oBACjE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,EAAE,CAAC;YACxC,EAAE,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;;AArCsB,mCAAM,GAAG,0BAA0B,AAA7B,CAA8B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Id64 } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { EmphasizeElements, IModelApp, QueryVisibleFeaturesOptions, ScreenViewport, Tool } from \"@itwin/core-frontend\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Applies the `EmphasizeElements` API in some way to the selected Viewport.\n * @beta\n */\nexport abstract class EmphasizeElementsTool extends Tool {\n protected get _wantCreate(): boolean { return true; }\n protected get _wantClear(): boolean { return false; }\n protected abstract execute(emph: EmphasizeElements, vp: ScreenViewport): void;\n\n public override async run(_args: any[]): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (this._wantClear)\n EmphasizeElements.clear(vp);\n\n const emph = this._wantCreate ? EmphasizeElements.getOrCreate(vp) : EmphasizeElements.get(vp);\n if (undefined !== emph)\n this.execute(emph, vp);\n\n return true;\n }\n}\n\nconst enum OverrideType { // eslint-disable-line no-restricted-syntax\n None = 0,\n Color = 1 << 0,\n Emphasis = 1 << 1,\n Both = Color | Emphasis,\n}\n\n/** If any elements are selected, emphasize them all by overriding their color to be orange; and de-emphasize all other elements by drawing them transparent grey.\n * @beta\n */\nexport class EmphasizeSelectedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"EmphasizeSelectedElements\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n private _type = OverrideType.None;\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n if (OverrideType.None === (this._type & OverrideType.Color) || emph.overrideSelectedElements(vp, ColorDef.white, undefined, true, false)) {\n emph.wantEmphasis = OverrideType.None !== (this._type & OverrideType.Emphasis);\n if (emph.emphasizeSelectedElements(vp, undefined, true)) {\n vp.isFadeOutActive = true;\n return;\n }\n }\n\n // Empty selection set - clear any previous overrides.\n EmphasizeElements.clear(vp);\n emph.wantEmphasis = false;\n vp.isFadeOutActive = false;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n if (1 === args.length) {\n switch (args[0].toLowerCase()[0]) {\n case \"n\":\n break;\n case \"c\":\n this._type = OverrideType.Color;\n break;\n case \"e\":\n this._type = OverrideType.Emphasis;\n break;\n case \"b\":\n this._type = OverrideType.Both;\n break;\n }\n }\n\n return this.run(args);\n }\n}\n\n/** Isolate all selected elements so that *only* those elements will be drawn.\n * @beta\n */\nexport class IsolateSelectedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"IsolateSelectedElements\";\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.isolateSelectedElements(vp, true, true);\n }\n}\n\n/** Clear the set of isolated elements.\n * @beta\n */\nexport class ClearIsolatedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"ClearIsolatedElements\";\n protected override get _wantCreate() { return false; }\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.clearIsolatedElements(vp);\n }\n}\n\n/** Reset [EmphasizeElements]($frontend) for the active [Viewport]($frontend).\n * @beta\n */\nexport class ClearEmphasizedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"ClearEmphasizedElements\";\n protected override get _wantCreate() { return false; }\n protected override get _wantClear() { return true; }\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.clearEmphasizedElements(vp);\n vp.isFadeOutActive = false;\n }\n}\n\n/** Emphasize the set of elements currently visible in the view based on [Viewport.queryVisibleFeatures]($frontend).\n * @beta\n */\nexport class EmphasizeVisibleElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"EmphasizeVisibleElements\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n private _options: QueryVisibleFeaturesOptions = { source: \"screen\" };\n protected override get _wantClear() { return true; }\n\n public override async parseAndRun(...input: string[]): Promise<boolean> {\n const args = parseArgs(input);\n const includeNonLocatable = args.getBoolean(\"n\");\n let source: \"screen\" | \"tiles\";\n switch (input[0].toLowerCase()) {\n case \"screen\":\n source = \"screen\";\n break;\n case \"tiles\":\n source = \"tiles\";\n break;\n default:\n return false;\n }\n\n this._options = { source, includeNonLocatable };\n return this.run(input);\n }\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n const elementIds = new Set<string>();\n vp.queryVisibleFeatures(this._options, (features) => {\n for (const feature of features) {\n if (feature.iModel === vp.iModel && Id64.isValid(feature.elementId))\n elementIds.add(feature.elementId);\n }\n });\n\n emph.wantEmphasis = true;\n if (emph.emphasizeElements(elementIds, vp))\n vp.isFadeOutActive = true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EmphasizeElementsTool.js","sourceRoot":"","sources":["../../../src/tools/EmphasizeElementsTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA+C,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,IAAI;IACtD,IAAc,WAAW,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IACrD,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B,CAAC;IAEM,OAAO,CAAC,IAAuB,EAAE,EAAkB;QACxD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;YAClD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;oBACjE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,EAAE,CAAC;YACxC,EAAE,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Id64 } from \"@itwin/core-bentley\";\nimport { ColorDef } from \"@itwin/core-common\";\nimport { EmphasizeElements, IModelApp, QueryVisibleFeaturesOptions, ScreenViewport, Tool } from \"@itwin/core-frontend\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Applies the `EmphasizeElements` API in some way to the selected Viewport.\n * @beta\n */\nexport abstract class EmphasizeElementsTool extends Tool {\n protected get _wantCreate(): boolean { return true; }\n protected get _wantClear(): boolean { return false; }\n protected abstract execute(emph: EmphasizeElements, vp: ScreenViewport): void;\n\n public override async run(_args: any[]): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (this._wantClear)\n EmphasizeElements.clear(vp);\n\n const emph = this._wantCreate ? EmphasizeElements.getOrCreate(vp) : EmphasizeElements.get(vp);\n if (undefined !== emph)\n this.execute(emph, vp);\n\n return true;\n }\n}\n\nconst enum OverrideType { // eslint-disable-line no-restricted-syntax\n None = 0,\n Color = 1 << 0,\n Emphasis = 1 << 1,\n Both = Color | Emphasis,\n}\n\n/** If any elements are selected, emphasize them all by overriding their color to be orange; and de-emphasize all other elements by drawing them transparent grey.\n * @beta\n */\nexport class EmphasizeSelectedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"EmphasizeSelectedElements\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n private _type = OverrideType.None;\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n if (OverrideType.None === (this._type & OverrideType.Color) || emph.overrideSelectedElements(vp, ColorDef.white, undefined, true, false)) {\n emph.wantEmphasis = OverrideType.None !== (this._type & OverrideType.Emphasis);\n if (emph.emphasizeSelectedElements(vp, undefined, true)) {\n vp.isFadeOutActive = true;\n return;\n }\n }\n\n // Empty selection set - clear any previous overrides.\n EmphasizeElements.clear(vp);\n emph.wantEmphasis = false;\n vp.isFadeOutActive = false;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n if (1 === args.length) {\n switch (args[0].toLowerCase()[0]) {\n case \"n\":\n break;\n case \"c\":\n this._type = OverrideType.Color;\n break;\n case \"e\":\n this._type = OverrideType.Emphasis;\n break;\n case \"b\":\n this._type = OverrideType.Both;\n break;\n }\n }\n\n return this.run(args);\n }\n}\n\n/** Isolate all selected elements so that *only* those elements will be drawn.\n * @beta\n */\nexport class IsolateSelectedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"IsolateSelectedElements\";\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.isolateSelectedElements(vp, true, true);\n }\n}\n\n/** Clear the set of isolated elements.\n * @beta\n */\nexport class ClearIsolatedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"ClearIsolatedElements\";\n protected override get _wantCreate() { return false; }\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.clearIsolatedElements(vp);\n }\n}\n\n/** Reset [EmphasizeElements]($frontend) for the active [Viewport]($frontend).\n * @beta\n */\nexport class ClearEmphasizedElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"ClearEmphasizedElements\";\n protected override get _wantCreate() { return false; }\n protected override get _wantClear() { return true; }\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n emph.clearEmphasizedElements(vp);\n vp.isFadeOutActive = false;\n }\n}\n\n/** Emphasize the set of elements currently visible in the view based on [Viewport.queryVisibleFeatures]($frontend).\n * @beta\n */\nexport class EmphasizeVisibleElementsTool extends EmphasizeElementsTool {\n public static override toolId = \"EmphasizeVisibleElements\";\n public static override get minArgs() { return 1; }\n public static override get maxArgs() { return 2; }\n private _options: QueryVisibleFeaturesOptions = { source: \"screen\" };\n protected override get _wantClear() { return true; }\n\n public override async parseAndRun(...input: string[]): Promise<boolean> {\n const args = parseArgs(input);\n const includeNonLocatable = args.getBoolean(\"n\");\n let source: \"screen\" | \"tiles\";\n switch (input[0].toLowerCase()) {\n case \"screen\":\n source = \"screen\";\n break;\n case \"tiles\":\n source = \"tiles\";\n break;\n default:\n return false;\n }\n\n this._options = { source, includeNonLocatable };\n return this.run(input);\n }\n\n public execute(emph: EmphasizeElements, vp: ScreenViewport): void {\n const elementIds = new Set<string>();\n vp.queryVisibleFeatures(this._options, (features) => {\n for (const feature of features) {\n if (feature.iModel === vp.iModel && Id64.isValid(feature.elementId))\n elementIds.add(feature.elementId);\n }\n });\n\n emph.wantEmphasis = true;\n if (emph.emphasizeElements(elementIds, vp))\n vp.isFadeOutActive = true;\n }\n}\n"]}
|
|
@@ -154,6 +154,7 @@ export class FrustumDecorator {
|
|
|
154
154
|
* @beta
|
|
155
155
|
*/
|
|
156
156
|
export class ToggleFrustumSnapshotTool extends Tool {
|
|
157
|
+
static { this.toolId = "ToggleFrustumSnapshot"; }
|
|
157
158
|
static get minArgs() { return 0; }
|
|
158
159
|
static get maxArgs() { return 2; }
|
|
159
160
|
async run(enable, showPreloadFrustum, showBackgroundIntersections) {
|
|
@@ -188,7 +189,6 @@ export class ToggleFrustumSnapshotTool extends Tool {
|
|
|
188
189
|
return true;
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
ToggleFrustumSnapshotTool.toolId = "ToggleFrustumSnapshot";
|
|
192
192
|
/**
|
|
193
193
|
* Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.
|
|
194
194
|
* Only useful when more than one spatial viewport is open.
|
|
@@ -265,6 +265,7 @@ class SelectedViewFrustumDecoration {
|
|
|
265
265
|
* @beta
|
|
266
266
|
*/
|
|
267
267
|
export class ToggleSelectedViewFrustumTool extends Tool {
|
|
268
|
+
static { this.toolId = "ToggleSelectedViewFrustum"; }
|
|
268
269
|
static get minArgs() { return 0; }
|
|
269
270
|
static get maxArgs() { return 1; }
|
|
270
271
|
async run(enable) {
|
|
@@ -288,7 +289,6 @@ export class ToggleSelectedViewFrustumTool extends Tool {
|
|
|
288
289
|
return true;
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
|
-
ToggleSelectedViewFrustumTool.toolId = "ToggleSelectedViewFrustum";
|
|
292
292
|
class ShadowFrustumDecoration {
|
|
293
293
|
constructor(vp) {
|
|
294
294
|
/** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */
|
|
@@ -349,6 +349,7 @@ class ShadowFrustumDecoration {
|
|
|
349
349
|
* @beta
|
|
350
350
|
*/
|
|
351
351
|
export class ToggleShadowFrustumTool extends Tool {
|
|
352
|
+
static { this.toolId = "ToggleShadowFrustum"; }
|
|
352
353
|
static get minArgs() { return 0; }
|
|
353
354
|
static get maxArgs() { return 1; }
|
|
354
355
|
async run(enable) {
|
|
@@ -364,5 +365,4 @@ export class ToggleShadowFrustumTool extends Tool {
|
|
|
364
365
|
return true;
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
|
-
ToggleShadowFrustumTool.toolId = "ToggleShadowFrustum";
|
|
368
368
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,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAlBsB,8BAAM,GAAG,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Map4d, Point3d } from \"@itwin/core-geometry\";\nimport { ColorByName, ColorDef, Frustum, LinePixels, Npc } from \"@itwin/core-common\";\nimport {\n CoordSystem, DecorateContext, Decorator, GraphicBuilder, GraphicType, IModelApp, Tool, Viewport, ViewState, ViewState3d,\n} from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\ninterface FrustumDecorationOptions {\n showPreloadFrustum?: boolean;\n showBackgroundIntersections?: boolean;\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n */\nclass FrustumDecoration {\n private readonly _worldFrustum: Frustum;\n private readonly _adjustedWorldFrustum: Frustum;\n private readonly _preloadFrustum: Frustum;\n private readonly _npcFrustum: Frustum;\n private readonly _worldToNpcMap: Map4d;\n private readonly _eyePoint: Point3d;\n private readonly _focalPlane: number;\n private readonly _isCameraOn: boolean;\n\n private constructor(vp: Viewport, view: ViewState3d, private readonly _options?: FrustumDecorationOptions) {\n this._worldFrustum = vp.getFrustum(CoordSystem.World, false);\n this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);\n this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();\n this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);\n this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();\n this._eyePoint = view.camera.getEyePoint().clone();\n this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;\n this._isCameraOn = vp.isCameraOn;\n }\n\n public static create(vp: Viewport, options?: FrustumDecorationOptions): FrustumDecoration | undefined {\n const view = vp.view.isSpatialView() ? vp.view : undefined;\n return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;\n }\n\n public decorate(context: DecorateContext): void {\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._isCameraOn)\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);\n\n FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n const options = this._options;\n if (options !== undefined) {\n if (options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);\n\n if (options?.showBackgroundIntersections) {\n const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();\n if (backgroundMapGeometry)\n backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);\n }\n }\n context.addDecorationFromBuilder(builder);\n }\n\n public static drawPreloadFrustum(builder: GraphicBuilder, frustum: Frustum) {\n const preloadColor = ColorDef.create(ColorByName.coral);\n builder.setSymbology(preloadColor, preloadColor, 1, LinePixels.Code2);\n builder.addFrustum(frustum);\n }\n\n public static drawFrustumBox(builder: GraphicBuilder, frustum: Frustum, adjustedBox: boolean, vp: Viewport): void {\n const backPts = this.getPlanePts(frustum.points, false); // back plane\n const frontPts = this.getPlanePts(frustum.points, true); // front plane\n\n const bgColor = vp.view.backgroundColor;\n const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);\n const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);\n const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);\n const edgeWeight = adjustedBox ? 2 : 1;\n const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;\n\n // Back plane\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(backPts);\n\n // Front plane\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(frontPts);\n\n // Bottom edge\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 0));\n builder.addLineString(this.getEdgePts(backPts, frontPts, 1));\n\n // Top edge\n builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 2));\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 3));\n }\n\n private static getEdgePts(startPts: Point3d[], endPts: Point3d[], index: number): Point3d[] {\n return [\n startPts[index],\n endPts[index],\n ];\n }\n\n private static getPlanePts(frustPts: Point3d[], front: boolean): Point3d[] {\n const baseIndex = front ? Npc._001 : Npc._000;\n const planePts = [\n frustPts[baseIndex + Npc._000],\n frustPts[baseIndex + Npc._100],\n frustPts[baseIndex + Npc._110],\n frustPts[baseIndex + Npc._010],\n ];\n\n planePts.push(planePts[0]);\n return planePts;\n }\n\n public static drawEyePositionAndFocalPlane(builder: GraphicBuilder, npcFrustum: Frustum, worldToNpcMap: Map4d, eyePoint: Point3d, focusPlaneNpc: number, vp: Viewport): void {\n // Eye position...\n const contrastColor = vp.getContrastToBackgroundColor();\n builder.setSymbology(contrastColor, ColorDef.black, 8);\n builder.addPointString([eyePoint]);\n\n // Focal plane...\n const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);\n const focalPtsWorld: Point3d[] = [];\n for (const npcPt of focalPtsNpc)\n focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));\n worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);\n\n const bgColor = vp.view.backgroundColor;\n const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);\n const focalTransColor = focalPlaneColor.withTransparency(100);\n builder.setSymbology(focalPlaneColor, focalTransColor, 2);\n builder.addLineString(focalPtsWorld);\n builder.addShape(focalPtsWorld);\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n * @beta\n */\nexport class FrustumDecorator implements Decorator {\n private readonly _decoration?: FrustumDecoration;\n\n private constructor(vp: Viewport, options?: FrustumDecorationOptions) {\n this._decoration = FrustumDecoration.create(vp, options);\n }\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n if (undefined !== this._decoration)\n this._decoration.decorate(context);\n }\n\n private static _instance?: FrustumDecorator;\n\n /** Add the decoration to the specified viewport. */\n public static enable(vp: Viewport, options?: FrustumDecorationOptions): void {\n FrustumDecorator.disable();\n FrustumDecorator._instance = new FrustumDecorator(vp, options);\n IModelApp.viewManager.addDecorator(FrustumDecorator._instance);\n }\n\n /** Remove the decoration from the specified viewport. */\n public static disable(): void {\n const instance = FrustumDecorator._instance;\n if (undefined !== instance) {\n IModelApp.viewManager.dropDecorator(instance);\n FrustumDecorator._instance = undefined;\n }\n }\n\n public static get isEnabled() { return undefined !== FrustumDecorator._instance; }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the [[FrustumDecorator]].\n * @beta\n */\nexport class ToggleFrustumSnapshotTool extends Tool {\n public static override toolId = \"ToggleFrustumSnapshot\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n\n public override async run(enable?: boolean, showPreloadFrustum?: boolean, showBackgroundIntersections?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (undefined === enable)\n enable = !FrustumDecorator.isEnabled;\n\n if (enable !== FrustumDecorator.isEnabled) {\n if (enable) {\n FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });\n vp.onChangeView.addOnce(() => FrustumDecorator.disable());\n } else {\n FrustumDecorator.disable();\n }\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n let showPreload, showBackgroundIntersections, enable;\n for (const arg of args) {\n if (arg === \"preload\")\n showPreload = true;\n else if (arg === \"background\")\n showBackgroundIntersections = true;\n else\n enable = parseToggle(arg);\n }\n\n if (typeof enable !== \"string\")\n await this.run(enable, showPreload, showBackgroundIntersections);\n\n return true;\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.\n * Only useful when more than one spatial viewport is open.\n */\nclass SelectedViewFrustumDecoration {\n private static _decorator?: SelectedViewFrustumDecoration;\n protected _targetVp: Viewport;\n protected _removeDecorationListener?: () => void;\n protected _removeViewChangedListener?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport, private _options?: FrustumDecorationOptions) {\n this._targetVp = vp;\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n protected stop(): void {\n if (this._removeDecorationListener) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n if (this._removeViewChangedListener) {\n this._removeViewChangedListener();\n this._removeViewChangedListener = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onViewChanged(targetVp: Viewport): void {\n if (targetVp !== this._targetVp)\n return;\n const decorator = SelectedViewFrustumDecoration._decorator;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._targetVp.isCameraOn) {\n const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);\n const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);\n }\n\n const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);\n const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);\n\n FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n if (this._options && this._options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());\n\n context.addDecorationFromBuilder(builder);\n }\n\n // Returns true if decoration becomes enabled.\n public static toggle(vp: Viewport, enabled?: boolean): boolean {\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;\n if (enabled === alreadyEnabled)\n return alreadyEnabled;\n }\n\n if (undefined === SelectedViewFrustumDecoration._decorator) {\n SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);\n return true;\n } else {\n SelectedViewFrustumDecoration._decorator.stop();\n SelectedViewFrustumDecoration._decorator = undefined;\n return false;\n }\n }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the selected view frustum decoration.\n * @beta\n */\nexport class ToggleSelectedViewFrustumTool extends Tool {\n public static override toolId = \"ToggleSelectedViewFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n if (SelectedViewFrustumDecoration.toggle(vp, enable)) {\n const remove = vp.onChangeView.addListener((_vp: Viewport, prev: ViewState) => {\n if (!prev.hasSameCoordinates(vp.view)) {\n SelectedViewFrustumDecoration.toggle(vp, false);\n remove();\n }\n });\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\nclass ShadowFrustumDecoration {\n private static _instance?: ShadowFrustumDecoration;\n private _targetVp: Viewport;\n private _cleanup?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport) {\n this._targetVp = vp;\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\n const removeOnRender = vp.onRender.addListener((_) => this.onRender());\n this._cleanup = () => {\n removeDecorator();\n removeOnRender();\n };\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onRender(): void {\n const decorator = ShadowFrustumDecoration._instance;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const frustum = this._targetVp.target.debugControl!.shadowFrustum;\n if (undefined === frustum)\n return;\n\n const thisVp = context.viewport;\n if (thisVp === this._targetVp || !thisVp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(vp: Viewport, enabled?: boolean): void {\n const instance = ShadowFrustumDecoration._instance;\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== instance;\n if (enabled === alreadyEnabled)\n return;\n }\n\n if (undefined === instance) {\n ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);\n } else {\n instance.stop();\n ShadowFrustumDecoration._instance = undefined;\n }\n }\n}\n\n/** Toggle visualization of the selected viewport's shadow frustum in all other viewports.\n * @beta\n */\nexport class ToggleShadowFrustumTool extends Tool {\n public static override toolId = \"ToggleShadowFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp && vp.view.isSpatialView())\n ShadowFrustumDecoration.toggle(vp, enable);\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FrustumDecoration.js","sourceRoot":"","sources":["../../../src/tools/FrustumDecoration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAS,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAW,UAAU,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EACL,WAAW,EAA8C,WAAW,EAAE,SAAS,EAAE,IAAI,GACtF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C;;;;;;GAMG;AACH,MAAM,iBAAiB;IAUrB,YAAoB,EA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SAAS,GAAG,IAAI,uBAAuB,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChB,uBAAuB,CAAC,SAAS,GAAG,SAAS,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,IAAI;aACxB,WAAM,GAAG,qBAAqB,CAAC;IAC/C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAc,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG,CAAC,MAAgB;QACxC,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,IAAI,SAAS,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;YAC7C,uBAAuB,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { Map4d, Point3d } from \"@itwin/core-geometry\";\nimport { ColorByName, ColorDef, Frustum, LinePixels, Npc } from \"@itwin/core-common\";\nimport {\n CoordSystem, DecorateContext, Decorator, GraphicBuilder, GraphicType, IModelApp, Tool, Viewport, ViewState, ViewState3d,\n} from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\ninterface FrustumDecorationOptions {\n showPreloadFrustum?: boolean;\n showBackgroundIntersections?: boolean;\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n */\nclass FrustumDecoration {\n private readonly _worldFrustum: Frustum;\n private readonly _adjustedWorldFrustum: Frustum;\n private readonly _preloadFrustum: Frustum;\n private readonly _npcFrustum: Frustum;\n private readonly _worldToNpcMap: Map4d;\n private readonly _eyePoint: Point3d;\n private readonly _focalPlane: number;\n private readonly _isCameraOn: boolean;\n\n private constructor(vp: Viewport, view: ViewState3d, private readonly _options?: FrustumDecorationOptions) {\n this._worldFrustum = vp.getFrustum(CoordSystem.World, false);\n this._adjustedWorldFrustum = vp.getFrustum(CoordSystem.World, true);\n this._preloadFrustum = vp.viewingSpace.getPreloadFrustum();\n this._npcFrustum = vp.getFrustum(CoordSystem.Npc, true);\n this._worldToNpcMap = vp.viewingSpace.worldToNpcMap.clone();\n this._eyePoint = view.camera.getEyePoint().clone();\n this._focalPlane = vp.worldToNpc(view.getTargetPoint()).z;\n this._isCameraOn = vp.isCameraOn;\n }\n\n public static create(vp: Viewport, options?: FrustumDecorationOptions): FrustumDecoration | undefined {\n const view = vp.view.isSpatialView() ? vp.view : undefined;\n return undefined !== view ? new FrustumDecoration(vp, view, options) : undefined;\n }\n\n public decorate(context: DecorateContext): void {\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._isCameraOn)\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, this._npcFrustum, this._worldToNpcMap, this._eyePoint, this._focalPlane, context.viewport);\n\n FrustumDecoration.drawFrustumBox(builder, this._worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, this._adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n const options = this._options;\n if (options !== undefined) {\n if (options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, this._preloadFrustum);\n\n if (options?.showBackgroundIntersections) {\n const backgroundMapGeometry = context.viewport.view.displayStyle.getBackgroundMapGeometry();\n if (backgroundMapGeometry)\n backgroundMapGeometry.addFrustumDecorations(builder, this._adjustedWorldFrustum);\n }\n }\n context.addDecorationFromBuilder(builder);\n }\n\n public static drawPreloadFrustum(builder: GraphicBuilder, frustum: Frustum) {\n const preloadColor = ColorDef.create(ColorByName.coral);\n builder.setSymbology(preloadColor, preloadColor, 1, LinePixels.Code2);\n builder.addFrustum(frustum);\n }\n\n public static drawFrustumBox(builder: GraphicBuilder, frustum: Frustum, adjustedBox: boolean, vp: Viewport): void {\n const backPts = this.getPlanePts(frustum.points, false); // back plane\n const frontPts = this.getPlanePts(frustum.points, true); // front plane\n\n const bgColor = vp.view.backgroundColor;\n const backAndBottomColor = ColorDef.red.adjustedForContrast(bgColor);\n const frontAndTopLeftColor = ColorDef.blue.adjustedForContrast(bgColor);\n const frontAndTopRightColor = ColorDef.green.adjustedForContrast(bgColor);\n const edgeWeight = adjustedBox ? 2 : 1;\n const edgeStyle = adjustedBox ? LinePixels.Solid : LinePixels.Code2;\n\n // Back plane\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(backPts);\n\n // Front plane\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(frontPts);\n\n // Bottom edge\n builder.setSymbology(backAndBottomColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 0));\n builder.addLineString(this.getEdgePts(backPts, frontPts, 1));\n\n // Top edge\n builder.setSymbology(frontAndTopRightColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 2));\n builder.setSymbology(frontAndTopLeftColor, ColorDef.black, edgeWeight, edgeStyle);\n builder.addLineString(this.getEdgePts(backPts, frontPts, 3));\n }\n\n private static getEdgePts(startPts: Point3d[], endPts: Point3d[], index: number): Point3d[] {\n return [\n startPts[index],\n endPts[index],\n ];\n }\n\n private static getPlanePts(frustPts: Point3d[], front: boolean): Point3d[] {\n const baseIndex = front ? Npc._001 : Npc._000;\n const planePts = [\n frustPts[baseIndex + Npc._000],\n frustPts[baseIndex + Npc._100],\n frustPts[baseIndex + Npc._110],\n frustPts[baseIndex + Npc._010],\n ];\n\n planePts.push(planePts[0]);\n return planePts;\n }\n\n public static drawEyePositionAndFocalPlane(builder: GraphicBuilder, npcFrustum: Frustum, worldToNpcMap: Map4d, eyePoint: Point3d, focusPlaneNpc: number, vp: Viewport): void {\n // Eye position...\n const contrastColor = vp.getContrastToBackgroundColor();\n builder.setSymbology(contrastColor, ColorDef.black, 8);\n builder.addPointString([eyePoint]);\n\n // Focal plane...\n const focalPtsNpc = FrustumDecoration.getPlanePts(npcFrustum.points, false);\n const focalPtsWorld: Point3d[] = [];\n for (const npcPt of focalPtsNpc)\n focalPtsWorld.push(Point3d.create(npcPt.x, npcPt.y, focusPlaneNpc));\n worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(focalPtsWorld);\n\n const bgColor = vp.view.backgroundColor;\n const focalPlaneColor = ColorDef.green.adjustedForContrast(bgColor);\n const focalTransColor = focalPlaneColor.withTransparency(100);\n builder.setSymbology(focalPlaneColor, focalTransColor, 2);\n builder.addLineString(focalPtsWorld);\n builder.addShape(focalPtsWorld);\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum.\n * This is obviously only useful when drawn inside a viewport using a *different* Frustum.\n * Options for doing so include:\n * - Having more than one viewport, and drawing the frustum of one viewport inside the other viewports; and\n * - Allowing the user to take a snapshot of the current frustum, then navigate the view to inspect it within the same viewport.\n * @beta\n */\nexport class FrustumDecorator implements Decorator {\n private readonly _decoration?: FrustumDecoration;\n\n private constructor(vp: Viewport, options?: FrustumDecorationOptions) {\n this._decoration = FrustumDecoration.create(vp, options);\n }\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n if (undefined !== this._decoration)\n this._decoration.decorate(context);\n }\n\n private static _instance?: FrustumDecorator;\n\n /** Add the decoration to the specified viewport. */\n public static enable(vp: Viewport, options?: FrustumDecorationOptions): void {\n FrustumDecorator.disable();\n FrustumDecorator._instance = new FrustumDecorator(vp, options);\n IModelApp.viewManager.addDecorator(FrustumDecorator._instance);\n }\n\n /** Remove the decoration from the specified viewport. */\n public static disable(): void {\n const instance = FrustumDecorator._instance;\n if (undefined !== instance) {\n IModelApp.viewManager.dropDecorator(instance);\n FrustumDecorator._instance = undefined;\n }\n }\n\n public static get isEnabled() { return undefined !== FrustumDecorator._instance; }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the [[FrustumDecorator]].\n * @beta\n */\nexport class ToggleFrustumSnapshotTool extends Tool {\n public static override toolId = \"ToggleFrustumSnapshot\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 2; }\n\n public override async run(enable?: boolean, showPreloadFrustum?: boolean, showBackgroundIntersections?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp)\n return true;\n\n if (undefined === enable)\n enable = !FrustumDecorator.isEnabled;\n\n if (enable !== FrustumDecorator.isEnabled) {\n if (enable) {\n FrustumDecorator.enable(vp, { showPreloadFrustum, showBackgroundIntersections });\n vp.onChangeView.addOnce(() => FrustumDecorator.disable());\n } else {\n FrustumDecorator.disable();\n }\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n let showPreload, showBackgroundIntersections, enable;\n for (const arg of args) {\n if (arg === \"preload\")\n showPreload = true;\n else if (arg === \"background\")\n showBackgroundIntersections = true;\n else\n enable = parseToggle(arg);\n }\n\n if (typeof enable !== \"string\")\n await this.run(enable, showPreload, showBackgroundIntersections);\n\n return true;\n }\n}\n\n/**\n * Decorates the viewport with a graphical depiction of a Frustum from the currently selected viewport.\n * Only useful when more than one spatial viewport is open.\n */\nclass SelectedViewFrustumDecoration {\n private static _decorator?: SelectedViewFrustumDecoration;\n protected _targetVp: Viewport;\n protected _removeDecorationListener?: () => void;\n protected _removeViewChangedListener?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport, private _options?: FrustumDecorationOptions) {\n this._targetVp = vp;\n this._removeDecorationListener = IModelApp.viewManager.addDecorator(this);\n this._removeViewChangedListener = vp.onViewChanged.addListener(this.onViewChanged, this); // eslint-disable-line @typescript-eslint/unbound-method\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n protected stop(): void {\n if (this._removeDecorationListener) {\n this._removeDecorationListener();\n this._removeDecorationListener = undefined;\n }\n if (this._removeViewChangedListener) {\n this._removeViewChangedListener();\n this._removeViewChangedListener = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onViewChanged(targetVp: Viewport): void {\n if (targetVp !== this._targetVp)\n return;\n const decorator = SelectedViewFrustumDecoration._decorator;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!this._targetVp.view.isSpatialView() || vp === this._targetVp || !vp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n\n if (this._targetVp.isCameraOn) {\n const npcFrustum = this._targetVp.getFrustum(CoordSystem.Npc, true);\n const focalPlane = this._targetVp.worldToNpc(this._targetVp.view.getTargetPoint()).z;\n FrustumDecoration.drawEyePositionAndFocalPlane(builder, npcFrustum, this._targetVp.viewingSpace.worldToNpcMap, this._targetVp.view.camera.getEyePoint(), focalPlane, context.viewport);\n }\n\n const worldFrustum = this._targetVp.getFrustum(CoordSystem.World, false);\n const adjustedWorldFrustum = this._targetVp.getFrustum(CoordSystem.World, true);\n\n FrustumDecoration.drawFrustumBox(builder, worldFrustum, false, context.viewport); // show original frustum...\n FrustumDecoration.drawFrustumBox(builder, adjustedWorldFrustum, true, context.viewport); // show adjusted frustum...\n if (this._options && this._options.showPreloadFrustum)\n FrustumDecoration.drawPreloadFrustum(builder, context.viewport.viewingSpace.getPreloadFrustum());\n\n context.addDecorationFromBuilder(builder);\n }\n\n // Returns true if decoration becomes enabled.\n public static toggle(vp: Viewport, enabled?: boolean): boolean {\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== SelectedViewFrustumDecoration._decorator;\n if (enabled === alreadyEnabled)\n return alreadyEnabled;\n }\n\n if (undefined === SelectedViewFrustumDecoration._decorator) {\n SelectedViewFrustumDecoration._decorator = new SelectedViewFrustumDecoration(vp);\n return true;\n } else {\n SelectedViewFrustumDecoration._decorator.stop();\n SelectedViewFrustumDecoration._decorator = undefined;\n return false;\n }\n }\n}\n\n/** Enable (\"ON\"), disable (\"OFF\"), or toggle (\"TOGGLE\" or omitted) the selected view frustum decoration.\n * @beta\n */\nexport class ToggleSelectedViewFrustumTool extends Tool {\n public static override toolId = \"ToggleSelectedViewFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined === vp || !vp.view.isSpatialView())\n return false;\n if (SelectedViewFrustumDecoration.toggle(vp, enable)) {\n const remove = vp.onChangeView.addListener((_vp: Viewport, prev: ViewState) => {\n if (!prev.hasSameCoordinates(vp.view)) {\n SelectedViewFrustumDecoration.toggle(vp, false);\n remove();\n }\n });\n }\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n\nclass ShadowFrustumDecoration {\n private static _instance?: ShadowFrustumDecoration;\n private _targetVp: Viewport;\n private _cleanup?: () => void;\n\n /** This will allow the render system to cache and reuse the decorations created by this decorator's decorate() method. */\n public readonly useCachedDecorations = true;\n\n public constructor(vp: Viewport) {\n this._targetVp = vp;\n const removeDecorator = IModelApp.viewManager.addDecorator(this);\n const removeOnRender = vp.onRender.addListener((_) => this.onRender());\n this._cleanup = () => {\n removeDecorator();\n removeOnRender();\n };\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n private stop(): void {\n if (undefined !== this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n }\n\n public onRender(): void {\n const decorator = ShadowFrustumDecoration._instance;\n if (undefined !== decorator) {\n for (const vp of IModelApp.viewManager) {\n if (vp !== this._targetVp)\n vp.invalidateCachedDecorations(decorator);\n }\n }\n }\n\n public decorate(context: DecorateContext): void {\n const frustum = this._targetVp.target.debugControl!.shadowFrustum;\n if (undefined === frustum)\n return;\n\n const thisVp = context.viewport;\n if (thisVp === this._targetVp || !thisVp.view.isSpatialView())\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration);\n FrustumDecoration.drawFrustumBox(builder, frustum, false, thisVp);\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(vp: Viewport, enabled?: boolean): void {\n const instance = ShadowFrustumDecoration._instance;\n if (undefined !== enabled) {\n const alreadyEnabled = undefined !== instance;\n if (enabled === alreadyEnabled)\n return;\n }\n\n if (undefined === instance) {\n ShadowFrustumDecoration._instance = new ShadowFrustumDecoration(vp);\n } else {\n instance.stop();\n ShadowFrustumDecoration._instance = undefined;\n }\n }\n}\n\n/** Toggle visualization of the selected viewport's shadow frustum in all other viewports.\n * @beta\n */\nexport class ToggleShadowFrustumTool extends Tool {\n public static override toolId = \"ToggleShadowFrustum\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 1; }\n\n public override async run(enable?: boolean): Promise<boolean> {\n const vp = IModelApp.viewManager.selectedView;\n if (undefined !== vp && vp.view.isSpatialView())\n ShadowFrustumDecoration.toggle(vp, enable);\n\n return true;\n }\n\n public override async parseAndRun(...args: string[]): Promise<boolean> {\n const enable = parseToggle(args[0]);\n if (typeof enable !== \"string\")\n await this.run(enable);\n\n return true;\n }\n}\n"]}
|
|
@@ -22,6 +22,7 @@ import { parseArgs } from "./parseArgs";
|
|
|
22
22
|
* @beta
|
|
23
23
|
*/
|
|
24
24
|
export class InspectElementTool extends PrimitiveTool {
|
|
25
|
+
static { this.toolId = "InspectElement"; }
|
|
25
26
|
static get minArgs() { return 0; }
|
|
26
27
|
static get maxArgs() { return 6; }
|
|
27
28
|
constructor(options, elementIds) {
|
|
@@ -191,5 +192,4 @@ export class InspectElementTool extends PrimitiveTool {
|
|
|
191
192
|
return this.run();
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
|
-
InspectElementTool.toolId = "InspectElement";
|
|
195
195
|
//# sourceMappingURL=InspectElementTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InspectElementTool.js","sourceRoot":"","sources":["../../../src/tools/InspectElementTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAyB,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAA0B,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EACU,SAAS,EAAE,YAAY,EAAa,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EACpI,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,GAC3D,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;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AC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAErG,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEtB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;;AA5MsB,yBAAM,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { BentleyError, Id64, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { GeometrySummaryOptions, GeometrySummaryVerbosity, IModelReadRpcInterface } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, CoreTools, EventHandled, HitDetail, IModelApp, LocateFilterStatus, LocateResponse, MessageBoxIconType, MessageBoxType,\n NotifyMessageDetails, OutputMessagePriority, PrimitiveTool,\n} from \"@itwin/core-frontend\";\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Creates a readable text summary of a geometric element or geometry part. The keyin takes the following arguments, all of which are optional:\n * - `id=elementId,elementId,elementId` comma-separated list of element Ids where each `elementId` is a hexadecimal element Id such as \"0x12cb\";\n * - `symbology=0|1` where 1 indicates detailed symbology information should be included in the output;\n * - `placement=0|1` where 1 indicates detailed geometric element placement should be included; and\n * - `verbosity=0|1|2` controlling the verbosity of the output for each geometric primitive in the geometry stream. Higher values = more detailed information. Note verbosity=2 can produce megabytes of data for certain types of geometric primitives like large meshes.\n * - `modal=0|1` where 1 indicates the output should appear in a modal dialog.\n * - `copy=0|1` where 1 indicates the output should be copied to the clipboard. Defaults to true.\n * - `refs=0|1` where 1 indicates that for geometry parts a list of all elements referencing that part should be included in the output. This is extremely computationally expensive.\n * If no id is specified, the tool runs in interactive mode: first operating upon the selection set (if any), then allowing the user to select additional elements.\n * @beta\n */\nexport class InspectElementTool extends PrimitiveTool {\n public static override toolId = \"InspectElement\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 6; }\n\n private _options: GeometrySummaryOptions = {};\n private _elementIds?: Id64String[];\n private _modal = false;\n private _useSelection = false;\n private _doCopy = false;\n private _explodeParts = false;\n\n constructor(options?: GeometrySummaryOptions, elementIds?: Id64String[]) {\n super();\n if (undefined !== options)\n this._options = { ...options };\n\n this._elementIds = elementIds;\n }\n\n private setupAndPromptForNextAction(): void {\n this._useSelection = (undefined !== this.targetView && this.targetView.iModel.selectionSet.isActive);\n if (!this._useSelection)\n IModelApp.accuSnap.enableLocate(true);\n\n this.showPrompt();\n }\n\n private showPrompt(): void {\n CoreTools.outputPromptByKey(this._useSelection ? \"ElementSet.Prompts.ConfirmSelection\" : \"ElementSet.Prompts.IdentifyElement\");\n }\n\n public override autoLockTarget(): void { }\n\n public override requireWriteableTarget(): boolean { return false; }\n\n public override async onUnsuspend() {\n this.showPrompt();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n if (undefined !== this._elementIds)\n this.process(this._elementIds).then(async () => {\n await this.onReinitialize();\n }).catch((err) => {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, err.toString()));\n });\n else {\n this.setupAndPromptForNextAction();\n }\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (this._useSelection) {\n if (undefined !== ev.viewport) {\n const ids: Id64Array = [];\n ev.viewport.iModel.selectionSet.elements.forEach((id) => {\n if (!Id64.isInvalid(id) && !Id64.isTransient(id))\n ids.push(id);\n });\n\n if (0 === ids.length)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.NotSupportedElmType\")));\n else\n await this.process(ids);\n\n await this.onReinitialize();\n return EventHandled.Yes;\n }\n }\n\n const hit = await IModelApp.locateManager.doLocate(new LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);\n if (undefined === hit || !hit.isElementHit)\n return EventHandled.No;\n\n await this.process([hit.sourceId]);\n this.setupAndPromptForNextAction();\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onReinitialize() {\n if (this._useSelection || undefined !== this._elementIds) {\n await this.exitTool();\n } else {\n await this.onRestartTool();\n }\n }\n\n public async onRestartTool() {\n const tool = new InspectElementTool();\n if (!await tool.run())\n return this.exitTool();\n }\n\n public override async filterHit(hit: HitDetail, _out: LocateResponse): Promise<LocateFilterStatus> {\n return hit.isElementHit ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n private async process(elementIds: Id64String[]) {\n const request = {\n elementIds,\n options: this._options,\n };\n let messageDetails: NotifyMessageDetails;\n try {\n let str = await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n if (this._explodeParts) {\n const regex = /^part id: (0x[a-f0-9]+)/gm;\n const partIds = new Set<string>();\n let match;\n while (null !== (match = regex.exec(str)))\n partIds.add(match[1]);\n\n if (partIds.size > 0) {\n request.elementIds = Array.from(partIds);\n str += `\\npart ids: ${JSON.stringify(request.elementIds)}\\n`;\n str += await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n }\n }\n\n if (this._doCopy)\n copyStringToClipboard(str);\n\n const brief = `Summary ${this._doCopy ? \"copied to clipboard.\" : \"complete.\"}`;\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Info, brief, str);\n\n if (this._modal) {\n const div = document.createElement(\"div\");\n const appendText = (toAppend: string) => {\n const txt = document.createElement(\"div\");\n txt.innerText = toAppend;\n div.append(txt);\n };\n\n const lines = str.split(\"\\n\");\n const maxLines = 30;\n let curLine = 0;\n for (const line of lines) {\n appendText(line);\n if (++curLine > maxLines) {\n appendText(\"...\");\n break;\n }\n }\n\n await IModelApp.notifications.openMessageBox(MessageBoxType.Ok, div, MessageBoxIconType.Information);\n }\n } catch (err) {\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Error, \"Error occurred while generating summary\", BentleyError.getErrorMessage(err));\n }\n\n IModelApp.notifications.outputMessage(messageDetails);\n }\n\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\n const args = parseArgs(inputArgs);\n const ids = args.get(\"i\");\n if (undefined !== ids)\n this._elementIds = ids.split(\",\");\n\n const verbosity = args.getInteger(\"v\");\n if (undefined !== verbosity) {\n switch (verbosity) {\n case 0:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Basic;\n break;\n case 1:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Detailed;\n break;\n case 2:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Full;\n break;\n }\n }\n\n const symbology = args.getBoolean(\"s\");\n if (undefined !== symbology)\n this._options.verboseSymbology = symbology;\n\n const placement = args.getBoolean(\"p\");\n if (undefined !== placement)\n this._options.includePlacement = placement;\n\n const parts = args.getBoolean(\"r\");\n if (true === parts && undefined !== IModelApp.viewManager.selectedView)\n this._options.includePartReferences = IModelApp.viewManager.selectedView.view.is3d() ? \"3d\" : \"2d\";\n\n const modal = args.getBoolean(\"m\");\n if (undefined !== modal)\n this._modal = modal;\n\n const doCopy = args.getBoolean(\"c\");\n if (undefined !== doCopy)\n this._doCopy = doCopy;\n\n this._explodeParts = true === args.getBoolean(\"e\");\n\n return this.run();\n }\n}\n"]}
|
|
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CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAE7C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAE7C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,KAAK,IAAI,SAAS,KAAK,SAAS,CAAC,WAAW,CAAC,YAAY;YACpE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAErG,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEtB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,SAAS,KAAK,MAAM;YACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { BentleyError, Id64, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { GeometrySummaryOptions, GeometrySummaryVerbosity, IModelReadRpcInterface } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, CoreTools, EventHandled, HitDetail, IModelApp, LocateFilterStatus, LocateResponse, MessageBoxIconType, MessageBoxType,\n NotifyMessageDetails, OutputMessagePriority, PrimitiveTool,\n} from \"@itwin/core-frontend\";\nimport { copyStringToClipboard } from \"../ClipboardUtilities\";\nimport { parseArgs } from \"./parseArgs\";\n\n/** Creates a readable text summary of a geometric element or geometry part. The keyin takes the following arguments, all of which are optional:\n * - `id=elementId,elementId,elementId` comma-separated list of element Ids where each `elementId` is a hexadecimal element Id such as \"0x12cb\";\n * - `symbology=0|1` where 1 indicates detailed symbology information should be included in the output;\n * - `placement=0|1` where 1 indicates detailed geometric element placement should be included; and\n * - `verbosity=0|1|2` controlling the verbosity of the output for each geometric primitive in the geometry stream. Higher values = more detailed information. Note verbosity=2 can produce megabytes of data for certain types of geometric primitives like large meshes.\n * - `modal=0|1` where 1 indicates the output should appear in a modal dialog.\n * - `copy=0|1` where 1 indicates the output should be copied to the clipboard. Defaults to true.\n * - `refs=0|1` where 1 indicates that for geometry parts a list of all elements referencing that part should be included in the output. This is extremely computationally expensive.\n * If no id is specified, the tool runs in interactive mode: first operating upon the selection set (if any), then allowing the user to select additional elements.\n * @beta\n */\nexport class InspectElementTool extends PrimitiveTool {\n public static override toolId = \"InspectElement\";\n public static override get minArgs() { return 0; }\n public static override get maxArgs() { return 6; }\n\n private _options: GeometrySummaryOptions = {};\n private _elementIds?: Id64String[];\n private _modal = false;\n private _useSelection = false;\n private _doCopy = false;\n private _explodeParts = false;\n\n constructor(options?: GeometrySummaryOptions, elementIds?: Id64String[]) {\n super();\n if (undefined !== options)\n this._options = { ...options };\n\n this._elementIds = elementIds;\n }\n\n private setupAndPromptForNextAction(): void {\n this._useSelection = (undefined !== this.targetView && this.targetView.iModel.selectionSet.isActive);\n if (!this._useSelection)\n IModelApp.accuSnap.enableLocate(true);\n\n this.showPrompt();\n }\n\n private showPrompt(): void {\n CoreTools.outputPromptByKey(this._useSelection ? \"ElementSet.Prompts.ConfirmSelection\" : \"ElementSet.Prompts.IdentifyElement\");\n }\n\n public override autoLockTarget(): void { }\n\n public override requireWriteableTarget(): boolean { return false; }\n\n public override async onUnsuspend() {\n this.showPrompt();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n if (undefined !== this._elementIds)\n this.process(this._elementIds).then(async () => {\n await this.onReinitialize();\n }).catch((err) => {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, err.toString()));\n });\n else {\n this.setupAndPromptForNextAction();\n }\n }\n\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\n if (this._useSelection) {\n if (undefined !== ev.viewport) {\n const ids: Id64Array = [];\n ev.viewport.iModel.selectionSet.elements.forEach((id) => {\n if (!Id64.isInvalid(id) && !Id64.isTransient(id))\n ids.push(id);\n });\n\n if (0 === ids.length)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.NotSupportedElmType\")));\n else\n await this.process(ids);\n\n await this.onReinitialize();\n return EventHandled.Yes;\n }\n }\n\n const hit = await IModelApp.locateManager.doLocate(new LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);\n if (undefined === hit || !hit.isElementHit)\n return EventHandled.No;\n\n await this.process([hit.sourceId]);\n this.setupAndPromptForNextAction();\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onReinitialize() {\n if (this._useSelection || undefined !== this._elementIds) {\n await this.exitTool();\n } else {\n await this.onRestartTool();\n }\n }\n\n public async onRestartTool() {\n const tool = new InspectElementTool();\n if (!await tool.run())\n return this.exitTool();\n }\n\n public override async filterHit(hit: HitDetail, _out: LocateResponse): Promise<LocateFilterStatus> {\n return hit.isElementHit ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n private async process(elementIds: Id64String[]) {\n const request = {\n elementIds,\n options: this._options,\n };\n let messageDetails: NotifyMessageDetails;\n try {\n let str = await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n if (this._explodeParts) {\n const regex = /^part id: (0x[a-f0-9]+)/gm;\n const partIds = new Set<string>();\n let match;\n while (null !== (match = regex.exec(str)))\n partIds.add(match[1]);\n\n if (partIds.size > 0) {\n request.elementIds = Array.from(partIds);\n str += `\\npart ids: ${JSON.stringify(request.elementIds)}\\n`;\n str += await IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).getGeometrySummary(this.iModel.getRpcProps(), request);\n }\n }\n\n if (this._doCopy)\n copyStringToClipboard(str);\n\n const brief = `Summary ${this._doCopy ? \"copied to clipboard.\" : \"complete.\"}`;\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Info, brief, str);\n\n if (this._modal) {\n const div = document.createElement(\"div\");\n const appendText = (toAppend: string) => {\n const txt = document.createElement(\"div\");\n txt.innerText = toAppend;\n div.append(txt);\n };\n\n const lines = str.split(\"\\n\");\n const maxLines = 30;\n let curLine = 0;\n for (const line of lines) {\n appendText(line);\n if (++curLine > maxLines) {\n appendText(\"...\");\n break;\n }\n }\n\n await IModelApp.notifications.openMessageBox(MessageBoxType.Ok, div, MessageBoxIconType.Information);\n }\n } catch (err) {\n messageDetails = new NotifyMessageDetails(OutputMessagePriority.Error, \"Error occurred while generating summary\", BentleyError.getErrorMessage(err));\n }\n\n IModelApp.notifications.outputMessage(messageDetails);\n }\n\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\n const args = parseArgs(inputArgs);\n const ids = args.get(\"i\");\n if (undefined !== ids)\n this._elementIds = ids.split(\",\");\n\n const verbosity = args.getInteger(\"v\");\n if (undefined !== verbosity) {\n switch (verbosity) {\n case 0:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Basic;\n break;\n case 1:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Detailed;\n break;\n case 2:\n this._options.geometryVerbosity = GeometrySummaryVerbosity.Full;\n break;\n }\n }\n\n const symbology = args.getBoolean(\"s\");\n if (undefined !== symbology)\n this._options.verboseSymbology = symbology;\n\n const placement = args.getBoolean(\"p\");\n if (undefined !== placement)\n this._options.includePlacement = placement;\n\n const parts = args.getBoolean(\"r\");\n if (true === parts && undefined !== IModelApp.viewManager.selectedView)\n this._options.includePartReferences = IModelApp.viewManager.selectedView.view.is3d() ? \"3d\" : \"2d\";\n\n const modal = args.getBoolean(\"m\");\n if (undefined !== modal)\n this._modal = modal;\n\n const doCopy = args.getBoolean(\"c\");\n if (undefined !== doCopy)\n this._doCopy = doCopy;\n\n this._explodeParts = true === args.getBoolean(\"e\");\n\n return this.run();\n }\n}\n"]}
|
|
@@ -61,6 +61,7 @@ class AttachMapLayerBaseTool extends Tool {
|
|
|
61
61
|
export class AttachModelMapLayerTool extends Tool {
|
|
62
62
|
static get minArgs() { return 0; }
|
|
63
63
|
static get maxArgs() { return 1; }
|
|
64
|
+
static { this.toolId = "AttachModelMapLayerTool"; }
|
|
64
65
|
constructor(_formatId) {
|
|
65
66
|
super();
|
|
66
67
|
this._formatId = _formatId;
|
|
@@ -89,7 +90,6 @@ export class AttachModelMapLayerTool extends Tool {
|
|
|
89
90
|
async onRestartTool() {
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
AttachModelMapLayerTool.toolId = "AttachModelMapLayerTool";
|
|
93
93
|
/** Attach a map layer from URL base class. */
|
|
94
94
|
class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
|
|
95
95
|
static get minArgs() { return 1; }
|
|
@@ -115,6 +115,7 @@ class AttachMapLayerByURLBaseTool extends AttachMapLayerBaseTool {
|
|
|
115
115
|
* @beta
|
|
116
116
|
*/
|
|
117
117
|
export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
118
|
+
static { this.toolId = "AttachWmsMapLayerTool"; }
|
|
118
119
|
constructor() { super("WMS"); }
|
|
119
120
|
/** This method runs the tool, attaching a WMS map layer from a given URL.
|
|
120
121
|
* @param args contains url, name, userName, password in array order
|
|
@@ -123,11 +124,11 @@ export class AttachWmsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
|
123
124
|
return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
|
-
AttachWmsMapLayerByUrlTool.toolId = "AttachWmsMapLayerTool";
|
|
127
127
|
/** This tool attaches a WMTS map layer from a given URL.
|
|
128
128
|
* @beta
|
|
129
129
|
*/
|
|
130
130
|
export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
131
|
+
static { this.toolId = "AttachWmtsMapLayerTool"; }
|
|
131
132
|
constructor() { super("WMTS"); }
|
|
132
133
|
/** This method runs the tool, attaching a WMTS map layer from a given URL.
|
|
133
134
|
* @param args contains url, name, userName, password in array order
|
|
@@ -136,39 +137,39 @@ export class AttachWmtsMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
|
136
137
|
return this.run(WmsUtilities.getBaseUrl(args[0]), args[1], args[2], args[3]);
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
AttachWmtsMapLayerByUrlTool.toolId = "AttachWmtsMapLayerTool";
|
|
140
140
|
/** This tool attaches an ArcGIS map layer from a given URL.
|
|
141
141
|
* @beta
|
|
142
142
|
*/
|
|
143
143
|
export class AttachArcGISMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
144
|
+
static { this.toolId = "AttachArcGISMapLayerTool"; }
|
|
144
145
|
constructor() { super("ArcGIS"); }
|
|
145
146
|
}
|
|
146
|
-
AttachArcGISMapLayerByUrlTool.toolId = "AttachArcGISMapLayerTool";
|
|
147
147
|
/** This tool attaches an ArcGIS map layer from a given URL.
|
|
148
148
|
* @beta
|
|
149
149
|
*/
|
|
150
150
|
export class AttachArcGISFeatureMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
151
|
+
static { this.toolId = "AttachArcGISFeatureMapLayerTool"; }
|
|
151
152
|
constructor() { super("ArcGISFeature"); }
|
|
152
153
|
}
|
|
153
|
-
AttachArcGISFeatureMapLayerByUrlTool.toolId = "AttachArcGISFeatureMapLayerTool";
|
|
154
154
|
/** This tool attaches an ArcGIS map layer from a given URL.
|
|
155
155
|
* @beta
|
|
156
156
|
*/
|
|
157
157
|
export class AttachOgcApiFeaturesMapLayerTool extends AttachMapLayerByURLBaseTool {
|
|
158
|
+
static { this.toolId = "AttachOgcApiFeaturesMapLayerTool"; }
|
|
158
159
|
constructor() { super("OgcApiFeatures"); }
|
|
159
160
|
}
|
|
160
|
-
AttachOgcApiFeaturesMapLayerTool.toolId = "AttachOgcApiFeaturesMapLayerTool";
|
|
161
161
|
/** This tool attaches a map layer from a given tile URL.
|
|
162
162
|
* @beta
|
|
163
163
|
*/
|
|
164
164
|
export class AttachTileURLMapLayerByUrlTool extends AttachMapLayerByURLBaseTool {
|
|
165
|
+
static { this.toolId = "AttachTileURLMapLayerTool"; }
|
|
165
166
|
constructor() { super("TileURL"); }
|
|
166
167
|
}
|
|
167
|
-
AttachTileURLMapLayerByUrlTool.toolId = "AttachTileURLMapLayerTool";
|
|
168
168
|
/** This tool add a Map Layer from a specified name (look up in MapLayerSources.json).
|
|
169
169
|
* @beta
|
|
170
170
|
*/
|
|
171
171
|
export class AttachMapLayerTool extends AttachMapLayerBaseTool {
|
|
172
|
+
static { this.toolId = "AttachMapLayerTool"; }
|
|
172
173
|
static get minArgs() { return 1; }
|
|
173
174
|
static get maxArgs() { return 1; }
|
|
174
175
|
/** This method runs the tool, adding a map layer from a specified name in MayLayerSources.json.
|
|
@@ -194,31 +195,31 @@ export class AttachMapLayerTool extends AttachMapLayerBaseTool {
|
|
|
194
195
|
return this.run(args[0]);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
AttachMapLayerTool.toolId = "AttachMapLayerTool";
|
|
198
198
|
/** This tool attaches a Overlay map layer.
|
|
199
199
|
* @beta
|
|
200
200
|
*/
|
|
201
201
|
export class AttachMapOverlayTool extends AttachMapLayerTool {
|
|
202
|
+
static { this.toolId = "AttachMapOverlayTool"; }
|
|
202
203
|
constructor() {
|
|
203
204
|
super();
|
|
204
205
|
this._isBackground = false;
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
AttachMapOverlayTool.toolId = "AttachMapOverlayTool";
|
|
208
208
|
/** Sets map layer base tool.
|
|
209
209
|
* @beta
|
|
210
210
|
*/
|
|
211
211
|
export class SetMapBaseTool extends AttachMapLayerTool {
|
|
212
|
+
static { this.toolId = "SetMapBaseTool"; }
|
|
212
213
|
constructor() {
|
|
213
214
|
super();
|
|
214
215
|
this._isBase = true;
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
|
-
SetMapBaseTool.toolId = "SetMapBaseTool";
|
|
218
218
|
/** Detach Map Layers Tool.
|
|
219
219
|
* @beta
|
|
220
220
|
*/
|
|
221
221
|
export class DetachMapLayersTool extends Tool {
|
|
222
|
+
static { this.toolId = "DetachMapLayersTool"; }
|
|
222
223
|
static get minArgs() { return 0; }
|
|
223
224
|
static get maxArgs() { return 0; }
|
|
224
225
|
async parseAndRun(..._args) {
|
|
@@ -234,7 +235,6 @@ export class DetachMapLayersTool extends Tool {
|
|
|
234
235
|
return true;
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
|
-
DetachMapLayersTool.toolId = "DetachMapLayersTool";
|
|
238
238
|
function parseLayerIndex(args) {
|
|
239
239
|
const layerIndex = args.length > 1 ? parseInt(args[1], 10) : 0;
|
|
240
240
|
return isNaN(layerIndex) ? 0 : layerIndex;
|
|
@@ -243,6 +243,7 @@ function parseLayerIndex(args) {
|
|
|
243
243
|
* @beta
|
|
244
244
|
*/
|
|
245
245
|
export class MapLayerVisibilityTool extends Tool {
|
|
246
|
+
static { this.toolId = "SetMapLayerVisibility"; }
|
|
246
247
|
static get minArgs() { return 1; }
|
|
247
248
|
static get maxArgs() { return 2; }
|
|
248
249
|
/** This method runs the tool, setting the visibility of a map layer.
|
|
@@ -272,11 +273,11 @@ export class MapLayerVisibilityTool extends Tool {
|
|
|
272
273
|
return true;
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
|
-
MapLayerVisibilityTool.toolId = "SetMapLayerVisibility";
|
|
276
276
|
/** This tool reorders map layers.
|
|
277
277
|
* @beta
|
|
278
278
|
*/
|
|
279
279
|
export class ReorderMapLayers extends Tool {
|
|
280
|
+
static { this.toolId = "ReorderMapLayers"; }
|
|
280
281
|
static get minArgs() { return 0; }
|
|
281
282
|
static get maxArgs() { return 2; }
|
|
282
283
|
/** This method runs the tool, reordering the map layers.
|
|
@@ -301,11 +302,11 @@ export class ReorderMapLayers extends Tool {
|
|
|
301
302
|
return true;
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
|
-
ReorderMapLayers.toolId = "ReorderMapLayers";
|
|
305
305
|
/** This tool sets the transparency of a map layer.
|
|
306
306
|
* @beta
|
|
307
307
|
*/
|
|
308
308
|
export class MapLayerTransparencyTool extends Tool {
|
|
309
|
+
static { this.toolId = "SetMapLayerTransparency"; }
|
|
309
310
|
static get minArgs() { return 1; }
|
|
310
311
|
static get maxArgs() { return 2; }
|
|
311
312
|
/** This method runs the tool, setting the transparency of a map layer.
|
|
@@ -331,11 +332,11 @@ export class MapLayerTransparencyTool extends Tool {
|
|
|
331
332
|
return true;
|
|
332
333
|
}
|
|
333
334
|
}
|
|
334
|
-
MapLayerTransparencyTool.toolId = "SetMapLayerTransparency";
|
|
335
335
|
/** This tool sets the visibility of the map sublayer.
|
|
336
336
|
* @beta
|
|
337
337
|
*/
|
|
338
338
|
export class MapLayerSubLayerVisibilityTool extends Tool {
|
|
339
|
+
static { this.toolId = "SetMapSubLayerVisibility"; }
|
|
339
340
|
static get minArgs() { return 1; }
|
|
340
341
|
static get maxArgs() { return 2; }
|
|
341
342
|
/** This method runs the tool, setting the visibility of a map sublayer.
|
|
@@ -360,11 +361,11 @@ export class MapLayerSubLayerVisibilityTool extends Tool {
|
|
|
360
361
|
return true;
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
|
-
MapLayerSubLayerVisibilityTool.toolId = "SetMapSubLayerVisibility";
|
|
364
364
|
/** This tool changes the viewport so it is zoomed to the range of a map layer.
|
|
365
365
|
* @beta
|
|
366
366
|
*/
|
|
367
367
|
export class MapLayerZoomTool extends Tool {
|
|
368
|
+
static { this.toolId = "MapLayerZoom"; }
|
|
368
369
|
static get minArgs() { return 0; }
|
|
369
370
|
static get maxArgs() { return 1; }
|
|
370
371
|
/** This method runs the tool, changing the viewport so it is zoomed to the range of a map layer.
|
|
@@ -386,11 +387,11 @@ export class MapLayerZoomTool extends Tool {
|
|
|
386
387
|
return true;
|
|
387
388
|
}
|
|
388
389
|
}
|
|
389
|
-
MapLayerZoomTool.toolId = "MapLayerZoom";
|
|
390
390
|
/** This tool toggles whether to apply terrain heights to the map.
|
|
391
391
|
* @beta
|
|
392
392
|
*/
|
|
393
393
|
export class ToggleTerrainTool extends Tool {
|
|
394
|
+
static { this.toolId = "ToggleTerrain"; }
|
|
394
395
|
static get minArgs() { return 0; }
|
|
395
396
|
static get maxArgs() { return 1; }
|
|
396
397
|
/** This method runs the tool, changing whether to apply terrain heights to the map.
|
|
@@ -415,11 +416,11 @@ export class ToggleTerrainTool extends Tool {
|
|
|
415
416
|
return true;
|
|
416
417
|
}
|
|
417
418
|
}
|
|
418
|
-
ToggleTerrainTool.toolId = "ToggleTerrain";
|
|
419
419
|
/** This tool changes the color of the base map.
|
|
420
420
|
* @beta
|
|
421
421
|
*/
|
|
422
422
|
export class MapBaseColorTool extends Tool {
|
|
423
|
+
static { this.toolId = "SetMapBaseColorTool"; }
|
|
423
424
|
static get minArgs() { return 3; }
|
|
424
425
|
static get maxArgs() { return 3; }
|
|
425
426
|
/** This method runs the tool, changing the color of the base map.
|
|
@@ -443,11 +444,11 @@ export class MapBaseColorTool extends Tool {
|
|
|
443
444
|
return (isNaN(red) || red < 0 || red > 255 || isNaN(green) || green < 0 || green > 255 || isNaN(blue) || blue < 0 || blue > 255) ? false : this.run(ColorDef.from(red, green, blue));
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
|
-
MapBaseColorTool.toolId = "SetMapBaseColorTool";
|
|
447
447
|
/** This tool changes the transparency of the base map.
|
|
448
448
|
* @beta
|
|
449
449
|
*/
|
|
450
450
|
export class MapBaseTransparencyTool extends Tool {
|
|
451
|
+
static { this.toolId = "SetMapBaseTransparencyTool"; }
|
|
451
452
|
static get minArgs() { return 1; }
|
|
452
453
|
static get maxArgs() { return 1; }
|
|
453
454
|
/** This method runs the tool, changing the transparency of the base map.
|
|
@@ -469,11 +470,11 @@ export class MapBaseTransparencyTool extends Tool {
|
|
|
469
470
|
return (isNaN(transparency) || transparency < 0 || transparency > 1) ? false : this.run(transparency);
|
|
470
471
|
}
|
|
471
472
|
}
|
|
472
|
-
MapBaseTransparencyTool.toolId = "SetMapBaseTransparencyTool";
|
|
473
473
|
/** This tool changes the visibility of the base map.
|
|
474
474
|
* @beta
|
|
475
475
|
*/
|
|
476
476
|
export class MapBaseVisibilityTool extends Tool {
|
|
477
|
+
static { this.toolId = "SetMapBaseVisibilityTool"; }
|
|
477
478
|
static get minArgs() { return 1; }
|
|
478
479
|
static get maxArgs() { return 1; }
|
|
479
480
|
/** This method runs the tool, changing the visibility of the base map.
|
|
@@ -495,5 +496,4 @@ export class MapBaseVisibilityTool extends Tool {
|
|
|
495
496
|
return (visible !== undefined ? this.run(visible) : false);
|
|
496
497
|
}
|
|
497
498
|
}
|
|
498
|
-
MapBaseVisibilityTool.toolId = "SetMapBaseVisibilityTool";
|
|
499
499
|
//# sourceMappingURL=MapLayerTool.js.map
|