@itwin/core-common 3.3.0-dev.5 → 3.3.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -1
- package/lib/cjs/BackgroundMapProvider.d.ts +2 -2
- package/lib/cjs/BackgroundMapProvider.js +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/ChangedEntities.d.ts +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/Code.d.ts +7 -7
- package/lib/cjs/Code.d.ts.map +1 -1
- package/lib/cjs/Code.js +5 -5
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +6 -6
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +2 -2
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/IModel.d.ts +9 -6
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.d.ts +3 -3
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +1 -2
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/MapImagerySettings.d.ts +7 -7
- package/lib/cjs/MapImagerySettings.d.ts.map +1 -1
- package/lib/cjs/MapImagerySettings.js +3 -3
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +21 -14
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +6 -6
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ModelProps.d.ts +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +1 -1
- package/lib/cjs/RenderSchedule.js +1 -1
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/core-common.d.ts +5 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +5 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +38 -2
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +16 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.d.ts +2 -0
- package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +7 -0
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +9 -2
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts +2 -4
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +2 -7
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +0 -5
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +0 -47
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts +2 -3
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +25 -20
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.d.ts +4 -0
- package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +2 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.d.ts +2 -2
- package/lib/esm/BackgroundMapProvider.js +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/ChangedEntities.d.ts +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/Code.d.ts +7 -7
- package/lib/esm/Code.d.ts.map +1 -1
- package/lib/esm/Code.js +5 -5
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +6 -6
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +2 -2
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/IModel.d.ts +9 -6
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.d.ts +3 -3
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/MapImagerySettings.d.ts +7 -7
- package/lib/esm/MapImagerySettings.d.ts.map +1 -1
- package/lib/esm/MapImagerySettings.js +3 -3
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +21 -14
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +6 -6
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ModelProps.d.ts +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +1 -1
- package/lib/esm/RenderSchedule.js +1 -1
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/core-common.d.ts +5 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +5 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +37 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +15 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.d.ts +2 -0
- package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +7 -0
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +10 -3
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts +2 -4
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +2 -7
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +0 -5
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +0 -47
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts +2 -3
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +25 -20
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.d.ts +4 -0
- package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +2 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqB/G;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAc9B,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EAAE,QAAuB;QACxH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC;QAChD,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,mGAAmG;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAsB;QAC3C,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,IA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AAC,CAAC;QAEH,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,YAAY,oBAAoB,CAAC,CAAC;QAEjD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** @beta */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @beta\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @beta\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @beta\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @beta\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @beta\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @beta\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @beta\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @beta\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @beta\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @beta\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA2B/G;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAc9B,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EA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AAI,CAAC,EAAE,CAAC;gBACrE,QAAQ,QAAQ,CAAC,IAAI,EAAE;oBACrB,KAAK,iBAAiB,CAAC,MAAM;wBAC3B,GAAG,GAAG,4DAA4D,CAAC;wBACnE,MAAM;oBACR,KAAK,iBAAiB,CAAC,MAAM;wBAC3B,GAAG,GAAG,6DAA6D,CAAC;wBACpE,MAAM;oBACR,KAAK,iBAAiB,CAAC,MAAM;wBAC3B,GAAG,GAAG,sEAAsE,CAAC;wBAC7E,MAAM;iBACT;gBAED,MAAM;SACT;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC9B,IAAI;YACJ,QAAQ;YACR,GAAG;YACH,qBAAqB,EAAE,KAAK;YAC5B,OAAO,EAAE,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA;YAC5B,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;SACpC,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,YAAY,oBAAoB,CAAC,CAAC;QAEjD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module MapLayers\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** The current set of supported map layer formats.\r\n * In order to be displayed, a corresponding format must have been registered in the [MapLayerFormatRegistry]($frontend)\r\n * @public\r\n */\r\nexport type ImageryMapLayerFormatId = \"ArcGIS\" | \"BingMaps\" | \"MapboxImagery\" | \"TileURL\" | \"WMS\" | \"WMTS\";\r\n\r\n/** @public */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @public\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @public\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @public\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @see [[ImageryMapLayerFormatId]].\r\n * @public\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n /** @internal */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @public\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @public\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @public\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @public\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @public\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
|
package/lib/esm/ModelProps.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { XYProps } from "@itwin/core-geometry";
|
|
|
6
6
|
import { CodeProps } from "./Code";
|
|
7
7
|
import { RelatedElementProps } from "./ElementProps";
|
|
8
8
|
import { EntityProps, EntityQueryParams } from "./EntityProps";
|
|
9
|
-
/** Properties that define a [Model]($docs/bis/
|
|
9
|
+
/** Properties that define a [Model]($docs/bis/guide/fundamentals/model-fundamentals)
|
|
10
10
|
* @public
|
|
11
11
|
* @extensions
|
|
12
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelProps.js","sourceRoot":"","sources":["../../src/ModelProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Entities\r\n */\r\n\r\nimport { GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { XYProps } from \"@itwin/core-geometry\";\r\nimport { CodeProps } from \"./Code\";\r\nimport { RelatedElementProps } from \"./ElementProps\";\r\nimport { EntityProps, EntityQueryParams } from \"./EntityProps\";\r\n\r\n/** Properties that define a [Model]($docs/bis/
|
|
1
|
+
{"version":3,"file":"ModelProps.js","sourceRoot":"","sources":["../../src/ModelProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Entities\r\n */\r\n\r\nimport { GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { XYProps } from \"@itwin/core-geometry\";\r\nimport { CodeProps } from \"./Code\";\r\nimport { RelatedElementProps } from \"./ElementProps\";\r\nimport { EntityProps, EntityQueryParams } from \"./EntityProps\";\r\n\r\n/** Properties that define a [Model]($docs/bis/guide/fundamentals/model-fundamentals)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelProps extends EntityProps {\r\n modeledElement: RelatedElementProps;\r\n name?: string;\r\n parentModel?: Id64String; // NB! Must always match the model of the modeledElement!\r\n isPrivate?: boolean;\r\n isTemplate?: boolean;\r\n jsonProperties?: any;\r\n}\r\n\r\n/** Properties that specify what model should be loaded.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelLoadProps {\r\n id?: Id64String;\r\n code?: CodeProps;\r\n}\r\n\r\n/** Parameters for performing a query on [Model]($backend) classes.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelQueryParams extends EntityQueryParams {\r\n wantTemplate?: boolean;\r\n wantPrivate?: boolean;\r\n}\r\n\r\n/** Properties that describe a [GeometricModel]($backend)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometricModelProps extends ModelProps {\r\n /** A unique identifier that is updated each time a change affecting the appearance of a geometric element within this model\r\n * is committed to the iModel. In other words, between versions of the iModel, if this value is the same you can\r\n * assume the appearance of all of the geometry in the model is the same (Note: other properties of elements may have changed.)\r\n * If undefined, the state of the geometry is unknown.\r\n */\r\n geometryGuid?: GuidString;\r\n}\r\n\r\n/** Properties that define a [GeometricModel2d]($backend)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometricModel2dProps extends GeometricModelProps {\r\n /** The actual coordinates of (0,0) in modeling coordinates. An offset applied to all modeling coordinates. */\r\n globalOrigin?: XYProps;\r\n}\r\n\r\n/** Properties that define a [GeometricModel3d]($backend)\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GeometricModel3dProps extends GeometricModelProps {\r\n /** If true, then the elements in this GeometricModel3d are not in real-world coordinates and will not be in the spatial index. */\r\n isNotSpatiallyLocated?: boolean;\r\n /** If true, then the elements in this GeometricModel3d are expected to be in an XY plane. */\r\n isPlanProjection?: boolean;\r\n}\r\n"]}
|
|
@@ -362,7 +362,7 @@ export declare namespace RenderSchedule {
|
|
|
362
362
|
getTransform(modelId: Id64String, batchId: number, time: number): Readonly<Transform> | undefined;
|
|
363
363
|
/** @internal */
|
|
364
364
|
addSymbologyOverrides(overrides: FeatureOverrides, time: number): void;
|
|
365
|
-
/** Used by
|
|
365
|
+
/** Used by the [Element.collectReferenceIds]($backend) method overrides in RenderTimeline and DisplayStyle.
|
|
366
366
|
* @internal
|
|
367
367
|
*/
|
|
368
368
|
discloseIds(ids: Id64Set): void;
|
|
@@ -585,7 +585,7 @@ export var RenderSchedule;
|
|
|
585
585
|
for (const timeline of this.modelTimelines)
|
|
586
586
|
timeline.addSymbologyOverrides(overrides, time);
|
|
587
587
|
}
|
|
588
|
-
/** Used by
|
|
588
|
+
/** Used by the [Element.collectReferenceIds]($backend) method overrides in RenderTimeline and DisplayStyle.
|
|
589
589
|
* @internal
|
|
590
590
|
*/
|
|
591
591
|
discloseIds(ids) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderSchedule.js","sourceRoot":"","sources":["../../src/RenderSchedule.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE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C7B,IAAI,SAAS,KAAK,IAAI,CAAC,eAAe;gBACpC,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YAE/C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC;QACf,CAAC;KACF;IAvDY,mCAAoB,uBAuDhC,CAAA;IAED;;;;;;;;OAQG;IACH,MAAa,aAAa;QAA1B;YACU,iBAAY,GAAG,CAAC,CAAC;YACR,YAAO,GAA2B,EAAE,CAAC;QAexD,CAAC;QAbC,uFAAuF;QAChF,gBAAgB,CAAC,OAAmB;YACzC,MAAM,OAAO,GAAG,IAAI,oBAAoB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED;;WAEG;QACI,MAAM;YACX,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7C,CAAC;KACF;IAjBY,4BAAa,gBAiBzB,CAAA;AACH,CAAC,EAlkCgB,cAAc,KAAd,cAAc,QAkkC9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { assert, CompressedId64Set, Constructor, Id64, Id64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport {\r\n ClipPlane, ClipPrimitive, ClipVector, ConvexClipPlaneSet, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Point4d, Range1d, Transform, UnionOfConvexClipPlaneSets, Vector3d, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\nimport { RgbColor } from \"./RgbColor\";\r\nimport { FeatureAppearance, FeatureOverrides } from \"./FeatureSymbology\";\r\n\r\nfunction interpolate(start: number, end: number, fraction: number): number {\r\n return start + fraction * (end - start);\r\n}\r\n\r\nfunction interpolateRgb(start: RgbColor, end: RgbColor, fraction: number): RgbColor {\r\n return new RgbColor(interpolate(start.r, end.r, fraction), interpolate(start.g, end.g, fraction), interpolate(start.b, end.b, fraction));\r\n}\r\n\r\n/** Namespace containing types that collectively define a script that animates the contents of a view by adjusting the visibility, position,\r\n * and/or symbology of groups of elements over time. A [[RenderSchedule.Script]] is hosted by a [RenderTimeline]($backend) element. The script\r\n * can be associated with a [DisplayStyleState]($frontend) by way of its [[DisplayStyleSettings.renderTimeline]] property.\r\n * @public\r\n */\r\nexport namespace RenderSchedule {\r\n /** Defines how two interpolate between two entries in a [[RenderSchedule.Timeline]].\r\n * @note Currently only Linear and Step are supported. Any other value is treated as Step.\r\n * @see [[RenderSchedule.TimelineEntry]].\r\n */\r\n export enum Interpolation {\r\n /** Each timeline entry's value is discrete - the timeline jumps from one entry's value directly to another. */\r\n Step = 1,\r\n /** Given two entries on the timeline and a timepoint in between them, linearly interpolate based on the timepoint's distance between the\r\n * two entries.\r\n */\r\n Linear = 2,\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TimelineEntry]]. */\r\n export interface TimelineEntryProps {\r\n /** The time point in seconds in the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). */\r\n time: number;\r\n /** How to interpolate from this entry to the next entry in the timeline.\r\n * Currently, anything other than [[RenderSchedule.Interpolation.Linear]] is treated as [[RenderSchedule.Interpolation.Step]].\r\n * Additional interpolation modes may become supported in the future.\r\n */\r\n interpolation?: Interpolation;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.VisibilityEntry]]. */\r\n export interface VisibilityEntryProps extends TimelineEntryProps {\r\n /** Visibility of the geometry from 0 (invisible) to 100 (fully visible), with intermediate values appearing increasingly less transparent.\r\n * Default: 100 (fully visible).\r\n */\r\n value?: number;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.ColorEntry]]. */\r\n export interface ColorEntryProps extends TimelineEntryProps {\r\n /** The color applied to the geometry, with each component specified as an integer in [0, 255].\r\n * e.g., (0, 0, 0) represents black and (255, 255, 255) represents white.\r\n * If `undefined`, the geometry is displayed in its actual color.\r\n */\r\n value?: { red: number, green: number, blue: number };\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.CuttingPlane]]. */\r\n export interface CuttingPlaneProps {\r\n /** (x,y,z) of a point on the plane. */\r\n position: number[];\r\n /** (x, y, z) of the plane direction (towards the clip) */\r\n direction: number[];\r\n /** If true, the clip plane is ignored and the geometry is displayed unclipped. */\r\n visible?: boolean;\r\n /** If true, the clip plane is ignored and the geometry is not displayed. */\r\n hidden?: boolean;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.CuttingPlaneEntry]]. */\r\n export interface CuttingPlaneEntryProps extends TimelineEntryProps {\r\n /** The clip plane, or undefined if the geometry is not clipped. */\r\n value?: CuttingPlaneProps;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TransformComponents]]. */\r\n export interface TransformComponentsProps {\r\n /** (x, y, z) of position - applied after rotation. */\r\n position?: number[];\r\n /** Quaternion representing rotation. */\r\n orientation?: number[];\r\n /** (x, y, z) of pivot - applied before rotation. */\r\n pivot?: number[];\r\n }\r\n\r\n /** JSON representation of a [Transform]($core-geometry) associated with a [[RenderSchedule.TransformEntryProps]]. */\r\n export interface TransformProps extends TransformComponentsProps {\r\n /** 3 X 4 transformation matrix containing 3 arrays of matrix rows consisting of 4 numbers each: [qx qy qz ax]\r\n * where the fourth columnn in each row holds the translation.\r\n * `undefined` is equivalent to an identity transform.\r\n * This transform is only used if position, orientation, and/or pivot are undefined.\r\n */\r\n transform?: number[][];\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TransformEntry]]. */\r\n export interface TransformEntryProps extends TimelineEntryProps {\r\n /** The transformation matrix, with `undefined` corresponding to an identity matrix. */\r\n value?: TransformProps;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.Timeline]]. */\r\n export interface TimelineProps {\r\n /** Timeline controlling the visibility of the associated geometry. */\r\n visibilityTimeline?: VisibilityEntryProps[];\r\n /** Timeline controlling the colors of the associated geometry. */\r\n colorTimeline?: ColorEntryProps[];\r\n /** Timeline applying transforms to the associated geometry. */\r\n transformTimeline?: TransformEntryProps[];\r\n /** Timeline applying [ClipVector]($core-geometry)s to the associated geometry. */\r\n cuttingPlaneTimeline?: CuttingPlaneEntryProps[];\r\n }\r\n\r\n /** JSON representation of an [[RenderSchedule.ElementTimeline]]. */\r\n export interface ElementTimelineProps extends TimelineProps {\r\n /** A positive integer that uniquely identifies this timeline among all element timelines in the [[RenderSchedule.Script]]. */\r\n batchId: number;\r\n /** The Ids of the elements to which this timeline applies.\r\n * @note Prefer the compressed representation - lists of element Ids can be comparatively enormous.\r\n * @note For a [[DisplayStyleSettingsProps]] associated with a [DisplayStyleState]($frontend) obtained via [IModelConnection.Views.load]($frontend),\r\n * this property will be an empty `CompressedId64Set`. They are omitted to conserve bandwidth and memory because they are not needed for display on the frontend.\r\n */\r\n elementIds: Id64String[] | CompressedId64Set;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.ModelTimeline]]. */\r\n export interface ModelTimelineProps extends TimelineProps {\r\n /** The Id of the [GeometricModelState]($frontend) to which the timeline applies. */\r\n modelId: Id64String;\r\n /** @alpha */\r\n realityModelUrl?: string; // defined only for \"context\" reality models (attached through display style)\r\n /** Timelines affecting groups of elements. */\r\n elementTimelines: ElementTimelineProps[];\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.Script]]. */\r\n export type ScriptProps = ModelTimelineProps[];\r\n\r\n /** Describes the value of some property at a specific point along a [[RenderSchedule.Timeline]].\r\n * @see [[RenderSchedule.VisibilityEntry]]\r\n * @see [[RenderSchedule.ColorEntry]]\r\n * @see [[RenderSchedule.TransformEntry]]\r\n * @see [[RenderSchedule.CuttingPlaneEntry]]\r\n */\r\n export class TimelineEntry {\r\n /** The time point in seconds in the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). */\r\n public readonly time: number;\r\n /** How to interpolate from this entry to the next entry in the timeline. */\r\n public readonly interpolation: Interpolation;\r\n\r\n public constructor(props: TimelineEntryProps) {\r\n this.time = props.time;\r\n this.interpolation = props.interpolation === Interpolation.Linear ? props.interpolation : Interpolation.Step;\r\n }\r\n\r\n public toJSON(): TimelineEntryProps {\r\n const props: TimelineEntryProps = {\r\n time: this.time,\r\n };\r\n\r\n if (this.interpolation === Interpolation.Linear)\r\n props.interpolation = this.interpolation;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry that controls the visibility of the associated geometry. */\r\n export class VisibilityEntry extends TimelineEntry {\r\n /** The visibility of the geometry at this point on the timeline, in the range [0, 100] where 0 is completely invisible, 100 is completely visible,\r\n * and values in between indicate increasing opacity.\r\n */\r\n public readonly value: number;\r\n\r\n public constructor(props: VisibilityEntryProps) {\r\n super(props);\r\n if (typeof props.value !== \"number\")\r\n this.value = 100;\r\n else\r\n this.value = Math.max(0, Math.min(100, props.value));\r\n }\r\n\r\n public override toJSON(): VisibilityEntryProps {\r\n const props = super.toJSON() as VisibilityEntryProps;\r\n if (100 !== this.value)\r\n props.value = this.value;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry controlling the color of the affected geometry. */\r\n export class ColorEntry extends TimelineEntry {\r\n /** If defined, the color in which to draw the geometry. If undefined, the geometry is drawn in its actual color. */\r\n public readonly value: RgbColor | undefined;\r\n\r\n public constructor(props: ColorEntryProps) {\r\n super(props);\r\n if (props.value)\r\n this.value = new RgbColor(props.value.red, props.value.green, props.value.blue);\r\n }\r\n\r\n public override toJSON(): ColorEntryProps {\r\n const props = super.toJSON() as ColorEntryProps;\r\n if (this.value) {\r\n props.value = {\r\n red: this.value.r,\r\n green: this.value.g,\r\n blue: this.value.b,\r\n };\r\n }\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Describes the components of a [[RenderSchedule.TransformEntry]] as a rotation around a pivot point followed by a translation. */\r\n export class TransformComponents {\r\n /** Pivot point - applied before rotation. */\r\n public readonly pivot: Vector3d;\r\n /** Quaternion rotation. */\r\n public readonly orientation: Point4d;\r\n /** Translation - applied after rotation. */\r\n public readonly position: Vector3d;\r\n\r\n public constructor(position: Vector3d, pivot: Vector3d, orientation: Point4d) {\r\n this.position = position;\r\n this.pivot = pivot;\r\n this.orientation = orientation;\r\n }\r\n\r\n public static fromJSON(props: TransformComponentsProps): TransformComponents | undefined {\r\n if (props.pivot && props.position && props.orientation)\r\n return new TransformComponents(Vector3d.fromJSON(props.position), Vector3d.fromJSON(props.pivot), Point4d.fromJSON(props.orientation));\r\n else\r\n return undefined;\r\n }\r\n\r\n public toJSON(): TransformComponentsProps {\r\n return {\r\n position: [this.position.x, this.position.y, this.position.z],\r\n pivot: [this.pivot.x, this.pivot.y, this.pivot.z],\r\n orientation: [this.orientation.x, this.orientation.y, this.orientation.z, this.orientation.w],\r\n };\r\n }\r\n }\r\n\r\n /** A timeline entry that applies rotation, scaling, and/or translation to the affected geometry. */\r\n export class TransformEntry extends TimelineEntry {\r\n /** The transform matrix to be applied to the geometry, used only if [[components]] is not defined. */\r\n public readonly value: Readonly<Transform>;\r\n /** The transform represented as a rotation about a pivot point followed by a translation. If undefined, [[value]] is used instead. */\r\n public readonly components?: TransformComponents;\r\n\r\n public constructor(props: TransformEntryProps) {\r\n super(props);\r\n this.value = props.value ? Transform.fromJSON(props.value.transform) : Transform.identity;\r\n if (props.value)\r\n this.components = TransformComponents.fromJSON(props.value);\r\n }\r\n\r\n public override toJSON(): TransformEntryProps {\r\n const props = super.toJSON() as TransformEntryProps;\r\n if (this.components) {\r\n props.value = this.components.toJSON();\r\n props.value.transform = this.value.toRows();\r\n } else {\r\n props.value = { transform: this.value.toRows() };\r\n }\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Defines a [ClipPlane]($core-geometry) associated with a [[RenderSchedule.CuttingPlaneEntry]]. */\r\n export class CuttingPlane {\r\n /** A point on the plane. */\r\n public readonly position: XYAndZ;\r\n /** The direction perpendicular to the plane pointing toward the clip. */\r\n public readonly direction: XYAndZ;\r\n /** If true, the clip plane is ignored and the geometry is never clipped. */\r\n public readonly visible: boolean;\r\n /** If true, the clip plane is ignored and the geometry is always clipped. */\r\n public readonly hidden: boolean;\r\n\r\n public constructor(props: CuttingPlaneProps) {\r\n this.position = Point3d.fromJSON(props.position);\r\n this.direction = Point3d.fromJSON(props.direction);\r\n this.hidden = true === props.hidden;\r\n this.visible = true === props.visible;\r\n }\r\n\r\n public toJSON(): CuttingPlaneProps {\r\n const props: CuttingPlaneProps = {\r\n position: [this.position.x, this.position.y, this.position.z],\r\n direction: [this.direction.x, this.direction.y, this.direction.z],\r\n };\r\n\r\n if (this.visible)\r\n props.visible = true;\r\n\r\n if (this.hidden)\r\n props.hidden = true;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry that applies a [ClipPlane]($core-geometry) to the affected geometry. */\r\n export class CuttingPlaneEntry extends TimelineEntry {\r\n /** The definition of the [ClipPlane]($core-geometry), or undefined if this entry applies no clipping. */\r\n public readonly value: CuttingPlane | undefined;\r\n\r\n public constructor(props: CuttingPlaneEntryProps) {\r\n super(props);\r\n if (props.value)\r\n this.value = new CuttingPlane(props.value);\r\n }\r\n\r\n public override toJSON(): CuttingPlaneEntryProps {\r\n const props = super.toJSON() as CuttingPlaneEntryProps;\r\n if (this.value)\r\n props.value = this.value.toJSON();\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Identifies a fractional position along a [[RenderSchedule.Timeline]] between any two [[RenderSchedule.TimelineEntry]]'s within a [[RenderSchedule.TimelineEntryList]].\r\n * @internal\r\n */\r\n export class Interval {\r\n /** The index of the first timeline entry within the list. */\r\n public lowerIndex!: number;\r\n /** The index of the second timeline entry within the list. */\r\n public upperIndex!: number;\r\n /** The normalized distance between the two timeline entries. */\r\n public fraction!: number;\r\n\r\n public constructor(lower = 0, upper = 0, fraction = 0) {\r\n this.init(lower, upper, fraction);\r\n }\r\n\r\n public init(lower = 0, upper = 0, fraction = 0): void {\r\n this.lowerIndex = lower;\r\n this.upperIndex = upper;\r\n this.fraction = fraction;\r\n }\r\n }\r\n\r\n /** A list of the [[RenderSchedule.TimelineEntry]] objects within a [[RenderSchedule.Timeline]]. The type parameters are:\r\n * - T, a subclass of TimelineEntry with a `value` property specifying the value of the property controlled by the timeline at that entry's time point.\r\n * - P, the JSON representation from which T is to be constructed.\r\n * - V, the type of `T.value`.\r\n */\r\n export class TimelineEntryList<T extends TimelineEntry & { readonly value: V }, P extends TimelineEntryProps, V> implements Iterable<T> {\r\n private readonly _entries: ReadonlyArray<T>;\r\n /** The total time period represented by the entries in this list. */\r\n public readonly duration: Range1d;\r\n\r\n public constructor(props: P[], ctor: Constructor<T>) {\r\n this.duration = Range1d.createNull();\r\n this._entries = props.map((x) => {\r\n const entry = new ctor(x);\r\n this.duration.extendX(entry.time);\r\n return entry;\r\n });\r\n }\r\n\r\n /** The number of entries in the list. */\r\n public get length(): number {\r\n return this._entries.length;\r\n }\r\n\r\n /** An iterator over the entries in the list. */\r\n public [Symbol.iterator](): Iterator<T> {\r\n return this._entries[Symbol.iterator]();\r\n }\r\n\r\n /** Look up an entry by its position in the list. */\r\n public getEntry(index: number): T | undefined {\r\n return this._entries[index];\r\n }\r\n\r\n /** Look up the value of an entry by its position in the list. */\r\n public getValue(index: number): V | undefined {\r\n return this.getEntry(index)?.value;\r\n }\r\n\r\n public toJSON(): P[] {\r\n return this._entries.map((x) => x.toJSON() as P);\r\n }\r\n\r\n /** @internal */\r\n public findInterval(time: number, interval?: Interval): Interval | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n\r\n interval = interval ?? new Interval();\r\n if (time < this._entries[0].time) {\r\n interval.init(0, 0, 0);\r\n return interval;\r\n }\r\n\r\n const last = this.length - 1;\r\n if (time >= this._entries[last].time) {\r\n interval.init(last, last, 0);\r\n return interval;\r\n }\r\n\r\n for (let i = 0; i < last; i++) {\r\n const time0 = this._entries[i].time;\r\n const time1 = this._entries[i + 1].time;\r\n if (time0 <= time && time1 >= time) {\r\n let fraction;\r\n if (Interpolation.Linear === this._entries[i].interpolation)\r\n fraction = (time - time0) / (time1 - time0);\r\n else\r\n fraction = 0;\r\n\r\n interval.init(i, i + 1, fraction);\r\n return interval;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n }\r\n\r\n const scratchInterval = new Interval();\r\n\r\n /** A list of [[RenderSchedule.VisibilityEntry]]s within a [[RenderSchedule.Timeline]]. */\r\n export class VisibilityTimelineEntries extends TimelineEntryList<VisibilityEntry, VisibilityEntryProps, number> {\r\n /** Returns the visibility value for the entry at the specified position in the list, or 100 (fully-visible) if no such entry exists. */\r\n public override getValue(index: number): number {\r\n return super.getValue(index) ?? 100;\r\n }\r\n }\r\n\r\n /** A list of [[RenderSchedule.TransformEntry]]s within a [[RenderSchedule.Timeline]]. */\r\n export class TransformTimelineEntries extends TimelineEntryList<TransformEntry, TransformEntryProps, Readonly<Transform>> {\r\n /** Returns the transform for the entry at the specified position in the list, or an identity transform if no such entry exists. */\r\n public override getValue(index: number): Readonly<Transform> {\r\n return super.getValue(index) ?? Transform.identity;\r\n }\r\n }\r\n\r\n /** Specifies how to animate a set of geometry over time within a [[RenderSchedule.Script]].\r\n * A [[RenderSchedule.Script]] can contain any number of [[RenderSchedule.Timeline]]s, each affecting different sets of geometry.\r\n * @see [[RenderSchedule.ElementTimeline]] and [[RenderSchedule.ModelTimeline]].\r\n */\r\n export class Timeline {\r\n /** Sequence controlling the visibility of the geometry. */\r\n public readonly visibility?: VisibilityTimelineEntries;\r\n /** Sequence controlling the color of the geometry. */\r\n public readonly color?: TimelineEntryList<ColorEntry, ColorEntryProps, RgbColor | undefined>;\r\n /** Sequence controlling the position, orientation, and/or scale of the geometry. */\r\n public readonly transform?: TransformTimelineEntries;\r\n /** Sequence controlling how the geometry is clipped. */\r\n public readonly cuttingPlane?: TimelineEntryList<CuttingPlaneEntry, CuttingPlaneEntryProps, CuttingPlane | undefined>;\r\n /** The total time period represented by this timeline. */\r\n public readonly duration: Range1d;\r\n\r\n public constructor(props: TimelineProps) {\r\n this.duration = Range1d.createNull();\r\n\r\n if (props.visibilityTimeline) {\r\n this.visibility = new VisibilityTimelineEntries(props.visibilityTimeline, VisibilityEntry);\r\n this.duration.extendRange(this.visibility.duration);\r\n }\r\n\r\n if (props.colorTimeline) {\r\n this.color = new TimelineEntryList(props.colorTimeline, ColorEntry);\r\n this.duration.extendRange(this.color.duration);\r\n }\r\n\r\n if (props.transformTimeline) {\r\n this.transform = new TransformTimelineEntries(props.transformTimeline, TransformEntry);\r\n this.duration.extendRange(this.transform.duration);\r\n }\r\n\r\n if (props.cuttingPlaneTimeline) {\r\n this.cuttingPlane = new TimelineEntryList(props.cuttingPlaneTimeline, CuttingPlaneEntry);\r\n this.duration.extendRange(this.cuttingPlane.duration);\r\n }\r\n }\r\n\r\n public toJSON(): TimelineProps {\r\n return {\r\n visibilityTimeline: this.visibility?.toJSON(),\r\n colorTimeline: this.color?.toJSON(),\r\n transformTimeline: this.transform?.toJSON(),\r\n cuttingPlaneTimeline: this.cuttingPlane?.toJSON(),\r\n };\r\n }\r\n\r\n /** Get the visibility of the geometry at the specified time point. */\r\n public getVisibility(time: number): number {\r\n let interval;\r\n if (!this.visibility || !(interval = this.visibility.findInterval(time, scratchInterval)))\r\n return 100;\r\n\r\n let visibility = this.visibility.getValue(interval.lowerIndex) ?? 100;\r\n if (interval.fraction > 0)\r\n visibility = interpolate(visibility, this.visibility.getValue(interval.upperIndex) ?? 100, interval.fraction);\r\n\r\n return visibility;\r\n }\r\n\r\n /** Get the color of the geometry at the specified time point, or undefined if the color is not overridden at that time point. */\r\n public getColor(time: number): RgbColor | undefined {\r\n let interval;\r\n if (!this.color || !(interval = this.color.findInterval(time, scratchInterval)))\r\n return undefined;\r\n\r\n const start = this.color.getValue(interval.lowerIndex);\r\n if (start && interval.fraction > 0) {\r\n const end = this.color.getValue(interval.upperIndex);\r\n if (end)\r\n return interpolateRgb(start, end, interval.fraction);\r\n }\r\n\r\n return start;\r\n }\r\n\r\n /** Get the transform applied to the geometry at the specified time point. */\r\n public getAnimationTransform(time: number): Readonly<Transform> {\r\n let interval;\r\n if (!this.transform || !(interval = this.transform.findInterval(time, scratchInterval)))\r\n return Transform.identity;\r\n\r\n let transform = this.transform.getValue(interval.lowerIndex);\r\n if (interval.fraction > 0) {\r\n const comp0 = this.transform.getEntry(interval.lowerIndex)?.components;\r\n const comp1 = this.transform.getEntry(interval.upperIndex)?.components;\r\n if (comp0 && comp1) {\r\n const sum = Point4d.interpolateQuaternions(comp0.orientation, interval.fraction, comp1.orientation);\r\n const matrix = Matrix3d.createFromQuaternion(sum);\r\n const pre = Transform.createTranslation(comp0.pivot);\r\n const post = Transform.createTranslation(comp0.position.interpolate(interval.fraction, comp1.position));\r\n const product = post.multiplyTransformMatrix3d(matrix);\r\n product.multiplyTransformTransform(pre, product);\r\n transform = product;\r\n } else {\r\n const end = this.transform.getValue(interval.upperIndex);\r\n const q0 = transform.matrix.inverse()?.toQuaternion();\r\n const q1 = end.matrix.inverse()?.toQuaternion();\r\n if (q0 && q1) {\r\n const sum = Point4d.interpolateQuaternions(q0, interval.fraction, q1);\r\n const matrix = Matrix3d.createFromQuaternion(sum);\r\n\r\n const origin0 = Vector3d.createFrom(transform.origin);\r\n const origin1 = Vector3d.createFrom(end.origin);\r\n transform = Transform.createRefs(origin0.interpolate(interval.fraction, origin1), matrix);\r\n }\r\n }\r\n }\r\n\r\n return transform;\r\n }\r\n\r\n /** Get the clipping plane applied to the geometry at the specified time point, or undefined if the geometry is unclipped at that time point. */\r\n public getCuttingPlane(time: number): Plane3dByOriginAndUnitNormal | undefined {\r\n let interval;\r\n if (!this.cuttingPlane || !(interval = this.cuttingPlane.findInterval(time, scratchInterval)))\r\n return undefined;\r\n\r\n const start = this.cuttingPlane.getValue(interval.lowerIndex);\r\n if (!start)\r\n return undefined;\r\n\r\n const position = Point3d.createFrom(start.position);\r\n const direction = Vector3d.createFrom(start.direction);\r\n const end = interval.fraction > 0 ? this.cuttingPlane.getValue(interval.upperIndex) : undefined;\r\n if (end) {\r\n position.interpolate(interval.fraction, end.position, position);\r\n direction.interpolate(interval.fraction, end.direction, direction);\r\n } else {\r\n if (start.hidden || start.visible)\r\n return undefined;\r\n }\r\n\r\n direction.negate(direction);\r\n direction.normalizeInPlace();\r\n\r\n return Plane3dByOriginAndUnitNormal.create(position, direction);\r\n }\r\n\r\n /** Create a ClipVector from the [[RenderSchedule.CuttingPlane]] applied to the geometry at the specified time point, if any. */\r\n public getClipVector(time: number): ClipVector | undefined {\r\n const plane = this.getCuttingPlane(time);\r\n if (!plane)\r\n return undefined;\r\n\r\n const cp = ClipPlane.createPlane(plane);\r\n const cps = UnionOfConvexClipPlaneSets.createConvexSets([ConvexClipPlaneSet.createPlanes([cp])]);\r\n const prim = ClipPrimitive.createCapture(cps);\r\n return ClipVector.createCapture([prim]);\r\n }\r\n\r\n /** @internal */\r\n protected getFeatureAppearance(visibility: number, time: number): FeatureAppearance | undefined {\r\n const transparency = visibility < 100 ? (1 - visibility / 100) : undefined;\r\n const rgb = this.getColor(time);\r\n return undefined !== rgb || undefined !== transparency ? FeatureAppearance.fromJSON({ rgb, transparency }) : undefined;\r\n }\r\n }\r\n\r\n /** Specifies how to animate the geometry belonging to a set of [GeometricElement]($backend)s as part of a [[RenderSchedule.Script]]. */\r\n export class ElementTimeline extends Timeline {\r\n /** A positive integer that uniquely identififes this timeline among all ElementTimelines in the [[RenderSchedule.Script]]. */\r\n public readonly batchId: number;\r\n private readonly _elementIds: Id64String[] | CompressedId64Set;\r\n\r\n private constructor(props: ElementTimelineProps) {\r\n super(props);\r\n this.batchId = props.batchId;\r\n this._elementIds = props.elementIds;\r\n }\r\n\r\n public static fromJSON(props?: ElementTimelineProps): ElementTimeline {\r\n return new ElementTimeline(props ?? { elementIds: [], batchId: 0 });\r\n }\r\n\r\n public override toJSON(): ElementTimelineProps {\r\n return {\r\n ...super.toJSON(),\r\n batchId: this.batchId,\r\n elementIds: this._elementIds,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public static getElementIds(ids: Id64String[] | CompressedId64Set): Iterable<Id64String> {\r\n if (typeof ids === \"string\")\r\n return CompressedId64Set.iterable(ids);\r\n else if (Array.isArray(ids)) {\r\n return ids;\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n /** The Ids of the elements controlled by this timeline. */\r\n public get elementIds(): Iterable<Id64String> {\r\n return ElementTimeline.getElementIds(this._elementIds);\r\n }\r\n\r\n /** True if this timeline affects the color or transparency of the elements. */\r\n public get containsFeatureOverrides(): boolean {\r\n return undefined !== this.visibility || undefined !== this.color;\r\n }\r\n\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public get requiresBatching(): boolean {\r\n if (this.cuttingPlane)\r\n return true;\r\n\r\n return this.batchId !== 0 && (undefined !== this.color || undefined !== this.visibility);\r\n }\r\n\r\n /** True if this timeline affects the position, orientation, or scale of the elements. */\r\n public get containsTransform(): boolean {\r\n return undefined !== this.transform;\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n assert(0 !== this.batchId);\r\n\r\n const vis = this.getVisibility(time);\r\n if (vis <= 0) {\r\n overrides.setAnimationNodeNeverDrawn(this.batchId);\r\n return;\r\n }\r\n\r\n const appearance = this.getFeatureAppearance(vis, time);\r\n if (appearance)\r\n overrides.overrideAnimationNode(this.batchId, appearance);\r\n }\r\n }\r\n\r\n /** Specifies how to animate the geometry within a [GeometricModel]($backend) as part of a [[RenderSchedule.Script]]. */\r\n export class ModelTimeline extends Timeline {\r\n /** The Id of the [GeometricModel]($backend) to be animated. */\r\n public readonly modelId: Id64String;\r\n /** @internal */\r\n public readonly realityModelUrl?: string;\r\n /** Timelines specifying how to animate groups of [GeometricElement]($backend)s within the model. */\r\n public readonly elementTimelines: ReadonlyArray<ElementTimeline>;\r\n /** @internal */\r\n public readonly transformBatchIds: ReadonlyArray<number>;\r\n /** True if this timeline affects the color or transparency of the geometry. */\r\n public readonly containsFeatureOverrides: boolean;\r\n /** True if this timeline applies clipping to the model. */\r\n public readonly containsModelClipping: boolean;\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public readonly requiresBatching: boolean;\r\n /** True if this timeline affects the position, orientation, or scale of the geometry. */\r\n public readonly containsTransform: boolean;\r\n\r\n private constructor(props: ModelTimelineProps) {\r\n super(props);\r\n\r\n this.modelId = props.modelId;\r\n this.realityModelUrl = props.realityModelUrl;\r\n this.containsModelClipping = undefined !== this.cuttingPlane;\r\n\r\n let containsFeatureOverrides = undefined !== this.visibility || undefined !== this.color;\r\n let requiresBatching = false;\r\n let containsTransform = false;\r\n\r\n const transformBatchIds: number[] = [];\r\n const elementTimelines: ElementTimeline[] = [];\r\n\r\n for (const elProps of props.elementTimelines) {\r\n const el = ElementTimeline.fromJSON(elProps);\r\n elementTimelines.push(el);\r\n\r\n this.duration.extendRange(el.duration);\r\n\r\n if (el.containsTransform) {\r\n containsTransform = true;\r\n if (el.batchId)\r\n transformBatchIds.push(el.batchId);\r\n }\r\n\r\n containsFeatureOverrides ||= el.containsFeatureOverrides;\r\n requiresBatching ||= el.requiresBatching;\r\n }\r\n\r\n this.elementTimelines = elementTimelines;\r\n this.transformBatchIds = transformBatchIds;\r\n\r\n this.containsFeatureOverrides = containsFeatureOverrides;\r\n this.requiresBatching = requiresBatching;\r\n this.containsTransform = containsTransform;\r\n }\r\n\r\n public static fromJSON(props?: ModelTimelineProps): ModelTimeline {\r\n return new ModelTimeline(props ?? { elementTimelines: [], modelId: Id64.invalid });\r\n }\r\n\r\n public override toJSON(): ModelTimelineProps {\r\n return {\r\n ...super.toJSON(),\r\n modelId: this.modelId,\r\n realityModelUrl: this.realityModelUrl,\r\n elementTimelines: this.elementTimelines.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Look up the element timeline with the specified batch Id. */\r\n public findByBatchId(batchId: number): ElementTimeline | undefined {\r\n return this.elementTimelines.find((x) => x.batchId === batchId);\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n const appearance = this.getFeatureAppearance(this.getVisibility(time), time);\r\n if (appearance)\r\n overrides.override({ modelId: this.modelId, appearance });\r\n\r\n for (const timeline of this.elementTimelines)\r\n timeline.addSymbologyOverrides(overrides, time);\r\n }\r\n\r\n /** Obtain the transform applied to the model at the specified time point, if any. */\r\n public getTransform(batchId: number, time: number): Readonly<Transform> | undefined {\r\n return this.findByBatchId(batchId)?.getAnimationTransform(time);\r\n }\r\n }\r\n\r\n /** Specifies how to animate the contents of a [ViewState]($frontend) over time. The script contains any number of [[RenderSchedule.ModelTimeline]]s, each describing how\r\n * to animate one of the models in the view.\r\n * @see [RenderTimeline]($backend) to create an [Element]($backend) to host a script.\r\n * @see [[DisplayStyleSettings.renderTimeline]] to associate a [RenderTimeline]($backend)'s script with a [DisplayStyle]($backend).\r\n * @see [DisplayStyleState.scheduleScript]($frontend) to obtain the script associated with a display style.\r\n * @see [[RenderSchedule.ScriptBuilder]] to define a new script.\r\n */\r\n export class Script {\r\n /** Timelines specifying how to animate individual models within the view. */\r\n public readonly modelTimelines: ReadonlyArray<ModelTimeline>;\r\n /** True if this script applies clipping to any models. */\r\n public readonly containsModelClipping: boolean;\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public readonly requiresBatching: boolean;\r\n /** True if this script affects the position, orientation, or scale of the geometry. */\r\n public readonly containsTransform: boolean;\r\n /** True if this script affects the color or transparency of the geometry. */\r\n public readonly containsFeatureOverrides: boolean;\r\n /** The total time period over which this script animates. */\r\n public readonly duration: Range1d;\r\n /** The batchIds of all nodes in all timelines that apply a transform.\r\n * @internal\r\n */\r\n public readonly transformBatchIds: ReadonlySet<number>;\r\n\r\n protected constructor(props: Readonly<ScriptProps>) {\r\n this.duration = Range1d.createNull();\r\n const transformBatchIds = new Set<number>();\r\n\r\n const modelTimelines: ModelTimeline[] = [];\r\n let containsModelClipping = false;\r\n let requiresBatching = false;\r\n let containsTransform = false;\r\n let containsFeatureOverrides = false;\r\n\r\n for (const modelProps of props) {\r\n const model = ModelTimeline.fromJSON(modelProps);\r\n modelTimelines.push(model);\r\n\r\n this.duration.extendRange(model.duration);\r\n\r\n containsModelClipping ||= model.containsModelClipping;\r\n requiresBatching ||= model.requiresBatching;\r\n containsTransform ||= model.containsTransform;\r\n containsFeatureOverrides ||= model.containsFeatureOverrides;\r\n\r\n for (const batchId of model.transformBatchIds)\r\n transformBatchIds.add(batchId);\r\n }\r\n\r\n this.modelTimelines = modelTimelines;\r\n this.containsModelClipping = containsModelClipping;\r\n this.containsTransform = containsTransform;\r\n this.requiresBatching = requiresBatching || this.containsTransform;\r\n this.containsFeatureOverrides = containsFeatureOverrides;\r\n this.transformBatchIds = transformBatchIds;\r\n }\r\n\r\n public static fromJSON(props: Readonly<ScriptProps>): Script | undefined {\r\n if (!Array.isArray(props) || props.length === 0)\r\n return undefined;\r\n\r\n return new Script(props);\r\n }\r\n\r\n public toJSON(): ScriptProps {\r\n return this.modelTimelines.map((x) => x.toJSON());\r\n }\r\n\r\n /** Look up the timeline that animates the specified model, if any. */\r\n public find(modelId: Id64String): ModelTimeline | undefined {\r\n return this.modelTimelines.find((x) => x.modelId === modelId);\r\n }\r\n\r\n /** @internal */\r\n public getTransformBatchIds(modelId: Id64String): ReadonlyArray<number> | undefined {\r\n return this.find(modelId)?.transformBatchIds;\r\n }\r\n\r\n /** @internal */\r\n public getTransform(modelId: Id64String, batchId: number, time: number): Readonly<Transform> | undefined {\r\n return this.find(modelId)?.getTransform(batchId, time);\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n for (const timeline of this.modelTimelines)\r\n timeline.addSymbologyOverrides(overrides, time);\r\n }\r\n\r\n /** Used by collectPredecessorIds methods of RenderTimeline and DisplayStyle.\r\n * @internal\r\n */\r\n public discloseIds(ids: Id64Set): void {\r\n for (const model of this.modelTimelines) {\r\n ids.add(model.modelId);\r\n for (const element of model.elementTimelines)\r\n for (const id of element.elementIds)\r\n ids.add(id);\r\n }\r\n }\r\n }\r\n\r\n /** A reference to a [[RenderSchedule.Script]] indicating the persistent [Element]($backend) from which the script was obtained.\r\n * Prior to the introduction of the [RenderTimeline]($backend) class in version 01.00.13 of the BisCore ECSchema, scripts were\r\n * stored in the JSON properties of [DisplayStyle]($backend) elements. Now they are stored in the Script property of a RenderTimeline element.\r\n * The `sourceId` can refer to either a DisplayStyle or a RenderTimeline.\r\n */\r\n export class ScriptReference {\r\n /** The Id of the [RenderTimeline]($backend) or [DisplayStyle]($backend) element that hosts the script. */\r\n public readonly sourceId: Id64String;\r\n /** The script. */\r\n public readonly script: Script;\r\n\r\n public constructor(sourceId: Id64String, script: Script) {\r\n this.sourceId = sourceId;\r\n this.script = script;\r\n }\r\n }\r\n\r\n /** Used as part of a [[RenderSchedule.ScriptBuilder]] to define a [[RenderSchedule.Timeline]].\r\n * @see [[RenderSchedule.ElementTimelineBuilder]] and [[RenderSchedule.ModelTimelineBuilder]].\r\n */\r\n export class TimelineBuilder {\r\n /** Timeline controlling visibility. */\r\n public visibility?: VisibilityEntryProps[];\r\n /** Timeline controlling color. */\r\n public color?: ColorEntryProps[];\r\n /** Timeline controlling position and orientation. */\r\n public transform?: TransformEntryProps[];\r\n /** Timeline controlling clipping. */\r\n public cuttingPlane?: CuttingPlaneEntryProps[];\r\n\r\n /** Append a new [[RenderSchedule.VisibilityEntry]] to the timeline. */\r\n public addVisibility(time: number, visibility: number | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.visibility)\r\n this.visibility = [];\r\n\r\n this.visibility.push({ time, value: visibility, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.ColorEntry]] to the timeline. */\r\n public addColor(time: number, color: RgbColor | { red: number, green: number, blue: number } | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.color)\r\n this.color = [];\r\n\r\n const value = color instanceof RgbColor ? { red: color.r, green: color.g, blue: color.b } : color;\r\n this.color.push({ time, value, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.CuttingPlaneEntry]] to the timeline. */\r\n public addCuttingPlane(time: number, plane: { position: XYAndZ, direction: XYAndZ, visible?: boolean, hidden?: boolean } | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.cuttingPlane)\r\n this.cuttingPlane = [];\r\n\r\n let value: CuttingPlaneProps | undefined;\r\n if (plane) {\r\n value = {\r\n position: [plane.position.x, plane.position.y, plane.position.z],\r\n direction: [plane.direction.x, plane.direction.y, plane.direction.z],\r\n };\r\n\r\n if (plane.visible)\r\n value.visible = true;\r\n\r\n if (plane.hidden)\r\n value.hidden = true;\r\n }\r\n\r\n this.cuttingPlane.push({ time, value, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.TransformEntry]] to the timeline. */\r\n public addTransform(time: number, transform: Transform | undefined, components?: { pivot: XYAndZ, orientation: Point4d, position: XYAndZ }, interpolation = Interpolation.Linear): void {\r\n if (!this.transform)\r\n this.transform = [];\r\n\r\n const value: TransformProps = { transform: transform?.toRows() };\r\n if (components) {\r\n value.pivot = [components.pivot.x, components.pivot.y, components.pivot.z];\r\n value.orientation = components.orientation.toJSON();\r\n value.position = [components.position.x, components.position.y, components.position.z];\r\n }\r\n\r\n this.transform.push({ time, value, interpolation });\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.Timeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public finish(): TimelineProps {\r\n const props: TimelineProps = {};\r\n if (this.visibility?.length)\r\n props.visibilityTimeline = this.visibility;\r\n\r\n if (this.color?.length)\r\n props.colorTimeline = this.color;\r\n\r\n if (this.transform?.length)\r\n props.transformTimeline = this.transform;\r\n\r\n if (this.cuttingPlane?.length)\r\n props.cuttingPlaneTimeline = this.cuttingPlane;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** As part of a [[RenderSchedule.ScriptBuilder]], assembles a [[RenderSchedule.ElementTimeline]].\r\n * @see [[RenderSchedule.ModelTimelineBuilder.addElementTimeline]].\r\n */\r\n export class ElementTimelineBuilder extends TimelineBuilder {\r\n /** A positive integer that uniquely identifies this timeline among all element timelines in the [[RenderSchedule.Script]].\r\n * [[RenderSchedule.ScriptBuilder]] ensures each ElementTimelineBuilder receives a unique batch Id.\r\n */\r\n public readonly batchId: number;\r\n /** The compressed set of Ids of the elements affected by this timeline. */\r\n public readonly elementIds: CompressedId64Set;\r\n\r\n /** Constructor - typically not used directly.\r\n * @see [[RenderSchedule.ModelTimelineBuilder.addElementTimeline]] to create an ElementTimelineBuilder.\r\n */\r\n public constructor(batchId: number, elementIds: CompressedId64Set) {\r\n super();\r\n this.batchId = batchId;\r\n this.elementIds = elementIds;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.ElementTimeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public override finish(): ElementTimelineProps {\r\n const props = super.finish() as ElementTimelineProps;\r\n props.batchId = this.batchId;\r\n props.elementIds = this.elementIds;\r\n return props;\r\n }\r\n }\r\n\r\n /** As part of a [[RenderSchedule.ScriptBuilder, assembles a [[RenderSchedule.ModelTimeline]].\r\n * @see [[RenderSchedule.ScriptBuilder.addModelTimeline]].\r\n */\r\n export class ModelTimelineBuilder extends TimelineBuilder {\r\n /** The Id of the model affected by this timeline. */\r\n public readonly modelId: Id64String;\r\n /** @internal */\r\n public realityModelUrl?: string;\r\n private readonly _obtainNextBatchId: () => number;\r\n private readonly _elements: ElementTimelineBuilder[] = [];\r\n\r\n /** Constructor - typically not used directly.\r\n * @see [[RenderSchedule.ScriptBuilder.addModelTimeline]] to create a ModelTimelineBuilder.\r\n */\r\n public constructor(modelId: Id64String, obtainNextBatchId: () => number) {\r\n super();\r\n this.modelId = modelId;\r\n this._obtainNextBatchId = obtainNextBatchId;\r\n }\r\n\r\n /** Add a new [[RenderSchedule.ElementTimeline]] to be applied to the specified elements.\r\n * This function will sort and compress the Ids if they are not already compressed.\r\n *\r\n */\r\n public addElementTimeline(elementIds: CompressedId64Set | Iterable<Id64String>): ElementTimelineBuilder {\r\n const batchId = this._obtainNextBatchId();\r\n let ids: CompressedId64Set;\r\n\r\n // It's far too easy to accidentally pass a single Id (compiler can't help).\r\n if (typeof elementIds === \"string\" && Id64.isValidId64(elementIds))\r\n elementIds = [elementIds];\r\n\r\n if (typeof elementIds === \"string\") {\r\n // Already compressed.\r\n ids = elementIds;\r\n } else {\r\n const sorted = Array.from(elementIds);\r\n OrderedId64Iterable.sortArray(sorted);\r\n ids = CompressedId64Set.compressIds(sorted);\r\n }\r\n\r\n const builder = new ElementTimelineBuilder(batchId, ids);\r\n this._elements.push(builder);\r\n return builder;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.ModelTimeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public override finish(): ModelTimelineProps {\r\n const props = super.finish() as ModelTimelineProps;\r\n props.modelId = this.modelId;\r\n if (undefined !== this.realityModelUrl)\r\n props.realityModelUrl = this.realityModelUrl;\r\n\r\n props.elementTimelines = this._elements.map((x) => x.finish());\r\n return props;\r\n }\r\n }\r\n\r\n /** Assembles the JSON representation for a new [[RenderSchedule.Script]]. As an extremely simple example, the following code produces a script that changes the color of a single element:\r\n * ```ts\r\n * const script = new ScriptBuilder();\r\n * const model = script.addModelTimeline(\"0x123\");\r\n * const element = model.addElementTimeline([ \"0x456\" ]);\r\n * element.addColor(Date.now(), new RgbColor(0xff, 0x7f, 0));\r\n * const scriptProps = script.finish();\r\n * ```\r\n */\r\n export class ScriptBuilder {\r\n private _nextBatchId = 1;\r\n private readonly _models: ModelTimelineBuilder[] = [];\r\n\r\n /** Add a new [[RenderSchedule.ModelTimeline]] to be applied to the specified model. */\r\n public addModelTimeline(modelId: Id64String): ModelTimelineBuilder {\r\n const builder = new ModelTimelineBuilder(modelId, () => this._nextBatchId++);\r\n this._models.push(builder);\r\n return builder;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.Script]] produced by this builder.\r\n * @see [RenderTimeline.scriptProps]($backend) to assign the new script to a RenderTimeline element.\r\n */\r\n public finish(): ScriptProps {\r\n return this._models.map((x) => x.finish());\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RenderSchedule.js","sourceRoot":"","sources":["../../src/RenderSchedule.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAe,IAAI,EAAuB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7H,OAAO,EACL,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,GAC7K,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,oBAAoB,CAAC;AAEzE,SAAS,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,QAAgB;IAC/D,OAAO,KAAK,GAAG,QAAQ,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,cAAc,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,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED;;WAEG;QACI,MAAM;YACX,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7C,CAAC;KACF;IAjBY,4BAAa,gBAiBzB,CAAA;AACH,CAAC,EAlkCgB,cAAc,KAAd,cAAc,QAkkC9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { assert, CompressedId64Set, Constructor, Id64, Id64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport {\r\n ClipPlane, ClipPrimitive, ClipVector, ConvexClipPlaneSet, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Point4d, Range1d, Transform, UnionOfConvexClipPlaneSets, Vector3d, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\nimport { RgbColor } from \"./RgbColor\";\r\nimport { FeatureAppearance, FeatureOverrides } from \"./FeatureSymbology\";\r\n\r\nfunction interpolate(start: number, end: number, fraction: number): number {\r\n return start + fraction * (end - start);\r\n}\r\n\r\nfunction interpolateRgb(start: RgbColor, end: RgbColor, fraction: number): RgbColor {\r\n return new RgbColor(interpolate(start.r, end.r, fraction), interpolate(start.g, end.g, fraction), interpolate(start.b, end.b, fraction));\r\n}\r\n\r\n/** Namespace containing types that collectively define a script that animates the contents of a view by adjusting the visibility, position,\r\n * and/or symbology of groups of elements over time. A [[RenderSchedule.Script]] is hosted by a [RenderTimeline]($backend) element. The script\r\n * can be associated with a [DisplayStyleState]($frontend) by way of its [[DisplayStyleSettings.renderTimeline]] property.\r\n * @public\r\n */\r\nexport namespace RenderSchedule {\r\n /** Defines how two interpolate between two entries in a [[RenderSchedule.Timeline]].\r\n * @note Currently only Linear and Step are supported. Any other value is treated as Step.\r\n * @see [[RenderSchedule.TimelineEntry]].\r\n */\r\n export enum Interpolation {\r\n /** Each timeline entry's value is discrete - the timeline jumps from one entry's value directly to another. */\r\n Step = 1,\r\n /** Given two entries on the timeline and a timepoint in between them, linearly interpolate based on the timepoint's distance between the\r\n * two entries.\r\n */\r\n Linear = 2,\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TimelineEntry]]. */\r\n export interface TimelineEntryProps {\r\n /** The time point in seconds in the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). */\r\n time: number;\r\n /** How to interpolate from this entry to the next entry in the timeline.\r\n * Currently, anything other than [[RenderSchedule.Interpolation.Linear]] is treated as [[RenderSchedule.Interpolation.Step]].\r\n * Additional interpolation modes may become supported in the future.\r\n */\r\n interpolation?: Interpolation;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.VisibilityEntry]]. */\r\n export interface VisibilityEntryProps extends TimelineEntryProps {\r\n /** Visibility of the geometry from 0 (invisible) to 100 (fully visible), with intermediate values appearing increasingly less transparent.\r\n * Default: 100 (fully visible).\r\n */\r\n value?: number;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.ColorEntry]]. */\r\n export interface ColorEntryProps extends TimelineEntryProps {\r\n /** The color applied to the geometry, with each component specified as an integer in [0, 255].\r\n * e.g., (0, 0, 0) represents black and (255, 255, 255) represents white.\r\n * If `undefined`, the geometry is displayed in its actual color.\r\n */\r\n value?: { red: number, green: number, blue: number };\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.CuttingPlane]]. */\r\n export interface CuttingPlaneProps {\r\n /** (x,y,z) of a point on the plane. */\r\n position: number[];\r\n /** (x, y, z) of the plane direction (towards the clip) */\r\n direction: number[];\r\n /** If true, the clip plane is ignored and the geometry is displayed unclipped. */\r\n visible?: boolean;\r\n /** If true, the clip plane is ignored and the geometry is not displayed. */\r\n hidden?: boolean;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.CuttingPlaneEntry]]. */\r\n export interface CuttingPlaneEntryProps extends TimelineEntryProps {\r\n /** The clip plane, or undefined if the geometry is not clipped. */\r\n value?: CuttingPlaneProps;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TransformComponents]]. */\r\n export interface TransformComponentsProps {\r\n /** (x, y, z) of position - applied after rotation. */\r\n position?: number[];\r\n /** Quaternion representing rotation. */\r\n orientation?: number[];\r\n /** (x, y, z) of pivot - applied before rotation. */\r\n pivot?: number[];\r\n }\r\n\r\n /** JSON representation of a [Transform]($core-geometry) associated with a [[RenderSchedule.TransformEntryProps]]. */\r\n export interface TransformProps extends TransformComponentsProps {\r\n /** 3 X 4 transformation matrix containing 3 arrays of matrix rows consisting of 4 numbers each: [qx qy qz ax]\r\n * where the fourth columnn in each row holds the translation.\r\n * `undefined` is equivalent to an identity transform.\r\n * This transform is only used if position, orientation, and/or pivot are undefined.\r\n */\r\n transform?: number[][];\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.TransformEntry]]. */\r\n export interface TransformEntryProps extends TimelineEntryProps {\r\n /** The transformation matrix, with `undefined` corresponding to an identity matrix. */\r\n value?: TransformProps;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.Timeline]]. */\r\n export interface TimelineProps {\r\n /** Timeline controlling the visibility of the associated geometry. */\r\n visibilityTimeline?: VisibilityEntryProps[];\r\n /** Timeline controlling the colors of the associated geometry. */\r\n colorTimeline?: ColorEntryProps[];\r\n /** Timeline applying transforms to the associated geometry. */\r\n transformTimeline?: TransformEntryProps[];\r\n /** Timeline applying [ClipVector]($core-geometry)s to the associated geometry. */\r\n cuttingPlaneTimeline?: CuttingPlaneEntryProps[];\r\n }\r\n\r\n /** JSON representation of an [[RenderSchedule.ElementTimeline]]. */\r\n export interface ElementTimelineProps extends TimelineProps {\r\n /** A positive integer that uniquely identifies this timeline among all element timelines in the [[RenderSchedule.Script]]. */\r\n batchId: number;\r\n /** The Ids of the elements to which this timeline applies.\r\n * @note Prefer the compressed representation - lists of element Ids can be comparatively enormous.\r\n * @note For a [[DisplayStyleSettingsProps]] associated with a [DisplayStyleState]($frontend) obtained via [IModelConnection.Views.load]($frontend),\r\n * this property will be an empty `CompressedId64Set`. They are omitted to conserve bandwidth and memory because they are not needed for display on the frontend.\r\n */\r\n elementIds: Id64String[] | CompressedId64Set;\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.ModelTimeline]]. */\r\n export interface ModelTimelineProps extends TimelineProps {\r\n /** The Id of the [GeometricModelState]($frontend) to which the timeline applies. */\r\n modelId: Id64String;\r\n /** @alpha */\r\n realityModelUrl?: string; // defined only for \"context\" reality models (attached through display style)\r\n /** Timelines affecting groups of elements. */\r\n elementTimelines: ElementTimelineProps[];\r\n }\r\n\r\n /** JSON representation of a [[RenderSchedule.Script]]. */\r\n export type ScriptProps = ModelTimelineProps[];\r\n\r\n /** Describes the value of some property at a specific point along a [[RenderSchedule.Timeline]].\r\n * @see [[RenderSchedule.VisibilityEntry]]\r\n * @see [[RenderSchedule.ColorEntry]]\r\n * @see [[RenderSchedule.TransformEntry]]\r\n * @see [[RenderSchedule.CuttingPlaneEntry]]\r\n */\r\n export class TimelineEntry {\r\n /** The time point in seconds in the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). */\r\n public readonly time: number;\r\n /** How to interpolate from this entry to the next entry in the timeline. */\r\n public readonly interpolation: Interpolation;\r\n\r\n public constructor(props: TimelineEntryProps) {\r\n this.time = props.time;\r\n this.interpolation = props.interpolation === Interpolation.Linear ? props.interpolation : Interpolation.Step;\r\n }\r\n\r\n public toJSON(): TimelineEntryProps {\r\n const props: TimelineEntryProps = {\r\n time: this.time,\r\n };\r\n\r\n if (this.interpolation === Interpolation.Linear)\r\n props.interpolation = this.interpolation;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry that controls the visibility of the associated geometry. */\r\n export class VisibilityEntry extends TimelineEntry {\r\n /** The visibility of the geometry at this point on the timeline, in the range [0, 100] where 0 is completely invisible, 100 is completely visible,\r\n * and values in between indicate increasing opacity.\r\n */\r\n public readonly value: number;\r\n\r\n public constructor(props: VisibilityEntryProps) {\r\n super(props);\r\n if (typeof props.value !== \"number\")\r\n this.value = 100;\r\n else\r\n this.value = Math.max(0, Math.min(100, props.value));\r\n }\r\n\r\n public override toJSON(): VisibilityEntryProps {\r\n const props = super.toJSON() as VisibilityEntryProps;\r\n if (100 !== this.value)\r\n props.value = this.value;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry controlling the color of the affected geometry. */\r\n export class ColorEntry extends TimelineEntry {\r\n /** If defined, the color in which to draw the geometry. If undefined, the geometry is drawn in its actual color. */\r\n public readonly value: RgbColor | undefined;\r\n\r\n public constructor(props: ColorEntryProps) {\r\n super(props);\r\n if (props.value)\r\n this.value = new RgbColor(props.value.red, props.value.green, props.value.blue);\r\n }\r\n\r\n public override toJSON(): ColorEntryProps {\r\n const props = super.toJSON() as ColorEntryProps;\r\n if (this.value) {\r\n props.value = {\r\n red: this.value.r,\r\n green: this.value.g,\r\n blue: this.value.b,\r\n };\r\n }\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Describes the components of a [[RenderSchedule.TransformEntry]] as a rotation around a pivot point followed by a translation. */\r\n export class TransformComponents {\r\n /** Pivot point - applied before rotation. */\r\n public readonly pivot: Vector3d;\r\n /** Quaternion rotation. */\r\n public readonly orientation: Point4d;\r\n /** Translation - applied after rotation. */\r\n public readonly position: Vector3d;\r\n\r\n public constructor(position: Vector3d, pivot: Vector3d, orientation: Point4d) {\r\n this.position = position;\r\n this.pivot = pivot;\r\n this.orientation = orientation;\r\n }\r\n\r\n public static fromJSON(props: TransformComponentsProps): TransformComponents | undefined {\r\n if (props.pivot && props.position && props.orientation)\r\n return new TransformComponents(Vector3d.fromJSON(props.position), Vector3d.fromJSON(props.pivot), Point4d.fromJSON(props.orientation));\r\n else\r\n return undefined;\r\n }\r\n\r\n public toJSON(): TransformComponentsProps {\r\n return {\r\n position: [this.position.x, this.position.y, this.position.z],\r\n pivot: [this.pivot.x, this.pivot.y, this.pivot.z],\r\n orientation: [this.orientation.x, this.orientation.y, this.orientation.z, this.orientation.w],\r\n };\r\n }\r\n }\r\n\r\n /** A timeline entry that applies rotation, scaling, and/or translation to the affected geometry. */\r\n export class TransformEntry extends TimelineEntry {\r\n /** The transform matrix to be applied to the geometry, used only if [[components]] is not defined. */\r\n public readonly value: Readonly<Transform>;\r\n /** The transform represented as a rotation about a pivot point followed by a translation. If undefined, [[value]] is used instead. */\r\n public readonly components?: TransformComponents;\r\n\r\n public constructor(props: TransformEntryProps) {\r\n super(props);\r\n this.value = props.value ? Transform.fromJSON(props.value.transform) : Transform.identity;\r\n if (props.value)\r\n this.components = TransformComponents.fromJSON(props.value);\r\n }\r\n\r\n public override toJSON(): TransformEntryProps {\r\n const props = super.toJSON() as TransformEntryProps;\r\n if (this.components) {\r\n props.value = this.components.toJSON();\r\n props.value.transform = this.value.toRows();\r\n } else {\r\n props.value = { transform: this.value.toRows() };\r\n }\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Defines a [ClipPlane]($core-geometry) associated with a [[RenderSchedule.CuttingPlaneEntry]]. */\r\n export class CuttingPlane {\r\n /** A point on the plane. */\r\n public readonly position: XYAndZ;\r\n /** The direction perpendicular to the plane pointing toward the clip. */\r\n public readonly direction: XYAndZ;\r\n /** If true, the clip plane is ignored and the geometry is never clipped. */\r\n public readonly visible: boolean;\r\n /** If true, the clip plane is ignored and the geometry is always clipped. */\r\n public readonly hidden: boolean;\r\n\r\n public constructor(props: CuttingPlaneProps) {\r\n this.position = Point3d.fromJSON(props.position);\r\n this.direction = Point3d.fromJSON(props.direction);\r\n this.hidden = true === props.hidden;\r\n this.visible = true === props.visible;\r\n }\r\n\r\n public toJSON(): CuttingPlaneProps {\r\n const props: CuttingPlaneProps = {\r\n position: [this.position.x, this.position.y, this.position.z],\r\n direction: [this.direction.x, this.direction.y, this.direction.z],\r\n };\r\n\r\n if (this.visible)\r\n props.visible = true;\r\n\r\n if (this.hidden)\r\n props.hidden = true;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** A timeline entry that applies a [ClipPlane]($core-geometry) to the affected geometry. */\r\n export class CuttingPlaneEntry extends TimelineEntry {\r\n /** The definition of the [ClipPlane]($core-geometry), or undefined if this entry applies no clipping. */\r\n public readonly value: CuttingPlane | undefined;\r\n\r\n public constructor(props: CuttingPlaneEntryProps) {\r\n super(props);\r\n if (props.value)\r\n this.value = new CuttingPlane(props.value);\r\n }\r\n\r\n public override toJSON(): CuttingPlaneEntryProps {\r\n const props = super.toJSON() as CuttingPlaneEntryProps;\r\n if (this.value)\r\n props.value = this.value.toJSON();\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** Identifies a fractional position along a [[RenderSchedule.Timeline]] between any two [[RenderSchedule.TimelineEntry]]'s within a [[RenderSchedule.TimelineEntryList]].\r\n * @internal\r\n */\r\n export class Interval {\r\n /** The index of the first timeline entry within the list. */\r\n public lowerIndex!: number;\r\n /** The index of the second timeline entry within the list. */\r\n public upperIndex!: number;\r\n /** The normalized distance between the two timeline entries. */\r\n public fraction!: number;\r\n\r\n public constructor(lower = 0, upper = 0, fraction = 0) {\r\n this.init(lower, upper, fraction);\r\n }\r\n\r\n public init(lower = 0, upper = 0, fraction = 0): void {\r\n this.lowerIndex = lower;\r\n this.upperIndex = upper;\r\n this.fraction = fraction;\r\n }\r\n }\r\n\r\n /** A list of the [[RenderSchedule.TimelineEntry]] objects within a [[RenderSchedule.Timeline]]. The type parameters are:\r\n * - T, a subclass of TimelineEntry with a `value` property specifying the value of the property controlled by the timeline at that entry's time point.\r\n * - P, the JSON representation from which T is to be constructed.\r\n * - V, the type of `T.value`.\r\n */\r\n export class TimelineEntryList<T extends TimelineEntry & { readonly value: V }, P extends TimelineEntryProps, V> implements Iterable<T> {\r\n private readonly _entries: ReadonlyArray<T>;\r\n /** The total time period represented by the entries in this list. */\r\n public readonly duration: Range1d;\r\n\r\n public constructor(props: P[], ctor: Constructor<T>) {\r\n this.duration = Range1d.createNull();\r\n this._entries = props.map((x) => {\r\n const entry = new ctor(x);\r\n this.duration.extendX(entry.time);\r\n return entry;\r\n });\r\n }\r\n\r\n /** The number of entries in the list. */\r\n public get length(): number {\r\n return this._entries.length;\r\n }\r\n\r\n /** An iterator over the entries in the list. */\r\n public [Symbol.iterator](): Iterator<T> {\r\n return this._entries[Symbol.iterator]();\r\n }\r\n\r\n /** Look up an entry by its position in the list. */\r\n public getEntry(index: number): T | undefined {\r\n return this._entries[index];\r\n }\r\n\r\n /** Look up the value of an entry by its position in the list. */\r\n public getValue(index: number): V | undefined {\r\n return this.getEntry(index)?.value;\r\n }\r\n\r\n public toJSON(): P[] {\r\n return this._entries.map((x) => x.toJSON() as P);\r\n }\r\n\r\n /** @internal */\r\n public findInterval(time: number, interval?: Interval): Interval | undefined {\r\n if (this.length === 0)\r\n return undefined;\r\n\r\n interval = interval ?? new Interval();\r\n if (time < this._entries[0].time) {\r\n interval.init(0, 0, 0);\r\n return interval;\r\n }\r\n\r\n const last = this.length - 1;\r\n if (time >= this._entries[last].time) {\r\n interval.init(last, last, 0);\r\n return interval;\r\n }\r\n\r\n for (let i = 0; i < last; i++) {\r\n const time0 = this._entries[i].time;\r\n const time1 = this._entries[i + 1].time;\r\n if (time0 <= time && time1 >= time) {\r\n let fraction;\r\n if (Interpolation.Linear === this._entries[i].interpolation)\r\n fraction = (time - time0) / (time1 - time0);\r\n else\r\n fraction = 0;\r\n\r\n interval.init(i, i + 1, fraction);\r\n return interval;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n }\r\n\r\n const scratchInterval = new Interval();\r\n\r\n /** A list of [[RenderSchedule.VisibilityEntry]]s within a [[RenderSchedule.Timeline]]. */\r\n export class VisibilityTimelineEntries extends TimelineEntryList<VisibilityEntry, VisibilityEntryProps, number> {\r\n /** Returns the visibility value for the entry at the specified position in the list, or 100 (fully-visible) if no such entry exists. */\r\n public override getValue(index: number): number {\r\n return super.getValue(index) ?? 100;\r\n }\r\n }\r\n\r\n /** A list of [[RenderSchedule.TransformEntry]]s within a [[RenderSchedule.Timeline]]. */\r\n export class TransformTimelineEntries extends TimelineEntryList<TransformEntry, TransformEntryProps, Readonly<Transform>> {\r\n /** Returns the transform for the entry at the specified position in the list, or an identity transform if no such entry exists. */\r\n public override getValue(index: number): Readonly<Transform> {\r\n return super.getValue(index) ?? Transform.identity;\r\n }\r\n }\r\n\r\n /** Specifies how to animate a set of geometry over time within a [[RenderSchedule.Script]].\r\n * A [[RenderSchedule.Script]] can contain any number of [[RenderSchedule.Timeline]]s, each affecting different sets of geometry.\r\n * @see [[RenderSchedule.ElementTimeline]] and [[RenderSchedule.ModelTimeline]].\r\n */\r\n export class Timeline {\r\n /** Sequence controlling the visibility of the geometry. */\r\n public readonly visibility?: VisibilityTimelineEntries;\r\n /** Sequence controlling the color of the geometry. */\r\n public readonly color?: TimelineEntryList<ColorEntry, ColorEntryProps, RgbColor | undefined>;\r\n /** Sequence controlling the position, orientation, and/or scale of the geometry. */\r\n public readonly transform?: TransformTimelineEntries;\r\n /** Sequence controlling how the geometry is clipped. */\r\n public readonly cuttingPlane?: TimelineEntryList<CuttingPlaneEntry, CuttingPlaneEntryProps, CuttingPlane | undefined>;\r\n /** The total time period represented by this timeline. */\r\n public readonly duration: Range1d;\r\n\r\n public constructor(props: TimelineProps) {\r\n this.duration = Range1d.createNull();\r\n\r\n if (props.visibilityTimeline) {\r\n this.visibility = new VisibilityTimelineEntries(props.visibilityTimeline, VisibilityEntry);\r\n this.duration.extendRange(this.visibility.duration);\r\n }\r\n\r\n if (props.colorTimeline) {\r\n this.color = new TimelineEntryList(props.colorTimeline, ColorEntry);\r\n this.duration.extendRange(this.color.duration);\r\n }\r\n\r\n if (props.transformTimeline) {\r\n this.transform = new TransformTimelineEntries(props.transformTimeline, TransformEntry);\r\n this.duration.extendRange(this.transform.duration);\r\n }\r\n\r\n if (props.cuttingPlaneTimeline) {\r\n this.cuttingPlane = new TimelineEntryList(props.cuttingPlaneTimeline, CuttingPlaneEntry);\r\n this.duration.extendRange(this.cuttingPlane.duration);\r\n }\r\n }\r\n\r\n public toJSON(): TimelineProps {\r\n return {\r\n visibilityTimeline: this.visibility?.toJSON(),\r\n colorTimeline: this.color?.toJSON(),\r\n transformTimeline: this.transform?.toJSON(),\r\n cuttingPlaneTimeline: this.cuttingPlane?.toJSON(),\r\n };\r\n }\r\n\r\n /** Get the visibility of the geometry at the specified time point. */\r\n public getVisibility(time: number): number {\r\n let interval;\r\n if (!this.visibility || !(interval = this.visibility.findInterval(time, scratchInterval)))\r\n return 100;\r\n\r\n let visibility = this.visibility.getValue(interval.lowerIndex) ?? 100;\r\n if (interval.fraction > 0)\r\n visibility = interpolate(visibility, this.visibility.getValue(interval.upperIndex) ?? 100, interval.fraction);\r\n\r\n return visibility;\r\n }\r\n\r\n /** Get the color of the geometry at the specified time point, or undefined if the color is not overridden at that time point. */\r\n public getColor(time: number): RgbColor | undefined {\r\n let interval;\r\n if (!this.color || !(interval = this.color.findInterval(time, scratchInterval)))\r\n return undefined;\r\n\r\n const start = this.color.getValue(interval.lowerIndex);\r\n if (start && interval.fraction > 0) {\r\n const end = this.color.getValue(interval.upperIndex);\r\n if (end)\r\n return interpolateRgb(start, end, interval.fraction);\r\n }\r\n\r\n return start;\r\n }\r\n\r\n /** Get the transform applied to the geometry at the specified time point. */\r\n public getAnimationTransform(time: number): Readonly<Transform> {\r\n let interval;\r\n if (!this.transform || !(interval = this.transform.findInterval(time, scratchInterval)))\r\n return Transform.identity;\r\n\r\n let transform = this.transform.getValue(interval.lowerIndex);\r\n if (interval.fraction > 0) {\r\n const comp0 = this.transform.getEntry(interval.lowerIndex)?.components;\r\n const comp1 = this.transform.getEntry(interval.upperIndex)?.components;\r\n if (comp0 && comp1) {\r\n const sum = Point4d.interpolateQuaternions(comp0.orientation, interval.fraction, comp1.orientation);\r\n const matrix = Matrix3d.createFromQuaternion(sum);\r\n const pre = Transform.createTranslation(comp0.pivot);\r\n const post = Transform.createTranslation(comp0.position.interpolate(interval.fraction, comp1.position));\r\n const product = post.multiplyTransformMatrix3d(matrix);\r\n product.multiplyTransformTransform(pre, product);\r\n transform = product;\r\n } else {\r\n const end = this.transform.getValue(interval.upperIndex);\r\n const q0 = transform.matrix.inverse()?.toQuaternion();\r\n const q1 = end.matrix.inverse()?.toQuaternion();\r\n if (q0 && q1) {\r\n const sum = Point4d.interpolateQuaternions(q0, interval.fraction, q1);\r\n const matrix = Matrix3d.createFromQuaternion(sum);\r\n\r\n const origin0 = Vector3d.createFrom(transform.origin);\r\n const origin1 = Vector3d.createFrom(end.origin);\r\n transform = Transform.createRefs(origin0.interpolate(interval.fraction, origin1), matrix);\r\n }\r\n }\r\n }\r\n\r\n return transform;\r\n }\r\n\r\n /** Get the clipping plane applied to the geometry at the specified time point, or undefined if the geometry is unclipped at that time point. */\r\n public getCuttingPlane(time: number): Plane3dByOriginAndUnitNormal | undefined {\r\n let interval;\r\n if (!this.cuttingPlane || !(interval = this.cuttingPlane.findInterval(time, scratchInterval)))\r\n return undefined;\r\n\r\n const start = this.cuttingPlane.getValue(interval.lowerIndex);\r\n if (!start)\r\n return undefined;\r\n\r\n const position = Point3d.createFrom(start.position);\r\n const direction = Vector3d.createFrom(start.direction);\r\n const end = interval.fraction > 0 ? this.cuttingPlane.getValue(interval.upperIndex) : undefined;\r\n if (end) {\r\n position.interpolate(interval.fraction, end.position, position);\r\n direction.interpolate(interval.fraction, end.direction, direction);\r\n } else {\r\n if (start.hidden || start.visible)\r\n return undefined;\r\n }\r\n\r\n direction.negate(direction);\r\n direction.normalizeInPlace();\r\n\r\n return Plane3dByOriginAndUnitNormal.create(position, direction);\r\n }\r\n\r\n /** Create a ClipVector from the [[RenderSchedule.CuttingPlane]] applied to the geometry at the specified time point, if any. */\r\n public getClipVector(time: number): ClipVector | undefined {\r\n const plane = this.getCuttingPlane(time);\r\n if (!plane)\r\n return undefined;\r\n\r\n const cp = ClipPlane.createPlane(plane);\r\n const cps = UnionOfConvexClipPlaneSets.createConvexSets([ConvexClipPlaneSet.createPlanes([cp])]);\r\n const prim = ClipPrimitive.createCapture(cps);\r\n return ClipVector.createCapture([prim]);\r\n }\r\n\r\n /** @internal */\r\n protected getFeatureAppearance(visibility: number, time: number): FeatureAppearance | undefined {\r\n const transparency = visibility < 100 ? (1 - visibility / 100) : undefined;\r\n const rgb = this.getColor(time);\r\n return undefined !== rgb || undefined !== transparency ? FeatureAppearance.fromJSON({ rgb, transparency }) : undefined;\r\n }\r\n }\r\n\r\n /** Specifies how to animate the geometry belonging to a set of [GeometricElement]($backend)s as part of a [[RenderSchedule.Script]]. */\r\n export class ElementTimeline extends Timeline {\r\n /** A positive integer that uniquely identififes this timeline among all ElementTimelines in the [[RenderSchedule.Script]]. */\r\n public readonly batchId: number;\r\n private readonly _elementIds: Id64String[] | CompressedId64Set;\r\n\r\n private constructor(props: ElementTimelineProps) {\r\n super(props);\r\n this.batchId = props.batchId;\r\n this._elementIds = props.elementIds;\r\n }\r\n\r\n public static fromJSON(props?: ElementTimelineProps): ElementTimeline {\r\n return new ElementTimeline(props ?? { elementIds: [], batchId: 0 });\r\n }\r\n\r\n public override toJSON(): ElementTimelineProps {\r\n return {\r\n ...super.toJSON(),\r\n batchId: this.batchId,\r\n elementIds: this._elementIds,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public static getElementIds(ids: Id64String[] | CompressedId64Set): Iterable<Id64String> {\r\n if (typeof ids === \"string\")\r\n return CompressedId64Set.iterable(ids);\r\n else if (Array.isArray(ids)) {\r\n return ids;\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n /** The Ids of the elements controlled by this timeline. */\r\n public get elementIds(): Iterable<Id64String> {\r\n return ElementTimeline.getElementIds(this._elementIds);\r\n }\r\n\r\n /** True if this timeline affects the color or transparency of the elements. */\r\n public get containsFeatureOverrides(): boolean {\r\n return undefined !== this.visibility || undefined !== this.color;\r\n }\r\n\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public get requiresBatching(): boolean {\r\n if (this.cuttingPlane)\r\n return true;\r\n\r\n return this.batchId !== 0 && (undefined !== this.color || undefined !== this.visibility);\r\n }\r\n\r\n /** True if this timeline affects the position, orientation, or scale of the elements. */\r\n public get containsTransform(): boolean {\r\n return undefined !== this.transform;\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n assert(0 !== this.batchId);\r\n\r\n const vis = this.getVisibility(time);\r\n if (vis <= 0) {\r\n overrides.setAnimationNodeNeverDrawn(this.batchId);\r\n return;\r\n }\r\n\r\n const appearance = this.getFeatureAppearance(vis, time);\r\n if (appearance)\r\n overrides.overrideAnimationNode(this.batchId, appearance);\r\n }\r\n }\r\n\r\n /** Specifies how to animate the geometry within a [GeometricModel]($backend) as part of a [[RenderSchedule.Script]]. */\r\n export class ModelTimeline extends Timeline {\r\n /** The Id of the [GeometricModel]($backend) to be animated. */\r\n public readonly modelId: Id64String;\r\n /** @internal */\r\n public readonly realityModelUrl?: string;\r\n /** Timelines specifying how to animate groups of [GeometricElement]($backend)s within the model. */\r\n public readonly elementTimelines: ReadonlyArray<ElementTimeline>;\r\n /** @internal */\r\n public readonly transformBatchIds: ReadonlyArray<number>;\r\n /** True if this timeline affects the color or transparency of the geometry. */\r\n public readonly containsFeatureOverrides: boolean;\r\n /** True if this timeline applies clipping to the model. */\r\n public readonly containsModelClipping: boolean;\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public readonly requiresBatching: boolean;\r\n /** True if this timeline affects the position, orientation, or scale of the geometry. */\r\n public readonly containsTransform: boolean;\r\n\r\n private constructor(props: ModelTimelineProps) {\r\n super(props);\r\n\r\n this.modelId = props.modelId;\r\n this.realityModelUrl = props.realityModelUrl;\r\n this.containsModelClipping = undefined !== this.cuttingPlane;\r\n\r\n let containsFeatureOverrides = undefined !== this.visibility || undefined !== this.color;\r\n let requiresBatching = false;\r\n let containsTransform = false;\r\n\r\n const transformBatchIds: number[] = [];\r\n const elementTimelines: ElementTimeline[] = [];\r\n\r\n for (const elProps of props.elementTimelines) {\r\n const el = ElementTimeline.fromJSON(elProps);\r\n elementTimelines.push(el);\r\n\r\n this.duration.extendRange(el.duration);\r\n\r\n if (el.containsTransform) {\r\n containsTransform = true;\r\n if (el.batchId)\r\n transformBatchIds.push(el.batchId);\r\n }\r\n\r\n containsFeatureOverrides ||= el.containsFeatureOverrides;\r\n requiresBatching ||= el.requiresBatching;\r\n }\r\n\r\n this.elementTimelines = elementTimelines;\r\n this.transformBatchIds = transformBatchIds;\r\n\r\n this.containsFeatureOverrides = containsFeatureOverrides;\r\n this.requiresBatching = requiresBatching;\r\n this.containsTransform = containsTransform;\r\n }\r\n\r\n public static fromJSON(props?: ModelTimelineProps): ModelTimeline {\r\n return new ModelTimeline(props ?? { elementTimelines: [], modelId: Id64.invalid });\r\n }\r\n\r\n public override toJSON(): ModelTimelineProps {\r\n return {\r\n ...super.toJSON(),\r\n modelId: this.modelId,\r\n realityModelUrl: this.realityModelUrl,\r\n elementTimelines: this.elementTimelines.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Look up the element timeline with the specified batch Id. */\r\n public findByBatchId(batchId: number): ElementTimeline | undefined {\r\n return this.elementTimelines.find((x) => x.batchId === batchId);\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n const appearance = this.getFeatureAppearance(this.getVisibility(time), time);\r\n if (appearance)\r\n overrides.override({ modelId: this.modelId, appearance });\r\n\r\n for (const timeline of this.elementTimelines)\r\n timeline.addSymbologyOverrides(overrides, time);\r\n }\r\n\r\n /** Obtain the transform applied to the model at the specified time point, if any. */\r\n public getTransform(batchId: number, time: number): Readonly<Transform> | undefined {\r\n return this.findByBatchId(batchId)?.getAnimationTransform(time);\r\n }\r\n }\r\n\r\n /** Specifies how to animate the contents of a [ViewState]($frontend) over time. The script contains any number of [[RenderSchedule.ModelTimeline]]s, each describing how\r\n * to animate one of the models in the view.\r\n * @see [RenderTimeline]($backend) to create an [Element]($backend) to host a script.\r\n * @see [[DisplayStyleSettings.renderTimeline]] to associate a [RenderTimeline]($backend)'s script with a [DisplayStyle]($backend).\r\n * @see [DisplayStyleState.scheduleScript]($frontend) to obtain the script associated with a display style.\r\n * @see [[RenderSchedule.ScriptBuilder]] to define a new script.\r\n */\r\n export class Script {\r\n /** Timelines specifying how to animate individual models within the view. */\r\n public readonly modelTimelines: ReadonlyArray<ModelTimeline>;\r\n /** True if this script applies clipping to any models. */\r\n public readonly containsModelClipping: boolean;\r\n /** If true, applying this timeline requires special tiles to be generated in which groups of elements are batched into nodes.\r\n * @internal\r\n */\r\n public readonly requiresBatching: boolean;\r\n /** True if this script affects the position, orientation, or scale of the geometry. */\r\n public readonly containsTransform: boolean;\r\n /** True if this script affects the color or transparency of the geometry. */\r\n public readonly containsFeatureOverrides: boolean;\r\n /** The total time period over which this script animates. */\r\n public readonly duration: Range1d;\r\n /** The batchIds of all nodes in all timelines that apply a transform.\r\n * @internal\r\n */\r\n public readonly transformBatchIds: ReadonlySet<number>;\r\n\r\n protected constructor(props: Readonly<ScriptProps>) {\r\n this.duration = Range1d.createNull();\r\n const transformBatchIds = new Set<number>();\r\n\r\n const modelTimelines: ModelTimeline[] = [];\r\n let containsModelClipping = false;\r\n let requiresBatching = false;\r\n let containsTransform = false;\r\n let containsFeatureOverrides = false;\r\n\r\n for (const modelProps of props) {\r\n const model = ModelTimeline.fromJSON(modelProps);\r\n modelTimelines.push(model);\r\n\r\n this.duration.extendRange(model.duration);\r\n\r\n containsModelClipping ||= model.containsModelClipping;\r\n requiresBatching ||= model.requiresBatching;\r\n containsTransform ||= model.containsTransform;\r\n containsFeatureOverrides ||= model.containsFeatureOverrides;\r\n\r\n for (const batchId of model.transformBatchIds)\r\n transformBatchIds.add(batchId);\r\n }\r\n\r\n this.modelTimelines = modelTimelines;\r\n this.containsModelClipping = containsModelClipping;\r\n this.containsTransform = containsTransform;\r\n this.requiresBatching = requiresBatching || this.containsTransform;\r\n this.containsFeatureOverrides = containsFeatureOverrides;\r\n this.transformBatchIds = transformBatchIds;\r\n }\r\n\r\n public static fromJSON(props: Readonly<ScriptProps>): Script | undefined {\r\n if (!Array.isArray(props) || props.length === 0)\r\n return undefined;\r\n\r\n return new Script(props);\r\n }\r\n\r\n public toJSON(): ScriptProps {\r\n return this.modelTimelines.map((x) => x.toJSON());\r\n }\r\n\r\n /** Look up the timeline that animates the specified model, if any. */\r\n public find(modelId: Id64String): ModelTimeline | undefined {\r\n return this.modelTimelines.find((x) => x.modelId === modelId);\r\n }\r\n\r\n /** @internal */\r\n public getTransformBatchIds(modelId: Id64String): ReadonlyArray<number> | undefined {\r\n return this.find(modelId)?.transformBatchIds;\r\n }\r\n\r\n /** @internal */\r\n public getTransform(modelId: Id64String, batchId: number, time: number): Readonly<Transform> | undefined {\r\n return this.find(modelId)?.getTransform(batchId, time);\r\n }\r\n\r\n /** @internal */\r\n public addSymbologyOverrides(overrides: FeatureOverrides, time: number): void {\r\n for (const timeline of this.modelTimelines)\r\n timeline.addSymbologyOverrides(overrides, time);\r\n }\r\n\r\n /** Used by the [Element.collectReferenceIds]($backend) method overrides in RenderTimeline and DisplayStyle.\r\n * @internal\r\n */\r\n public discloseIds(ids: Id64Set): void {\r\n for (const model of this.modelTimelines) {\r\n ids.add(model.modelId);\r\n for (const element of model.elementTimelines)\r\n for (const id of element.elementIds)\r\n ids.add(id);\r\n }\r\n }\r\n }\r\n\r\n /** A reference to a [[RenderSchedule.Script]] indicating the persistent [Element]($backend) from which the script was obtained.\r\n * Prior to the introduction of the [RenderTimeline]($backend) class in version 01.00.13 of the BisCore ECSchema, scripts were\r\n * stored in the JSON properties of [DisplayStyle]($backend) elements. Now they are stored in the Script property of a RenderTimeline element.\r\n * The `sourceId` can refer to either a DisplayStyle or a RenderTimeline.\r\n */\r\n export class ScriptReference {\r\n /** The Id of the [RenderTimeline]($backend) or [DisplayStyle]($backend) element that hosts the script. */\r\n public readonly sourceId: Id64String;\r\n /** The script. */\r\n public readonly script: Script;\r\n\r\n public constructor(sourceId: Id64String, script: Script) {\r\n this.sourceId = sourceId;\r\n this.script = script;\r\n }\r\n }\r\n\r\n /** Used as part of a [[RenderSchedule.ScriptBuilder]] to define a [[RenderSchedule.Timeline]].\r\n * @see [[RenderSchedule.ElementTimelineBuilder]] and [[RenderSchedule.ModelTimelineBuilder]].\r\n */\r\n export class TimelineBuilder {\r\n /** Timeline controlling visibility. */\r\n public visibility?: VisibilityEntryProps[];\r\n /** Timeline controlling color. */\r\n public color?: ColorEntryProps[];\r\n /** Timeline controlling position and orientation. */\r\n public transform?: TransformEntryProps[];\r\n /** Timeline controlling clipping. */\r\n public cuttingPlane?: CuttingPlaneEntryProps[];\r\n\r\n /** Append a new [[RenderSchedule.VisibilityEntry]] to the timeline. */\r\n public addVisibility(time: number, visibility: number | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.visibility)\r\n this.visibility = [];\r\n\r\n this.visibility.push({ time, value: visibility, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.ColorEntry]] to the timeline. */\r\n public addColor(time: number, color: RgbColor | { red: number, green: number, blue: number } | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.color)\r\n this.color = [];\r\n\r\n const value = color instanceof RgbColor ? { red: color.r, green: color.g, blue: color.b } : color;\r\n this.color.push({ time, value, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.CuttingPlaneEntry]] to the timeline. */\r\n public addCuttingPlane(time: number, plane: { position: XYAndZ, direction: XYAndZ, visible?: boolean, hidden?: boolean } | undefined, interpolation = Interpolation.Linear): void {\r\n if (!this.cuttingPlane)\r\n this.cuttingPlane = [];\r\n\r\n let value: CuttingPlaneProps | undefined;\r\n if (plane) {\r\n value = {\r\n position: [plane.position.x, plane.position.y, plane.position.z],\r\n direction: [plane.direction.x, plane.direction.y, plane.direction.z],\r\n };\r\n\r\n if (plane.visible)\r\n value.visible = true;\r\n\r\n if (plane.hidden)\r\n value.hidden = true;\r\n }\r\n\r\n this.cuttingPlane.push({ time, value, interpolation });\r\n }\r\n\r\n /** Append a new [[RenderSchedule.TransformEntry]] to the timeline. */\r\n public addTransform(time: number, transform: Transform | undefined, components?: { pivot: XYAndZ, orientation: Point4d, position: XYAndZ }, interpolation = Interpolation.Linear): void {\r\n if (!this.transform)\r\n this.transform = [];\r\n\r\n const value: TransformProps = { transform: transform?.toRows() };\r\n if (components) {\r\n value.pivot = [components.pivot.x, components.pivot.y, components.pivot.z];\r\n value.orientation = components.orientation.toJSON();\r\n value.position = [components.position.x, components.position.y, components.position.z];\r\n }\r\n\r\n this.transform.push({ time, value, interpolation });\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.Timeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public finish(): TimelineProps {\r\n const props: TimelineProps = {};\r\n if (this.visibility?.length)\r\n props.visibilityTimeline = this.visibility;\r\n\r\n if (this.color?.length)\r\n props.colorTimeline = this.color;\r\n\r\n if (this.transform?.length)\r\n props.transformTimeline = this.transform;\r\n\r\n if (this.cuttingPlane?.length)\r\n props.cuttingPlaneTimeline = this.cuttingPlane;\r\n\r\n return props;\r\n }\r\n }\r\n\r\n /** As part of a [[RenderSchedule.ScriptBuilder]], assembles a [[RenderSchedule.ElementTimeline]].\r\n * @see [[RenderSchedule.ModelTimelineBuilder.addElementTimeline]].\r\n */\r\n export class ElementTimelineBuilder extends TimelineBuilder {\r\n /** A positive integer that uniquely identifies this timeline among all element timelines in the [[RenderSchedule.Script]].\r\n * [[RenderSchedule.ScriptBuilder]] ensures each ElementTimelineBuilder receives a unique batch Id.\r\n */\r\n public readonly batchId: number;\r\n /** The compressed set of Ids of the elements affected by this timeline. */\r\n public readonly elementIds: CompressedId64Set;\r\n\r\n /** Constructor - typically not used directly.\r\n * @see [[RenderSchedule.ModelTimelineBuilder.addElementTimeline]] to create an ElementTimelineBuilder.\r\n */\r\n public constructor(batchId: number, elementIds: CompressedId64Set) {\r\n super();\r\n this.batchId = batchId;\r\n this.elementIds = elementIds;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.ElementTimeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public override finish(): ElementTimelineProps {\r\n const props = super.finish() as ElementTimelineProps;\r\n props.batchId = this.batchId;\r\n props.elementIds = this.elementIds;\r\n return props;\r\n }\r\n }\r\n\r\n /** As part of a [[RenderSchedule.ScriptBuilder, assembles a [[RenderSchedule.ModelTimeline]].\r\n * @see [[RenderSchedule.ScriptBuilder.addModelTimeline]].\r\n */\r\n export class ModelTimelineBuilder extends TimelineBuilder {\r\n /** The Id of the model affected by this timeline. */\r\n public readonly modelId: Id64String;\r\n /** @internal */\r\n public realityModelUrl?: string;\r\n private readonly _obtainNextBatchId: () => number;\r\n private readonly _elements: ElementTimelineBuilder[] = [];\r\n\r\n /** Constructor - typically not used directly.\r\n * @see [[RenderSchedule.ScriptBuilder.addModelTimeline]] to create a ModelTimelineBuilder.\r\n */\r\n public constructor(modelId: Id64String, obtainNextBatchId: () => number) {\r\n super();\r\n this.modelId = modelId;\r\n this._obtainNextBatchId = obtainNextBatchId;\r\n }\r\n\r\n /** Add a new [[RenderSchedule.ElementTimeline]] to be applied to the specified elements.\r\n * This function will sort and compress the Ids if they are not already compressed.\r\n *\r\n */\r\n public addElementTimeline(elementIds: CompressedId64Set | Iterable<Id64String>): ElementTimelineBuilder {\r\n const batchId = this._obtainNextBatchId();\r\n let ids: CompressedId64Set;\r\n\r\n // It's far too easy to accidentally pass a single Id (compiler can't help).\r\n if (typeof elementIds === \"string\" && Id64.isValidId64(elementIds))\r\n elementIds = [elementIds];\r\n\r\n if (typeof elementIds === \"string\") {\r\n // Already compressed.\r\n ids = elementIds;\r\n } else {\r\n const sorted = Array.from(elementIds);\r\n OrderedId64Iterable.sortArray(sorted);\r\n ids = CompressedId64Set.compressIds(sorted);\r\n }\r\n\r\n const builder = new ElementTimelineBuilder(batchId, ids);\r\n this._elements.push(builder);\r\n return builder;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.ModelTimeline]] produced by this builder.\r\n * @see [[RenderSchedule.ScriptBuilder.finish]] to obtain the JSON for the entire [[RenderSchedule.Script]].\r\n */\r\n public override finish(): ModelTimelineProps {\r\n const props = super.finish() as ModelTimelineProps;\r\n props.modelId = this.modelId;\r\n if (undefined !== this.realityModelUrl)\r\n props.realityModelUrl = this.realityModelUrl;\r\n\r\n props.elementTimelines = this._elements.map((x) => x.finish());\r\n return props;\r\n }\r\n }\r\n\r\n /** Assembles the JSON representation for a new [[RenderSchedule.Script]]. As an extremely simple example, the following code produces a script that changes the color of a single element:\r\n * ```ts\r\n * const script = new ScriptBuilder();\r\n * const model = script.addModelTimeline(\"0x123\");\r\n * const element = model.addElementTimeline([ \"0x456\" ]);\r\n * element.addColor(Date.now(), new RgbColor(0xff, 0x7f, 0));\r\n * const scriptProps = script.finish();\r\n * ```\r\n */\r\n export class ScriptBuilder {\r\n private _nextBatchId = 1;\r\n private readonly _models: ModelTimelineBuilder[] = [];\r\n\r\n /** Add a new [[RenderSchedule.ModelTimeline]] to be applied to the specified model. */\r\n public addModelTimeline(modelId: Id64String): ModelTimelineBuilder {\r\n const builder = new ModelTimelineBuilder(modelId, () => this._nextBatchId++);\r\n this._models.push(builder);\r\n return builder;\r\n }\r\n\r\n /** Obtain the JSON representation of the [[RenderSchedule.Script]] produced by this builder.\r\n * @see [RenderTimeline.scriptProps]($backend) to assign the new script to a RenderTimeline element.\r\n */\r\n public finish(): ScriptProps {\r\n return this._models.map((x) => x.finish());\r\n }\r\n }\r\n}\r\n"]}
|