"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Rendering
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeometryList = void 0;
const core_geometry_1 = require("@itwin/core-geometry");
const core_common_1 = require("@itwin/core-common");
/** @internal */
class GeometryList {
    constructor() {
        this._list = [];
    }
    get first() { return this._list[0]; }
    get isEmpty() { return this._list.length === 0; }
    get length() { return this._list.length; }
    push(geom) {
        return this._list.push(geom);
    }
    append(src) {
        this._list.push(...src._list);
        return this;
    }
    clear() { this._list.length = 0; }
    computeRange() {
        const range = core_geometry_1.Range3d.createNull();
        const extendRange = (geom) => range.extendRange(geom.tileRange);
        this._list.forEach(extendRange);
        return range;
    }
    computeQuantizationParams() { return core_common_1.QParams3d.fromRange(this.computeRange()); }
    [Symbol.iterator]() {
        return this._list[Symbol.iterator]();
    }
}
exports.GeometryList = GeometryList;
//# sourceMappingURL=GeometryList.js.map