message: Implemented IndexedPrimitiveParamFeatures
diff: /*---------------------------------------------------------------------------------------------
  | $Copyright: (c) 2018 Bentley Systems, Incorporated. All rights reserved. $
  *--------------------------------------------------------------------------------------------*/
  +import { assert } from "@bentley/bentleyjs-core/lib/Assert";
  import { Point3d, Vector3d } from "@bentley/geometry-core/lib/PointVector";
  +import { FeatureIndexType, FeatureIndex } from "./FeatureIndex";
  +
  +export class IndexedPrimitiveParamsFeatures {
  + public type: FeatureIndexType;
  + public uniform: number;
  + public nonUniform: Uint32Array | undefined;
  +
  + public constructor(index?: FeatureIndex, nVerts?: number) {
  + this.type = FeatureIndexType.kEmpty;
  + this.uniform = 0;
  + this.nonUniform = undefined;
  + if (undefined !== index) {
  + this.type = index.type;
  + if (FeatureIndexType.kUniform === index.type)
  + this.uniform = index.featureID;
  + else if (FeatureIndexType.kNonUniform === index.type) {
  + assert(undefined !== nVerts);
  + assert(undefined !== index.featureIDs);
  + if (undefined !== nVerts && undefined !== index.featureIDs) {
  + assert(0 < nVerts);
  + this.nonUniform = new Uint32Array(nVerts);
  + for (let i = 0; i < nVerts; ++i) {
  + this.nonUniform[i] = index.featureIDs[i];
  + }
  + }
  + }
  + }
  + }
  +
  + public clear(): void {
  + if (undefined !== this.nonUniform) {
  + this.nonUniform = undefined;
  + }
  + this.type = FeatureIndexType.kEmpty;
  + }
  + public isUniform(): boolean { return FeatureIndexType.kUniform === this.type; }
  + public isEmpty(): boolean { return FeatureIndexType.kEmpty === this.type; }
  +
  + public toFeatureIndex(): FeatureIndex {
  + const fIndex: FeatureIndex = new FeatureIndex();
  + fIndex.type = this.type;
  + fIndex.featureID = this.uniform;
  + fIndex.featureIDs = (undefined === this.nonUniform ? undefined : new Uint32Array(this.nonUniform.buffer));
  + return fIndex;
  + }
  +}
  export const enum PolylineParam {
  kNone = 0,
  