UNPKG

@itwin/core-frontend

Version:
35 lines 1.29 kB
/*--------------------------------------------------------------------------------------------- * 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 */ import { Range3d } from "@itwin/core-geometry"; import { QParams3d } from "@itwin/core-common"; /** @internal */ export class GeometryList { _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 = Range3d.createNull(); const extendRange = (geom) => range.extendRange(geom.tileRange); this._list.forEach(extendRange); return range; } computeQuantizationParams() { return QParams3d.fromRange(this.computeRange()); } [Symbol.iterator]() { return this._list[Symbol.iterator](); } } //# sourceMappingURL=GeometryList.js.map