@itwin/core-frontend
Version:
iTwin.js frontend components
53 lines • 2.15 kB
JavaScript
"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 WebGL
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TargetGraphics = void 0;
const core_bentley_1 = require("@itwin/core-bentley");
/** The various graphics associated with a [[Target]].
* @internal
*/
class TargetGraphics {
foreground = [];
background = [];
overlays = [];
foregroundDynamics = [];
overlayDynamics = [];
_decorations;
[Symbol.dispose]() {
this.foreground.length = this.background.length = this.overlays.length = 0;
(0, core_bentley_1.disposeArray)(this.foregroundDynamics);
(0, core_bentley_1.disposeArray)(this.overlayDynamics);
this._decorations = (0, core_bentley_1.dispose)(this._decorations);
}
get isDisposed() {
return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length
&& 0 === this.foregroundDynamics.length && 0 === this.overlayDynamics.length && !this._decorations;
}
changeScene(scene) {
this.foreground = scene.foreground;
this.background = scene.background;
this.overlays = scene.overlay;
}
changeDynamics(foreground, overlay) {
(0, core_bentley_1.disposeArray)(this.foregroundDynamics);
(0, core_bentley_1.disposeArray)(this.overlayDynamics);
this.foregroundDynamics = foreground ?? [];
this.overlayDynamics = overlay ?? [];
}
get decorations() { return this._decorations; }
set decorations(decorations) {
(0, core_bentley_1.dispose)(this._decorations);
this._decorations = decorations;
}
get canvasDecorations() {
return this._decorations?.canvasDecorations;
}
}
exports.TargetGraphics = TargetGraphics;
//# sourceMappingURL=TargetGraphics.js.map