@itwin/core-frontend 5.1.0-dev.55 → 5.1.0-dev.56

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.
Files changed (55) hide show
  1. package/lib/cjs/DisplayStyleState.d.ts +37 -0
  2. package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
  3. package/lib/cjs/DisplayStyleState.js +65 -0
  4. package/lib/cjs/DisplayStyleState.js.map +1 -1
  5. package/lib/cjs/Viewport.d.ts.map +1 -1
  6. package/lib/cjs/Viewport.js +16 -0
  7. package/lib/cjs/Viewport.js.map +1 -1
  8. package/lib/cjs/core-frontend.d.ts +1 -1
  9. package/lib/cjs/core-frontend.js +1 -1
  10. package/lib/cjs/core-frontend.js.map +1 -1
  11. package/lib/cjs/internal/ScriptUtils.d.ts +5 -0
  12. package/lib/cjs/internal/ScriptUtils.d.ts.map +1 -0
  13. package/lib/cjs/internal/ScriptUtils.js +120 -0
  14. package/lib/cjs/internal/ScriptUtils.js.map +1 -0
  15. package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
  16. package/lib/cjs/internal/tile/IModelTileTree.d.ts +4 -2
  17. package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
  18. package/lib/cjs/internal/tile/IModelTileTree.js +58 -0
  19. package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
  20. package/lib/cjs/internal/tile/PrimaryTileTree.js +1 -1
  21. package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
  22. package/lib/cjs/tile/ImdlReader.js.map +1 -1
  23. package/lib/cjs/tile/TileTree.d.ts +14 -1
  24. package/lib/cjs/tile/TileTree.d.ts.map +1 -1
  25. package/lib/cjs/tile/TileTree.js +13 -0
  26. package/lib/cjs/tile/TileTree.js.map +1 -1
  27. package/lib/esm/DisplayStyleState.d.ts +37 -0
  28. package/lib/esm/DisplayStyleState.d.ts.map +1 -1
  29. package/lib/esm/DisplayStyleState.js +65 -0
  30. package/lib/esm/DisplayStyleState.js.map +1 -1
  31. package/lib/esm/Viewport.d.ts.map +1 -1
  32. package/lib/esm/Viewport.js +16 -0
  33. package/lib/esm/Viewport.js.map +1 -1
  34. package/lib/esm/core-frontend.d.ts +1 -1
  35. package/lib/esm/core-frontend.js +1 -1
  36. package/lib/esm/core-frontend.js.map +1 -1
  37. package/lib/esm/internal/ScriptUtils.d.ts +5 -0
  38. package/lib/esm/internal/ScriptUtils.d.ts.map +1 -0
  39. package/lib/esm/internal/ScriptUtils.js +117 -0
  40. package/lib/esm/internal/ScriptUtils.js.map +1 -0
  41. package/lib/esm/internal/tile/IModelTile.js.map +1 -1
  42. package/lib/esm/internal/tile/IModelTileTree.d.ts +4 -2
  43. package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
  44. package/lib/esm/internal/tile/IModelTileTree.js +60 -2
  45. package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
  46. package/lib/esm/internal/tile/PrimaryTileTree.js +1 -1
  47. package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
  48. package/lib/esm/tile/ImdlReader.js.map +1 -1
  49. package/lib/esm/tile/TileTree.d.ts +14 -1
  50. package/lib/esm/tile/TileTree.d.ts.map +1 -1
  51. package/lib/esm/tile/TileTree.js +13 -0
  52. package/lib/esm/tile/TileTree.js.map +1 -1
  53. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  54. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  55. package/package.json +20 -20
@@ -1 +1 @@
1
- {"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmF;AAGnF,oEAAgF;AAChF,4CAAyC;AAMzC;;;;GAIG;AACH,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IAC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AAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;CACF;AA3JD,4BA2JC","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 Tiles\n */\n\nimport { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n}\n\n"]}
1
+ {"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmF;AAGnF,oEAAgF;AAChF,4CAAyC;AAMzC;;;;GAIG;AACH,IAAY,kBASX;AATD,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C;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,wBAAwB,CAAC,QAAyC,IAAkB,CAAC;IAClG;;;;OAIG;IACI,0BAA0B,KAAU,CAAC;CAC7C;AAzKD,4BAyKC","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 Tiles\n */\n\nimport { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, RenderSchedule, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n\n /**\n * Invoked when a schedule script is edited.\n * Override to handle updates for affected elements or timelines.\n *\n * @internal\n */\n public async onScheduleEditingChanged(_changes: RenderSchedule.EditingChanges[]): Promise<void> {}\n /**\n * Invoked when a schedule script is committed during editing.\n * Override in specific tile tree types to handle the change.\n * @internal\n */\n public onScheduleEditingCommitted(): void {}\n}\n\n"]}
@@ -44,6 +44,14 @@ export declare abstract class DisplayStyleState extends ElementState implements
44
44
  */
45
45
  readonly [_onScheduleScriptReferenceChanged]: BeEvent<(newScriptReference: RenderSchedule.ScriptReference | undefined) => void>;
46
46
  private _scriptReference?;
47
+ /** Event raised when schedule script edits are made, providing changed element IDs and the editing scope.
48
+ * @beta
49
+ */
50
+ readonly onScheduleEditingChanged: BeEvent<(changes: RenderSchedule.EditingChanges[]) => void>;
51
+ /** Event raised when schedule script edits are committed (finalized).
52
+ * @beta
53
+ */
54
+ readonly onScheduleEditingCommitted: BeEvent<() => void>;
47
55
  /** Event raised just before the [[scheduleScript]] property is changed. */
48
56
  readonly onScheduleScriptChanged: BeEvent<(newScript: RenderSchedule.Script | undefined) => void>;
49
57
  /** Event raised just after [[setOSMBuildingDisplay]] changes the enabled state of the OSM buildings. */
@@ -118,6 +126,35 @@ export declare abstract class DisplayStyleState extends ElementState implements
118
126
  * @see [DisplayStyleSettings.renderTimeline]($common).
119
127
  */
120
128
  changeRenderTimeline(timelineId: Id64String | undefined): Promise<void>;
129
+ /**
130
+ * Begins or updates a schedule script editing session for the current display style.
131
+ * During an editing session, changes to the schedule script are applied incrementally
132
+ * using temporary dynamic tiles, allowing for interactive preview of visual changes like color,
133
+ * transforms, visibility, and cutting planes — without requiring a full tile tree reload.
134
+ *
135
+ * Calling this method multiple times will update the current editing session with new script changes.
136
+ * When all edits are complete, you must invoke [[commitScheduleEditing]] to finalize the session and
137
+ * trigger a full tile tree refresh with the committed script.
138
+ *
139
+ * @note You cannot use schedule script editing while a @see [[GraphicalEditingScope]] is active.
140
+ *
141
+ * Example:
142
+ * ```ts
143
+ * [[include:ScheduleScript_editingMode]]
144
+ * ```
145
+ *
146
+ * @beta
147
+ */
148
+ setScheduleEditing(newScript: RenderSchedule.Script): void;
149
+ /**
150
+ * Finalizes a script editing session previously started with [[setScheduleEditing]].
151
+ * This applies all pending script changes and triggers a full tile tree reload to reflect them in the viewport.
152
+ * After this call, the schedule script is considered committed and editing mode ends.
153
+ *
154
+ * @see [[setScheduleEditing]] to begin a schedule script editing session.
155
+ * @beta
156
+ */
157
+ commitScheduleEditing(): void;
121
158
  /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.
122
159
  * @see [[changeRenderTimeline]] to change the script.
123
160
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayStyleState.d.ts","sourceRoot":"","sources":["../../src/DisplayStyleState.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAU,OAAO,EAAQ,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAAyB,0BAA0B,EAAE,qBAAqB,EAC5F,iBAAiB,EAAwB,QAAQ,EAAE,wBAAwB,EAAE,sBAAsB,EACnG,iBAAiB,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAyB,aAAa,EAAE,aAAa,EACvI,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EACvE,mBAAmB,EAAE,mBAAmB,EAAE,UAAU,EAAuF,SAAS,EACrJ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CA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W,YAAY,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAE5C;IAED;;;;OAIG;IACI,UAAU,CAAC,IAAI,EAAE,MAAM;IAI9B,2CAA2C;IAC3C,IAAW,YAAY,IAAI,mBAAmB,CAE7C;IACD,IAAW,YAAY,CAAC,QAAQ,EAAE,mBAAmB,EAEpD;IAED,gBAAgB;cACG,8BAA8B,IAAI,IAAI;IAezD,gBAAgB;IACT,sBAAsB,IAAI,uBAAuB,GAAG,SAAS;CAWrE"}
@@ -16,6 +16,7 @@ import { IModelApp } from "./IModelApp";
16
16
  import { PlanarClipMaskState } from "./PlanarClipMaskState";
17
17
  import { getCesiumOSMBuildingsUrl } from "./tile/internal";
18
18
  import { _onScheduleScriptReferenceChanged, _scheduleScriptReference } from './common/internal/Symbols';
19
+ import { getScriptDelta } from "./internal/ScriptUtils";
19
20
  /** @internal */
