@itwin/core-common 4.0.0-dev.94 → 4.0.0-dev.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Rendering
3
3
  */
4
- import { Id64, Id64String, IndexedValue, IndexMap } from "@itwin/core-bentley";
4
+ import { Id64, Id64String, IndexedValue, IndexMap, UintArray } from "@itwin/core-bentley";
5
5
  import { GeometryClass } from "./GeometryParams";
6
6
  /** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be
7
7
  * grouped with other such entities in a [[FeatureTable]].
@@ -116,8 +116,8 @@ export declare class FeatureTable extends IndexMap<Feature> {
116
116
  /** @internal */
117
117
  getArray(): Array<IndexedValue<Feature>>;
118
118
  }
119
- /** @alpha */
120
- export type ComputeNodeId = (elementId: Id64.Uint32Pair, featureIndex: number) => number;
119
+ /** @internal */
120
+ export type ComputeNodeId = (feature: PackedFeatureWithIndex) => number;
121
121
  /** Interface common to PackedFeatureTable and MultiModelPackedFeatureTable.
122
122
  * @internal
123
123
  */
@@ -146,6 +146,8 @@ export interface RenderFeatureTable {
146
146
  getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;
147
147
  /** Get an object that provides iteration over all features, in order. `output` is reused as the current value on each iteration. */
148
148
  iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;
149
+ populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;
150
+ getAnimationNodeId(featureIndex: number): number;
149
151
  }
150
152
  /**
151
153
  * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,
@@ -161,12 +163,14 @@ export declare class PackedFeatureTable implements RenderFeatureTable {
161
163
  readonly type: BatchType;
162
164
  private _animationNodeIds?;
163
165
  get byteLength(): number;
164
- get animationNodeIds(): Readonly<Uint8Array | Uint16Array | Uint32Array> | undefined;
166
+ get animationNodeIds(): Readonly<UintArray> | undefined;
167
+ /** @internal for use by MultiModelPackedFeatureTable */
168
+ setAnimationNodeIds(nodeIds: UintArray | undefined): void;
165
169
  /** Construct a PackedFeatureTable from the packed binary data.
166
170
  * This is used internally when deserializing Tiles in iMdl format.
167
171
  * @internal
168
172
  */
169
- constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: Uint8Array | Uint16Array | Uint32Array);
173
+ constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray);
170
174
  /** Create a packed feature table from a [[FeatureTable]]. */
171
175
  static pack(featureTable: FeatureTable): PackedFeatureTable;
172
176
  /** Retrieve the Feature associated with the specified index. */
@@ -236,6 +240,7 @@ export declare class MultiModelPackedFeatureTable implements RenderFeatureTable
236
240
  get batchModelIdPair(): Id64.Uint32Pair;
237
241
  get numFeatures(): number;
238
242
  get type(): BatchType;
243
+ get animationNodeIds(): Readonly<UintArray> | undefined;
239
244
  get byteLength(): number;
240
245
  getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;
241
246
  getFeature(featureIndex: number, result: ModelFeature): ModelFeature;
@@ -244,6 +249,8 @@ export declare class MultiModelPackedFeatureTable implements RenderFeatureTable
244
249
  findElementId(featureIndex: number): Id64String | undefined;
245
250
  iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex>;
246
251
  iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;
252
+ getAnimationNodeId(featureIndex: number): number;
253
+ populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;
247
254
  }
248
255
  export {};
249
256
  //# sourceMappingURL=FeatureTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureTable.d.ts","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0C,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,E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gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa;IAM5E,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY;IAKpE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS;IAIjF,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;IAI7E,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIzD,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;IAiB5E,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;IAM1E,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAIhD,wBAAwB,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAGvF"}
@@ -163,6 +163,23 @@ class FeatureTable extends core_bentley_1.IndexMap {
163
163
  }
164
164
  exports.FeatureTable = FeatureTable;
165
165
  const scratchPackedFeature = PackedFeature.create();
