-
Notifications
You must be signed in to change notification settings - Fork 208
/
RealityDataAccessProps.ts
50 lines (45 loc) · 2.14 KB
/
RealityDataAccessProps.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module RealityData
*/
import { AccessToken } from "@itwin/core-bentley";
/**
* All of the currently supported Reality Data types
* @beta
*/
export enum DefaultSupportedTypes {
RealityMesh3dTiles = "RealityMesh3DTiles", // Web Ready 3D Scalable Mesh
OPC = "OPC", // Web Ready Orbit Point Cloud
Terrain3dTiles = "Terrain3DTiles", // Web Ready Terrain Scalable Mesh
OMR = "OMR", // Orbit Mapping Resource
Cesium3dTiles = "Cesium3DTiles" // Cesium 3D Tiles
}
/** RealityData
* This class implements a Reality Data stored in the Reality Data API
* Data is accessed directly through methods of the reality data instance.
* Access to the data required a properly entitled token though the access to the blob is controlled through
* an Azure blob URL, the token may be required to obtain this Azure blob URL or refresh it.
* The Azure blob URL is considered valid for an hour and is refreshed after 50 minutes.
* In addition to the reality data properties, and Azure blob URL and internal states, a reality data also contains
* the identification of the iTwin to identify the context(used for access permissions resolution)
* @beta
*/
export interface RealityData {
id?: string;
rootDocument?: string;
type?: string;
getBlobUrl(accessToken: AccessToken, blobPath: string): Promise<URL>;
}
/**
* Client wrapper to Reality Data Service.
* An instance of this class is used to extract reality data from the Reality Data API
* This class implements obtaining a specific reality data and extraction of the Azure blob address.
* @beta
*/
export interface RealityDataAccess {
getRealityData: (accessToken: AccessToken, iTwinId: string | undefined, realityDataId: string) => Promise<RealityData>;
getRealityDataUrl: (iTwinId: string | undefined, realityDataId: string) => Promise<string>;
}