SpatialClassifiers Class
A set of SpatialClassifiers for a given reality model. At most one of the classifiers can be actively classifying the model at any given time. The set of classifiers can be presented to the user, listed by name, so that the active classifier can be changed. The set of classifiers is populated from its JSON representation and that representation is kept in sync as the set of classifiers is modified.
@see - this (interactive example)[https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=classifier-sample].
- SpatialClassifier for details on how spatial classification works.
- classifiers to define classifiers for a context reality model.
- SpatialModelState.classifiers to define classifiers for a persistent reality model.
Implements
- Iterable<SpatialClassifier>
Methods
Name | Description | |
---|---|---|
constructor(container: SpatialClassifiersContainer): SpatialClassifiers | Construct a new set of classifiers from the JSON representation. | |
[iterator](): Iterator<SpatialClassifier, any, undefined> | Obtain an iterator over the classifiers contained in this set. | |
add(classifier: SpatialClassifier): SpatialClassifier | Add a classifier to this set. | |
clear(): void | Remove all classifiers from this set. | |
delete(classifier: SpatialClassifier): undefined | SpatialClassifier | Remove the first classifier equivalent to classifier from this set. |
|
find(criterion: (classifier: SpatialClassifier) => boolean): undefined | SpatialClassifier | Returns the first classifier that satisfies criterion , or undefined if no classifier satisfies it. |
|
findEquivalent(classifier: SpatialClassifier): undefined | SpatialClassifier | Find the first classifier that is equivalent to the supplied classifier, or undefined if no equivalent classifier exists in this set. |
|
has(classifier: SpatialClassifier): boolean | Return true if the specified classifier or one equivalent to it exists in this set. | |
replace(toReplace: SpatialClassifier, replacement: SpatialClassifier): boolean | Replace an existing classifier with a different one. | |
setActive(active: SpatialClassifier): undefined | SpatialClassifier | Change the active classifier. |
Properties
Name | Type | Description | |
---|---|---|---|
active Accessor ReadOnly | undefined | SpatialClassifier | The classifier currently classifying the target reality model, if any. | |
size Accessor ReadOnly | number | The number of classifiers in this set. |
Defined in
Last Updated: 28 October, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.