166
+ function populateAnimationNodeIds(table, computeNodeId, maxNodeId) {
167
+ (0, core_bentley_1.assert)(maxNodeId > 0);
168
+ let nodeIds;
169
+ const outputFeature = PackedFeature.createWithIndex();
170
+ for (const feature of table.iterable(outputFeature)) {
171
+ const nodeId = computeNodeId(feature);
172
+ (0, core_bentley_1.assert)(nodeId <= maxNodeId);
173
+ if (0 !== nodeId) {
174
+ if (!nodeIds) {
175
+ const size = table.numFeatures;
176
+ nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));
177
+ }
178
+ nodeIds[feature.index] = nodeId;
179
+ }
180
+ }
181
+ return nodeIds;
182
+ }
166
183
  /**
167
184
  * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,
168
185
  * wherein each feature occupies 3 32-bit integers.
@@ -171,6 +188,11 @@ const scratchPackedFeature = PackedFeature.create();
171
188
  class PackedFeatureTable {
172
189
  get byteLength() { return this._data.byteLength; }
173
190
  get animationNodeIds() { return this._animationNodeIds; }
191
+ /** @internal for use by MultiModelPackedFeatureTable */
192
+ setAnimationNodeIds(nodeIds) {
193
+ (0, core_bentley_1.assert)(undefined === this._animationNodeIds);
194
+ this._animationNodeIds = nodeIds;
195
+ }
174
196
  /** Construct a PackedFeatureTable from the packed binary data.
175
197
  * This is used internally when deserializing Tiles in iMdl format.
176
198
  * @internal
@@ -304,22 +326,7 @@ class PackedFeatureTable {
304
326
  }
305
327
  populateAnimationNodeIds(computeNodeId, maxNodeId) {
306
328
  (0, core_bentley_1.assert)(undefined === this._animationNodeIds);
307
- (0, core_bentley_1.assert)(maxNodeId > 0);
308
- const pair = { lower: 0, upper: 0 };
309
- let haveNodes = false;
310
- const size = this.numFeatures;
311
- const nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));
312
- for (let i = 0; i < this.numFeatures; i++) {
313
- this.getElementIdPair(i, pair);
314
- const nodeId = computeNodeId(pair, i);
315
- (0, core_bentley_1.assert)(nodeId <= maxNodeId);
316
- if (0 !== nodeId) {
317
- nodeIds[i] = nodeId;
318
- haveNodes = true;
319
- }
320
- }
321
- if (haveNodes)
322
- this._animationNodeIds = nodeIds;
329
+ this._animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);
323
330
  }
324
331
  *iterator(output) {
325
332
  for (let i = 0; i < this.numFeatures; i++) {
@@ -426,6 +433,7 @@ class MultiModelPackedFeatureTable {
426
433
  get batchModelIdPair() { return this._features.batchModelIdPair; }
427
434
  get numFeatures() { return this._features.numFeatures; }
428
435
  get type() { return this._features.type; }
436
+ get animationNodeIds() { return this._features.animationNodeIds; }
429
437
  get byteLength() {
430
438
  return this._features.byteLength + this._models.byteLength;
431
439
  }
@@ -466,6 +474,12 @@ class MultiModelPackedFeatureTable {
466
474
  [Symbol.iterator]: () => this.iterator(output),
467
475
  };
468
476
  }
477
+ getAnimationNodeId(featureIndex) {
478
+ return this._features.getAnimationNodeId(featureIndex);
479
+ }
480
+ populateAnimationNodeIds(computeNodeId, maxNodeId) {
481
+ this._features.setAnimationNodeIds(populateAnimationNodeIds(this, computeNodeId, maxNodeId));
482
+ }
469
483
  }
470
484
  exports.MultiModelPackedFeatureTable = MultiModelPackedFeatureTable;
471
485
  //# sourceMappingURL=FeatureTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureTable.js","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuH;AACvH,qDAAiD;AAEjD;;;;;;;;GAQG;AACH,MAAa,OAAO;IAKlB,YAAmB,YAAwB,mBAAI,CAAC,OAAO,EAAE,gBAA4B,mBAAI,CAAC,OAAO,EAAE,gBAA+B,8BAAa,CAAC,OAAO;QACrJ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,IAAW,SAAS,KAAc,OAAO,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,KAAK,8BAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAClK,IAAW,WAAW,KAAc,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAE7D,0EAA0E;IACnE,MAAM,CAAC,KAAc,IAAa,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAA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;QAChE,OAAO,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAEM,aAAa,CAAC,YAAoB;QACvC,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;IAEM,CAAE,QAAQ,CAAC,MAA8B;QAC9C,uJAAuJ;QACvJ,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;QAErF,KAAK,IAAI,YAAY,GAAG,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE;YAC1E,IAAI,YAAY,GAAG,UAAU,CAAC,gBAAgB;gBAC5C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;YAElD,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACtD,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC;YAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC;YAC1C,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC;YAC5B,MAAM,MAAM,CAAC;SACd;IACH,CAAC;IAEM,QAAQ,CAAC,MAA8B;QAC5C,OAAO;YACL,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AA1ED,oEA0EC","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 Rendering\r\n */\r\n\r\nimport { assert, compareNumbers, compareStrings, Id64, Id64String, IndexedValue, IndexMap } from \"@itwin/core-bentley\";\r\nimport { GeometryClass } from \"./GeometryParams\";\r\n\r\n/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be\r\n * grouped with other such entities in a [[FeatureTable]].\r\n * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every\r\n * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature.\r\n * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and\r\n * [[GeometryClass]], so an individual element may produce more than one feature.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class Feature {\r\n public readonly elementId: Id64String;\r\n public readonly subCategoryId: Id64String;\r\n public readonly geometryClass: GeometryClass;\r\n\r\n public constructor(elementId: Id64String = Id64.invalid, subCategoryId: Id64String = Id64.invalid, geometryClass: GeometryClass = GeometryClass.Primary) {\r\n this.elementId = elementId;\r\n this.subCategoryId = subCategoryId;\r\n this.geometryClass = geometryClass;\r\n }\r\n\r\n public get isDefined(): boolean { return !Id64.isInvalid(this.elementId) || !Id64.isInvalid(this.subCategoryId) || this.geometryClass !== GeometryClass.Primary; }\r\n public get isUndefined(): boolean { return !this.isDefined; }\r\n\r\n /** Returns true if this feature is equivalent to the supplied feature. */\r\n public equals(other: Feature): boolean { return 0 === this.compare(other); }\r\n\r\n /** Performs ordinal comparison of this feature with another.\r\n * @param rhs The feature to compare with.\r\n * @returns zero if the features are equivalent, a negative value if this feature compares as \"less than\" `rhs`, or a positive value if this feature compares \"greater than\" `rhs`.\r\n */\r\n public compare(rhs: Feature): number {\r\n if (this === rhs)\r\n return 0;\r\n\r\n let cmp = compareNumbers(this.geometryClass, rhs.geometryClass);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.elementId, rhs.elementId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.subCategoryId, rhs.subCategoryId);\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n}\r\n\r\n/** A [[Feature]] with a modelId identifying the model containing the feature.\r\n * Typically produced from a PackedFeature.\r\n * Prior to the introduction of MultiModelPackedFeatureTable, every (Packed)FeatureTable was associated with exactly one model.\r\n * Now, each feature in a table may be associated with a different model.\r\n * @internal\r\n */\r\nexport interface ModelFeature {\r\n modelId: Id64String;\r\n elementId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n}\r\n\r\n/** @internal */\r\nexport namespace ModelFeature {\r\n export function create(): ModelFeature {\r\n return {\r\n modelId: Id64.invalid,\r\n elementId: Id64.invalid,\r\n subCategoryId: Id64.invalid,\r\n geometryClass: GeometryClass.Primary,\r\n };\r\n }\r\n\r\n export function isDefined(feature: ModelFeature): boolean {\r\n return !Id64.isInvalid(feature.modelId) || !Id64.isInvalid(feature.elementId) || !Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryClass.Primary;\r\n }\r\n\r\n export function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature {\r\n result.modelId = unpackedModelId ?? Id64.fromUint32PairObject(packed.modelId);\r\n result.elementId = Id64.fromUint32PairObject(packed.elementId);\r\n result.subCategoryId = Id64.fromUint32PairObject(packed.subCategoryId);\r\n result.geometryClass = packed.geometryClass;\r\n return result;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface PackedFeature {\r\n modelId: Id64.Uint32Pair;\r\n elementId: Id64.Uint32Pair;\r\n subCategoryId: Id64.Uint32Pair;\r\n geometryClass: GeometryClass;\r\n animationNodeId: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface PackedFeatureWithIndex extends PackedFeature {\r\n index: number;\r\n}\r\n\r\n/** @internal */\r\nexport namespace PackedFeature {\r\n export function create(): PackedFeature {\r\n const pair = { upper: 0, lower: 0 };\r\n return {\r\n modelId: { ...pair },\r\n elementId: { ...pair },\r\n subCategoryId: { ...pair },\r\n geometryClass: GeometryClass.Primary,\r\n animationNodeId: 0,\r\n };\r\n }\r\n\r\n export function createWithIndex(): PackedFeatureWithIndex {\r\n const result = create() as PackedFeatureWithIndex;\r\n result.index = 0;\r\n return result;\r\n }\r\n}\r\n\r\n/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.\r\n * The most commonly-encountered batches are Tiles, which can be of either Primary or\r\n * Classifier type.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BatchType {\r\n /** This batch contains graphics derived from a model's visible geometry. */\r\n Primary,\r\n /**\r\n * This batch contains color volumes which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n VolumeClassifier,\r\n /**\r\n * This batch contains planar graphics which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n PlanarClassifier,\r\n}\r\n\r\n/** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit\r\n * indices are assigned to each unique Feature. Primitives within the RenderGraphic can\r\n * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual\r\n * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table\r\n * identifying the elements whose geometry appears within that tile.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class FeatureTable extends IndexMap<Feature> {\r\n public readonly modelId: Id64String;\r\n public readonly type: BatchType;\r\n\r\n /** Construct an empty FeatureTable. */\r\n public constructor(maxFeatures: number, modelId: Id64String = Id64.invalid, type: BatchType = BatchType.Primary) {\r\n super((lhs, rhs) => lhs.compare(rhs), maxFeatures);\r\n this.modelId = modelId;\r\n this.type = type;\r\n }\r\n\r\n /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */\r\n public get maxFeatures(): number { return this._maximumSize; }\r\n /** @internal */\r\n public get anyDefined(): boolean { return this.length > 1 || (1 === this.length && this._array[0].value.isDefined); }\r\n /** Returns true if this FeatureTable contains exactly one [[Feature]]. */\r\n public get isUniform(): boolean { return 1 === this.length; }\r\n /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */\r\n public get uniform(): Feature | undefined { return 1 === this.length ? this._array[0].value : undefined; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */\r\n public get isPlanarClassifier(): boolean { return BatchType.PlanarClassifier === this.type; }\r\n\r\n /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */\r\n public findFeature(index: number): Feature | undefined {\r\n for (const entry of this._array)\r\n if (entry.index === index)\r\n return entry.value;\r\n\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public insertWithIndex(feature: Feature, index: number): void {\r\n const bound = this.lowerBound(feature);\r\n assert(!bound.equal);\r\n assert(!this.isFull);\r\n const entry = new IndexedValue<Feature>(feature, index);\r\n this._array.splice(bound.index, 0, entry);\r\n }\r\n\r\n /** @internal */\r\n public getArray(): Array<IndexedValue<Feature>> { return this._array; }\r\n}\r\n\r\n/** @alpha */\r\nexport type ComputeNodeId = (elementId: Id64.Uint32Pair, featureIndex: number) => number;\r\n\r\n/** Interface common to PackedFeatureTable and MultiModelPackedFeatureTable.\r\n * @internal\r\n */\r\nexport interface RenderFeatureTable {\r\n /** The \"model Id\" of the tile tree containing the tile from which this feature table originated.\r\n * It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple\r\n * persistent models batched together.\r\n */\r\n readonly batchModelId: Id64String;\r\n /** Split representation of batchModelId, so we're not constantly having to parse the string. */\r\n readonly batchModelIdPair: Id64.Uint32Pair;\r\n /** The number of features in the table; equivalently, one more than the largest feature index. */\r\n readonly numFeatures: number;\r\n /** Strictly for reporting memory usage. */\r\n readonly byteLength: number;\r\n readonly type: BatchType;\r\n\r\n /** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */\r\n getFeature(featureIndex: number, result: ModelFeature): ModelFeature;\r\n /** Find the specified feature. Returns undefined if featureIndex >= numFeatures. */\r\n findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;\r\n /** Find the Id of the element of the specified feature. */\r\n findElementId(featureIndex: number): Id64String | undefined;\r\n /** Get the Id of the element of the specified feature as a pair of 32-bit integers, asserting that feature index < numFeatures. */\r\n getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\r\n /** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */\r\n getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;\r\n /** Get an object that provides iteration over all features, in order. `output` is reused as the current value on each iteration. */\r\n iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;\r\n}\r\n\r\nconst scratchPackedFeature = PackedFeature.create();\r\n\r\n/**\r\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\r\n * wherein each feature occupies 3 32-bit integers.\r\n * @internal\r\n */\r\nexport class PackedFeatureTable implements RenderFeatureTable {\r\n private readonly _data: Uint32Array;\r\n public readonly batchModelId: Id64String;\r\n public readonly batchModelIdPair: Id64.Uint32Pair;\r\n public readonly numFeatures: number;\r\n public readonly anyDefined: boolean;\r\n public readonly type: BatchType;\r\n private _animationNodeIds?: Uint8Array | Uint16Array | Uint32Array;\r\n\r\n public get byteLength(): number { return this._data.byteLength; }\r\n public get animationNodeIds(): Readonly<Uint8Array | Uint16Array | Uint32Array> | undefined { return this._animationNodeIds; }\r\n\r\n /** Construct a PackedFeatureTable from the packed binary data.\r\n * This is used internally when deserializing Tiles in iMdl format.\r\n * @internal\r\n */\r\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: Uint8Array | Uint16Array | Uint32Array) {\r\n this._data = data;\r\n this.batchModelId = modelId;\r\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\r\n this.numFeatures = numFeatures;\r\n this.type = type;\r\n this._animationNodeIds = animationNodeIds;\r\n\r\n switch (this.numFeatures) {\r\n case 0:\r\n this.anyDefined = false;\r\n break;\r\n case 1:\r\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\r\n break;\r\n default:\r\n this.anyDefined = true;\r\n break;\r\n }\r\n\r\n assert(this._data.length >= this._subCategoriesOffset);\r\n assert(undefined === this._animationNodeIds || this._animationNodeIds.length === this.numFeatures);\r\n }\r\n\r\n /** Create a packed feature table from a [[FeatureTable]]. */\r\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\r\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\r\n // the array cannot be resized after it is created.\r\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\r\n // back-end arrive within tiles already in the packed format.\r\n const subcategories = new Map<string, number>();\r\n for (const iv of featureTable.getArray()) {\r\n const found = subcategories.get(iv.value.subCategoryId.toString());\r\n if (undefined === found)\r\n subcategories.set(iv.value.subCategoryId, subcategories.size);\r\n }\r\n\r\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\r\n const subCategoriesOffset = 3 * featureTable.length;\r\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\r\n const uint32s = new Uint32Array(nUint32s);\r\n\r\n for (const iv of featureTable.getArray()) {\r\n const feature = iv.value;\r\n const index = iv.index * 3;\r\n\r\n let subCategoryIndex = subcategories.get(feature.subCategoryId)!;\r\n assert(undefined !== subCategoryIndex); // we inserted it above...\r\n subCategoryIndex |= (feature.geometryClass << 24);\r\n\r\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\r\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\r\n uint32s[index + 2] = subCategoryIndex;\r\n }\r\n\r\n subcategories.forEach((index: number, id: string, _map) => {\r\n const index32 = subCategoriesOffset + 2 * index;\r\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\r\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\r\n });\r\n\r\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\r\n }\r\n\r\n /** Retrieve the Feature associated with the specified index. */\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result, this.batchModelId);\r\n }\r\n\r\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out = out ?? { lower: 0, upper: 0 };\r\n assert(featureIndex < this.numFeatures);\r\n const offset = 3 * featureIndex;\r\n out.lower = this._data[offset];\r\n out.upper = this._data[offset + 1];\r\n return out;\r\n }\r\n\r\n /** @internal */\r\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\r\n const index = 3 * featureIndex;\r\n let subCatIndex = this._data[index + 2];\r\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n return { lower: this._data[subCatIndex], upper: this._data[subCatIndex + 1] };\r\n }\r\n\r\n /** @internal */\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return undefined !== this._animationNodeIds && featureIndex < this.numFeatures ? this._animationNodeIds[featureIndex] : 0;\r\n }\r\n\r\n /** @internal */\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n assert(featureIndex < this.numFeatures);\r\n\r\n const index32 = 3 * featureIndex;\r\n result.elementId.lower = this._data[index32];\r\n result.elementId.upper = this._data[index32 + 1];\r\n\r\n const subCatIndexAndClass = this._data[index32 + 2];\r\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\r\n\r\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n result.subCategoryId.lower = this._data[subCatIndex];\r\n result.subCategoryId.upper = this._data[subCatIndex + 1];\r\n\r\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\r\n result.modelId.lower = this.batchModelIdPair.lower;\r\n result.modelId.upper = this.batchModelIdPair.upper;\r\n\r\n return result;\r\n }\r\n\r\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n if (featureIndex >= this.numFeatures)\r\n return undefined;\r\n else\r\n return this.readId(3 * featureIndex);\r\n }\r\n\r\n /** Return true if this table contains exactly 1 feature. */\r\n public get isUniform(): boolean { return 1 === this.numFeatures; }\r\n\r\n /** If this table contains exactly 1 feature, return it. */\r\n public getUniform(result: ModelFeature): ModelFeature | undefined {\r\n return this.isUniform ? this.getFeature(0, result) : undefined;\r\n }\r\n\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\r\n\r\n /** Unpack the features into a [[FeatureTable]]. */\r\n public unpack(): FeatureTable {\r\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\r\n const feature = ModelFeature.create();\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getFeature(i, feature);\r\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\r\n }\r\n\r\n return table;\r\n }\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n assert(undefined === this._animationNodeIds);\r\n assert(maxNodeId > 0);\r\n\r\n const pair = { lower: 0, upper: 0 };\r\n let haveNodes = false;\r\n const size = this.numFeatures;\r\n const nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getElementIdPair(i, pair);\r\n const nodeId = computeNodeId(pair, i);\r\n assert(nodeId <= maxNodeId);\r\n if (0 !== nodeId) {\r\n nodeIds[i] = nodeId;\r\n haveNodes = true;\r\n }\r\n }\r\n\r\n if (haveNodes)\r\n this._animationNodeIds = nodeIds;\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getPackedFeature(i, output);\r\n output.index = i;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\r\n\r\n private readId(offset32: number): Id64String {\r\n return Id64.fromUint32Pair(this._data[offset32], this._data[offset32 + 1]);\r\n }\r\n}\r\n\r\ninterface PackedFeatureModelEntry {\r\n lastFeatureIndex: number;\r\n idLower: number;\r\n idUpper: number;\r\n}\r\n\r\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\r\n\r\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\r\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\r\n * The model table itself consists of one entry per model, where each entry looks like:\r\n * indexOfLastFeatureInModel: u32\r\n * modelId: u64\r\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\r\n * This lookup can be optimized using binary search.\r\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\r\n * @internal\r\n */\r\nexport class PackedFeatureModelTable {\r\n private readonly _data: Uint32Array;\r\n\r\n public constructor(data: Uint32Array) {\r\n this._data = data;\r\n assert(this._data.length % 3 === 0);\r\n }\r\n\r\n /** The number of models in the table. */\r\n public get length(): number {\r\n return this._data.length / 3;\r\n }\r\n\r\n public get byteLength(): number {\r\n return this._data.byteLength;\r\n }\r\n\r\n private getLastFeatureIndex(modelIndex: number): number {\r\n return this._data[modelIndex * 3];\r\n }\r\n\r\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\r\n if (modelIndex >= this.length) {\r\n result.idLower = result.idUpper = 0;\r\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\r\n return result;\r\n }\r\n\r\n const index = modelIndex * 3;\r\n result.lastFeatureIndex = this._data[index + 0];\r\n result.idLower = this._data[index + 1];\r\n result.idUpper = this._data[index + 2];\r\n return result;\r\n }\r\n\r\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\r\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n if (!result)\r\n result = { lower: 0, upper: 0 };\r\n else\r\n result.lower = result.upper = 0;\r\n\r\n let first = 0;\r\n const last = this.length;\r\n let count = last;\r\n while (count > 0) {\r\n const step = Math.floor(count / 2);\r\n const mid = first + step;\r\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\r\n if (featureIndex > lastFeatureIndex) {\r\n first = mid + 1;\r\n count -= step + 1;\r\n } else {\r\n count = step;\r\n }\r\n }\r\n\r\n if (first < last) {\r\n result.lower = this._data[first * 3 + 1];\r\n result.upper = this._data[first * 3 + 2];\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\r\n * @internal\r\n */\r\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\r\n private readonly _features: PackedFeatureTable;\r\n private readonly _models: PackedFeatureModelTable;\r\n\r\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\r\n this._features = features;\r\n this._models = models;\r\n }\r\n\r\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\r\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\r\n const featureData = data.subarray(0, modelTableOffset);\r\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\r\n\r\n const modelData = data.subarray(modelTableOffset);\r\n const models = new PackedFeatureModelTable(modelData);\r\n\r\n return new MultiModelPackedFeatureTable(features, models);\r\n }\r\n\r\n public get batchModelId() { return this._features.batchModelId; }\r\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\r\n public get numFeatures() { return this._features.numFeatures; }\r\n public get type() { return this._features.type; }\r\n\r\n public get byteLength() {\r\n return this._features.byteLength + this._models.byteLength;\r\n }\r\n\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n this._features.getPackedFeature(featureIndex, result);\r\n this._models.getModelIdPair(featureIndex, result.modelId);\r\n return result;\r\n }\r\n\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result);\r\n }\r\n\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n return this._features.getElementIdPair(featureIndex, out);\r\n }\r\n\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n return this._features.findElementId(featureIndex);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\r\n let modelIndex = 0;\r\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\r\n\r\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\r\n if (featureIndex > modelEntry.lastFeatureIndex)\r\n this._models.getEntry(++modelIndex, modelEntry);\r\n\r\n this._features.getPackedFeature(featureIndex, output);\r\n output.modelId.lower = modelEntry.idLower;\r\n output.modelId.upper = modelEntry.idUpper;\r\n output.index = featureIndex;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"FeatureTable.js","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAC7B,qDAAiD;AAEjD;;;;;;;;GAQG;AACH,MAAa,OAAO;IAKlB,YAAmB,YAAwB,mBAAI,CAAC,OAAO,EAAE,gBAA4B,mBAAI,CAAC,OAAO,EAAE,gBAA+B,8BAAa,CAAC,OAAO;QACrJ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,IAAW,SAAS,KAAc,OAAO,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,KAAK,8BAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAClK,IAAW,WAAW,KAAc,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAE7D,0EAA0E;IACnE,MAAM,CAAC,KAAc,IAAa,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE5E;;;OAGG;IACI,OAAO,CAAC,GAAY;QACzB,IAAI,IAAI,KAAK,GAAG;YACd,OAAO,CAAC,CAAC;QAEX,IAAI,GAAG,GA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S,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAEM,wBAAwB,CAAC,aAA4B,EAAE,SAAiB;QAC7E,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,wBAAwB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF;AAnFD,oEAmFC","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 Rendering\r\n */\r\n\r\nimport {\r\n assert, compareNumbers, compareStrings, Id64, Id64String, IndexedValue, IndexMap, UintArray,\r\n} from \"@itwin/core-bentley\";\r\nimport { GeometryClass } from \"./GeometryParams\";\r\n\r\n/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be\r\n * grouped with other such entities in a [[FeatureTable]].\r\n * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every\r\n * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature.\r\n * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and\r\n * [[GeometryClass]], so an individual element may produce more than one feature.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class Feature {\r\n public readonly elementId: Id64String;\r\n public readonly subCategoryId: Id64String;\r\n public readonly geometryClass: GeometryClass;\r\n\r\n public constructor(elementId: Id64String = Id64.invalid, subCategoryId: Id64String = Id64.invalid, geometryClass: GeometryClass = GeometryClass.Primary) {\r\n this.elementId = elementId;\r\n this.subCategoryId = subCategoryId;\r\n this.geometryClass = geometryClass;\r\n }\r\n\r\n public get isDefined(): boolean { return !Id64.isInvalid(this.elementId) || !Id64.isInvalid(this.subCategoryId) || this.geometryClass !== GeometryClass.Primary; }\r\n public get isUndefined(): boolean { return !this.isDefined; }\r\n\r\n /** Returns true if this feature is equivalent to the supplied feature. */\r\n public equals(other: Feature): boolean { return 0 === this.compare(other); }\r\n\r\n /** Performs ordinal comparison of this feature with another.\r\n * @param rhs The feature to compare with.\r\n * @returns zero if the features are equivalent, a negative value if this feature compares as \"less than\" `rhs`, or a positive value if this feature compares \"greater than\" `rhs`.\r\n */\r\n public compare(rhs: Feature): number {\r\n if (this === rhs)\r\n return 0;\r\n\r\n let cmp = compareNumbers(this.geometryClass, rhs.geometryClass);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.elementId, rhs.elementId);\r\n if (0 === cmp) {\r\n cmp = compareStrings(this.subCategoryId, rhs.subCategoryId);\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n}\r\n\r\n/** A [[Feature]] with a modelId identifying the model containing the feature.\r\n * Typically produced from a PackedFeature.\r\n * Prior to the introduction of MultiModelPackedFeatureTable, every (Packed)FeatureTable was associated with exactly one model.\r\n * Now, each feature in a table may be associated with a different model.\r\n * @internal\r\n */\r\nexport interface ModelFeature {\r\n modelId: Id64String;\r\n elementId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n}\r\n\r\n/** @internal */\r\nexport namespace ModelFeature {\r\n export function create(): ModelFeature {\r\n return {\r\n modelId: Id64.invalid,\r\n elementId: Id64.invalid,\r\n subCategoryId: Id64.invalid,\r\n geometryClass: GeometryClass.Primary,\r\n };\r\n }\r\n\r\n export function isDefined(feature: ModelFeature): boolean {\r\n return !Id64.isInvalid(feature.modelId) || !Id64.isInvalid(feature.elementId) || !Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryClass.Primary;\r\n }\r\n\r\n export function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature {\r\n result.modelId = unpackedModelId ?? Id64.fromUint32PairObject(packed.modelId);\r\n result.elementId = Id64.fromUint32PairObject(packed.elementId);\r\n result.subCategoryId = Id64.fromUint32PairObject(packed.subCategoryId);\r\n result.geometryClass = packed.geometryClass;\r\n return result;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport interface PackedFeature {\r\n modelId: Id64.Uint32Pair;\r\n elementId: Id64.Uint32Pair;\r\n subCategoryId: Id64.Uint32Pair;\r\n geometryClass: GeometryClass;\r\n animationNodeId: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface PackedFeatureWithIndex extends PackedFeature {\r\n index: number;\r\n}\r\n\r\n/** @internal */\r\nexport namespace PackedFeature {\r\n export function create(): PackedFeature {\r\n const pair = { upper: 0, lower: 0 };\r\n return {\r\n modelId: { ...pair },\r\n elementId: { ...pair },\r\n subCategoryId: { ...pair },\r\n geometryClass: GeometryClass.Primary,\r\n animationNodeId: 0,\r\n };\r\n }\r\n\r\n export function createWithIndex(): PackedFeatureWithIndex {\r\n const result = create() as PackedFeatureWithIndex;\r\n result.index = 0;\r\n return result;\r\n }\r\n}\r\n\r\n/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.\r\n * The most commonly-encountered batches are Tiles, which can be of either Primary or\r\n * Classifier type.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum BatchType {\r\n /** This batch contains graphics derived from a model's visible geometry. */\r\n Primary,\r\n /**\r\n * This batch contains color volumes which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n VolumeClassifier,\r\n /**\r\n * This batch contains planar graphics which are used to classify a model's visible geometry.\r\n * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer\r\n * to resymbolize the primary geometry.\r\n */\r\n PlanarClassifier,\r\n}\r\n\r\n/** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit\r\n * indices are assigned to each unique Feature. Primitives within the RenderGraphic can\r\n * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual\r\n * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table\r\n * identifying the elements whose geometry appears within that tile.\r\n * @see [[FeatureOverrides]] for customizing the appearance of individual features.\r\n * @public\r\n */\r\nexport class FeatureTable extends IndexMap<Feature> {\r\n public readonly modelId: Id64String;\r\n public readonly type: BatchType;\r\n\r\n /** Construct an empty FeatureTable. */\r\n public constructor(maxFeatures: number, modelId: Id64String = Id64.invalid, type: BatchType = BatchType.Primary) {\r\n super((lhs, rhs) => lhs.compare(rhs), maxFeatures);\r\n this.modelId = modelId;\r\n this.type = type;\r\n }\r\n\r\n /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */\r\n public get maxFeatures(): number { return this._maximumSize; }\r\n /** @internal */\r\n public get anyDefined(): boolean { return this.length > 1 || (1 === this.length && this._array[0].value.isDefined); }\r\n /** Returns true if this FeatureTable contains exactly one [[Feature]]. */\r\n public get isUniform(): boolean { return 1 === this.length; }\r\n /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */\r\n public get uniform(): Feature | undefined { return 1 === this.length ? this._array[0].value : undefined; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */\r\n public get isPlanarClassifier(): boolean { return BatchType.PlanarClassifier === this.type; }\r\n\r\n /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */\r\n public findFeature(index: number): Feature | undefined {\r\n for (const entry of this._array)\r\n if (entry.index === index)\r\n return entry.value;\r\n\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public insertWithIndex(feature: Feature, index: number): void {\r\n const bound = this.lowerBound(feature);\r\n assert(!bound.equal);\r\n assert(!this.isFull);\r\n const entry = new IndexedValue<Feature>(feature, index);\r\n this._array.splice(bound.index, 0, entry);\r\n }\r\n\r\n /** @internal */\r\n public getArray(): Array<IndexedValue<Feature>> { return this._array; }\r\n}\r\n\r\n/** @internal */\r\nexport type ComputeNodeId = (feature: PackedFeatureWithIndex) => number;\r\n\r\n/** Interface common to PackedFeatureTable and MultiModelPackedFeatureTable.\r\n * @internal\r\n */\r\nexport interface RenderFeatureTable {\r\n /** The \"model Id\" of the tile tree containing the tile from which this feature table originated.\r\n * It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple\r\n * persistent models batched together.\r\n */\r\n readonly batchModelId: Id64String;\r\n /** Split representation of batchModelId, so we're not constantly having to parse the string. */\r\n readonly batchModelIdPair: Id64.Uint32Pair;\r\n /** The number of features in the table; equivalently, one more than the largest feature index. */\r\n readonly numFeatures: number;\r\n /** Strictly for reporting memory usage. */\r\n readonly byteLength: number;\r\n readonly type: BatchType;\r\n\r\n /** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */\r\n getFeature(featureIndex: number, result: ModelFeature): ModelFeature;\r\n /** Find the specified feature. Returns undefined if featureIndex >= numFeatures. */\r\n findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;\r\n /** Find the Id of the element of the specified feature. */\r\n findElementId(featureIndex: number): Id64String | undefined;\r\n /** Get the Id of the element of the specified feature as a pair of 32-bit integers, asserting that feature index < numFeatures. */\r\n getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;\r\n /** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */\r\n getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;\r\n /** Get an object that provides iteration over all features, in order. `output` is reused as the current value on each iteration. */\r\n iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;\r\n populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;\r\n getAnimationNodeId(featureIndex: number): number;\r\n}\r\n\r\nconst scratchPackedFeature = PackedFeature.create();\r\n\r\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\r\n assert(maxNodeId > 0);\r\n\r\n let nodeIds;\r\n const outputFeature = PackedFeature.createWithIndex();\r\n for (const feature of table.iterable(outputFeature)) {\r\n const nodeId = computeNodeId(feature);\r\n assert(nodeId <= maxNodeId);\r\n if (0 !== nodeId) {\r\n if (!nodeIds) {\r\n const size = table.numFeatures;\r\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\r\n }\r\n\r\n nodeIds[feature.index] = nodeId;\r\n }\r\n }\r\n\r\n return nodeIds;\r\n}\r\n\r\n/**\r\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\r\n * wherein each feature occupies 3 32-bit integers.\r\n * @internal\r\n */\r\nexport class PackedFeatureTable implements RenderFeatureTable {\r\n private readonly _data: Uint32Array;\r\n public readonly batchModelId: Id64String;\r\n public readonly batchModelIdPair: Id64.Uint32Pair;\r\n public readonly numFeatures: number;\r\n public readonly anyDefined: boolean;\r\n public readonly type: BatchType;\r\n private _animationNodeIds?: UintArray;\r\n\r\n public get byteLength(): number { return this._data.byteLength; }\r\n public get animationNodeIds(): Readonly<UintArray> | undefined { return this._animationNodeIds; }\r\n\r\n /** @internal for use by MultiModelPackedFeatureTable */\r\n public setAnimationNodeIds(nodeIds: UintArray | undefined): void {\r\n assert(undefined === this._animationNodeIds);\r\n this._animationNodeIds = nodeIds;\r\n }\r\n\r\n /** Construct a PackedFeatureTable from the packed binary data.\r\n * This is used internally when deserializing Tiles in iMdl format.\r\n * @internal\r\n */\r\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\r\n this._data = data;\r\n this.batchModelId = modelId;\r\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\r\n this.numFeatures = numFeatures;\r\n this.type = type;\r\n this._animationNodeIds = animationNodeIds;\r\n\r\n switch (this.numFeatures) {\r\n case 0:\r\n this.anyDefined = false;\r\n break;\r\n case 1:\r\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\r\n break;\r\n default:\r\n this.anyDefined = true;\r\n break;\r\n }\r\n\r\n assert(this._data.length >= this._subCategoriesOffset);\r\n assert(undefined === this._animationNodeIds || this._animationNodeIds.length === this.numFeatures);\r\n }\r\n\r\n /** Create a packed feature table from a [[FeatureTable]]. */\r\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\r\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\r\n // the array cannot be resized after it is created.\r\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\r\n // back-end arrive within tiles already in the packed format.\r\n const subcategories = new Map<string, number>();\r\n for (const iv of featureTable.getArray()) {\r\n const found = subcategories.get(iv.value.subCategoryId.toString());\r\n if (undefined === found)\r\n subcategories.set(iv.value.subCategoryId, subcategories.size);\r\n }\r\n\r\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\r\n const subCategoriesOffset = 3 * featureTable.length;\r\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\r\n const uint32s = new Uint32Array(nUint32s);\r\n\r\n for (const iv of featureTable.getArray()) {\r\n const feature = iv.value;\r\n const index = iv.index * 3;\r\n\r\n let subCategoryIndex = subcategories.get(feature.subCategoryId)!;\r\n assert(undefined !== subCategoryIndex); // we inserted it above...\r\n subCategoryIndex |= (feature.geometryClass << 24);\r\n\r\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\r\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\r\n uint32s[index + 2] = subCategoryIndex;\r\n }\r\n\r\n subcategories.forEach((index: number, id: string, _map) => {\r\n const index32 = subCategoriesOffset + 2 * index;\r\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\r\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\r\n });\r\n\r\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\r\n }\r\n\r\n /** Retrieve the Feature associated with the specified index. */\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result, this.batchModelId);\r\n }\r\n\r\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n out = out ?? { lower: 0, upper: 0 };\r\n assert(featureIndex < this.numFeatures);\r\n const offset = 3 * featureIndex;\r\n out.lower = this._data[offset];\r\n out.upper = this._data[offset + 1];\r\n return out;\r\n }\r\n\r\n /** @internal */\r\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\r\n const index = 3 * featureIndex;\r\n let subCatIndex = this._data[index + 2];\r\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n return { lower: this._data[subCatIndex], upper: this._data[subCatIndex + 1] };\r\n }\r\n\r\n /** @internal */\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return undefined !== this._animationNodeIds && featureIndex < this.numFeatures ? this._animationNodeIds[featureIndex] : 0;\r\n }\r\n\r\n /** @internal */\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n assert(featureIndex < this.numFeatures);\r\n\r\n const index32 = 3 * featureIndex;\r\n result.elementId.lower = this._data[index32];\r\n result.elementId.upper = this._data[index32 + 1];\r\n\r\n const subCatIndexAndClass = this._data[index32 + 2];\r\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\r\n\r\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\r\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\r\n result.subCategoryId.lower = this._data[subCatIndex];\r\n result.subCategoryId.upper = this._data[subCatIndex + 1];\r\n\r\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\r\n result.modelId.lower = this.batchModelIdPair.lower;\r\n result.modelId.upper = this.batchModelIdPair.upper;\r\n\r\n return result;\r\n }\r\n\r\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n if (featureIndex >= this.numFeatures)\r\n return undefined;\r\n else\r\n return this.readId(3 * featureIndex);\r\n }\r\n\r\n /** Return true if this table contains exactly 1 feature. */\r\n public get isUniform(): boolean { return 1 === this.numFeatures; }\r\n\r\n /** If this table contains exactly 1 feature, return it. */\r\n public getUniform(result: ModelFeature): ModelFeature | undefined {\r\n return this.isUniform ? this.getFeature(0, result) : undefined;\r\n }\r\n\r\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\r\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\r\n\r\n /** Unpack the features into a [[FeatureTable]]. */\r\n public unpack(): FeatureTable {\r\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\r\n const feature = ModelFeature.create();\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getFeature(i, feature);\r\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\r\n }\r\n\r\n return table;\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n assert(undefined === this._animationNodeIds);\r\n this._animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n for (let i = 0; i < this.numFeatures; i++) {\r\n this.getPackedFeature(i, output);\r\n output.index = i;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\r\n\r\n private readId(offset32: number): Id64String {\r\n return Id64.fromUint32Pair(this._data[offset32], this._data[offset32 + 1]);\r\n }\r\n}\r\n\r\ninterface PackedFeatureModelEntry {\r\n lastFeatureIndex: number;\r\n idLower: number;\r\n idUpper: number;\r\n}\r\n\r\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\r\n\r\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\r\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\r\n * The model table itself consists of one entry per model, where each entry looks like:\r\n * indexOfLastFeatureInModel: u32\r\n * modelId: u64\r\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\r\n * This lookup can be optimized using binary search.\r\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\r\n * @internal\r\n */\r\nexport class PackedFeatureModelTable {\r\n private readonly _data: Uint32Array;\r\n\r\n public constructor(data: Uint32Array) {\r\n this._data = data;\r\n assert(this._data.length % 3 === 0);\r\n }\r\n\r\n /** The number of models in the table. */\r\n public get length(): number {\r\n return this._data.length / 3;\r\n }\r\n\r\n public get byteLength(): number {\r\n return this._data.byteLength;\r\n }\r\n\r\n private getLastFeatureIndex(modelIndex: number): number {\r\n return this._data[modelIndex * 3];\r\n }\r\n\r\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\r\n if (modelIndex >= this.length) {\r\n result.idLower = result.idUpper = 0;\r\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\r\n return result;\r\n }\r\n\r\n const index = modelIndex * 3;\r\n result.lastFeatureIndex = this._data[index + 0];\r\n result.idLower = this._data[index + 1];\r\n result.idUpper = this._data[index + 2];\r\n return result;\r\n }\r\n\r\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\r\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\r\n if (!result)\r\n result = { lower: 0, upper: 0 };\r\n else\r\n result.lower = result.upper = 0;\r\n\r\n let first = 0;\r\n const last = this.length;\r\n let count = last;\r\n while (count > 0) {\r\n const step = Math.floor(count / 2);\r\n const mid = first + step;\r\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\r\n if (featureIndex > lastFeatureIndex) {\r\n first = mid + 1;\r\n count -= step + 1;\r\n } else {\r\n count = step;\r\n }\r\n }\r\n\r\n if (first < last) {\r\n result.lower = this._data[first * 3 + 1];\r\n result.upper = this._data[first * 3 + 2];\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\r\n * @internal\r\n */\r\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\r\n private readonly _features: PackedFeatureTable;\r\n private readonly _models: PackedFeatureModelTable;\r\n\r\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\r\n this._features = features;\r\n this._models = models;\r\n }\r\n\r\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\r\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\r\n const featureData = data.subarray(0, modelTableOffset);\r\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\r\n\r\n const modelData = data.subarray(modelTableOffset);\r\n const models = new PackedFeatureModelTable(modelData);\r\n\r\n return new MultiModelPackedFeatureTable(features, models);\r\n }\r\n\r\n public get batchModelId() { return this._features.batchModelId; }\r\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\r\n public get numFeatures() { return this._features.numFeatures; }\r\n public get type() { return this._features.type; }\r\n public get animationNodeIds(): Readonly<UintArray> | undefined { return this._features.animationNodeIds; }\r\n\r\n public get byteLength() {\r\n return this._features.byteLength + this._models.byteLength;\r\n }\r\n\r\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\r\n this._features.getPackedFeature(featureIndex, result);\r\n this._models.getModelIdPair(featureIndex, result.modelId);\r\n return result;\r\n }\r\n\r\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\r\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\r\n return ModelFeature.unpack(packed, result);\r\n }\r\n\r\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\r\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\r\n }\r\n\r\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\r\n return this._features.getElementIdPair(featureIndex, out);\r\n }\r\n\r\n public findElementId(featureIndex: number): Id64String | undefined {\r\n return this._features.findElementId(featureIndex);\r\n }\r\n\r\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\r\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\r\n let modelIndex = 0;\r\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\r\n\r\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\r\n if (featureIndex > modelEntry.lastFeatureIndex)\r\n this._models.getEntry(++modelIndex, modelEntry);\r\n\r\n this._features.getPackedFeature(featureIndex, output);\r\n output.modelId.lower = modelEntry.idLower;\r\n output.modelId.upper = modelEntry.idUpper;\r\n output.index = featureIndex;\r\n yield output;\r\n }\r\n }\r\n\r\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\r\n return {\r\n [Symbol.iterator]: () => this.iterator(output),\r\n };\r\n }\r\n\r\n public getAnimationNodeId(featureIndex: number): number {\r\n return this._features.getAnimationNodeId(featureIndex);\r\n }\r\n\r\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\r\n this._features.setAnimationNodeIds(populateAnimationNodeIds(this, computeNodeId, maxNodeId));\r\n }\r\n}\r\n"]}
