/** @packageDocumentation * @module Rendering */ import { Id64, Id64String, IndexedValue, IndexMap } from "@bentley/bentleyjs-core"; import { GeometryClass } from "./GeometryParams"; /** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be * grouped with other such entities in a [[FeatureTable]]. * Features roughly correlate to elements: a [Tile]($frontend)'s graphics combines geometry from every * [GeometricElement]($backend) that intersects the tile's volume, so each element produces at least one feature. * However, an element's geometry stream can contain geometry belonging to multiple different combinations of [SubCategory]($backend) and * [[GeometryClass]], so an individual element may produce more than one feature. * @see [[FeatureOverrides]] for customizing the appearance of individual features. * @public */ export declare class Feature { readonly elementId: string; readonly subCategoryId: string; readonly geometryClass: GeometryClass; constructor(elementId?: Id64String, subCategoryId?: Id64String, geometryClass?: GeometryClass); get isDefined(): boolean; get isUndefined(): boolean; /** Returns true if this feature is equivalent to the supplied feature. */ equals(other: Feature): boolean; /** Performs ordinal comparison of this feature with another. * @param rhs The feature to compare with. * @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`. */ compare(rhs: Feature): number; } /** @internal */ export interface PackedFeature { elementId: Id64.Uint32Pair; subCategoryId: Id64.Uint32Pair; geometryClass: GeometryClass; animationNodeId: number; } /** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s. * The most commonly-encountered batches are Tiles, which can be of either Primary or * Classifier type. * @public */ export declare enum BatchType { /** This batch contains graphics derived from a model's visible geometry. */ Primary = 0, /** * This batch contains color volumes which are used to classify a model's visible geometry. * The graphics themselves are not rendered to the screen; instead they are rendered to the stencil buffer * to resymbolize the primary geometry. */ VolumeClassifier = 1, /** * This batch contains planar graphics which are used to classify a model's visible geometry. * The graphics themselves are not rendered to the screen; instead they are rendered to a texture buffer * to resymbolize the primary geometry. */ PlanarClassifier = 2 } /** Defines a look-up table for [[Feature]]s within a batched [RenderGraphic]($frontend). Consecutive 32-bit * indices are assigned to each unique Feature. Primitives within the RenderGraphic can * use per-vertex indices to specify the distribution of Features within the primitive. The appearance of individual * features can be customized using [[FeatureOverrides]]. Typically a [Tile]($frontend) will contain a feature table * identifying the elements whose geometry appears within that tile. * @see [[FeatureOverrides]] for customizing the appearance of individual features. * @public */ export declare class FeatureTable extends IndexMap { readonly modelId: Id64String; readonly type: BatchType; /** Construct an empty FeatureTable. */ constructor(maxFeatures: number, modelId?: Id64String, type?: BatchType); /** Returns the maximum number of [[Feature]]s this FeatureTable can contain. */ get maxFeatures(): number; /** @internal */ get anyDefined(): boolean; /** Returns true if this FeatureTable contains exactly one [[Feature]]. */ get isUniform(): boolean; /** If this FeatureTable contains exactly one [[Feature]], returns that Feature; otherwise returns undefined. */ get uniform(): Feature | undefined; /** Returns true if this FeatureTable is associated with [[BatchType.VolumeClassifier]] geometry. */ get isVolumeClassifier(): boolean; /** Returns true if this FeatureTable is associated with [[BatchType.PlanarClassifier]] geometry. */ get isPlanarClassifier(): boolean; /** Returns the Feature corresponding to the specified index, or undefined if the index is not present. */ findFeature(index: number): Feature | undefined; /** @internal */ insertWithIndex(feature: Feature, index: number): void; /** @internal */ getArray(): Array>; } /** * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values, * wherein each feature occupies 3 32-bit integers. * @internal */ export declare class PackedFeatureTable { private readonly _data; readonly modelId: Id64String; readonly maxFeatures: number; readonly numFeatures: number; readonly anyDefined: boolean; readonly type: BatchType; private readonly _animationNodeIds?; get byteLength(): number; /** Construct a PackedFeatureTable from the packed binary data. * This is used internally when deserializing Tiles in iMdl format. * @internal */ constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, maxFeatures: number, type: BatchType, animationNodeIds?: Uint8Array | Uint16Array | Uint32Array); /** Create a packed feature table from a [[FeatureTable]]. */ static pack(featureTable: FeatureTable): PackedFeatureTable; /** Retrieve the Feature associated with the specified index. */ getFeature(featureIndex: number): Feature; /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */ findFeature(featureIndex: number): Feature | undefined; /** @internal */ getElementIdPair(featureIndex: number): Id64.Uint32Pair; /** @internal */ getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair; /** @internal */ getAnimationNodeId(featureIndex: number): number; /** @internal */ getPackedFeature(featureIndex: number): PackedFeature; /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */ findElementId(featureIndex: number): Id64String | undefined; /** Return true if this table contains exactly 1 feature. */ get isUniform(): boolean; /** If this table contains exactly 1 feature, return it. */ get uniform(): Feature | undefined; get isVolumeClassifier(): boolean; get isPlanarClassifier(): boolean; get isClassifier(): boolean; /** Unpack the features into a [[FeatureTable]]. */ unpack(): FeatureTable; private get _subCategoriesOffset(); private readId; } //# sourceMappingURL=FeatureTable.d.ts.map