@itwin/core-frontend
Version:
iTwin.js frontend components
48 lines • 2.08 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Views
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpatialClassifiersState = void 0;
const core_common_1 = require("@itwin/core-common");
/** The front-end representation of [SpatialClassifiers]($common) that adds support for classifying a reality model using non-persistent
* geometry via [[DynamicSpatialClassifier]].
*
* @see [[ContextRealityModelState.classifiers]] or [[SpatialModelState.classifiers]] to access the classifiers for a particular reality model.
* @public
*/
class SpatialClassifiersState extends core_common_1.SpatialClassifiers {
_dynamicClassifier;
constructor(container) {
super(container);
}
/** The classifier currently being used to classify the reality model.
* This may be either a [SpatialClassifier]($common) already defined in the set of available [SpatialClassifiers]($common), or a [[DynamicSpatialClassifier]].
* @note Unlike [[PersistentSpatialClassifier]]s, [[DynamicSpatialClassifier]]s are not preserved when saving and recalling a view.
*/
get activeClassifier() {
return this._dynamicClassifier ?? this.active;
}
set activeClassifier(active) {
if (active === this.activeClassifier) {
return;
}
this._dynamicClassifier = undefined;
if (active?.tileTreeReference) {
this._dynamicClassifier = active;
}
else {
this.setActive(active);
}
}
/** @internal */
static create(container) {
return new SpatialClassifiersState(container);
}
}
exports.SpatialClassifiersState = SpatialClassifiersState;
//# sourceMappingURL=SpatialClassifiersState.js.map