@@ -6,6 +6,7 @@ import { EntityReferenceSet } from "./EntityReference";
6
6
  import { ClipVector, Plane3dByOriginAndUnitNormal, Point4d, Range1d, Transform, Vector3d, XYAndZ } from "@itwin/core-geometry";
7
7
  import { RgbColor } from "./RgbColor";
8
8
  import { FeatureAppearance, FeatureOverrides } from "./FeatureSymbology";
9
+ import { PackedFeatureWithIndex } from "./FeatureTable";
9
10
  /** Namespace containing types that collectively define a script that animates the contents of a view by adjusting the visibility, position,
10
11
  * and/or symbology of groups of elements over time. A [[RenderSchedule.Script]] is hosted by a [RenderTimeline]($backend) element. The script
11
12
  * can be associated with a [DisplayStyleState]($frontend) by way of its [[DisplayStyleSettings.renderTimeline]] property.
@@ -364,6 +365,8 @@ export declare namespace RenderSchedule {
364
365
  * @alpha
365
366
  */
366
367
  get discreteBatchIds(): Set<number>;
368
+ /** @internal see ImdlReader.readAnimationBranches */
369
+ getBatchIdForFeature(feature: PackedFeatureWithIndex): number;
367
370
  }
368
371
  /** Specifies how to animate the contents of a [ViewState]($frontend) over time. The script contains any number of [[RenderSchedule.ModelTimeline]]s, each describing how
369
372
  * to animate one of the models in the view.
@@ -393,6 +396,9 @@ export declare namespace RenderSchedule {
393
396
  readonly transformBatchIds: ReadonlySet<number>;
394
397
  /** Tile tree references perform **very** frequent ordered comparisons of Scripts. They need to be fast. */
395
398
  private readonly _cachedComparisons;
399
+ private _discreteBatchIds?;
400
+ private _lastFeatureModelTimeline?;
401
+ private _maxBatchId?;
396
402
  compareTo(other: Script): number;
397
403
  equals(other: Script): boolean;
398
404
  protected constructor(props: Readonly<ScriptProps>);
@@ -412,6 +418,14 @@ export declare namespace RenderSchedule {
412
418
  discloseIds(ids: EntityReferenceSet): void;
413
419
  /** @internal */
414
420
  modelRequiresBatching(modelId: Id64String): boolean;
421
+ /** The batch Ids of the subset of [[elementTimelines]] that apply a transform and/or cutting plane.
422
+ * @alpha
423
+ */
424
+ get discreteBatchIds(): Set<number>;
425
+ /** @internal see ImdlReader.readAnimationBranches. */
426
+ getBatchIdForFeature(feature: PackedFeatureWithIndex): number;
427
+ /** @alpha */
428
+ get maxBatchId(): number;
415
429
  }
416
430
  /** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.
417
431
  * @see [DisplayStyle.loadScheduleScript]($backend) and [DisplayStyleState.scheduleScript]($frontend) to obtain the script reference for a display style on the frontend
@@ -1 +1 @@
1
- {"version":3,"file":"RenderSchedule.d.ts","sourceRoot":"","sources":["../../src/RenderSchedule.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAEL,iBAAiB,EAAE,WAAW,EAAQ,UAAU,EACjD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACqB,UAAU,EAAgC,4BAA4B,EAAW,OAAO,EAAE,OAAO,EAAE,SAAS,EAA8B,QAAQ,EAAE,MAAM,EACrL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA8BzE;;;;GAIG;AACH,yBAAiB,cAAc,CAAC;IAC9B;;;OAGG;IACH,KAAY,aAAa;QACvB,+GAA+G;QAC/G,IAAI,IAAI;QACR;;WAEG;QACH,MAAM,IAAI;KACX;IAED,iEAAiE;IACjE,UAAiB,kBAAkB;QACjC,8FAA8F;QAC9F,IAAI,EAAE,MAAM,CAAC;QACb;;;WAGG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B;IAED,mEAAmE;IACnE,UAAiB,oBAAqB,SAAQ,kBAAkB;QAC9D;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;IAED,8DAA8D;IAC9D,UAAiB,eAAgB,SAAQ,kBAAkB;QACzD;;;WAGG;QACH,KAAK,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA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,CAAgC;QAE1D;;WAEG;oBACgB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,MAAM;QAMvE;;;WAGG;QACI,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,sBAAsB;QAsBvG;;WAEG;QACa,MAAM,IAAI,kBAAkB;KAS7C;IAED;;;;;;;;OAQG;IACH,MAAa,aAAa;QACxB,OAAO,CAAC,YAAY,CAAK;QACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;QAEtD,uFAAuF;QAChF,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;QAMlE;;WAEG;QACI,MAAM,IAAI,WAAW;KAG7B;CACF"}
@@ -701,6 +701,12 @@ var RenderSchedule;
701
701
  }
702
702
  return this._discreteBatchIds;
703
703
  }
704
+ /** @internal see ImdlReader.readAnimationBranches */
705
+ getBatchIdForFeature(feature) {
706
+ (0, core_bentley_1.assert)(core_bentley_1.Id64.fromUint32PairObject(feature.modelId) === this.modelId);
707
+ const elementTimeline = this.getTimelineForElement(feature.elementId.lower, feature.elementId.upper);
708
+ return elementTimeline?.batchId ?? 0;
709
+ }
704
710
  }
