@itwin/frontend-devtools 5.0.0-dev.50 → 5.0.0-dev.52

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TileTreeBoundsDecoration.d.ts","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":"AAUA,OAAO,EAA8D,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAyDxG;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,IAAI;IAC1D,OAAuB,MAAM,SAAoC;IACjE,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
1
+ {"version":3,"file":"TileTreeBoundsDecoration.d.ts","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":"AAUA,OAAO,EAA8D,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA2DxG;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,IAAI;IAC1D,OAAuB,MAAM,SAAoC;IACjE,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
@@ -24,7 +24,9 @@ class TreeDecoration {
24
24
  }
25
25
  }
26
26
  decorate(context) {
27
- context.viewport.forEachTileTreeRef((ref) => this.drawBoundingBox(ref, context));
27
+ for (const ref of context.viewport.getTileTreeRefs()) {
28
+ this.drawBoundingBox(ref, context);
29
+ }
28
30
  }
29
31
  drawBoundingBox(ref, context) {
30
32
  const tree = ref.treeOwner.tileTree;
@@ -1 +1 @@
1
- {"version":3,"file":"TileTreeBoundsDecoration.js","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,oDAA0D;AAC1D,wDAAwG;AACxG,+CAA4C;AAE5C,MAAM,cAAc;IAIlB;QAWA,0HAA0H;QAC1G,yBAAoB,GAAG,IAAI,CAAC;QAX1C,IAAI,CAAC,SAAS,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEO,IAAI;QACV,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAKM,QAAQ,CAAC,OAAwB;QACtC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACnF,CAAC;IAEO,eAAe,CAAC,GAAsB,EAAE,OAAwB;QACtE,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;QACpC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;YAC9F,OAAO;QAET,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,2BAAW,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;QACpF,OAAO,CAAC,YAAY,CAAC,sBAAQ,CAAC,KAAK,EAAE,sBAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,wBAAU,CAAC,KAAK,CAAC,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AC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAhBH,gFAiBC","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 { ColorDef, LinePixels } from \"@itwin/core-common\";\nimport { DecorateContext, GraphicType, IModelApp, TileTreeReference, Tool } from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\nclass TreeDecoration {\n private static _instance?: TreeDecoration;\n private _removeMe?: () => void;\n\n private constructor() {\n this._removeMe = IModelApp.viewManager.addDecorator(this);\n }\n\n private stop() {\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\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 context.viewport.forEachTileTreeRef((ref) => this.drawBoundingBox(ref, context));\n }\n\n private drawBoundingBox(ref: TileTreeReference, context: DecorateContext): void {\n const tree = ref.treeOwner.tileTree;\n const location = ref.getLocation();\n if (undefined === location || undefined === tree || tree.isContentUnbounded || tree.range.isNull)\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration, location);\n builder.setSymbology(ColorDef.green, ColorDef.green, 1, LinePixels.Solid);\n builder.addRangeBox(tree.range);\n\n if (undefined !== tree.contentRange) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 1, LinePixels.Solid);\n builder.addRangeBox(tree.contentRange);\n }\n\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(enabled?: boolean): void {\n const instance = TreeDecoration._instance;\n if (undefined !== enabled && (undefined !== instance) === enabled)\n return;\n\n if (undefined === instance) {\n TreeDecoration._instance = new TreeDecoration();\n } else {\n instance.stop();\n TreeDecoration._instance = undefined;\n }\n }\n}\n\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\n * @beta\n */\nexport class ToggleTileTreeBoundsDecorationTool extends Tool {\n public static override toolId = \"ToggleTileTreeBoundsDecoration\";\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 TreeDecoration.toggle(enable);\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":"TileTreeBoundsDecoration.js","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,oDAA0D;AAC1D,wDAAwG;AACxG,+CAA4C;AAE5C,MAAM,cAAc;IAIlB;QAWA,0HAA0H;QAC1G,yBAAoB,GAAG,IAAI,CAAC;QAX1C,IAAI,CAAC,SAAS,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEO,IAAI;QACV,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAKM,QAAQ,CAAC,OAAwB;QACtC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC;YACrD,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,GAAsB,EAAE,OAAwB;QACtE,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;QACpC,MAAM,QAAQ,GAAG,GAAG,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,CAAC;IAC1D,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,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAEe,KAAK,CAAC,WAAW,CAAC,GAAG,IAAc;QACjD,MAAM,MAAM,GAAG,IAAA,yBAAW,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACd,CAAC;;AAhBH,gFAiBC","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 { ColorDef, LinePixels } from \"@itwin/core-common\";\nimport { DecorateContext, GraphicType, IModelApp, TileTreeReference, Tool } from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\nclass TreeDecoration {\n private static _instance?: TreeDecoration;\n private _removeMe?: () => void;\n\n private constructor() {\n this._removeMe = IModelApp.viewManager.addDecorator(this);\n }\n\n private stop() {\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\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 for (const ref of context.viewport.getTileTreeRefs()) {\n this.drawBoundingBox(ref, context);\n }\n }\n\n private drawBoundingBox(ref: TileTreeReference, context: DecorateContext): void {\n const tree = ref.treeOwner.tileTree;\n const location = ref.getLocation();\n if (undefined === location || undefined === tree || tree.isContentUnbounded || tree.range.isNull)\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration, location);\n builder.setSymbology(ColorDef.green, ColorDef.green, 1, LinePixels.Solid);\n builder.addRangeBox(tree.range);\n\n if (undefined !== tree.contentRange) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 1, LinePixels.Solid);\n builder.addRangeBox(tree.contentRange);\n }\n\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(enabled?: boolean): void {\n const instance = TreeDecoration._instance;\n if (undefined !== enabled && (undefined !== instance) === enabled)\n return;\n\n if (undefined === instance) {\n TreeDecoration._instance = new TreeDecoration();\n } else {\n instance.stop();\n TreeDecoration._instance = undefined;\n }\n }\n}\n\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\n * @beta\n */\nexport class ToggleTileTreeBoundsDecorationTool extends Tool {\n public static override toolId = \"ToggleTileTreeBoundsDecoration\";\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 TreeDecoration.toggle(enable);\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 +1 @@
1
- {"version":3,"file":"TileTreeBoundsDecoration.d.ts","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":"AAUA,OAAO,EAA8D,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAyDxG;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,IAAI;IAC1D,OAAuB,MAAM,SAAoC;IACjE,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
1
+ {"version":3,"file":"TileTreeBoundsDecoration.d.ts","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":"AAUA,OAAO,EAA8D,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA2DxG;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,IAAI;IAC1D,OAAuB,MAAM,SAAoC;IACjE,WAA2B,OAAO,WAAgB;IAClD,WAA2B,OAAO,WAAgB;IAE5B,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAOvE"}
@@ -21,7 +21,9 @@ class TreeDecoration {
21
21
  }
22
22
  }
23
23
  decorate(context) {
24
- context.viewport.forEachTileTreeRef((ref) => this.drawBoundingBox(ref, context));
24
+ for (const ref of context.viewport.getTileTreeRefs()) {
25
+ this.drawBoundingBox(ref, context);
26
+ }
25
27
  }
26
28
  drawBoundingBox(ref, context) {
27
29
  const tree = ref.treeOwner.tileTree;
@@ -1 +1 @@
1
- {"version":3,"file":"TileTreeBoundsDecoration.js","sourceRoot":"","sources":["../../../src/tools/TileTreeBoundsDecoration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAmB,WAAW,EAAE,SAAS,EAAqB,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,cAAc;IAIlB;QAWA,0HAA0H;QAC1G,yBAAoB,GAAG,IAAI,CAAC;QAX1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEO,IAAI;QACV,IAAI,IAAI,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,GAAG,cAAc,CAAC,SAAS,CAAC;QAC1C,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,KAAK,OAAO;YAC/D,OAAO;QAET,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,cAAc,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,EAAE,CAAC;YAChB,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,IAAI;aACnC,WAAM,GAAG,gCAAgC,CAAC;IAC1D,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,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,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 { ColorDef, LinePixels } from \"@itwin/core-common\";\nimport { DecorateContext, GraphicType, IModelApp, TileTreeReference, Tool } from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\nclass TreeDecoration {\n private static _instance?: TreeDecoration;\n private _removeMe?: () => void;\n\n private constructor() {\n this._removeMe = IModelApp.viewManager.addDecorator(this);\n }\n\n private stop() {\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\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 context.viewport.forEachTileTreeRef((ref) => this.drawBoundingBox(ref, context));\n }\n\n private drawBoundingBox(ref: TileTreeReference, context: DecorateContext): void {\n const tree = ref.treeOwner.tileTree;\n const location = ref.getLocation();\n if (undefined === location || undefined === tree || tree.isContentUnbounded || tree.range.isNull)\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration, location);\n builder.setSymbology(ColorDef.green, ColorDef.green, 1, LinePixels.Solid);\n builder.addRangeBox(tree.range);\n\n if (undefined !== tree.contentRange) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 1, LinePixels.Solid);\n builder.addRangeBox(tree.contentRange);\n }\n\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(enabled?: boolean): void {\n const instance = TreeDecoration._instance;\n if (undefined !== enabled && (undefined !== instance) === enabled)\n return;\n\n if (undefined === instance) {\n TreeDecoration._instance = new TreeDecoration();\n } else {\n instance.stop();\n TreeDecoration._instance = undefined;\n }\n }\n}\n\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\n * @beta\n */\nexport class ToggleTileTreeBoundsDecorationTool extends Tool {\n public static override toolId = \"ToggleTileTreeBoundsDecoration\";\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 TreeDecoration.toggle(enable);\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":"TileTreeBoundsDecoration.js","sourceRoot":"","sources":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AW,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 { ColorDef, LinePixels } from \"@itwin/core-common\";\nimport { DecorateContext, GraphicType, IModelApp, TileTreeReference, Tool } from \"@itwin/core-frontend\";\nimport { parseToggle } from \"./parseToggle\";\n\nclass TreeDecoration {\n private static _instance?: TreeDecoration;\n private _removeMe?: () => void;\n\n private constructor() {\n this._removeMe = IModelApp.viewManager.addDecorator(this);\n }\n\n private stop() {\n if (this._removeMe) {\n this._removeMe();\n this._removeMe = undefined;\n }\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 for (const ref of context.viewport.getTileTreeRefs()) {\n this.drawBoundingBox(ref, context);\n }\n }\n\n private drawBoundingBox(ref: TileTreeReference, context: DecorateContext): void {\n const tree = ref.treeOwner.tileTree;\n const location = ref.getLocation();\n if (undefined === location || undefined === tree || tree.isContentUnbounded || tree.range.isNull)\n return;\n\n const builder = context.createGraphicBuilder(GraphicType.WorldDecoration, location);\n builder.setSymbology(ColorDef.green, ColorDef.green, 1, LinePixels.Solid);\n builder.addRangeBox(tree.range);\n\n if (undefined !== tree.contentRange) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 1, LinePixels.Solid);\n builder.addRangeBox(tree.contentRange);\n }\n\n context.addDecorationFromBuilder(builder);\n }\n\n public static toggle(enabled?: boolean): void {\n const instance = TreeDecoration._instance;\n if (undefined !== enabled && (undefined !== instance) === enabled)\n return;\n\n if (undefined === instance) {\n TreeDecoration._instance = new TreeDecoration();\n } else {\n instance.stop();\n TreeDecoration._instance = undefined;\n }\n }\n}\n\n/** Display in every viewport a green range graphic for each displayed tile tree, plus a red range graphic for each tile tree's content range if defined.\n * @beta\n */\nexport class ToggleTileTreeBoundsDecorationTool extends Tool {\n public static override toolId = \"ToggleTileTreeBoundsDecoration\";\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 TreeDecoration.toggle(enable);\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/frontend-devtools",
3
- "version": "5.0.0-dev.50",
3
+ "version": "5.0.0-dev.52",
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": "5.0.0-dev.50",
28
- "@itwin/core-common": "5.0.0-dev.50",
29
- "@itwin/core-frontend": "5.0.0-dev.50",
30
- "@itwin/core-geometry": "5.0.0-dev.50"
27
+ "@itwin/core-bentley": "5.0.0-dev.52",
28
+ "@itwin/core-common": "5.0.0-dev.52",
29
+ "@itwin/core-frontend": "5.0.0-dev.52",
30
+ "@itwin/core-geometry": "5.0.0-dev.52"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@itwin/eslint-plugin": "5.0.0-dev.1",
@@ -36,7 +36,7 @@
36
36
  "eslint": "^9.13.0",
37
37
  "rimraf": "^3.0.2",
38
38
  "typescript": "~5.6.2",
39
- "@itwin/build-tools": "5.0.0-dev.50"
39
+ "@itwin/build-tools": "5.0.0-dev.52"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm",