@itwin/core-common 3.3.0-dev.44 → 3.3.0-dev.46
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.
|
@@ -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;
|
|
@@ -588,7 +588,7 @@ var RenderSchedule;
|
|
|
588
588
|
for (const timeline of this.modelTimelines)
|
|
589
589
|
timeline.addSymbologyOverrides(overrides, time);
|
|
590
590
|
}
|
|
591
|
-
/** Used by
|
|
591
|
+
/** Used by the [Element.collectReferenceIds]($backend) method overrides in RenderTimeline and DisplayStyle.
|
|
592
592
|
* @internal
|
|
593
593
|
*/
|
|
594
594
|
discloseIds(ids) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderSchedule.js","sourceRoot":"","sources":["../../src/RenderSchedule.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6H;AAC7H,wDAE8B;AAC9B,yCAAsC;AACtC,yDAAyE;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,CAAC,KAAe,EAAE,GAAa,EAAE,QAAgB;IACtE,OAAO,IAAI,mBAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,WAAW,C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,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,GAAd,sBAAc,KAAd,sBAAc,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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C;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,GAAd,sBAAc,KAAd,sBAAc,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"]}
|
|
@@ -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,MAAM,EAAE,iBAAiB,EAAe,IAAI,EAAuB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7H,OAAO,EACL,SAAS,EAAE,aAAa,EAAE,UA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gB,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,CAAC,KAAe,EAAE,GAAa,EAAE,QAAgB;IACtE,OAAO,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAA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AC;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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-common",
|
|
3
|
-
"version": "3.3.0-dev.
|
|
3
|
+
"version": "3.3.0-dev.46",
|
|
4
4
|
"description": "iTwin.js components common to frontend and backend",
|
|
5
5
|
"main": "lib/cjs/core-common.js",
|
|
6
6
|
"module": "lib/esm/core-common.js",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"js-base64": "^3.6.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@itwin/core-bentley": "^3.3.0-dev.
|
|
33
|
-
"@itwin/core-geometry": "^3.3.0-dev.
|
|
32
|
+
"@itwin/core-bentley": "^3.3.0-dev.46",
|
|
33
|
+
"@itwin/core-geometry": "^3.3.0-dev.46"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@itwin/build-tools": "3.3.0-dev.
|
|
37
|
-
"@itwin/core-bentley": "3.3.0-dev.
|
|
38
|
-
"@itwin/core-geometry": "3.3.0-dev.
|
|
39
|
-
"@itwin/eslint-plugin": "3.3.0-dev.
|
|
36
|
+
"@itwin/build-tools": "3.3.0-dev.46",
|
|
37
|
+
"@itwin/core-bentley": "3.3.0-dev.46",
|
|
38
|
+
"@itwin/core-geometry": "3.3.0-dev.46",
|
|
39
|
+
"@itwin/eslint-plugin": "3.3.0-dev.46",
|
|
40
40
|
"@types/chai": "4.3.1",
|
|
41
41
|
"@types/flatbuffers": "~1.10.0",
|
|
42
42
|
"@types/mocha": "^8.2.2",
|