20
21
  export class TerrainDisplayOverrides {
21
22
  wantSkirts;
@@ -38,6 +39,14 @@ export class DisplayStyleState extends ElementState {
38
39
  */
39
40
  [_onScheduleScriptReferenceChanged] = new BeEvent();
40
41
  _scriptReference;
42
+ /** Event raised when schedule script edits are made, providing changed element IDs and the editing scope.
43
+ * @beta
44
+ */
45
+ onScheduleEditingChanged = new BeEvent();
46
+ /** Event raised when schedule script edits are committed (finalized).
47
+ * @beta
48
+ */
49
+ onScheduleEditingCommitted = new BeEvent();
41
50
  /** Event raised just before the [[scheduleScript]] property is changed. */
42
51
  onScheduleScriptChanged = new BeEvent();
43
52
  /** Event raised just after [[setOSMBuildingDisplay]] changes the enabled state of the OSM buildings. */
@@ -240,6 +249,62 @@ export class DisplayStyleState extends ElementState {
240
249
  if (this._queryRenderTimelinePropsPromise)
241
250
  await this._queryRenderTimelinePropsPromise;
242
251
  }
252
+ /**
253
+ * Begins or updates a schedule script editing session for the current display style.
254
+ * During an editing session, changes to the schedule script are applied incrementally
255
+ * using temporary dynamic tiles, allowing for interactive preview of visual changes like color,
256
+ * transforms, visibility, and cutting planes — without requiring a full tile tree reload.
257
+ *
258
+ * Calling this method multiple times will update the current editing session with new script changes.
259
+ * When all edits are complete, you must invoke [[commitScheduleEditing]] to finalize the session and
260
+ * trigger a full tile tree refresh with the committed script.
261
+ *
262
+ * @note You cannot use schedule script editing while a @see [[GraphicalEditingScope]] is active.
263
+ *
264
+ * Example:
265
+ * ```ts
266
+ * [[include:ScheduleScript_editingMode]]
267
+ * ```
268
+ *
269
+ * @beta
270
+ */
271
+ setScheduleEditing(newScript) {
272
+ const prevScript = this.scheduleScript;
273
+ const changes = [];
274
+ const globalDelta = getScriptDelta(prevScript, newScript);
275
+ for (const timeline of newScript.modelTimelines) {
276
+ const ids = new Set();
277
+ for (const et of timeline.elementTimelines) {
278
+ for (const id of et.elementIds) {
279
+ if (globalDelta.has(id))
280
+ ids.add(id);
281
+ }
282
+ }
283
+ if (ids.size > 0)
284
+ changes.push({ timeline, elements: ids });
285
+ }
286
+ this.scheduleScript = newScript;
287
+ this.onScheduleEditingChanged.raiseEvent(changes);
288
+ for (const modelTimeline of this.scheduleScript.modelTimelines) {
289
+ modelTimeline.isEditingCommitted = false;
290
+ }
291
+ }
292
+ /**
293
+ * Finalizes a script editing session previously started with [[setScheduleEditing]].
294
+ * This applies all pending script changes and triggers a full tile tree reload to reflect them in the viewport.
295
+ * After this call, the schedule script is considered committed and editing mode ends.
296
+ *
297
+ * @see [[setScheduleEditing]] to begin a schedule script editing session.
298
+ * @beta
299
+ */
300
+ commitScheduleEditing() {
301
+ this.onScheduleEditingCommitted.raiseEvent();
302
+ if (!this.scheduleScript)
303
+ return;
304
+ for (const modelTimeline of this.scheduleScript.modelTimelines) {
305
+ modelTimeline.isEditingCommitted = true;
306
+ }
307
+ }
243
308
  /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.
244
309
  * @see [[changeRenderTimeline]] to change the script.
245
310
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayStyleState.js","sourceRoot":"","sources":["../../src/DisplayStyleState.ts"],"names":[],"mappings":"AAA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AAO,CAAC,KAAK,EAAE,CAAC;gBACzD,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;IACT,sBAAsB;QAC3B,IAAI,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACzC,MAAM,GAAG,GAAG,IAAI,uBAAuB,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,oBAAoB,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;gBAClH,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC;YACzB,IAAI,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,CAAC,mBAAmB,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,IAAI,mBAAmB,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAC9K,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;YACzB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 Views\n */\nimport { assert, BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\nimport { Range1d, Vector3d } from \"@itwin/core-geometry\";\nimport {\n BackgroundMapProps, BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapSettings,\n BaseLayerSettings, BaseMapLayerSettings, ColorDef, ContextRealityModelProps, DisplayStyle3dSettings, DisplayStyle3dSettingsProps,\n DisplayStyleProps, DisplayStyleSettings, Environment, FeatureAppearance, GlobeMode, ImageMapLayerSettings, LightSettings, MapLayerProps,\n MapLayerSettings, MapSubLayerProps, RenderSchedule, RenderTimelineProps,\n SolarShadowSettings, SubCategoryOverride, SubLayerId, TerrainHeightOriginMode, ThematicDisplay, ThematicDisplayMode, ThematicGradientMode, ViewFlags,\n} from \"@itwin/core-common\";\nimport { ApproximateTerrainHeights } from \"./ApproximateTerrainHeights\";\nimport { BackgroundMapGeometry } from \"./BackgroundMapGeometry\";\nimport { ContextRealityModelState } from \"./ContextRealityModelState\";\nimport { ElementState } from \"./EntityState\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\nimport { getCesiumOSMBuildingsUrl, MapLayerIndex, TileTreeReference } from \"./tile/internal\";\nimport { _onScheduleScriptReferenceChanged, _scheduleScriptReference } from './common/internal/Symbols';\n\n/** @internal */\nexport class TerrainDisplayOverrides {\n public wantSkirts?: boolean;\n public wantNormals?: boolean;\n public produceGeometry?: boolean;\n}\n\n/** Options controlling display of [OpenStreetMap Buildings](https://cesium.com/platform/cesium-ion/content/cesium-osm-buildings/).\n * @see [[DisplayStyleState.setOSMBuildingDisplay]].\n * @public\n * @extensions\n */\nexport interface OsmBuildingDisplayOptions {\n /** If defined, enables or disables display of the buildings by attaching or detaching the OpenStreetMap Buildings reality model. */\n onOff?: boolean;\n /** If defined, overrides aspects of the appearance of the OpenStreetMap building meshes. */\n appearanceOverrides?: FeatureAppearance;\n}\n\n/** A DisplayStyle defines the parameters for 'styling' the contents of a [[ViewState]].\n * @public\n * @extensions\n */\nexport abstract class DisplayStyleState extends ElementState implements DisplayStyleProps {\n public static override get className() { return \"DisplayStyle\"; }\n private _ellipsoidMapGeometry: BackgroundMapGeometry | undefined;\n private _attachedRealityModelPlanarClipMasks = new Map<Id64String, PlanarClipMaskState>();\n /** @internal */\n protected _queryRenderTimelinePropsPromise?: Promise<RenderTimelineProps | undefined>;\n private _assigningScript = false;\n\n\n /** Event raised just before the [[scheduleScriptReference]] property is changed.\n * @internal as of 5.0, use [[onScheduleScriptChanged]].\n */\n public readonly [_onScheduleScriptReferenceChanged] = new BeEvent<(newScriptReference: RenderSchedule.ScriptReference | undefined) => void>();\n\n private _scriptReference?: RenderSchedule.ScriptReference;\n\n /** Event raised just before the [[scheduleScript]] property is changed. */\n public readonly onScheduleScriptChanged = new BeEvent<(newScript: RenderSchedule.Script | undefined) => void>();\n /** Event raised just after [[setOSMBuildingDisplay]] changes the enabled state of the OSM buildings. */\n public readonly onOSMBuildingDisplayChanged = new BeEvent<(osmBuildingDisplayEnabled: boolean) => void>();\n\n /** The container for this display style's settings. */\n public abstract get settings(): DisplayStyleSettings;\n\n /** @internal */\n public abstract overrideTerrainDisplay(): TerrainDisplayOverrides | undefined;\n\n /** Construct a new DisplayStyleState from its JSON representation.\n * @param props JSON representation of the display style.\n * @param iModel IModelConnection containing the display style.\n * @param source If the constructor is being invoked from [[EntityState.clone]], the display style that is being cloned.\n */\n constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyleState) {\n super(props, iModel);\n const styles = this.jsonProperties.styles;\n\n if (source)\n this._scriptReference = source._scriptReference;\n\n if (styles) {\n // ###TODO Use DisplayStyleSettings.planarClipMasks\n if (styles.planarClipOvr)\n for (const planarClipOvr of styles.planarClipOvr)\n if (Id64.isValid(planarClipOvr.modelId))\n this._attachedRealityModelPlanarClipMasks.set(planarClipOvr.modelId, PlanarClipMaskState.fromJSON(planarClipOvr));\n }\n }\n\n /** Ensures all of the data required by the display style is loaded. This method is invoked for you by [[ViewState.load]], but if\n * you obtain a display style by some other means you should `await` this method before using the display style.\n */\n public async load(): Promise<void> {\n // If we were cloned, we may already have a valid schedule state, and our display style Id may be invalid / different.\n // Preserve it if still usable.\n if (this._scriptReference) {\n if (this.settings.renderTimeline === this._scriptReference.sourceId) {\n // The script came from the same RenderTimeline element. Keep it.\n return;\n }\n\n if (undefined === this.settings.renderTimeline) {\n // The script came from a display style's JSON properties. Keep it if (1) this style is not persistent or (2) this style has the same Id\n if (this.id === this._scriptReference.sourceId || !Id64.isValidId64(this.id))\n return;\n }\n }\n\n // The schedule script stored in JSON properties takes precedence over the RenderTimeline if both are defined.\n if (this.settings.scheduleScriptProps)\n this.loadScriptReferenceFromScript(this.settings.scheduleScriptProps);\n else\n await this.loadScriptReferenceFromTimeline(this.settings.renderTimeline);\n }\n\n private loadScriptReferenceFromScript(scriptProps: Readonly<RenderSchedule.ScriptProps>): void {\n let newState;\n try {\n const script = RenderSchedule.Script.fromJSON(scriptProps);\n if (script)\n newState = new RenderSchedule.ScriptReference(this.id, script);\n } catch {\n // schedule state is undefined.\n }\n\n if (newState !== this._scriptReference) {\n this[_onScheduleScriptReferenceChanged].raiseEvent(newState);\n this.onScheduleScriptChanged.raiseEvent(newState?.script);\n this._scriptReference = newState;\n }\n }\n\n private async loadScriptReferenceFromTimeline(timelineId: Id64String | undefined): Promise<void> {\n let newState;\n if (timelineId && Id64.isValidId64(timelineId)) {\n try {\n // If a subsequent call to loadScriptReferenceFromTimeline is made while we're awaiting this one, we'll abort this one.\n const promise = this._queryRenderTimelinePropsPromise = this.queryRenderTimelineProps(timelineId);\n const timeline = await promise;\n if (promise !== this._queryRenderTimelinePropsPromise)\n return;\n\n if (timeline) {\n const scriptProps = JSON.parse(timeline.script);\n const script = RenderSchedule.Script.fromJSON(scriptProps);\n if (script)\n newState = new RenderSchedule.ScriptReference(timelineId, script);\n }\n } catch {\n // schedule state is undefined.\n }\n }\n\n this._queryRenderTimelinePropsPromise = undefined;\n if (newState !== this._scriptReference) {\n this[_onScheduleScriptReferenceChanged].raiseEvent(newState);\n this.onScheduleScriptChanged.raiseEvent(newState?.script);\n this._scriptReference = newState;\n }\n }\n\n /** @internal */\n protected async queryRenderTimelineProps(timelineId: Id64String): Promise<RenderTimelineProps | undefined> {\n try {\n const omitScriptElementIds = !IModelApp.tileAdmin.enableFrontendScheduleScripts;\n return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds } }) as RenderTimelineProps;\n } catch {\n return undefined;\n }\n }\n\n /** @internal */\n public get displayTerrain() {\n return this.viewFlags.backgroundMap && this.settings.backgroundMap.applyTerrain;\n }\n\n /** @internal */\n public get globeMode(): GlobeMode { return this.settings.backgroundMap.globeMode; }\n\n /** Settings controlling how the base map is displayed within a view.\n * The base map can be provided by any map imagery source or set to be a single color.\n */\n public get backgroundMapBase(): BaseLayerSettings {\n return this.settings.mapImagery.backgroundBase;\n }\n public set backgroundMapBase(base: BaseLayerSettings) {\n this.settings.mapImagery.backgroundBase = base;\n this._synchBackgroundMapImagery();\n }\n\n /** The settings controlling how a background map is displayed within a view.\n * @see [[ViewFlags.backgroundMap]] for toggling display of the map on or off.\n */\n public get backgroundMapSettings(): BackgroundMapSettings { return this.settings.backgroundMap; }\n public set backgroundMapSettings(settings: BackgroundMapSettings) {\n this.settings.backgroundMap = settings;\n }\n\n /** Modify a subset of the background map display settings.\n * @param name props JSON representation of the properties to change. Any properties not present will retain their current values in `this.backgroundMapSettings`.\n * @see [[ViewFlags.backgroundMap]] for toggling display of the map.\n * @see [[changeBackgroundMapProvider]] to change the type of map imagery displayed.\n *\n * Example that changes only the elevation, leaving the provider and type unchanged:\n * ``` ts\n * style.changeBackgroundMapProps({ groundBias: 16.2 });\n * ```\n * @public\n */\n public changeBackgroundMapProps(props: BackgroundMapProps): void {\n const newSettings = this.backgroundMapSettings.clone(props);\n this.backgroundMapSettings = newSettings;\n }\n\n /** Change aspects of the [BackgroundMapProvider]($common) from which background map imagery is obtained.\n * Any properties not explicitly specified by `props` will retain their current values.\n * @public\n */\n public changeBackgroundMapProvider(props: BackgroundMapProviderProps): void {\n const base = this.settings.mapImagery.backgroundBase;\n if (base instanceof ColorDef) {\n this.settings.mapImagery.backgroundBase = BaseMapLayerSettings.fromProvider(BackgroundMapProvider.fromJSON(props));\n } else {\n const provider = base.provider ? base.provider.clone(props) : BackgroundMapProvider.fromJSON(props);\n this.settings.mapImagery.backgroundBase = base.cloneWithProvider(provider);\n }\n\n this._synchBackgroundMapImagery();\n }\n\n /** Call a function for each reality model attached to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n */\n public forEachRealityModel(func: (model: ContextRealityModelState) => void): void {\n for (const model of this.settings.contextRealityModels.models) {\n assert(model instanceof ContextRealityModelState);\n func(model);\n }\n }\n\n private * getRealityModels(): Iterable<ContextRealityModelState> {\n for (const model of this.settings.contextRealityModels.models) {\n assert(model instanceof ContextRealityModelState);\n yield model;\n }\n }\n\n /** Iterate over the reality models attached to this display style. */\n public get realityModels(): Iterable<ContextRealityModelState> {\n return this.getRealityModels();\n }\n\n /** @internal */\n public * getTileTreeRefs(): Iterable<TileTreeReference> {\n for (const model of this.realityModels) {\n if (!model.invisible) {\n yield model.treeRef;\n }\n }\n }\n\n /** Performs logical comparison against another display style. Two display styles are logically equivalent if they have the same name, Id, and settings.\n * @param other The display style to which to compare.\n * @returns true if the specified display style is logically equivalent to this display style - i.e., both styles have the same values for all of their settings.\n */\n public equalState(other: DisplayStyleState): boolean {\n if (this.name !== other.name || this.id !== other.id)\n return false;\n else\n return JSON.stringify(this.settings) === JSON.stringify(other.settings);\n }\n\n /** The name of this DisplayStyle */\n public get name(): string { return this.code.value; }\n\n /** Change the Id of the [RenderTimeline]($backend) element that hosts the [RenderSchedule.Script]($common) to be applied by this display style for\n * animating the contents of the view, and update [[scheduleScript]] using the script associated with the [RenderTimeline]($backend) element.\n * @see [DisplayStyleSettings.renderTimeline]($common).\n */\n public async changeRenderTimeline(timelineId: Id64String | undefined): Promise<void> {\n // Potentially trigger async loading of new schedule state.\n this.settings.renderTimeline = timelineId;\n\n // Await async loading if necessary.\n // Note the `await` in loadScriptReferenceFromTimeline will resolve before this one [per the spec](https://262.ecma-international.org/6.0/#sec-triggerpromisereactions).\n if (this._queryRenderTimelinePropsPromise)\n await this._queryRenderTimelinePropsPromise;\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.\n * @see [[changeRenderTimeline]] to change the script.\n */\n public get scheduleScript(): RenderSchedule.Script | undefined {\n return this._scriptReference?.script;\n }\n\n public set scheduleScript(script: RenderSchedule.Script | undefined) {\n if (script === this.scheduleScript)\n return;\n\n try {\n const scriptRef = script ? new RenderSchedule.ScriptReference(script) : undefined;\n this[_onScheduleScriptReferenceChanged].raiseEvent(scriptRef);\n this.onScheduleScriptChanged.raiseEvent(script);\n this._scriptReference = scriptRef;\n\n this._assigningScript = true;\n this.settings.scheduleScriptProps = script?.toJSON();\n\n if (!script)\n this.loadScriptReferenceFromTimeline(this.settings.renderTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n } finally {\n this._assigningScript = false;\n }\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any, along with the Id of the element that hosts the script.\n * @note The host element may be a [RenderTimeline]($backend) or a [DisplayStyle]($backend).\n * @internal\n */\n public get [_scheduleScriptReference](): RenderSchedule.ScriptReference | undefined {\n return this._scriptReference;\n }\n\n /** Attach a [ContextRealityModel]($common) to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n * @see [ContextRealityModels.add]($common)\n */\n public attachRealityModel(props: ContextRealityModelProps): ContextRealityModelState {\n const model = this.settings.contextRealityModels.add(props);\n assert(model instanceof ContextRealityModelState);\n return model;\n }\n\n /** Detach the first [ContextRealityModel]($common) that matches the specified name and url.\n * @see [DisplayStyleSettings.contextRealityModels]($common)\n * @see [ContextRealityModels.delete]($common)\n */\n public detachRealityModelByNameAndUrl(name: string, url: string): boolean {\n const model = this.settings.contextRealityModels.models.find((x) => x.matchesNameAndUrl(name, url));\n return undefined !== model && this.settings.contextRealityModels.delete(model);\n }\n\n /** Get the [[ContextRealityModelState]] that displays the OpenStreetMap worldwide building layer, if enabled.\n * @see [[setOSMBuildingDisplay]]\n */\n public getOSMBuildingRealityModel(): ContextRealityModelState | undefined {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid) // The OSM tile tree is ellipsoidal.\n return undefined;\n\n const url = getCesiumOSMBuildingsUrl();\n if (undefined === url)\n return undefined;\n\n return this.contextRealityModelStates.find((x) => x.url === url);\n }\n\n /** Set the display of the OpenStreetMap worldwide building layer in this display style by attaching or detaching the reality model displaying the buildings.\n * The OSM buildings are displayed from a reality model aggregated and served from Cesium ion.<(https://cesium.com/content/cesium-osm-buildings/>\n * The options [[OsmBuildingDisplayOptions]] control the display and appearance overrides.\n */\n public setOSMBuildingDisplay(options: OsmBuildingDisplayOptions): boolean {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid) // The OSM tile tree is ellipsoidal.\n return false;\n\n const url = getCesiumOSMBuildingsUrl();\n if (undefined === url)\n return false;\n\n let model = this.settings.contextRealityModels.models.find((x) => x.url === url);\n if (options.onOff === false) {\n const turnedOff = undefined !== model && this.settings.contextRealityModels.delete(model);\n if (turnedOff)\n this.onOSMBuildingDisplayChanged.raiseEvent(false);\n\n return turnedOff;\n }\n\n if (!model) {\n const name = IModelApp.localization.getLocalizedString(\"iModelJs:RealityModelNames.OSMBuildings\");\n model = this.attachRealityModel({ tilesetUrl: url, name });\n this.onOSMBuildingDisplayChanged.raiseEvent(true);\n }\n\n if (options.appearanceOverrides)\n model.appearanceOverrides = options.appearanceOverrides;\n\n return true;\n }\n\n /** Return if a context reality model is attached.\n * @see [[ContextRealityModelProps]].\n */\n public hasAttachedRealityModel(name: string, url: string): boolean {\n return undefined !== this.settings.contextRealityModels.models.find((x) => x.matchesNameAndUrl(name, url));\n }\n\n /** @internal */\n public getMapLayers(isOverlay: boolean) { return isOverlay ? this.settings.mapImagery.overlayLayers : this.settings.mapImagery.backgroundLayers; }\n\n /** Attach a map layer to display style.\n * @param Settings representing the map layer.\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.\n * @public\n */\n public attachMapLayer(options: { settings: MapLayerSettings, mapLayerIndex: MapLayerIndex }): void {\n const layerSettings = options.settings.clone({});\n if (undefined === layerSettings)\n return;\n\n const isOverlay = options.mapLayerIndex.isOverlay;\n const insertIndex = options.mapLayerIndex.index;\n const layers = this.getMapLayers(isOverlay);\n\n if (insertIndex < 0 || insertIndex > (layers.length - 1)) {\n this.getMapLayers(isOverlay).push(layerSettings);\n } else {\n layers.splice(insertIndex, 0, layerSettings);\n }\n\n this._synchBackgroundMapImagery();\n }\n\n /**\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.\n * @internal\n */\n public attachMapLayerProps(options: { props: MapLayerProps, mapLayerIndex: MapLayerIndex }): void {\n const settings = MapLayerSettings.fromJSON(options.props);\n if (undefined === settings)\n return;\n\n this.attachMapLayer({ settings, mapLayerIndex: options.mapLayerIndex });\n }\n\n /** @internal */\n public hasAttachedMapLayer(name: string, source: string, isOverlay: boolean): boolean {\n return -1 !== this.findMapLayerIndexByNameAndSource(name, source, isOverlay);\n }\n\n /** @internal */\n public detachMapLayerByNameAndSource(name: string, source: string, isOverlay: boolean): void {\n const index = this.findMapLayerIndexByNameAndSource(name, source, isOverlay);\n if (- 1 !== index)\n this.detachMapLayerByIndex({ index, isOverlay });\n }\n\n /** Detach map layer at index (-1 to remove all layers)\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to detach.\n * @public\n */\n public detachMapLayerByIndex(mapLayerIndex: MapLayerIndex): void {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index < 0)\n layers.length = 0;\n else\n layers.splice(index, 1);\n\n this._synchBackgroundMapImagery();\n }\n\n /**\n * Lookup a maplayer index by name and source.\n * @param name Name of of the layer.\n * @param source Unique string identifying the layer.\n * @param isOverlay true if layer is overlay, otherwise layer is background. Defaults to false.\n * @public\n *\n */\n public findMapLayerIndexByNameAndSource(name: string, source: string, isOverlay: boolean) {\n return this.getMapLayers(isOverlay).findIndex((layer) => layer.matchesNameAndSource(name, source));\n }\n\n /** Return the map layer settings for a map layer at the provided index.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.\n * @public\n */\n public mapLayerAtIndex(mapLayerIndex: MapLayerIndex): MapLayerSettings | undefined {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n return (index < 0 || index >= layers.length) ? undefined : layers[index];\n }\n\n /** Return map base transparency as a number between 0 and 1.\n * @public\n */\n public get baseMapTransparency(): number {\n return this.settings.mapImagery.baseTransparency;\n }\n\n /** Change the map base transparency as a number between 0 and 1.\n * @public\n */\n public changeBaseMapTransparency(transparency: number) {\n if (this.settings.mapImagery.backgroundBase instanceof ColorDef) {\n this.settings.mapImagery.backgroundBase = this.settings.mapImagery.backgroundBase.withTransparency(transparency * 255);\n } else {\n this.settings.mapImagery.backgroundBase = this.settings.mapImagery.backgroundBase.clone({ transparency });\n }\n this._synchBackgroundMapImagery();\n }\n\n /** Modify a subset of a map layer settings.\n * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be inserted.\n *\n * Example that changes only the visibility of the first overlay map layer.\n * ``` ts\n * style.changeMapLayerProps({ visible: false }, 0, false);\n * ```\n * @public\n */\n public changeMapLayerProps(props: Partial<MapLayerProps>, mapLayerIndex: MapLayerIndex) {\n const index = mapLayerIndex.index;\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n if (index < 0 || index >= layers.length)\n return;\n layers[index] = layers[index].clone(props);\n this._synchBackgroundMapImagery();\n }\n\n /** Change the credentials for a map layer.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to change the credentials of.\n * @public\n */\n public changeMapLayerCredentials(mapLayerIndex: MapLayerIndex, userName?: string, password?: string) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index < 0 || index >= layers.length)\n return;\n const layer = layers[index];\n if (layer instanceof ImageMapLayerSettings) {\n layer.setCredentials(userName, password);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Modify a subset of a sub-layer settings.\n * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.\n * @param subLayerId Id of the sub-layer that should be modified.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer that contains the sub-layer to be modified.\n *\n * @public\n */\n public changeMapSubLayerProps(props: Partial<MapSubLayerProps>, subLayerId: SubLayerId, mapLayerIndex: MapLayerIndex) {\n const mapLayerSettings = this.mapLayerAtIndex(mapLayerIndex);\n if (undefined === mapLayerSettings)\n return;\n\n if (!(mapLayerSettings instanceof ImageMapLayerSettings)) {\n assert(false);\n return;\n }\n\n const subLayers = new Array<MapSubLayerProps>();\n for (const subLayer of mapLayerSettings.subLayers) {\n subLayers.push((subLayerId === -1 || subLayer.id === subLayerId) ? subLayer.clone(props).toJSON() : subLayer.toJSON());\n }\n\n this.changeMapLayerProps({ subLayers }, mapLayerIndex);\n }\n\n /* @internal */\n private _synchBackgroundMapImagery() {\n this.settings.synchMapImagery();\n }\n\n /** Move map layer to top.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.\n * @public\n *\n */\n public moveMapLayerToTop(mapLayerIndex: MapLayerIndex) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index >= 0 && index < layers.length - 1) {\n const layer = layers.splice(index, 1);\n layers.push(layer[0]);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Move map layer to bottom.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.\n * @public\n */\n public moveMapLayerToBottom(mapLayerIndex: MapLayerIndex) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index > 0 && index < layers.length) {\n const layer = layers.splice(index, 1);\n layers.unshift(layer[0]);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Reorder map layers\n * @param fromIndex index of map layer to move\n * @param toIndex insert index. If equal to length of map array the map layer is moved to end of array.\n * @param isOverlay true if map-layer is part of the overlay map, otherwise it is part of the background map.\n * @public\n */\n public moveMapLayerToIndex(fromIndex: number, toIndex: number, isOverlay: boolean) {\n const layers = this.getMapLayers(isOverlay);\n if (fromIndex === toIndex)\n return;\n\n if (fromIndex < 0 || fromIndex >= layers.length || toIndex > layers.length)\n return;\n\n const layer = layers.splice(fromIndex, 1);\n layers.splice(toIndex, 0, layer[0]); // note: if toIndex === settings.mapImagery.backgroundLayers.length item is appended\n this._synchBackgroundMapImagery();\n }\n\n /** Flags controlling various aspects of the display style.\n * @see [DisplayStyleSettings.viewFlags]($common)\n */\n public get viewFlags(): ViewFlags { return this.settings.viewFlags; }\n public set viewFlags(flags: ViewFlags) { this.settings.viewFlags = flags; }\n\n /** The background color for this DisplayStyle */\n public get backgroundColor(): ColorDef { return this.settings.backgroundColor; }\n public set backgroundColor(val: ColorDef) { this.settings.backgroundColor = val; }\n\n /** The color used to draw geometry in monochrome mode.\n * @see [ViewFlags.monochrome]($common) for enabling monochrome mode.\n */\n public get monochromeColor(): ColorDef { return this.settings.monochromeColor; }\n public set monochromeColor(val: ColorDef) { this.settings.monochromeColor = val; }\n\n private _backgroundMapGeometry?: {\n bimElevationBias: number;\n geometry: BackgroundMapGeometry;\n globeMode: GlobeMode;\n };\n\n /** @internal */\n public anyMapLayersVisible(overlay: boolean): boolean {\n const layers = this.getMapLayers(overlay);\n\n for (const mapLayer of layers)\n if (mapLayer.visible)\n return true;\n\n return false;\n }\n\n /** @internal */\n public getIsBackgroundMapVisible(): boolean {\n return undefined !== this.iModel.ecefLocation && (this.viewFlags.backgroundMap || this.anyMapLayersVisible(false));\n }\n /** @internal */\n public get backgroundMapElevationBias(): number | undefined {\n if (this.backgroundMapSettings.applyTerrain) {\n const terrainSettings = this.backgroundMapSettings.terrainSettings;\n switch (terrainSettings.heightOriginMode) {\n case TerrainHeightOriginMode.Ground:\n return (undefined === this.iModel.projectCenterAltitude) ? undefined : terrainSettings.heightOrigin + terrainSettings.exaggeration * this.iModel.projectCenterAltitude;\n\n case TerrainHeightOriginMode.Geodetic:\n return terrainSettings.heightOrigin;\n\n case TerrainHeightOriginMode.Geoid:\n return (undefined === this.iModel.geodeticToSeaLevel) ? undefined : terrainSettings.heightOrigin + this.iModel.geodeticToSeaLevel;\n }\n } else {\n return this.backgroundMapSettings.groundBias;\n }\n\n }\n\n /** @internal */\n public getBackgroundMapGeometry(): BackgroundMapGeometry | undefined {\n if (undefined === this.iModel.ecefLocation)\n return undefined;\n\n const bimElevationBias = this.backgroundMapElevationBias;\n\n if (undefined === bimElevationBias)\n return undefined;\n\n const globeMode = this.globeMode;\n if (undefined === this._backgroundMapGeometry || this._backgroundMapGeometry.globeMode !== globeMode || this._backgroundMapGeometry.bimElevationBias !== bimElevationBias) {\n const geometry = new BackgroundMapGeometry(bimElevationBias, globeMode, this.iModel);\n this._backgroundMapGeometry = { bimElevationBias, geometry, globeMode };\n }\n return this._backgroundMapGeometry.geometry;\n }\n\n /** [[ContextRealityModelState]]s attached to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n */\n public get contextRealityModelStates(): ReadonlyArray<ContextRealityModelState> {\n return this.settings.contextRealityModels.models as ContextRealityModelState[];\n }\n\n /** @internal */\n public getGlobalGeometryAndHeightRange(): { geometry: BackgroundMapGeometry, heightRange: Range1d } | undefined {\n let geometry = this.getIsBackgroundMapVisible() ? this.getBackgroundMapGeometry() : undefined;\n const terrainRange = ApproximateTerrainHeights.instance.globalHeightRange;\n let heightRange = this.displayTerrain ? terrainRange : Range1d.createXX(-1, 1);\n if (this.globeMode === GlobeMode.Ellipsoid && this.contextRealityModelStates.find((model) => model.isGlobal)) {\n if (!geometry) {\n if (!this._ellipsoidMapGeometry)\n this._ellipsoidMapGeometry = new BackgroundMapGeometry(0, GlobeMode.Ellipsoid, this.iModel);\n\n geometry = this._ellipsoidMapGeometry;\n }\n\n heightRange = terrainRange;\n }\n\n return geometry ? { geometry, heightRange } : undefined;\n }\n\n /** Returns true if this is a 3d display style. */\n public is3d(): this is DisplayStyle3dState { return this instanceof DisplayStyle3dState; }\n\n /** Customize the way geometry belonging to a [[SubCategory]] is drawn by this display style.\n * @param id The ID of the SubCategory whose appearance is to be overridden.\n * @param ovr The overrides to apply to the [[SubCategoryAppearance]].\n * @see [[dropSubCategoryOverride]]\n */\n public overrideSubCategory(id: Id64String, ovr: SubCategoryOverride) { this.settings.overrideSubCategory(id, ovr); }\n\n /** Remove any [[SubCategoryOverride]] applied to a [[SubCategoryAppearance]] by this style.\n * @param id The ID of the [[SubCategory]].\n * @see [[overrideSubCategory]]\n */\n public dropSubCategoryOverride(id: Id64String) { this.settings.dropSubCategoryOverride(id); }\n\n /** Returns true if an [[SubCategoryOverride]]s are defined by this style. */\n public get hasSubCategoryOverride() { return this.settings.hasSubCategoryOverride; }\n\n /** Obtain the overrides applied to a [[SubCategoryAppearance]] by this style.\n * @param id The ID of the [[SubCategory]].\n * @returns The corresponding SubCategoryOverride, or undefined if the SubCategory's appearance is not overridden.\n * @see [[overrideSubCategory]]\n */\n public getSubCategoryOverride(id: Id64String): SubCategoryOverride | undefined { return this.settings.getSubCategoryOverride(id); }\n\n /** For each subcategory belonging to any of the specified categories, make it visible by turning off the \"invisible\" flag in its subcategory appearance.\n * This requires that the categories and subcategories have been previously loaded by, e.g., a call to IModelConnection.querySubCategories.\n * @returns true if the visibility of any subcategory was modified.\n * @see Viewport.changeCategoryDisplay\n * @see ViewCreator3dOptions.allSubCategoriesVisible\n * @internal\n */\n public enableAllLoadedSubCategories(categoryIds: Id64Arg): boolean {\n let anyChanged = false;\n for (const categoryId of Id64.iterable(categoryIds)) {\n const subCategoryIds = this.iModel.subcategories.getSubCategories(categoryId);\n if (undefined !== subCategoryIds)\n for (const subCategoryId of subCategoryIds)\n if (this.setSubCategoryVisible(subCategoryId, true))\n anyChanged = true;\n }\n\n return anyChanged;\n }\n\n /** Change the \"invisible\" flag for the given subcategory's appearance.\n * This requires that the subcategory appearance has been previously loaded by, e.g., a call to IModelConnection.Categories.getSubCategoryInfo.\n * @returns true if the visibility of any subcategory was modified.\n * @see [[enableAllLoadedSubCategories]]\n * @internal\n */\n public setSubCategoryVisible(subCategoryId: Id64String, visible: boolean): boolean {\n const app = this.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\n if (undefined === app)\n return false; // category not enabled or subcategory not found\n\n const curOvr = this.getSubCategoryOverride(subCategoryId);\n const isAlreadyVisible = undefined !== curOvr && undefined !== curOvr.invisible ? !curOvr.invisible : !app.invisible;\n if (isAlreadyVisible === visible)\n return false;\n\n // Preserve existing overrides - just flip the visibility flag.\n const json = undefined !== curOvr ? curOvr.toJSON() : {};\n json.invisible = !visible;\n this.overrideSubCategory(subCategoryId, SubCategoryOverride.fromJSON(json));\n return true;\n }\n\n /** Returns true if solar shadow display is enabled by this display style. */\n public get wantShadows(): boolean {\n return this.is3d() && this.viewFlags.shadows && false !== IModelApp.renderSystem.options.displaySolarShadows;\n }\n\n /** @internal */\n protected registerSettingsEventListeners(): void {\n this.settings.onScheduleScriptPropsChanged.addListener((scriptProps) => {\n if (this._assigningScript)\n return;\n\n try {\n this._assigningScript = true;\n if (scriptProps)\n this.loadScriptReferenceFromScript(scriptProps);\n else\n this.loadScriptReferenceFromTimeline(this.settings.renderTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n } finally {\n this._assigningScript = false;\n }\n });\n\n this.settings.onRenderTimelineChanged.addListener((newTimeline) => {\n // Cancel any in-progress loading of script from timeline.\n this._queryRenderTimelinePropsPromise = undefined;\n\n if (!this.settings.scheduleScriptProps)\n this.loadScriptReferenceFromTimeline(newTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n });\n\n this.settings.onPlanarClipMaskChanged.addListener((id, newSettings) => {\n if (newSettings)\n this._attachedRealityModelPlanarClipMasks.set(id, PlanarClipMaskState.create(newSettings));\n else\n this._attachedRealityModelPlanarClipMasks.delete(id);\n });\n }\n\n /** @internal */\n protected createRealityModel(props: ContextRealityModelProps): ContextRealityModelState {\n return new ContextRealityModelState(props, this.iModel, this);\n }\n\n /** @internal */\n public getPlanarClipMaskState(modelId: Id64String): PlanarClipMaskState | undefined {\n const model = this.iModel.models.getLoaded(modelId)?.asSpatialModel;\n return (model && model.isRealityModel) ? this._attachedRealityModelPlanarClipMasks.get(modelId) : undefined;\n }\n}\n\n/** A display style that can be applied to 2d views.\n * @public\n * @extensions\n */\nexport class DisplayStyle2dState extends DisplayStyleState {\n public static override get className() { return \"DisplayStyle2d\"; }\n private readonly _settings: DisplayStyleSettings;\n\n public get settings(): DisplayStyleSettings { return this._settings; }\n\n /** @internal */\n public overrideTerrainDisplay(): TerrainDisplayOverrides | undefined { return undefined; }\n\n constructor(props: DisplayStyleProps, iModel: IModelConnection) {\n super(props, iModel);\n this._settings = new DisplayStyleSettings(this.jsonProperties, {\n createContextRealityModel: (modelProps) => this.createRealityModel(modelProps),\n deferContextRealityModels: true,\n });\n\n this._settings.contextRealityModels.populate();\n this.registerSettingsEventListeners();\n }\n}\n\n/** A [[DisplayStyleState]] that can be applied to spatial views.\n * @public\n * @extensions\n */\nexport class DisplayStyle3dState extends DisplayStyleState {\n public static override get className() { return \"DisplayStyle3d\"; }\n private _settings: DisplayStyle3dSettings;\n\n public get settings(): DisplayStyle3dSettings { return this._settings; }\n\n public constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyle3dState) {\n super(props, iModel, source);\n this._settings = new DisplayStyle3dSettings(this.jsonProperties, {\n createContextRealityModel: (modelProps) => this.createRealityModel(modelProps),\n deferContextRealityModels: true,\n });\n\n this._settings.contextRealityModels.populate();\n this.registerSettingsEventListeners();\n }\n\n public get environment(): Environment {\n return this.settings.environment;\n }\n public set environment(env: Environment) {\n this.settings.environment = env;\n }\n\n public get lights(): LightSettings { return this.settings.lights; }\n public set lights(lights: LightSettings) { this.settings.lights = lights; }\n\n /** The direction of the solar light. */\n public get sunDirection(): Readonly<Vector3d> {\n return this.settings.lights.solar.direction;\n }\n\n /** Set the solar light direction based on time value\n * @param time The time in unix time milliseconds.\n * @see [DisplayStyle3dSettings.sunTime]($common) to obtain the current sun time.\n * @see [DisplayStyle3dSettings.setSunTime]($common).\n */\n public setSunTime(time: number) {\n this.settings.setSunTime(time, this.iModel);\n }\n\n /** Settings controlling shadow display. */\n public get solarShadows(): SolarShadowSettings {\n return this.settings.solarShadows;\n }\n public set solarShadows(settings: SolarShadowSettings) {\n this.settings.solarShadows = settings;\n }\n\n /** @internal */\n protected override registerSettingsEventListeners(): void {\n super.registerSettingsEventListeners();\n\n this.settings.onOverridesApplied.addListener((overrides: DisplayStyle3dSettingsProps) => {\n if (overrides.thematic && this.settings.thematic.displayMode === ThematicDisplayMode.Height && undefined === overrides.thematic.range) {\n // Use the project extents as reasonable default height range.\n // NB: assumes using Z axis...\n const extents = this.iModel.projectExtents;\n const props = { ...overrides.thematic };\n props.range = { low: extents.zLow, high: extents.zHigh };\n this.settings.thematic = ThematicDisplay.fromJSON(props);\n }\n });\n }\n\n /** @internal */\n public overrideTerrainDisplay(): TerrainDisplayOverrides | undefined {\n if (undefined !== this.settings.thematic) {\n const ovr = new TerrainDisplayOverrides();\n if (this.viewFlags.thematicDisplay && ThematicGradientMode.IsoLines === this.settings.thematic.gradientSettings.mode)\n ovr.wantSkirts = false;\n if (this.viewFlags.thematicDisplay && (ThematicDisplayMode.Slope === this.settings.thematic.displayMode || ThematicDisplayMode.HillShade === this.settings.thematic.displayMode))\n ovr.wantNormals = true;\n return ovr;\n }\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"DisplayStyleState.js","sourceRoot":"","sources":["../../src/DisplayStyleState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAuB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACe,qBAAqB,EACtB,oBAAoB,EAAE,QAAQ,EAA4B,sBAAsB,EAChF,oBAAoB,EAAkC,SAAS,EAAE,qBAAqB,EACzG,gBAAgB,EAAoB,cAAc,EAC7B,mBAAmB,EAAc,u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C,CAAC;IACL,CAAC;IAED,gBAAgB;IACT,sBAAsB;QAC3B,IAAI,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACzC,MAAM,GAAG,GAAG,IAAI,uBAAuB,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,oBAAoB,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;gBAClH,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC;YACzB,IAAI,IAAI,CAAC,SAAS,CAAC,eAAe,IAAI,CAAC,mBAAmB,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,IAAI,mBAAmB,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAC9K,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;YACzB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 Views\n */\nimport { assert, BeEvent, Id64, Id64Arg, Id64String } from \"@itwin/core-bentley\";\nimport { Range1d, Vector3d } from \"@itwin/core-geometry\";\nimport {\n BackgroundMapProps, BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapSettings,\n BaseLayerSettings, BaseMapLayerSettings, ColorDef, ContextRealityModelProps, DisplayStyle3dSettings, DisplayStyle3dSettingsProps,\n DisplayStyleProps, DisplayStyleSettings, Environment, FeatureAppearance, GlobeMode, ImageMapLayerSettings, LightSettings, MapLayerProps,\n MapLayerSettings, MapSubLayerProps, RenderSchedule, RenderTimelineProps,\n SolarShadowSettings, SubCategoryOverride, SubLayerId, TerrainHeightOriginMode, ThematicDisplay, ThematicDisplayMode, ThematicGradientMode, ViewFlags,\n} from \"@itwin/core-common\";\nimport { ApproximateTerrainHeights } from \"./ApproximateTerrainHeights\";\nimport { BackgroundMapGeometry } from \"./BackgroundMapGeometry\";\nimport { ContextRealityModelState } from \"./ContextRealityModelState\";\nimport { ElementState } from \"./EntityState\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\nimport { getCesiumOSMBuildingsUrl, MapLayerIndex, TileTreeReference } from \"./tile/internal\";\nimport { _onScheduleScriptReferenceChanged, _scheduleScriptReference } from './common/internal/Symbols';\nimport { getScriptDelta } from \"./internal/ScriptUtils\";\n\n/** @internal */\nexport class TerrainDisplayOverrides {\n public wantSkirts?: boolean;\n public wantNormals?: boolean;\n public produceGeometry?: boolean;\n}\n\n/** Options controlling display of [OpenStreetMap Buildings](https://cesium.com/platform/cesium-ion/content/cesium-osm-buildings/).\n * @see [[DisplayStyleState.setOSMBuildingDisplay]].\n * @public\n * @extensions\n */\nexport interface OsmBuildingDisplayOptions {\n /** If defined, enables or disables display of the buildings by attaching or detaching the OpenStreetMap Buildings reality model. */\n onOff?: boolean;\n /** If defined, overrides aspects of the appearance of the OpenStreetMap building meshes. */\n appearanceOverrides?: FeatureAppearance;\n}\n\n/** A DisplayStyle defines the parameters for 'styling' the contents of a [[ViewState]].\n * @public\n * @extensions\n */\nexport abstract class DisplayStyleState extends ElementState implements DisplayStyleProps {\n public static override get className() { return \"DisplayStyle\"; }\n private _ellipsoidMapGeometry: BackgroundMapGeometry | undefined;\n private _attachedRealityModelPlanarClipMasks = new Map<Id64String, PlanarClipMaskState>();\n /** @internal */\n protected _queryRenderTimelinePropsPromise?: Promise<RenderTimelineProps | undefined>;\n private _assigningScript = false;\n\n\n /** Event raised just before the [[scheduleScriptReference]] property is changed.\n * @internal as of 5.0, use [[onScheduleScriptChanged]].\n */\n public readonly [_onScheduleScriptReferenceChanged] = new BeEvent<(newScriptReference: RenderSchedule.ScriptReference | undefined) => void>();\n\n private _scriptReference?: RenderSchedule.ScriptReference;\n\n /** Event raised when schedule script edits are made, providing changed element IDs and the editing scope.\n * @beta\n */\n public readonly onScheduleEditingChanged = new BeEvent<(changes: RenderSchedule.EditingChanges[]) => void>();\n\n /** Event raised when schedule script edits are committed (finalized).\n * @beta\n */\n public readonly onScheduleEditingCommitted = new BeEvent<\n () => void\n >();\n\n /** Event raised just before the [[scheduleScript]] property is changed. */\n public readonly onScheduleScriptChanged = new BeEvent<(newScript: RenderSchedule.Script | undefined) => void>();\n /** Event raised just after [[setOSMBuildingDisplay]] changes the enabled state of the OSM buildings. */\n public readonly onOSMBuildingDisplayChanged = new BeEvent<(osmBuildingDisplayEnabled: boolean) => void>();\n\n /** The container for this display style's settings. */\n public abstract get settings(): DisplayStyleSettings;\n\n /** @internal */\n public abstract overrideTerrainDisplay(): TerrainDisplayOverrides | undefined;\n\n /** Construct a new DisplayStyleState from its JSON representation.\n * @param props JSON representation of the display style.\n * @param iModel IModelConnection containing the display style.\n * @param source If the constructor is being invoked from [[EntityState.clone]], the display style that is being cloned.\n */\n constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyleState) {\n super(props, iModel);\n const styles = this.jsonProperties.styles;\n\n if (source)\n this._scriptReference = source._scriptReference;\n\n if (styles) {\n // ###TODO Use DisplayStyleSettings.planarClipMasks\n if (styles.planarClipOvr)\n for (const planarClipOvr of styles.planarClipOvr)\n if (Id64.isValid(planarClipOvr.modelId))\n this._attachedRealityModelPlanarClipMasks.set(planarClipOvr.modelId, PlanarClipMaskState.fromJSON(planarClipOvr));\n }\n }\n\n /** Ensures all of the data required by the display style is loaded. This method is invoked for you by [[ViewState.load]], but if\n * you obtain a display style by some other means you should `await` this method before using the display style.\n */\n public async load(): Promise<void> {\n // If we were cloned, we may already have a valid schedule state, and our display style Id may be invalid / different.\n // Preserve it if still usable.\n if (this._scriptReference) {\n if (this.settings.renderTimeline === this._scriptReference.sourceId) {\n // The script came from the same RenderTimeline element. Keep it.\n return;\n }\n\n if (undefined === this.settings.renderTimeline) {\n // The script came from a display style's JSON properties. Keep it if (1) this style is not persistent or (2) this style has the same Id\n if (this.id === this._scriptReference.sourceId || !Id64.isValidId64(this.id))\n return;\n }\n }\n\n // The schedule script stored in JSON properties takes precedence over the RenderTimeline if both are defined.\n if (this.settings.scheduleScriptProps)\n this.loadScriptReferenceFromScript(this.settings.scheduleScriptProps);\n else\n await this.loadScriptReferenceFromTimeline(this.settings.renderTimeline);\n }\n\n private loadScriptReferenceFromScript(scriptProps: Readonly<RenderSchedule.ScriptProps>): void {\n let newState;\n try {\n const script = RenderSchedule.Script.fromJSON(scriptProps);\n if (script)\n newState = new RenderSchedule.ScriptReference(this.id, script);\n } catch {\n // schedule state is undefined.\n }\n\n if (newState !== this._scriptReference) {\n this[_onScheduleScriptReferenceChanged].raiseEvent(newState);\n this.onScheduleScriptChanged.raiseEvent(newState?.script);\n this._scriptReference = newState;\n }\n }\n\n private async loadScriptReferenceFromTimeline(timelineId: Id64String | undefined): Promise<void> {\n let newState;\n if (timelineId && Id64.isValidId64(timelineId)) {\n try {\n // If a subsequent call to loadScriptReferenceFromTimeline is made while we're awaiting this one, we'll abort this one.\n const promise = this._queryRenderTimelinePropsPromise = this.queryRenderTimelineProps(timelineId);\n const timeline = await promise;\n if (promise !== this._queryRenderTimelinePropsPromise)\n return;\n\n if (timeline) {\n const scriptProps = JSON.parse(timeline.script);\n const script = RenderSchedule.Script.fromJSON(scriptProps);\n if (script)\n newState = new RenderSchedule.ScriptReference(timelineId, script);\n }\n } catch {\n // schedule state is undefined.\n }\n }\n\n this._queryRenderTimelinePropsPromise = undefined;\n if (newState !== this._scriptReference) {\n this[_onScheduleScriptReferenceChanged].raiseEvent(newState);\n this.onScheduleScriptChanged.raiseEvent(newState?.script);\n this._scriptReference = newState;\n }\n }\n\n /** @internal */\n protected async queryRenderTimelineProps(timelineId: Id64String): Promise<RenderTimelineProps | undefined> {\n try {\n const omitScriptElementIds = !IModelApp.tileAdmin.enableFrontendScheduleScripts;\n return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds } }) as RenderTimelineProps;\n } catch {\n return undefined;\n }\n }\n\n /** @internal */\n public get displayTerrain() {\n return this.viewFlags.backgroundMap && this.settings.backgroundMap.applyTerrain;\n }\n\n /** @internal */\n public get globeMode(): GlobeMode { return this.settings.backgroundMap.globeMode; }\n\n /** Settings controlling how the base map is displayed within a view.\n * The base map can be provided by any map imagery source or set to be a single color.\n */\n public get backgroundMapBase(): BaseLayerSettings {\n return this.settings.mapImagery.backgroundBase;\n }\n public set backgroundMapBase(base: BaseLayerSettings) {\n this.settings.mapImagery.backgroundBase = base;\n this._synchBackgroundMapImagery();\n }\n\n /** The settings controlling how a background map is displayed within a view.\n * @see [[ViewFlags.backgroundMap]] for toggling display of the map on or off.\n */\n public get backgroundMapSettings(): BackgroundMapSettings { return this.settings.backgroundMap; }\n public set backgroundMapSettings(settings: BackgroundMapSettings) {\n this.settings.backgroundMap = settings;\n }\n\n /** Modify a subset of the background map display settings.\n * @param name props JSON representation of the properties to change. Any properties not present will retain their current values in `this.backgroundMapSettings`.\n * @see [[ViewFlags.backgroundMap]] for toggling display of the map.\n * @see [[changeBackgroundMapProvider]] to change the type of map imagery displayed.\n *\n * Example that changes only the elevation, leaving the provider and type unchanged:\n * ``` ts\n * style.changeBackgroundMapProps({ groundBias: 16.2 });\n * ```\n * @public\n */\n public changeBackgroundMapProps(props: BackgroundMapProps): void {\n const newSettings = this.backgroundMapSettings.clone(props);\n this.backgroundMapSettings = newSettings;\n }\n\n /** Change aspects of the [BackgroundMapProvider]($common) from which background map imagery is obtained.\n * Any properties not explicitly specified by `props` will retain their current values.\n * @public\n */\n public changeBackgroundMapProvider(props: BackgroundMapProviderProps): void {\n const base = this.settings.mapImagery.backgroundBase;\n if (base instanceof ColorDef) {\n this.settings.mapImagery.backgroundBase = BaseMapLayerSettings.fromProvider(BackgroundMapProvider.fromJSON(props));\n } else {\n const provider = base.provider ? base.provider.clone(props) : BackgroundMapProvider.fromJSON(props);\n this.settings.mapImagery.backgroundBase = base.cloneWithProvider(provider);\n }\n\n this._synchBackgroundMapImagery();\n }\n\n /** Call a function for each reality model attached to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n */\n public forEachRealityModel(func: (model: ContextRealityModelState) => void): void {\n for (const model of this.settings.contextRealityModels.models) {\n assert(model instanceof ContextRealityModelState);\n func(model);\n }\n }\n\n private * getRealityModels(): Iterable<ContextRealityModelState> {\n for (const model of this.settings.contextRealityModels.models) {\n assert(model instanceof ContextRealityModelState);\n yield model;\n }\n }\n\n /** Iterate over the reality models attached to this display style. */\n public get realityModels(): Iterable<ContextRealityModelState> {\n return this.getRealityModels();\n }\n\n /** @internal */\n public * getTileTreeRefs(): Iterable<TileTreeReference> {\n for (const model of this.realityModels) {\n if (!model.invisible) {\n yield model.treeRef;\n }\n }\n }\n\n /** Performs logical comparison against another display style. Two display styles are logically equivalent if they have the same name, Id, and settings.\n * @param other The display style to which to compare.\n * @returns true if the specified display style is logically equivalent to this display style - i.e., both styles have the same values for all of their settings.\n */\n public equalState(other: DisplayStyleState): boolean {\n if (this.name !== other.name || this.id !== other.id)\n return false;\n else\n return JSON.stringify(this.settings) === JSON.stringify(other.settings);\n }\n\n /** The name of this DisplayStyle */\n public get name(): string { return this.code.value; }\n\n /** Change the Id of the [RenderTimeline]($backend) element that hosts the [RenderSchedule.Script]($common) to be applied by this display style for\n * animating the contents of the view, and update [[scheduleScript]] using the script associated with the [RenderTimeline]($backend) element.\n * @see [DisplayStyleSettings.renderTimeline]($common).\n */\n public async changeRenderTimeline(timelineId: Id64String | undefined): Promise<void> {\n // Potentially trigger async loading of new schedule state.\n this.settings.renderTimeline = timelineId;\n\n // Await async loading if necessary.\n // Note the `await` in loadScriptReferenceFromTimeline will resolve before this one [per the spec](https://262.ecma-international.org/6.0/#sec-triggerpromisereactions).\n if (this._queryRenderTimelinePropsPromise)\n await this._queryRenderTimelinePropsPromise;\n }\n\n /**\n * Begins or updates a schedule script editing session for the current display style.\n * During an editing session, changes to the schedule script are applied incrementally\n * using temporary dynamic tiles, allowing for interactive preview of visual changes like color,\n * transforms, visibility, and cutting planes — without requiring a full tile tree reload.\n *\n * Calling this method multiple times will update the current editing session with new script changes.\n * When all edits are complete, you must invoke [[commitScheduleEditing]] to finalize the session and\n * trigger a full tile tree refresh with the committed script.\n *\n * @note You cannot use schedule script editing while a @see [[GraphicalEditingScope]] is active.\n *\n * Example:\n * ```ts\n * [[include:ScheduleScript_editingMode]]\n * ```\n *\n * @beta\n */\n public setScheduleEditing(newScript: RenderSchedule.Script): void {\n const prevScript = this.scheduleScript;\n const changes: Array<{ timeline: RenderSchedule.ModelTimeline, elements: Set<Id64String> }> = [];\n\n const globalDelta = getScriptDelta(prevScript, newScript);\n\n for (const timeline of newScript.modelTimelines) {\n const ids = new Set<Id64String>();\n for (const et of timeline.elementTimelines) {\n for (const id of et.elementIds) {\n if (globalDelta.has(id))\n ids.add(id);\n }\n }\n\n if (ids.size > 0)\n changes.push({ timeline, elements: ids });\n }\n\n this.scheduleScript = newScript;\n this.onScheduleEditingChanged.raiseEvent(changes);\n\n for (const modelTimeline of this.scheduleScript.modelTimelines) {\n modelTimeline.isEditingCommitted = false;\n }\n }\n\n /**\n * Finalizes a script editing session previously started with [[setScheduleEditing]].\n * This applies all pending script changes and triggers a full tile tree reload to reflect them in the viewport.\n * After this call, the schedule script is considered committed and editing mode ends.\n *\n * @see [[setScheduleEditing]] to begin a schedule script editing session.\n * @beta\n */\n public commitScheduleEditing(): void {\n this.onScheduleEditingCommitted.raiseEvent();\n if (!this.scheduleScript)\n return;\n for (const modelTimeline of this.scheduleScript.modelTimelines) {\n modelTimeline.isEditingCommitted = true;\n }\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.\n * @see [[changeRenderTimeline]] to change the script.\n */\n public get scheduleScript(): RenderSchedule.Script | undefined {\n return this._scriptReference?.script;\n }\n\n public set scheduleScript(script: RenderSchedule.Script | undefined) {\n if (script === this.scheduleScript)\n return;\n\n try {\n const scriptRef = script ? new RenderSchedule.ScriptReference(script) : undefined;\n this[_onScheduleScriptReferenceChanged].raiseEvent(scriptRef);\n this.onScheduleScriptChanged.raiseEvent(script);\n this._scriptReference = scriptRef;\n\n this._assigningScript = true;\n this.settings.scheduleScriptProps = script?.toJSON();\n\n if (!script)\n this.loadScriptReferenceFromTimeline(this.settings.renderTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n } finally {\n this._assigningScript = false;\n }\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any, along with the Id of the element that hosts the script.\n * @note The host element may be a [RenderTimeline]($backend) or a [DisplayStyle]($backend).\n * @internal\n */\n public get [_scheduleScriptReference](): RenderSchedule.ScriptReference | undefined {\n return this._scriptReference;\n }\n\n /** Attach a [ContextRealityModel]($common) to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n * @see [ContextRealityModels.add]($common)\n */\n public attachRealityModel(props: ContextRealityModelProps): ContextRealityModelState {\n const model = this.settings.contextRealityModels.add(props);\n assert(model instanceof ContextRealityModelState);\n return model;\n }\n\n /** Detach the first [ContextRealityModel]($common) that matches the specified name and url.\n * @see [DisplayStyleSettings.contextRealityModels]($common)\n * @see [ContextRealityModels.delete]($common)\n */\n public detachRealityModelByNameAndUrl(name: string, url: string): boolean {\n const model = this.settings.contextRealityModels.models.find((x) => x.matchesNameAndUrl(name, url));\n return undefined !== model && this.settings.contextRealityModels.delete(model);\n }\n\n /** Get the [[ContextRealityModelState]] that displays the OpenStreetMap worldwide building layer, if enabled.\n * @see [[setOSMBuildingDisplay]]\n */\n public getOSMBuildingRealityModel(): ContextRealityModelState | undefined {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid) // The OSM tile tree is ellipsoidal.\n return undefined;\n\n const url = getCesiumOSMBuildingsUrl();\n if (undefined === url)\n return undefined;\n\n return this.contextRealityModelStates.find((x) => x.url === url);\n }\n\n /** Set the display of the OpenStreetMap worldwide building layer in this display style by attaching or detaching the reality model displaying the buildings.\n * The OSM buildings are displayed from a reality model aggregated and served from Cesium ion.<(https://cesium.com/content/cesium-osm-buildings/>\n * The options [[OsmBuildingDisplayOptions]] control the display and appearance overrides.\n */\n public setOSMBuildingDisplay(options: OsmBuildingDisplayOptions): boolean {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid) // The OSM tile tree is ellipsoidal.\n return false;\n\n const url = getCesiumOSMBuildingsUrl();\n if (undefined === url)\n return false;\n\n let model = this.settings.contextRealityModels.models.find((x) => x.url === url);\n if (options.onOff === false) {\n const turnedOff = undefined !== model && this.settings.contextRealityModels.delete(model);\n if (turnedOff)\n this.onOSMBuildingDisplayChanged.raiseEvent(false);\n\n return turnedOff;\n }\n\n if (!model) {\n const name = IModelApp.localization.getLocalizedString(\"iModelJs:RealityModelNames.OSMBuildings\");\n model = this.attachRealityModel({ tilesetUrl: url, name });\n this.onOSMBuildingDisplayChanged.raiseEvent(true);\n }\n\n if (options.appearanceOverrides)\n model.appearanceOverrides = options.appearanceOverrides;\n\n return true;\n }\n\n /** Return if a context reality model is attached.\n * @see [[ContextRealityModelProps]].\n */\n public hasAttachedRealityModel(name: string, url: string): boolean {\n return undefined !== this.settings.contextRealityModels.models.find((x) => x.matchesNameAndUrl(name, url));\n }\n\n /** @internal */\n public getMapLayers(isOverlay: boolean) { return isOverlay ? this.settings.mapImagery.overlayLayers : this.settings.mapImagery.backgroundLayers; }\n\n /** Attach a map layer to display style.\n * @param Settings representing the map layer.\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.\n * @public\n */\n public attachMapLayer(options: { settings: MapLayerSettings, mapLayerIndex: MapLayerIndex }): void {\n const layerSettings = options.settings.clone({});\n if (undefined === layerSettings)\n return;\n\n const isOverlay = options.mapLayerIndex.isOverlay;\n const insertIndex = options.mapLayerIndex.index;\n const layers = this.getMapLayers(isOverlay);\n\n if (insertIndex < 0 || insertIndex > (layers.length - 1)) {\n this.getMapLayers(isOverlay).push(layerSettings);\n } else {\n layers.splice(insertIndex, 0, layerSettings);\n }\n\n this._synchBackgroundMapImagery();\n }\n\n /**\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be attached.\n * @internal\n */\n public attachMapLayerProps(options: { props: MapLayerProps, mapLayerIndex: MapLayerIndex }): void {\n const settings = MapLayerSettings.fromJSON(options.props);\n if (undefined === settings)\n return;\n\n this.attachMapLayer({ settings, mapLayerIndex: options.mapLayerIndex });\n }\n\n /** @internal */\n public hasAttachedMapLayer(name: string, source: string, isOverlay: boolean): boolean {\n return -1 !== this.findMapLayerIndexByNameAndSource(name, source, isOverlay);\n }\n\n /** @internal */\n public detachMapLayerByNameAndSource(name: string, source: string, isOverlay: boolean): void {\n const index = this.findMapLayerIndexByNameAndSource(name, source, isOverlay);\n if (- 1 !== index)\n this.detachMapLayerByIndex({ index, isOverlay });\n }\n\n /** Detach map layer at index (-1 to remove all layers)\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to detach.\n * @public\n */\n public detachMapLayerByIndex(mapLayerIndex: MapLayerIndex): void {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index < 0)\n layers.length = 0;\n else\n layers.splice(index, 1);\n\n this._synchBackgroundMapImagery();\n }\n\n /**\n * Lookup a maplayer index by name and source.\n * @param name Name of of the layer.\n * @param source Unique string identifying the layer.\n * @param isOverlay true if layer is overlay, otherwise layer is background. Defaults to false.\n * @public\n *\n */\n public findMapLayerIndexByNameAndSource(name: string, source: string, isOverlay: boolean) {\n return this.getMapLayers(isOverlay).findIndex((layer) => layer.matchesNameAndSource(name, source));\n }\n\n /** Return the map layer settings for a map layer at the provided index.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer.\n * @public\n */\n public mapLayerAtIndex(mapLayerIndex: MapLayerIndex): MapLayerSettings | undefined {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n return (index < 0 || index >= layers.length) ? undefined : layers[index];\n }\n\n /** Return map base transparency as a number between 0 and 1.\n * @public\n */\n public get baseMapTransparency(): number {\n return this.settings.mapImagery.baseTransparency;\n }\n\n /** Change the map base transparency as a number between 0 and 1.\n * @public\n */\n public changeBaseMapTransparency(transparency: number) {\n if (this.settings.mapImagery.backgroundBase instanceof ColorDef) {\n this.settings.mapImagery.backgroundBase = this.settings.mapImagery.backgroundBase.withTransparency(transparency * 255);\n } else {\n this.settings.mapImagery.backgroundBase = this.settings.mapImagery.backgroundBase.clone({ transparency });\n }\n this._synchBackgroundMapImagery();\n }\n\n /** Modify a subset of a map layer settings.\n * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.\n * @param mapLayerIndex the [[MapLayerIndex]] where the map layer should be inserted.\n *\n * Example that changes only the visibility of the first overlay map layer.\n * ``` ts\n * style.changeMapLayerProps({ visible: false }, 0, false);\n * ```\n * @public\n */\n public changeMapLayerProps(props: Partial<MapLayerProps>, mapLayerIndex: MapLayerIndex) {\n const index = mapLayerIndex.index;\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n if (index < 0 || index >= layers.length)\n return;\n layers[index] = layers[index].clone(props);\n this._synchBackgroundMapImagery();\n }\n\n /** Change the credentials for a map layer.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to change the credentials of.\n * @public\n */\n public changeMapLayerCredentials(mapLayerIndex: MapLayerIndex, userName?: string, password?: string) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index < 0 || index >= layers.length)\n return;\n const layer = layers[index];\n if (layer instanceof ImageMapLayerSettings) {\n layer.setCredentials(userName, password);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Modify a subset of a sub-layer settings.\n * @param props props JSON representation of the properties to change. Any properties not present will retain their current values.\n * @param subLayerId Id of the sub-layer that should be modified.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer that contains the sub-layer to be modified.\n *\n * @public\n */\n public changeMapSubLayerProps(props: Partial<MapSubLayerProps>, subLayerId: SubLayerId, mapLayerIndex: MapLayerIndex) {\n const mapLayerSettings = this.mapLayerAtIndex(mapLayerIndex);\n if (undefined === mapLayerSettings)\n return;\n\n if (!(mapLayerSettings instanceof ImageMapLayerSettings)) {\n assert(false);\n return;\n }\n\n const subLayers = new Array<MapSubLayerProps>();\n for (const subLayer of mapLayerSettings.subLayers) {\n subLayers.push((subLayerId === -1 || subLayer.id === subLayerId) ? subLayer.clone(props).toJSON() : subLayer.toJSON());\n }\n\n this.changeMapLayerProps({ subLayers }, mapLayerIndex);\n }\n\n /* @internal */\n private _synchBackgroundMapImagery() {\n this.settings.synchMapImagery();\n }\n\n /** Move map layer to top.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.\n * @public\n *\n */\n public moveMapLayerToTop(mapLayerIndex: MapLayerIndex) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index >= 0 && index < layers.length - 1) {\n const layer = layers.splice(index, 1);\n layers.push(layer[0]);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Move map layer to bottom.\n * @param mapLayerIndex the [[MapLayerIndex]] of the map layer to move.\n * @public\n */\n public moveMapLayerToBottom(mapLayerIndex: MapLayerIndex) {\n const layers = this.getMapLayers(mapLayerIndex.isOverlay);\n const index = mapLayerIndex.index;\n if (index > 0 && index < layers.length) {\n const layer = layers.splice(index, 1);\n layers.unshift(layer[0]);\n this._synchBackgroundMapImagery();\n }\n }\n\n /** Reorder map layers\n * @param fromIndex index of map layer to move\n * @param toIndex insert index. If equal to length of map array the map layer is moved to end of array.\n * @param isOverlay true if map-layer is part of the overlay map, otherwise it is part of the background map.\n * @public\n */\n public moveMapLayerToIndex(fromIndex: number, toIndex: number, isOverlay: boolean) {\n const layers = this.getMapLayers(isOverlay);\n if (fromIndex === toIndex)\n return;\n\n if (fromIndex < 0 || fromIndex >= layers.length || toIndex > layers.length)\n return;\n\n const layer = layers.splice(fromIndex, 1);\n layers.splice(toIndex, 0, layer[0]); // note: if toIndex === settings.mapImagery.backgroundLayers.length item is appended\n this._synchBackgroundMapImagery();\n }\n\n /** Flags controlling various aspects of the display style.\n * @see [DisplayStyleSettings.viewFlags]($common)\n */\n public get viewFlags(): ViewFlags { return this.settings.viewFlags; }\n public set viewFlags(flags: ViewFlags) { this.settings.viewFlags = flags; }\n\n /** The background color for this DisplayStyle */\n public get backgroundColor(): ColorDef { return this.settings.backgroundColor; }\n public set backgroundColor(val: ColorDef) { this.settings.backgroundColor = val; }\n\n /** The color used to draw geometry in monochrome mode.\n * @see [ViewFlags.monochrome]($common) for enabling monochrome mode.\n */\n public get monochromeColor(): ColorDef { return this.settings.monochromeColor; }\n public set monochromeColor(val: ColorDef) { this.settings.monochromeColor = val; }\n\n private _backgroundMapGeometry?: {\n bimElevationBias: number;\n geometry: BackgroundMapGeometry;\n globeMode: GlobeMode;\n };\n\n /** @internal */\n public anyMapLayersVisible(overlay: boolean): boolean {\n const layers = this.getMapLayers(overlay);\n\n for (const mapLayer of layers)\n if (mapLayer.visible)\n return true;\n\n return false;\n }\n\n /** @internal */\n public getIsBackgroundMapVisible(): boolean {\n return undefined !== this.iModel.ecefLocation && (this.viewFlags.backgroundMap || this.anyMapLayersVisible(false));\n }\n /** @internal */\n public get backgroundMapElevationBias(): number | undefined {\n if (this.backgroundMapSettings.applyTerrain) {\n const terrainSettings = this.backgroundMapSettings.terrainSettings;\n switch (terrainSettings.heightOriginMode) {\n case TerrainHeightOriginMode.Ground:\n return (undefined === this.iModel.projectCenterAltitude) ? undefined : terrainSettings.heightOrigin + terrainSettings.exaggeration * this.iModel.projectCenterAltitude;\n\n case TerrainHeightOriginMode.Geodetic:\n return terrainSettings.heightOrigin;\n\n case TerrainHeightOriginMode.Geoid:\n return (undefined === this.iModel.geodeticToSeaLevel) ? undefined : terrainSettings.heightOrigin + this.iModel.geodeticToSeaLevel;\n }\n } else {\n return this.backgroundMapSettings.groundBias;\n }\n\n }\n\n /** @internal */\n public getBackgroundMapGeometry(): BackgroundMapGeometry | undefined {\n if (undefined === this.iModel.ecefLocation)\n return undefined;\n\n const bimElevationBias = this.backgroundMapElevationBias;\n\n if (undefined === bimElevationBias)\n return undefined;\n\n const globeMode = this.globeMode;\n if (undefined === this._backgroundMapGeometry || this._backgroundMapGeometry.globeMode !== globeMode || this._backgroundMapGeometry.bimElevationBias !== bimElevationBias) {\n const geometry = new BackgroundMapGeometry(bimElevationBias, globeMode, this.iModel);\n this._backgroundMapGeometry = { bimElevationBias, geometry, globeMode };\n }\n return this._backgroundMapGeometry.geometry;\n }\n\n /** [[ContextRealityModelState]]s attached to this display style.\n * @see [DisplayStyleSettings.contextRealityModels]($common).\n */\n public get contextRealityModelStates(): ReadonlyArray<ContextRealityModelState> {\n return this.settings.contextRealityModels.models as ContextRealityModelState[];\n }\n\n /** @internal */\n public getGlobalGeometryAndHeightRange(): { geometry: BackgroundMapGeometry, heightRange: Range1d } | undefined {\n let geometry = this.getIsBackgroundMapVisible() ? this.getBackgroundMapGeometry() : undefined;\n const terrainRange = ApproximateTerrainHeights.instance.globalHeightRange;\n let heightRange = this.displayTerrain ? terrainRange : Range1d.createXX(-1, 1);\n if (this.globeMode === GlobeMode.Ellipsoid && this.contextRealityModelStates.find((model) => model.isGlobal)) {\n if (!geometry) {\n if (!this._ellipsoidMapGeometry)\n this._ellipsoidMapGeometry = new BackgroundMapGeometry(0, GlobeMode.Ellipsoid, this.iModel);\n\n geometry = this._ellipsoidMapGeometry;\n }\n\n heightRange = terrainRange;\n }\n\n return geometry ? { geometry, heightRange } : undefined;\n }\n\n /** Returns true if this is a 3d display style. */\n public is3d(): this is DisplayStyle3dState { return this instanceof DisplayStyle3dState; }\n\n /** Customize the way geometry belonging to a [[SubCategory]] is drawn by this display style.\n * @param id The ID of the SubCategory whose appearance is to be overridden.\n * @param ovr The overrides to apply to the [[SubCategoryAppearance]].\n * @see [[dropSubCategoryOverride]]\n */\n public overrideSubCategory(id: Id64String, ovr: SubCategoryOverride) { this.settings.overrideSubCategory(id, ovr); }\n\n /** Remove any [[SubCategoryOverride]] applied to a [[SubCategoryAppearance]] by this style.\n * @param id The ID of the [[SubCategory]].\n * @see [[overrideSubCategory]]\n */\n public dropSubCategoryOverride(id: Id64String) { this.settings.dropSubCategoryOverride(id); }\n\n /** Returns true if an [[SubCategoryOverride]]s are defined by this style. */\n public get hasSubCategoryOverride() { return this.settings.hasSubCategoryOverride; }\n\n /** Obtain the overrides applied to a [[SubCategoryAppearance]] by this style.\n * @param id The ID of the [[SubCategory]].\n * @returns The corresponding SubCategoryOverride, or undefined if the SubCategory's appearance is not overridden.\n * @see [[overrideSubCategory]]\n */\n public getSubCategoryOverride(id: Id64String): SubCategoryOverride | undefined { return this.settings.getSubCategoryOverride(id); }\n\n /** For each subcategory belonging to any of the specified categories, make it visible by turning off the \"invisible\" flag in its subcategory appearance.\n * This requires that the categories and subcategories have been previously loaded by, e.g., a call to IModelConnection.querySubCategories.\n * @returns true if the visibility of any subcategory was modified.\n * @see Viewport.changeCategoryDisplay\n * @see ViewCreator3dOptions.allSubCategoriesVisible\n * @internal\n */\n public enableAllLoadedSubCategories(categoryIds: Id64Arg): boolean {\n let anyChanged = false;\n for (const categoryId of Id64.iterable(categoryIds)) {\n const subCategoryIds = this.iModel.subcategories.getSubCategories(categoryId);\n if (undefined !== subCategoryIds)\n for (const subCategoryId of subCategoryIds)\n if (this.setSubCategoryVisible(subCategoryId, true))\n anyChanged = true;\n }\n\n return anyChanged;\n }\n\n /** Change the \"invisible\" flag for the given subcategory's appearance.\n * This requires that the subcategory appearance has been previously loaded by, e.g., a call to IModelConnection.Categories.getSubCategoryInfo.\n * @returns true if the visibility of any subcategory was modified.\n * @see [[enableAllLoadedSubCategories]]\n * @internal\n */\n public setSubCategoryVisible(subCategoryId: Id64String, visible: boolean): boolean {\n const app = this.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\n if (undefined === app)\n return false; // category not enabled or subcategory not found\n\n const curOvr = this.getSubCategoryOverride(subCategoryId);\n const isAlreadyVisible = undefined !== curOvr && undefined !== curOvr.invisible ? !curOvr.invisible : !app.invisible;\n if (isAlreadyVisible === visible)\n return false;\n\n // Preserve existing overrides - just flip the visibility flag.\n const json = undefined !== curOvr ? curOvr.toJSON() : {};\n json.invisible = !visible;\n this.overrideSubCategory(subCategoryId, SubCategoryOverride.fromJSON(json));\n return true;\n }\n\n /** Returns true if solar shadow display is enabled by this display style. */\n public get wantShadows(): boolean {\n return this.is3d() && this.viewFlags.shadows && false !== IModelApp.renderSystem.options.displaySolarShadows;\n }\n\n /** @internal */\n protected registerSettingsEventListeners(): void {\n this.settings.onScheduleScriptPropsChanged.addListener((scriptProps) => {\n if (this._assigningScript)\n return;\n\n try {\n this._assigningScript = true;\n if (scriptProps)\n this.loadScriptReferenceFromScript(scriptProps);\n else\n this.loadScriptReferenceFromTimeline(this.settings.renderTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n } finally {\n this._assigningScript = false;\n }\n });\n\n this.settings.onRenderTimelineChanged.addListener((newTimeline) => {\n // Cancel any in-progress loading of script from timeline.\n this._queryRenderTimelinePropsPromise = undefined;\n\n if (!this.settings.scheduleScriptProps)\n this.loadScriptReferenceFromTimeline(newTimeline); // eslint-disable-line @typescript-eslint/no-floating-promises\n });\n\n this.settings.onPlanarClipMaskChanged.addListener((id, newSettings) => {\n if (newSettings)\n this._attachedRealityModelPlanarClipMasks.set(id, PlanarClipMaskState.create(newSettings));\n else\n this._attachedRealityModelPlanarClipMasks.delete(id);\n });\n }\n\n /** @internal */\n protected createRealityModel(props: ContextRealityModelProps): ContextRealityModelState {\n return new ContextRealityModelState(props, this.iModel, this);\n }\n\n /** @internal */\n public getPlanarClipMaskState(modelId: Id64String): PlanarClipMaskState | undefined {\n const model = this.iModel.models.getLoaded(modelId)?.asSpatialModel;\n return (model && model.isRealityModel) ? this._attachedRealityModelPlanarClipMasks.get(modelId) : undefined;\n }\n}\n\n/** A display style that can be applied to 2d views.\n * @public\n * @extensions\n */\nexport class DisplayStyle2dState extends DisplayStyleState {\n public static override get className() { return \"DisplayStyle2d\"; }\n private readonly _settings: DisplayStyleSettings;\n\n public get settings(): DisplayStyleSettings { return this._settings; }\n\n /** @internal */\n public overrideTerrainDisplay(): TerrainDisplayOverrides | undefined { return undefined; }\n\n constructor(props: DisplayStyleProps, iModel: IModelConnection) {\n super(props, iModel);\n this._settings = new DisplayStyleSettings(this.jsonProperties, {\n createContextRealityModel: (modelProps) => this.createRealityModel(modelProps),\n deferContextRealityModels: true,\n });\n\n this._settings.contextRealityModels.populate();\n this.registerSettingsEventListeners();\n }\n}\n\n/** A [[DisplayStyleState]] that can be applied to spatial views.\n * @public\n * @extensions\n */\nexport class DisplayStyle3dState extends DisplayStyleState {\n public static override get className() { return \"DisplayStyle3d\"; }\n private _settings: DisplayStyle3dSettings;\n\n public get settings(): DisplayStyle3dSettings { return this._settings; }\n\n public constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyle3dState) {\n super(props, iModel, source);\n this._settings = new DisplayStyle3dSettings(this.jsonProperties, {\n createContextRealityModel: (modelProps) => this.createRealityModel(modelProps),\n deferContextRealityModels: true,\n });\n\n this._settings.contextRealityModels.populate();\n this.registerSettingsEventListeners();\n }\n\n public get environment(): Environment {\n return this.settings.environment;\n }\n public set environment(env: Environment) {\n this.settings.environment = env;\n }\n\n public get lights(): LightSettings { return this.settings.lights; }\n public set lights(lights: LightSettings) { this.settings.lights = lights; }\n\n /** The direction of the solar light. */\n public get sunDirection(): Readonly<Vector3d> {\n return this.settings.lights.solar.direction;\n }\n\n /** Set the solar light direction based on time value\n * @param time The time in unix time milliseconds.\n * @see [DisplayStyle3dSettings.sunTime]($common) to obtain the current sun time.\n * @see [DisplayStyle3dSettings.setSunTime]($common).\n */\n public setSunTime(time: number) {\n this.settings.setSunTime(time, this.iModel);\n }\n\n /** Settings controlling shadow display. */\n public get solarShadows(): SolarShadowSettings {\n return this.settings.solarShadows;\n }\n public set solarShadows(settings: SolarShadowSettings) {\n this.settings.solarShadows = settings;\n }\n\n /** @internal */\n protected override registerSettingsEventListeners(): void {\n super.registerSettingsEventListeners();\n\n this.settings.onOverridesApplied.addListener((overrides: DisplayStyle3dSettingsProps) => {\n if (overrides.thematic && this.settings.thematic.displayMode === ThematicDisplayMode.Height && undefined === overrides.thematic.range) {\n // Use the project extents as reasonable default height range.\n // NB: assumes using Z axis...\n const extents = this.iModel.projectExtents;\n const props = { ...overrides.thematic };\n props.range = { low: extents.zLow, high: extents.zHigh };\n this.settings.thematic = ThematicDisplay.fromJSON(props);\n }\n });\n }\n\n /** @internal */\n public overrideTerrainDisplay(): TerrainDisplayOverrides | undefined {\n if (undefined !== this.settings.thematic) {\n const ovr = new TerrainDisplayOverrides();\n if (this.viewFlags.thematicDisplay && ThematicGradientMode.IsoLines === this.settings.thematic.gradientSettings.mode)\n ovr.wantSkirts = false;\n if (this.viewFlags.thematicDisplay && (ThematicDisplayMode.Slope === this.settings.thematic.displayMode || ThematicDisplayMode.HillShade === this.settings.thematic.displayMode))\n ovr.wantNormals = true;\n return ovr;\n }\n return undefined;\n }\n}\n"]}