message: refactor GeometryList in primitives/Geometry.ts
diff: @@ -158,22 +158,27 @@ export class PrimitiveGeometry extends Geometry {
  }
  }
  -export class GeometryList {
  - public list: Geometry[] = [];
  - public isComplete = false;
  - public isCurved = false;
  -
  - public get isEmpty() { return this.list.length === 0; }
  - public size() { return this.list.length; }
  - public push_back(geom: Geometry) { this.list.push(geom); this.isCurved = this.isCurved || geom.isCurved; }
  - public append(src: GeometryList) { this.list.concat(src.list); this.isCurved = this.isCurved || src.isCurved; }
  - public clear() { this.list = []; }
  -
  +export class GeometryList extends Array<Geometry> {
  + private _isComplete = false;
  + private _isCurved = false;
  + public get isComplete(): boolean { return this._isComplete; }
  + public get isCurved(): boolean { return this._isCurved; }
  + public get isEmpty() { return this.length === 0; }
  + constructor(...args: Geometry[]) { super(...args); }
  + public push(geom: Geometry): number {
  + this._isCurved = this._isCurved || geom.isCurved;
  + return super.push(geom);
  + }
  + public append(src: GeometryList): GeometryList {
  + this._isCurved = this._isCurved || src.isCurved;
  + super.push(...src);
  + return this;
  + }
  + public clear(): void { this.length = 0; }
  public computeRange(): Range3d {
  const range: Range3d = Range3d.createNull();
  - this.list.forEach((geom: Geometry) => {
  - range.extendRange(geom.tileRange);
  - });
  + const extendRange = (geom: Geometry) => range.extendRange(geom.tileRange);
  + this.forEach(extendRange);
  return range;
  }
  public computeQuantizationParams(): QParams3d { return QParams3d.fromRange(this.computeRange()); }
  @@ -231,10 +236,10 @@ export class GeometryAccumulator {
  const geometry = Geometry.createFromGeom(geom, transform, range3d, displayParams, isCurved, /*this.iModel,*/ disjoint);
  if (!geometry) { return false; }
  geometry.clip = clip;
  - if (this.geometries) { this.geometries.push_back(geometry); }
  + if (this.geometries) { this.geometries.push(geometry); }
  return true;
  }
  - public addGeometryWithGeom(geom: Geometry): void { if (this.geometries) { this.geometries.push_back(geom); } }
  + public addGeometryWithGeom(geom: Geometry): void { if (this.geometries) { this.geometries.push(geom); } }
  public clear() { if (this.geometries) { this.geometries.clear(); } }
  public reInitialize(transform: Transform = Transform.createIdentity(), elemId: Id64 = new Id64(), surfacesOnly: boolean = false) {
  