/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module WebGL
 */
import { dispose, disposeArray } from "@itwin/core-bentley";
/** The various graphics associated with a [[Target]].
 * @internal
 */
export class TargetGraphics {
    constructor() {
        this.foreground = [];
        this.background = [];
        this.overlays = [];
    }
    dispose() {
        this.foreground.length = this.background.length = this.overlays.length = 0;
        this._dynamics = disposeArray(this._dynamics);
        this._decorations = dispose(this._decorations);
    }
    get isDisposed() {
        return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length
            && undefined === this._dynamics && undefined === this._decorations;
    }
    changeScene(scene) {
        this.foreground = scene.foreground;
        this.background = scene.background;
        this.overlays = scene.overlay;
    }
    get dynamics() { return this._dynamics; }
    set dynamics(dynamics) {
        disposeArray(this._dynamics);
        this._dynamics = dynamics;
    }
    get decorations() { return this._decorations; }
    set decorations(decorations) {
        dispose(this._decorations);
        this._decorations = decorations;
    }
    get canvasDecorations() {
        return this._decorations?.canvasDecorations;
    }
}
//# sourceMappingURL=TargetGraphics.js.map