ContextRealityModels Class
A list of ContextRealityModels attached to a DisplayStyleSettings. The list may be presented to the user with the name and description of each model. The list is automatically synchronized with the underlying JSON representation provided by the input ContextRealityModelsContainer.
@see - this interactive example
Methods
Name | Description | |
---|---|---|
constructor(args: ContextRealityModelsArgs): ContextRealityModels | Construct a new list of reality models from its JSON representation. | |
constructor(container: ContextRealityModelsContainer, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel): ContextRealityModels | Construct a new list of reality models from its JSON representation. | |
add(props: ContextRealityModelProps): ContextRealityModel | Append a new reality model to the list. | |
clear(): void | Remove all reality models from the list. | |
delete(model: ContextRealityModel): boolean | Remove the specified reality model from the list. | |
populate(): void | Populate the list of models from the container that was supplied to the constructor. | |
replace(toReplace: ContextRealityModel, replaceWith: ContextRealityModelProps): ContextRealityModel | Replace a reality model in the list. | |
update(toUpdate: ContextRealityModel, updateProps: Partial<ContextRealityModelProps>): ContextRealityModel | Change selected properties of a reality model. |
Properties
Name | Type | Description | |
---|---|---|---|
models Accessor ReadOnly | ReadonlyArray<ContextRealityModel> | The read-only list of reality models. | |
onAppearanceOverridesChanged Readonly | BeEvent<(model: ContextRealityModel, newOverrides: FeatureAppearance) => void> | Event dispatched just before appearanceOverrides is modified for one of the reality models. | |
onChanged Readonly | BeEvent<(previousModel: ContextRealityModel, newModel: ContextRealityModel) => void> | Event dispatched when a model is added, deleted, replaced, or updated. | |
onDisplaySettingsChanged Readonly | BeEvent<(model: ContextRealityModel, newSettings: RealityModelDisplaySettings) => void> | Event dispatched just before displaySettings is modified for one of the reality models. | |
onPlanarClipMaskChanged Readonly | BeEvent<(model: ContextRealityModel, newSettings: PlanarClipMaskSettings) => void> | Event dispatched just before planarClipMaskSettings is modified for one of the reality models. |
Defined in
Last Updated: 28 October, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.