@itwin/core-common
Version:
iTwin.js components common to frontend and backend
86 lines • 4.35 kB
TypeScript
/** @packageDocumentation
* @module Rendering
*/
import { ColorDef } from "./ColorDef";
/** As part of a [[ColorIndex]], describes per-vertex colors for a [MeshArgs]($frontend) or [PolylineArgs]($frontend).
* The [[colors]] array holds the set of unique colors. The [[indices]] array describes the color of each vertex as an index into [[colors]].
* @note A `NonUniformColor` table cannot contain a mix of opaque and translucent colors. If any color in [[colors]] has a transparency greater
* than zero, all of them must have a transparency greater than zero.
* @public
*/
export declare class NonUniformColor {
/** An array of 32-bit [[ColorDef]] values in `tbgr` format, indexed by [[indices]]. */
readonly colors: Uint32Array;
/** For each vertex, an index into [[colors]] indicating the color of that vertex. */
readonly indices: Uint16Array;
/** If `true`, indicates none of the [[colors]] have a transparency greater than zero; otherwise, all of
* the colors have a transparency greater than zero.
*/
readonly isOpaque: boolean;
/** Constructor.
* @param colors See [[colors]].
* @param indices See [[indices]]
* @param hasAlpha `true` if all `colors` have a transparency greater than zero, or `false` if they all have a transparency of zero.
*/
constructor(colors: Uint32Array, indices: number[], hasAlpha: boolean);
}
/** Describes the color(s) of the vertices of a [MeshArgs]($frontend) or [PolylineArgs]($frontend).
* This may be a uniform color to be applied to every vertex, or a table specifying individual per-vertex colors.
* @public
*/
export declare class ColorIndex {
private _color;
/** Whether the color(s) in this index have transparency. */
get hasAlpha(): boolean;
/** Whether this index specifies a single uniform color for the entire mesh or polyline. */
get isUniform(): boolean;
/** The number of colors in this index. */
get numColors(): number;
/** Construct a default index specifying a uniform white color. */
constructor();
/** Reset this index to specify a uniform white color. */
reset(): void;
/** Returns the single color to be applied to all vertices, if [[isUniform]] is `true`; or `undefined` otherwise. */
get uniform(): ColorDef | undefined;
/** Set the specified color to be applied to all vertices. */
initUniform(color: ColorDef | number): void;
/** Returns the per-vertex colors, if [[isUniform]] is `false`; or `undefined` otherwise. */
get nonUniform(): NonUniformColor | undefined;
/** Set the per-vertex colors.
* @param colors See [[NonUniformColor.colors]].
* @param indices See [[NonUniformColor.indices]].
* @param hasAlpha `true` if all `colors` have a transparency greater than zero, or `false` if they all have a transparency of zero.
*/
initNonUniform(colors: Uint32Array, indices: number[], hasAlpha: boolean): void;
}
/** Describes the type of a [[FeatureIndex]].
* @public
*/
export declare enum FeatureIndexType {
/** Indicates that the index contains no features. */
Empty = 0,
/** Indicates that the index contains exactly one feature. */
Uniform = 1,
/** Indicates that the index contains more than one feature. */
NonUniform = 2
}
/** Describes the set of [[Feature]]s associated with a [MeshArgs]($frontend) or [PolylineArgs]($frontend).
* The mesh or polyline may have zero or one features; or, individual vertices may be associated with different features.
* The features are expressed as unsigned 32-bit integer Ids of [[Feature]]s within a [[FeatureTable]].
* @public
*/
export declare class FeatureIndex {
/** Describes the quantity (zero, one, or more than one) of features in this index. */
type: FeatureIndexType;
/** If [[type]] is [[FeatureIndexType.Uniform]], the Id of the single feature. */
featureID: number;
/** If [[type]] is [[FeatureIndexType.NonUniform]], the per-vertex feature Ids, indexed by the mesh or polyline's vertex indices. */
featureIDs?: Uint32Array;
/** True if [[type]] is [[FeatureIndexType.Uniform]]. */
get isUniform(): boolean;
/** True if [[type]] is [[FeatureIndexType.Empty]]. */
get isEmpty(): boolean;
/** Reset to an empty index. */
reset(): void;
}
//# sourceMappingURL=FeatureIndex.d.ts.map