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

see DisplayStyleSettings.contextRealityModels.

Methods

Name Description
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.  
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 undefined The read-only list of reality models.  
onAppearanceOverridesChanged Readonly BeEvent<(model: ContextRealityModel, newOverrides: undefined | FeatureAppearance) => void> Event dispatched just before ContextRealityModel.appearanceOverrides is modified for one of the reality models.  
onChanged Readonly BeEvent<(previousModel: undefined | ContextRealityModel, newModel: undefined | ContextRealityModel) => void> Event dispatched when a model is ContextRealityModels.added, ContextRealityModels.deleted, ContextRealityModels.replaced, or ContextRealityModels.updated.  
onPlanarClipMaskChanged Readonly BeEvent<(model: ContextRealityModel, newSettings: undefined | PlanarClipMaskSettings) => void> Event dispatched just before ContextRealityModel.planarClipMaskSettings is modified for one of the reality models.  

Defined in

Last Updated: 11 June, 2024