/** @packageDocumentation * @module DisplayStyles */ import { BeEvent } from "@bentley/bentleyjs-core"; import { FeatureAppearance, FeatureAppearanceProps } from "./FeatureSymbology"; import { PlanarClipMaskProps, PlanarClipMaskSettings } from "./PlanarClipMask"; import { SpatialClassifierProps, SpatialClassifiers } from "./SpatialClassification"; /** JSON representation of the blob properties for an OrbitGt property cloud. * @alpha */ export interface OrbitGtBlobProps { rdsUrl?: string; containerName: string; blobFileName: string; sasToken: string; accountName: string; } /** Identify the Reality Data service provider * @alpha */ export declare enum RealityDataProvider { /** * This is the legacy mode where the access to the 3d tiles is harcoded in ContextRealityModelProps.tilesetUrl property. * It was use to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles * You should use other mode when possible * @see [[RealityDataSource.createRealityDataSourceKeyFromUrl]] that will try to detect provider from an URL */ TilesetUrl = "TilesetUrl", /** * This is the legacy mode where the access to the 3d tiles is harcoded in ContextRealityModelProps.OrbitGtBlob property. * It was use to support OrbitPointCloud (OPC) from other server than ContextShare * You should use other mode when possible * @see [[RealityDataSource.createRealityDataSourceKeyFromUrl]] that will try to detect provider from an URL */ OrbitGtBlob = "OrbitGtBlob", /** * Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format * This provider support all type of 3dTile storage fomat and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC * @see [[RealityDataFormat]]. */ ContextShare = "ContextShare", /** * Will provide Open Street Map Building (OSM) from Cesium Ion (in 3dTile format) */ CesiumIonAsset = "CesiumIonAsset" } /** Identify the Reality Data storage format * @alpha */ export declare enum RealityDataFormat { /** * 3dTile supported formats; RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles * */ ThreeDTile = "ThreeDTile", /** * Orbit Point Cloud (OPC) storage format (RealityDataType.OPC) */ OPC = "OPC" } /** * Key used by RealityDataConnection to identify RealityDataSource and reality data format * This key identify one and only one reality data on the provider * @alpha */ export interface RealityDataSourceKey { /** * The provider that supplies the access to reality data source for displaying the reality model * @see [[RealityDataProvider]] for default supported value; */ provider: string; /** * The format used by the provider to store the reality data * @see [[RealityDataFormat]] for default supported value; */ format: string; /** The reality data id that identify a reality data for the provider */ id: string; /** The context id that was used when reality data was attached - if none provided, current session iTwinId will be used */ iTwinId?: string; } /** JSON representation of the reality data reference attachment properties. * @alpha */ export interface RealityDataSourceProps { /** The source key that identify a reality data for the provider. */ sourceKey: RealityDataSourceKey; } /** JSON representation of a [[ContextRealityModel]]. * @public */ export interface ContextRealityModelProps { /** * The reality data source key identify the reality data provider and storage format. * It takes precedence over tilesetUrl and orbitGtBlob when present and can be use to actually replace these properties. * @alpha */ rdSourceKey?: RealityDataSourceKey; /** The URL that supplies the 3d tiles for displaying the reality model. */ tilesetUrl: string; /** @see [[ContextRealityModel.orbitGtBlob]]. * @alpha */ orbitGtBlob?: OrbitGtBlobProps; /** @see [[ContextRealityModel.realityDataId]]. */ realityDataId?: string; /** An optional, user-friendly name for the reality model suitable for display in a user interface. */ name?: string; /** An optional, user-friendly description of the reality model suitable for display in a user interface. */ description?: string; /** @see [[ContextRealityModel.classifiers]]. */ classifiers?: SpatialClassifierProps[]; /** @see [[ContextRealityModel.planarClipMask]]. */ planarClipMask?: PlanarClipMaskProps; /** @see [[ContextRealityModel.appearanceOverrides]]. */ appearanceOverrides?: FeatureAppearanceProps; } /** @public */ export declare namespace ContextRealityModelProps { /** Produce a deep copy of `input`. */ function clone(input: ContextRealityModelProps): ContextRealityModelProps; } /** A reality model not associated with a [GeometricModel]($backend) but instead defined in a [DisplayStyle]($backend) or [DisplayStyleState]($frontend). * Such reality models are displayed to provide context to the view and can be freely attached and detached at display time. * @see [this interactive example](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample) * @see [[DisplayStyleSettings.contextRealityModels]] to define context reality models for a display style. * @public */ export declare class ContextRealityModel { protected readonly _props: ContextRealityModelProps; /** * The reality data source key identify the reality data provider and storage format. * @alpha */ readonly rdSourceKey?: RealityDataSourceKey; /** A name suitable for display in a user interface. By default, an empty string. */ readonly name: string; /** The URL that supplies the 3d tiles for displaying the reality model. */ readonly url: string; /** A description of the model suitable for display in a user interface. By default, an empty string. */ readonly description: string; /** An optional identifier that, if present, can be used to elide a request to the reality data service. */ readonly realityDataId?: string; /** A set of [[SpatialClassifier]]s, of which one at any given time can be used to classify the reality model. */ readonly classifiers?: SpatialClassifiers; /** @alpha */ readonly orbitGtBlob?: Readonly; protected _appearanceOverrides?: FeatureAppearance; protected _planarClipMask?: PlanarClipMaskSettings; /** Event dispatched just before assignment to [[planarClipMaskSettings]]. */ readonly onPlanarClipMaskChanged: BeEvent<(newSettings: PlanarClipMaskSettings | undefined, model: ContextRealityModel) => void>; /** Event dispatched just before assignment to [[appearanceOverrides]]. */ readonly onAppearanceOverridesChanged: BeEvent<(newOverrides: FeatureAppearance | undefined, model: ContextRealityModel) => void>; /** Construct a new context reality model. * @param props JSON representation of the reality model, which will be kept in sync with changes made via the ContextRealityModel's methods. */ constructor(props: ContextRealityModelProps); /** Optionally describes how the geometry of the reality model can be masked by other models. */ get planarClipMaskSettings(): PlanarClipMaskSettings | undefined; set planarClipMaskSettings(settings: PlanarClipMaskSettings | undefined); /** Overrides applied to the appearance of the reality model. Only the rgb, transparency, nonLocatable, and emphasized properties are applicable - the rest are ignored. */ get appearanceOverrides(): FeatureAppearance | undefined; set appearanceOverrides(overrides: FeatureAppearance | undefined); /** Convert this model to its JSON representation. */ toJSON(): ContextRealityModelProps; /** Returns true if [[name]] and [[url]] match the specified name and url. */ matchesNameAndUrl(name: string, url: string): boolean; } /** An object that can store the JSON representation of a list of [[ContextRealityModel]]s. * @see [[ContextRealityModels]]. * @see [[DisplayStyleSettingsProps.contextRealityModels]]. * @public */ export interface ContextRealityModelsContainer { /** The list of reality models. */ contextRealityModels?: ContextRealityModelProps[]; } /** A list of [[ContextRealityModel]]s 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](https://www.itwinjs.org/sample-showcase/?group=Viewer&sample=reality-data-sample) * @see [[DisplayStyleSettings.contextRealityModels]]. * @public */ export declare class ContextRealityModels { private readonly _container; private readonly _createModel; private readonly _models; /** Event dispatched just before [[ContextRealityModel.planarClipMaskSettings]] is modified for one of the reality models. */ readonly onPlanarClipMaskChanged: BeEvent<(model: ContextRealityModel, newSettings: PlanarClipMaskSettings | undefined) => void>; /** Event dispatched just before [[ContextRealityModel.appearanceOverrides]] is modified for one of the reality models. */ readonly onAppearanceOverridesChanged: BeEvent<(model: ContextRealityModel, newOverrides: FeatureAppearance | undefined) => void>; /** Event dispatched when a model is [[add]]ed, [[delete]]d, [[replace]]d, or [[update]]d. */ readonly onChanged: BeEvent<(previousModel: ContextRealityModel | undefined, newModel: ContextRealityModel | undefined) => void>; /** Construct a new list of reality models from its JSON representation. THe list will be initialized from `container.classifiers` and that JSON representation * will be kept in sync with changes made to the list. The caller should not directly modify `container.classifiers` or its contents as that will cause the list * to become out of sync with the JSON representation. * @param container The object that holds the JSON representation of the list. * @param createContextRealityModel Optional function used to instantiate ContextRealityModels added to the list. */ constructor(container: ContextRealityModelsContainer, createContextRealityModel?: (props: ContextRealityModelProps) => ContextRealityModel); /** The read-only list of reality models. */ get models(): ReadonlyArray; /** Append a new reality model to the list. * @param The JSON representation of the reality model. * @returns the newly-added reality model. */ add(props: ContextRealityModelProps): ContextRealityModel; /** Remove the specified reality model from the list. * @param model The reality model to remove. * @returns true if the model was removed, or false if the model was not present in the list. */ delete(model: ContextRealityModel): boolean; /** Remove all reality models from the list. */ clear(): void; /** Replace a reality model in the list. * @param toReplace The reality model to be replaced. * @param replaceWith The JSON representation of the replacement reality model. * @returns the newly-created reality model that replaced `toReplace`. * @throws Error if `toReplace` is not present in the list * @note The replacement occupies the same index in the list as `toReplace` did. */ replace(toReplace: ContextRealityModel, replaceWith: ContextRealityModelProps): ContextRealityModel; /** Change selected properties of a reality model. * @param toUpdate The reality model whose properties are to be modified. * @param updateProps The properties to change. * @returns The updated reality model, identical to `toUpdate` except for properties explicitly supplied by `updateProps`. * @throws Error if `toUpdate` is not present in the list. */ update(toUpdate: ContextRealityModel, updateProps: Partial): ContextRealityModel; private createModel; private dropEventListeners; private handlePlanarClipMaskChanged; private handleAppearanceOverridesChanged; } //# sourceMappingURL=ContextRealityModel.d.ts.map