705
711
  RenderSchedule.ModelTimeline = ModelTimeline;
706
712
  /** Specifies how to animate the contents of a [ViewState]($frontend) over time. The script contains any number of [[RenderSchedule.ModelTimeline]]s, each describing how
@@ -801,6 +807,36 @@ var RenderSchedule;
801
807
  // Only if the script contains animation (cutting plane, transform or visibility by node ID) do we require separate tilesets for animations.
802
808
  return this.requiresBatching && this.modelTimelines.some((x) => x.modelId === modelId && x.requiresBatching);
803
809
  }
810
+ /** The batch Ids of the subset of [[elementTimelines]] that apply a transform and/or cutting plane.
811
+ * @alpha
812
+ */
813
+ get discreteBatchIds() {
814
+ if (this._discreteBatchIds)
815
+ return this._discreteBatchIds;
816
+ this._discreteBatchIds = new Set();
817
+ for (const timeline of this.modelTimelines)
818
+ for (const batchId of timeline.discreteBatchIds)
819
+ this._discreteBatchIds.add(batchId);
820
+ return this._discreteBatchIds;
821
+ }
822
+ /** @internal see ImdlReader.readAnimationBranches. */
823
+ getBatchIdForFeature(feature) {
824
+ let timeline;
825
+ const prev = this._lastFeatureModelTimeline;
826
+ if (prev && prev.idLower === feature.modelId.lower && prev.idUpper === feature.modelId.upper) {
827
+ timeline = prev.timeline;
828
+ }
829
+ else {
830
+ const modelId = core_bentley_1.Id64.fromUint32PairObject(feature.modelId);
831
+ timeline = this.find(modelId);
832
+ this._lastFeatureModelTimeline = { timeline, idLower: feature.modelId.lower, idUpper: feature.modelId.upper };
833
+ }
834
+ return timeline?.getBatchIdForFeature(feature) ?? 0;
835
+ }
836
+ /** @alpha */
837
+ get maxBatchId() {
838
+ return this._maxBatchId ?? (this._maxBatchId = this.modelTimelines.reduce((accum, timeline) => Math.max(accum, timeline.maxBatchId), 0));
839
+ }
804
840
  }
805
841
  RenderSchedule.Script = Script;
806
842
  /** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.