@itwin/core-frontend 3.1.0-dev.23 → 3.1.0-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/lib/cjs/RealityDataSource.d.ts +50 -14
  2. package/lib/cjs/RealityDataSource.d.ts.map +1 -1
  3. package/lib/cjs/RealityDataSource.js +19 -241
  4. package/lib/cjs/RealityDataSource.js.map +1 -1
  5. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
  6. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
  7. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +166 -0
  8. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
  9. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts +83 -0
  10. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts.map +1 -0
  11. package/lib/cjs/RealityDataSourceContextShareImpl.js +234 -0
  12. package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -0
  13. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
  14. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
  15. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +135 -0
  16. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -0
  17. package/lib/cjs/tile/OPCFormatInterpreter.d.ts +21 -0
  18. package/lib/cjs/tile/OPCFormatInterpreter.d.ts.map +1 -0
  19. package/lib/cjs/tile/OPCFormatInterpreter.js +81 -0
  20. package/lib/cjs/tile/OPCFormatInterpreter.js.map +1 -0
  21. package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts +51 -0
  22. package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
  23. package/lib/cjs/tile/ThreeDTileFormatInterpreter.js +160 -0
  24. package/lib/cjs/tile/ThreeDTileFormatInterpreter.js.map +1 -0
  25. package/lib/cjs/tile/internal.d.ts +2 -0
  26. package/lib/cjs/tile/internal.d.ts.map +1 -1
  27. package/lib/cjs/tile/internal.js +2 -0
  28. package/lib/cjs/tile/internal.js.map +1 -1
  29. package/lib/esm/RealityDataSource.d.ts +50 -14
  30. package/lib/esm/RealityDataSource.d.ts.map +1 -1
  31. package/lib/esm/RealityDataSource.js +22 -244
  32. package/lib/esm/RealityDataSource.js.map +1 -1
  33. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
  34. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
  35. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +162 -0
  36. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
  37. package/lib/esm/RealityDataSourceContextShareImpl.d.ts +83 -0
  38. package/lib/esm/RealityDataSourceContextShareImpl.d.ts.map +1 -0
  39. package/lib/esm/RealityDataSourceContextShareImpl.js +230 -0
  40. package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -0
  41. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
  42. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
  43. package/lib/esm/RealityDataSourceTilesetUrlImpl.js +131 -0
  44. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -0
  45. package/lib/esm/tile/OPCFormatInterpreter.d.ts +21 -0
  46. package/lib/esm/tile/OPCFormatInterpreter.d.ts.map +1 -0
  47. package/lib/esm/tile/OPCFormatInterpreter.js +77 -0
  48. package/lib/esm/tile/OPCFormatInterpreter.js.map +1 -0
  49. package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts +51 -0
  50. package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
  51. package/lib/esm/tile/ThreeDTileFormatInterpreter.js +156 -0
  52. package/lib/esm/tile/ThreeDTileFormatInterpreter.js.map +1 -0
  53. package/lib/esm/tile/internal.d.ts +2 -0
  54. package/lib/esm/tile/internal.d.ts.map +1 -1
  55. package/lib/esm/tile/internal.js +2 -0
  56. package/lib/esm/tile/internal.js.map +1 -1
  57. package/package.json +20 -20
@@ -0,0 +1,131 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Tiles
7
+ */
8
+ import { request } from "./request/Request";
9
+ import { assert, BentleyStatus } from "@itwin/core-bentley";
10
+ import { IModelError, RealityDataFormat, RealityDataProvider } from "@itwin/core-common";
11
+ import { ThreeDTileFormatInterpreter } from "./tile/internal";
12
+ /** This class provides access to the reality data provider services.
13
+ * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
14
+ * The key provided at the creation determines if this is ProjectWise Context Share reference.
15
+ * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
16
+ * There is a one to one relationship between a reality data and the instances of present class.
17
+ * @internal
18
+ */
19
+ export class RealityDataSourceTilesetUrlImpl {
20
+ /** Construct a new reality data source.
21
+ * @param props JSON representation of the reality data source
22
+ */
23
+ constructor(props) {
24
+ /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/
25
+ this._baseUrl = "";
26
+ assert(props.sourceKey.provider === RealityDataProvider.TilesetUrl || props.sourceKey.provider === RealityDataProvider.OrbitGtBlob);
27
+ this.key = props.sourceKey;
28
+ this._tilesetUrl = this.key.id;
29
+ }
30
+ /**
31
+ * Create an instance of this class from a source key and iTwin context/
32
+ */
33
+ static async createFromKey(sourceKey, _iTwinId) {
34
+ if (sourceKey.provider !== RealityDataProvider.TilesetUrl)
35
+ return undefined;
36
+ const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });
37
+ return rdSource;
38
+ }
39
+ get isContextShare() {
40
+ return false;
41
+ }
42
+ /**
43
+ * Returns Reality Data if available
44
+ */
45
+ get realityData() {
46
+ return undefined;
47
+ }
48
+ get realityDataId() {
49
+ return undefined;
50
+ }
51
+ /**
52
+ * Returns Reality Data type if available
53
+ */
54
+ get realityDataType() {
55
+ return undefined;
56
+ }
57
+ // This is to set the root url from the provided root document path.
58
+ // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,
59
+ // otherwise the full path to root document is given.
60
+ // The base URL contains the base URL from which tile relative path are constructed.
61
+ // The tile's path root will need to be reinserted for child tiles to return a 200
62
+ setBaseUrl(url) {
63
+ const urlParts = url.split("/");
64
+ urlParts.pop();
65
+ if (urlParts.length === 0)
66
+ this._baseUrl = "";
67
+ else
68
+ this._baseUrl = `${urlParts.join("/")}/`;
69
+ }
70
+ async _doRequest(url, responseType) {
71
+ const options = {
72
+ method: "GET",
73
+ responseType,
74
+ };
75
+ const data = await request(url, options);
76
+ return data.body;
77
+ }
78
+ /**
79
+ * This method returns the URL to access the actual 3d tiles from the service provider.
80
+ * @returns string containing the URL to reality data.
81
+ */
82
+ async getServiceUrl(_iTwinId) {
83
+ return this._tilesetUrl;
84
+ }
85
+ async getRootDocument(iTwinId) {
86
+ const url = await this.getServiceUrl(iTwinId);
87
+ if (!url)
88
+ throw new IModelError(BentleyStatus.ERROR, "Unable to get service url");
89
+ // The following is only if the reality data is not stored on PW Context Share.
90
+ this.setBaseUrl(url);
91
+ return this._doRequest(url, "json");
92
+ }
93
+ /**
94
+ * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
95
+ */
96
+ async getTileContent(name) {
97
+ const tileUrl = this._baseUrl + name;
98
+ return this._doRequest(tileUrl, "arraybuffer");
99
+ }
100
+ /**
101
+ * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.
102
+ */
103
+ async getTileJson(name) {
104
+ const tileUrl = this._baseUrl + name;
105
+ return this._doRequest(tileUrl, "json");
106
+ }
107
+ /**
108
+ * Gets spatial location and extents of this reality data source
109
+ * @returns spatial location and extents
110
+ * @internal
111
+ */
112
+ async getSpatialLocationAndExtents() {
113
+ let spatialLocation;
114
+ if (this.key.format === RealityDataFormat.ThreeDTile) {
115
+ const rootDocument = await this.getRootDocument(undefined);
116
+ spatialLocation = ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);
117
+ }
118
+ return spatialLocation;
119
+ }
120
+ /**
121
+ * Gets information to identify the product and engine that create this reality data
122
+ * Will return undefined if cannot be resolved
123
+ * @returns information to identify the product and engine that create this reality data
124
+ * @alpha
125
+ */
126
+ async getPublisherProductInfo() {
127
+ let publisherInfo;
128
+ return publisherInfo;
129
+ }
130
+ }
131
+ //# sourceMappingURL=RealityDataSourceTilesetUrlImpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RealityDataSourceTilesetUrlImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUrlImpl.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAkB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAc,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAe,iBAAiB,EAAE,mBAAmB,EAAgD,MAAM,oBAAoB,CAAC;AAGpJ,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;;;;;EAME;AACF,MAAM,OAAO,+BAA+B;IAO1C;;OAEG;IACH,YAAsB,KAA6B;QANnD,sIAAsI;QAC9H,aAAQ,GAAW,EAAE,CAAC;QAM5B,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,mBAAmB,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACpI,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACj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B,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAA+B;QAC1D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;QAE1E,+EAA+E;QAC/E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,cAAc,CAAC,IAAY;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,IAAY;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B;QACvC,IAAI,eAAsD,CAAC;QAC3D,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,iBAAiB,CAAC,UAAU,EAAE;YACpD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YAC3D,eAAe,GAAG,2BAA2B,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;SAC1F;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { request, RequestOptions } from \"./request/Request\";\r\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\r\nimport { IModelError, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\n\r\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\r\nimport { ThreeDTileFormatInterpreter } from \"./tile/internal\";\r\n\r\n/** This class provides access to the reality data provider services.\r\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\r\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\r\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n* @internal\r\n*/\r\nexport class RealityDataSourceTilesetUrlImpl implements RealityDataSource {\r\n public readonly key: RealityDataSourceKey;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n private _tilesetUrl: string | undefined;\r\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\r\n private _baseUrl: string = \"\";\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n protected constructor(props: RealityDataSourceProps) {\r\n assert(props.sourceKey.provider === RealityDataProvider.TilesetUrl || props.sourceKey.provider === RealityDataProvider.OrbitGtBlob);\r\n this.key = props.sourceKey;\r\n this._tilesetUrl = this.key.id;\r\n }\r\n\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n */\r\n public static async createFromKey(sourceKey: RealityDataSourceKey, _iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n if (sourceKey.provider !== RealityDataProvider.TilesetUrl)\r\n return undefined;\r\n const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });\r\n return rdSource;\r\n }\r\n\r\n public get isContextShare(): boolean {\r\n return false;\r\n }\r\n /**\r\n * Returns Reality Data if available\r\n */\r\n public get realityData(): RealityData | undefined {\r\n return undefined;\r\n }\r\n public get realityDataId(): string | undefined {\r\n return undefined;\r\n }\r\n /**\r\n * Returns Reality Data type if available\r\n */\r\n public get realityDataType(): string | undefined {\r\n return undefined;\r\n }\r\n\r\n // This is to set the root url from the provided root document path.\r\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\r\n // otherwise the full path to root document is given.\r\n // The base URL contains the base URL from which tile relative path are constructed.\r\n // The tile's path root will need to be reinserted for child tiles to return a 200\r\n private setBaseUrl(url: string): void {\r\n const urlParts = url.split(\"/\");\r\n urlParts.pop();\r\n if (urlParts.length === 0)\r\n this._baseUrl = \"\";\r\n else\r\n this._baseUrl = `${urlParts.join(\"/\")}/`;\r\n }\r\n private async _doRequest(url: string, responseType: string): Promise<any> {\r\n const options: RequestOptions = {\r\n method: \"GET\",\r\n responseType,\r\n };\r\n\r\n const data = await request(url, options);\r\n return data.body;\r\n }\r\n\r\n /**\r\n * This method returns the URL to access the actual 3d tiles from the service provider.\r\n * @returns string containing the URL to reality data.\r\n */\r\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\r\n return this._tilesetUrl;\r\n }\r\n\r\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\r\n const url = await this.getServiceUrl(iTwinId);\r\n if (!url)\r\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n this.setBaseUrl(url);\r\n return this._doRequest(url, \"json\");\r\n }\r\n\r\n /**\r\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileContent(name: string): Promise<any> {\r\n const tileUrl = this._baseUrl + name;\r\n\r\n return this._doRequest(tileUrl, \"arraybuffer\");\r\n }\r\n\r\n /**\r\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileJson(name: string): Promise<any> {\r\n const tileUrl = this._baseUrl + name;\r\n\r\n return this._doRequest(tileUrl, \"json\");\r\n }\r\n\r\n /**\r\n * Gets spatial location and extents of this reality data source\r\n * @returns spatial location and extents\r\n * @internal\r\n */\r\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\r\n let spatialLocation: SpatialLocationAndExtents | undefined;\r\n if (this.key.format === RealityDataFormat.ThreeDTile) {\r\n const rootDocument = await this.getRootDocument(undefined);\r\n spatialLocation = ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);\r\n }\r\n return spatialLocation;\r\n }\r\n /**\r\n * Gets information to identify the product and engine that create this reality data\r\n * Will return undefined if cannot be resolved\r\n * @returns information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\r\n let publisherInfo: PublisherProductInfo | undefined;\r\n return publisherInfo;\r\n }\r\n}\r\n\r\n"]}
@@ -0,0 +1,21 @@
1
+ import { PointCloudReader } from "@itwin/core-orbitgt";
2
+ import { SpatialLocationAndExtents } from "../RealityDataSource";
3
+ /**
4
+ * This class provide methods used to interpret Orbit Point Cloud (OPC) format
5
+ * @internal
6
+ */
7
+ export declare class OPCFormatInterpreter {
8
+ /** Gets an OPC file reader from a blobFileUrl
9
+ * @param blobFileURL the name of the file.
10
+ * @returns return a file reader open to read provided blob file
11
+ * @internal
12
+ */
13
+ static getFileReaderFromBlobFileURL(blobFileURL: string): Promise<PointCloudReader>;
14
+ /** Gets reality data spatial location and extents
15
+ * @param fileReader a file reader instance obtains from call to getFileReaderFromBlobFileURL
16
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
17
+ * @internal
18
+ */
19
+ static getSpatialLocationAndExtents(fileReader: PointCloudReader): Promise<SpatialLocationAndExtents>;
20
+ }
21
+ //# sourceMappingURL=OPCFormatInterpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OPCFormatInterpreter.d.ts","sourceRoot":"","sources":["../../../src/tile/OPCFormatInterpreter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyF,gBAAgB,EAAS,MAAM,qBAAqB,CAAC;AAIrJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAIjE;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B;;;;OAIG;WACiB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAiBhG;;;;OAIG;WACiB,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAmCnH"}
@@ -0,0 +1,77 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { Cartographic, EcefLocation } from "@itwin/core-common";
6
+ import { Range3d } from "@itwin/core-geometry";
7
+ import { CRSManager, Downloader, OnlineEngine, OPCReader, OrbitGtBounds, PageCachedFile, UrlFS } from "@itwin/core-orbitgt";
8
+ import { FrontendLoggerCategory } from "../FrontendLoggerCategory";
9
+ import { DownloaderNode } from "@itwin/core-orbitgt/lib/cjs/system/runtime/DownloaderNode";
10
+ import { Logger } from "@itwin/core-bentley";
11
+ const loggerCategory = FrontendLoggerCategory.RealityData;
12
+ /**
13
+ * This class provide methods used to interpret Orbit Point Cloud (OPC) format
14
+ * @internal
15
+ */
16
+ export class OPCFormatInterpreter {
17
+ /** Gets an OPC file reader from a blobFileUrl
18
+ * @param blobFileURL the name of the file.
19
+ * @returns return a file reader open to read provided blob file
20
+ * @internal
21
+ */
22
+ static async getFileReaderFromBlobFileURL(blobFileURL) {
23
+ if (Downloader.INSTANCE == null)
24
+ Downloader.INSTANCE = new DownloaderNode();
25
+ if (CRSManager.ENGINE == null)
26
+ CRSManager.ENGINE = await OnlineEngine.create();
27
+ // let blobFileURL: string = rdUrl;
28
+ // if (accountName.length > 0) blobFileURL = UrlFS.getAzureBlobSasUrl(opcConfig.accountName, opcConfig.containerName, opcConfig.blobFileName, opcConfig.sasToken);
29
+ const urlFS = new UrlFS();
30
+ // wrap a caching layer (16 MB) around the blob file
31
+ const blobFileSize = await urlFS.getFileLength(blobFileURL);
32
+ Logger.logTrace(loggerCategory, `OPC File Size is ${blobFileSize}`);
33
+ const blobFile = new PageCachedFile(urlFS, blobFileURL, blobFileSize, 128 * 1024 /* pageSize */, 128 /* maxPageCount */);
34
+ const fileReader = await OPCReader.openFile(blobFile, blobFileURL, true /* lazyLoading */);
35
+ return fileReader;
36
+ }
37
+ /** Gets reality data spatial location and extents
38
+ * @param fileReader a file reader instance obtains from call to getFileReaderFromBlobFileURL
39
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
40
+ * @internal
41
+ */
42
+ static async getSpatialLocationAndExtents(fileReader) {
43
+ let worldRange = new Range3d();
44
+ let location;
45
+ let isGeolocated = true;
46
+ const bounds = fileReader.getFileBounds();
47
+ worldRange = Range3d.createXYZXYZ(bounds.getMinX(), bounds.getMinY(), bounds.getMinZ(), bounds.getMaxX(), bounds.getMaxY(), bounds.getMaxZ());
48
+ isGeolocated = false;
49
+ const fileCrs = fileReader.getFileCRS();
50
+ if (fileCrs) {
51
+ await CRSManager.ENGINE.prepareForArea(fileCrs, bounds);
52
+ const wgs84ECEFCrs = "4978";
53
+ await CRSManager.ENGINE.prepareForArea(wgs84ECEFCrs, new OrbitGtBounds());
54
+ const ecefBounds = CRSManager.transformBounds(bounds, fileCrs, wgs84ECEFCrs);
55
+ const ecefRange = Range3d.createXYZXYZ(ecefBounds.getMinX(), ecefBounds.getMinY(), ecefBounds.getMinZ(), ecefBounds.getMaxX(), ecefBounds.getMaxY(), ecefBounds.getMaxZ());
56
+ const ecefCenter = ecefRange.localXYZToWorld(.5, .5, .5);
57
+ const cartoCenter = Cartographic.fromEcef(ecefCenter);
58
+ cartoCenter.height = 0;
59
+ const ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter);
60
+ location = ecefLocation;
61
+ // this.iModelDb.setEcefLocation(ecefLocation);
62
+ const ecefToWorld = ecefLocation.getTransform().inverse();
63
+ worldRange = ecefToWorld.multiplyRange(ecefRange);
64
+ isGeolocated = true;
65
+ }
66
+ else {
67
+ // NoGCS case
68
+ isGeolocated = false;
69
+ const centerOfEarth = new EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });
70
+ location = centerOfEarth;
71
+ Logger.logTrace(loggerCategory, "OPC RealityData NOT Geolocated", () => ({ ...location }));
72
+ }
73
+ const spatialLocation = { location, worldRange, isGeolocated };
74
+ return spatialLocation;
75
+ }
76
+ }
77
+ //# sourceMappingURL=OPCFormatInterpreter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OPCFormatInterpreter.js","sourceRoot":"","sources":["../../../src/tile/OPCFormatInterpreter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAS,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAoB,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACrJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2DAA2D,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,cAAc,GAAW,sBAAsB,CAAC,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;;;OAIG;IACI,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,WAAm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AAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YACjI,QAAQ,GAAG,aAAa,CAAC;YACzB,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,gCAAgC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC;SAC5F;QACD,MAAM,eAAe,GAA8B,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;QAC1F,OAAO,eAAe,CAAC;IACzB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Cartographic, EcefLocation } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { ALong, CRSManager, Downloader, OnlineEngine, OPCReader, OrbitGtBounds, PageCachedFile, PointCloudReader, UrlFS } from \"@itwin/core-orbitgt\";\r\nimport { FrontendLoggerCategory } from \"../FrontendLoggerCategory\";\r\nimport { DownloaderNode } from \"@itwin/core-orbitgt/lib/cjs/system/runtime/DownloaderNode\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { SpatialLocationAndExtents } from \"../RealityDataSource\";\r\n\r\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\r\n\r\n/**\r\n * This class provide methods used to interpret Orbit Point Cloud (OPC) format\r\n * @internal\r\n */\r\nexport class OPCFormatInterpreter {\r\n /** Gets an OPC file reader from a blobFileUrl\r\n * @param blobFileURL the name of the file.\r\n * @returns return a file reader open to read provided blob file\r\n * @internal\r\n */\r\n public static async getFileReaderFromBlobFileURL(blobFileURL: string): Promise<PointCloudReader> {\r\n if (Downloader.INSTANCE == null)\r\n Downloader.INSTANCE = new DownloaderNode();\r\n if (CRSManager.ENGINE == null)\r\n CRSManager.ENGINE = await OnlineEngine.create();\r\n\r\n // let blobFileURL: string = rdUrl;\r\n // if (accountName.length > 0) blobFileURL = UrlFS.getAzureBlobSasUrl(opcConfig.accountName, opcConfig.containerName, opcConfig.blobFileName, opcConfig.sasToken);\r\n const urlFS: UrlFS = new UrlFS();\r\n // wrap a caching layer (16 MB) around the blob file\r\n const blobFileSize: ALong = await urlFS.getFileLength(blobFileURL);\r\n Logger.logTrace(loggerCategory, `OPC File Size is ${blobFileSize}`);\r\n const blobFile: PageCachedFile = new PageCachedFile(urlFS, blobFileURL, blobFileSize, 128 * 1024 /* pageSize */, 128 /* maxPageCount */);\r\n const fileReader: PointCloudReader = await OPCReader.openFile(blobFile, blobFileURL, true/* lazyLoading */);\r\n return fileReader;\r\n }\r\n\r\n /** Gets reality data spatial location and extents\r\n * @param fileReader a file reader instance obtains from call to getFileReaderFromBlobFileURL\r\n * @returns spatial location and volume of interest, in meters, centered around `spatial location`\r\n * @internal\r\n */\r\n public static async getSpatialLocationAndExtents(fileReader: PointCloudReader): Promise<SpatialLocationAndExtents> {\r\n let worldRange = new Range3d();\r\n let location: Cartographic | EcefLocation;\r\n let isGeolocated = true;\r\n\r\n const bounds = fileReader.getFileBounds();\r\n worldRange = Range3d.createXYZXYZ(bounds.getMinX(), bounds.getMinY(), bounds.getMinZ(), bounds.getMaxX(), bounds.getMaxY(), bounds.getMaxZ());\r\n isGeolocated = false;\r\n const fileCrs = fileReader.getFileCRS();\r\n if (fileCrs) {\r\n await CRSManager.ENGINE.prepareForArea(fileCrs, bounds);\r\n const wgs84ECEFCrs = \"4978\";\r\n await CRSManager.ENGINE.prepareForArea(wgs84ECEFCrs, new OrbitGtBounds());\r\n\r\n const ecefBounds = CRSManager.transformBounds(bounds, fileCrs, wgs84ECEFCrs);\r\n const ecefRange = Range3d.createXYZXYZ(ecefBounds.getMinX(), ecefBounds.getMinY(), ecefBounds.getMinZ(), ecefBounds.getMaxX(), ecefBounds.getMaxY(), ecefBounds.getMaxZ());\r\n const ecefCenter = ecefRange.localXYZToWorld(.5, .5, .5)!;\r\n const cartoCenter = Cartographic.fromEcef(ecefCenter)!;\r\n cartoCenter.height = 0;\r\n const ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter);\r\n location = ecefLocation;\r\n // this.iModelDb.setEcefLocation(ecefLocation);\r\n const ecefToWorld = ecefLocation.getTransform().inverse()!;\r\n worldRange = ecefToWorld.multiplyRange(ecefRange);\r\n isGeolocated = true;\r\n } else {\r\n // NoGCS case\r\n isGeolocated = false;\r\n const centerOfEarth = new EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });\r\n location = centerOfEarth;\r\n Logger.logTrace(loggerCategory, \"OPC RealityData NOT Geolocated\", () => ({ ...location }));\r\n }\r\n const spatialLocation: SpatialLocationAndExtents = { location, worldRange, isGeolocated };\r\n return spatialLocation;\r\n }\r\n}\r\n\r\n"]}
@@ -0,0 +1,51 @@
1
+ import { Range3d, Transform } from "@itwin/core-geometry";
2
+ import { PublisherProductInfo, SpatialLocationAndExtents } from "../RealityDataSource";
3
+ /** This interface provides information about 3dTile files for this reality data
4
+ * Currently only used for debbugging
5
+ * @internal
6
+ */
7
+ export interface ThreeDTileFileInfo {
8
+ /** the number of children at the root of this reality data */
9
+ rootChildren?: number;
10
+ }
11
+ /**
12
+ * This class provide methods used to interpret Cesium 3dTile format
13
+ * @internal
14
+ */
15
+ export declare class ThreeDTileFormatInterpreter {
16
+ /** Gets reality data spatial location and extents
17
+ * @param json root document file in json format
18
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
19
+ * @internal
20
+ */
21
+ static getSpatialLocationAndExtents(json: any): SpatialLocationAndExtents;
22
+ /** Gets information to identify the product and engine that create this reality data
23
+ * Will return undefined if cannot be resolved
24
+ * @param rootDocjson root document file in json format
25
+ * @returns information to identify the product and engine that create this reality data
26
+ * @alpha
27
+ */
28
+ static getPublisherProductInfo(rootDocjson: any): PublisherProductInfo;
29
+ /** Gets information about 3dTile file for this reality data
30
+ * Will return undefined if cannot be resolved
31
+ * @param rootDocjson root document file in json format
32
+ * @returns information about 3dTile file for this reality data
33
+ * @internal
34
+ */
35
+ static getFileInfo(rootDocjson: any): ThreeDTileFileInfo;
36
+ /** Convert a boundingVolume into a range
37
+ * @param boundingVolume the bounding volume to convert
38
+ * @returns the range or undefined if cannot convert
39
+ * @internal
40
+ */
41
+ static rangeFromBoundingVolume(boundingVolume: any): Range3d | undefined;
42
+ /** Convert a boundingVolume into a range
43
+ * @internal
44
+ */
45
+ static maximumSizeFromGeometricTolerance(range: Range3d, geometricError: number): number;
46
+ /** Convert a boundingVolume into a range
47
+ * @internal
48
+ */
49
+ static transformFromJson(jTrans: number[] | undefined): Transform | undefined;
50
+ }
51
+ //# sourceMappingURL=ThreeDTileFormatInterpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreeDTileFormatInterpreter.d.ts","sourceRoot":"","sources":["../../../src/tile/ThreeDTileFormatInterpreter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAqB,OAAO,EAAE,SAAS,EAAgC,MAAM,sBAAsB,CAAC;AAE3G,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGvF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD;;;GAGG;AACH,qBAAa,2BAA2B;IACtC;;;;OAIG;WACW,4BAA4B,CAAC,IAAI,EAAE,GAAG,GAAG,yBAAyB;IA+DhF;;;;;OAKG;WACW,uBAAuB,CAAC,WAAW,EAAE,GAAG,GAAG,oBAAoB;IAW7E;;;;;OAKG;WACW,WAAW,CAAC,WAAW,EAAE,GAAG,GAAG,kBAAkB;IAM/D;;;;OAIG;WACW,uBAAuB,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS;IA0B/E;;OAEG;WACW,iCAAiC,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAI/F;;OAEG;WACW,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS;CAGrF"}
@@ -0,0 +1,156 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { JsonUtils, Logger } from "@itwin/core-bentley";
6
+ import { Cartographic, EcefLocation } from "@itwin/core-common";
7
+ import { Matrix3d, Point3d, Range3d, Transform, Vector3d, YawPitchRollAngles } from "@itwin/core-geometry";
8
+ import { FrontendLoggerCategory } from "../FrontendLoggerCategory";
9
+ const loggerCategory = FrontendLoggerCategory.RealityData;
10
+ /**
11
+ * This class provide methods used to interpret Cesium 3dTile format
12
+ * @internal
13
+ */
14
+ export class ThreeDTileFormatInterpreter {
15
+ /** Gets reality data spatial location and extents
16
+ * @param json root document file in json format
17
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
18
+ * @internal
19
+ */
20
+ static getSpatialLocationAndExtents(json) {
21
+ const worldRange = new Range3d();
22
+ let isGeolocated = true;
23
+ let location;
24
+ Logger.logTrace(loggerCategory, "RealityData realityModelFromJson");
25
+ if (undefined !== json.root.boundingVolume.region) {
26
+ const region = JsonUtils.asArray(json.root.boundingVolume.region);
27
+ Logger.logTrace(loggerCategory, "RealityData json.root.boundingVolume.region", () => ({ ...region }));
28
+ if (undefined === region) {
29
+ Logger.logError(loggerCategory, `Error realityModelFromJson - region undefined`);
30
+ throw new TypeError("Unable to determine GeoLocation - no root Transform or Region on root.");
31
+ }
32
+ const ecefLow = (Cartographic.fromRadians({ longitude: region[0], latitude: region[1], height: region[4] })).toEcef();
33
+ const ecefHigh = (Cartographic.fromRadians({ longitude: region[2], latitude: region[3], height: region[5] })).toEcef();
34
+ const ecefRange = Range3d.create(ecefLow, ecefHigh);
35
+ const cartoCenter = Cartographic.fromRadians({ longitude: (region[0] + region[2]) / 2.0, latitude: (region[1] + region[3]) / 2.0, height: (region[4] + region[5]) / 2.0 });
36
+ location = cartoCenter;
37
+ const ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter);
38
+ // iModelDb.setEcefLocation(ecefLocation);
39
+ const ecefToWorld = ecefLocation.getTransform().inverse();
40
+ worldRange.extendRange(Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));
41
+ }
42
+ else {
43
+ let worldToEcefTransform = ThreeDTileFormatInterpreter.transformFromJson(json.root.transform);
44
+ Logger.logTrace(loggerCategory, "RealityData json.root.transform", () => ({ ...worldToEcefTransform }));
45
+ const range = ThreeDTileFormatInterpreter.rangeFromBoundingVolume(json.root.boundingVolume);
46
+ if (undefined === worldToEcefTransform)
47
+ worldToEcefTransform = Transform.createIdentity();
48
+ const ecefRange = worldToEcefTransform.multiplyRange(range); // range in model -> range in ecef
49
+ const ecefCenter = worldToEcefTransform.multiplyPoint3d(range.center); // range center in model -> range center in ecef
50
+ const cartoCenter = Cartographic.fromEcef(ecefCenter); // ecef center to cartographic center
51
+ const isNotNearEarthSurface = cartoCenter && (cartoCenter.height < -5000); // 5 km under ground!
52
+ const earthCenterToRangeCenterRayLenght = range.center.magnitude();
53
+ if (worldToEcefTransform.matrix.isIdentity && (earthCenterToRangeCenterRayLenght < 1.0E5 || isNotNearEarthSurface)) {
54
+ isGeolocated = false;
55
+ worldRange.extendRange(Range3d.fromJSON(ecefRange));
56
+ const centerOfEarth = new EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });
57
+ location = centerOfEarth;
58
+ Logger.logTrace(loggerCategory, "RealityData NOT Geolocated", () => ({ ...location }));
59
+ }
60
+ else {
61
+ let ecefLocation;
62
+ const locationOrientation = YawPitchRollAngles.tryFromTransform(worldToEcefTransform);
63
+ // Fix Bug 445630: [RDV][Regression] Orientation of georeferenced Reality Mesh is wrong.
64
+ // Use json.root.transform only if defined and not identity -> otherwise will use a transform computed from cartographic center.
65
+ if (!worldToEcefTransform.matrix.isIdentity && locationOrientation !== undefined && locationOrientation.angles !== undefined)
66
+ ecefLocation = new EcefLocation({ origin: locationOrientation.origin, orientation: locationOrientation.angles.toJSON() });
67
+ else
68
+ ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter);
69
+ location = ecefLocation;
70
+ Logger.logTrace(loggerCategory, "RealityData is worldToEcefTransform.matrix.isIdentity", () => ({ isIdentity: worldToEcefTransform.matrix.isIdentity }));
71
+ // iModelDb.setEcefLocation(ecefLocation);
72
+ const ecefToWorld = ecefLocation.getTransform().inverse();
73
+ worldRange.extendRange(Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));
74
+ Logger.logTrace(loggerCategory, "RealityData ecefToWorld", () => ({ ...ecefToWorld }));
75
+ }
76
+ }
77
+ const spatialLocation = { location, worldRange, isGeolocated };
78
+ return spatialLocation;
79
+ }
80
+ /** Gets information to identify the product and engine that create this reality data
81
+ * Will return undefined if cannot be resolved
82
+ * @param rootDocjson root document file in json format
83
+ * @returns information to identify the product and engine that create this reality data
84
+ * @alpha
85
+ */
86
+ static getPublisherProductInfo(rootDocjson) {
87
+ const info = { product: "", engine: "", version: "" };
88
+ if (rootDocjson && rootDocjson.root) {
89
+ if (rootDocjson.root.SMPublisherInfo) {
90
+ info.product = rootDocjson.root.SMPublisherInfo.Product ? rootDocjson.root.SMPublisherInfo.Product : "";
91
+ info.engine = rootDocjson.root.SMPublisherInfo.Publisher ? rootDocjson.root.SMPublisherInfo.Publisher : "";
92
+ info.version = rootDocjson.root.SMPublisherInfo["Publisher Version"] ? rootDocjson.root.SMPublisherInfo["Publisher Version"] : "";
93
+ }
94
+ }
95
+ return info;
96
+ }
97
+ /** Gets information about 3dTile file for this reality data
98
+ * Will return undefined if cannot be resolved
99
+ * @param rootDocjson root document file in json format
100
+ * @returns information about 3dTile file for this reality data
101
+ * @internal
102
+ */
103
+ static getFileInfo(rootDocjson) {
104
+ var _a, _b, _c;
105
+ const info = {
106
+ rootChildren: (_c = (_b = (_a = rootDocjson === null || rootDocjson === void 0 ? void 0 : rootDocjson.root) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0,
107
+ };
108
+ return info;
109
+ }
110
+ /** Convert a boundingVolume into a range
111
+ * @param boundingVolume the bounding volume to convert
112
+ * @returns the range or undefined if cannot convert
113
+ * @internal
114
+ */
115
+ static rangeFromBoundingVolume(boundingVolume) {
116
+ if (undefined === boundingVolume)
117
+ return undefined;
118
+ if (Array.isArray(boundingVolume.box)) {
119
+ const box = boundingVolume.box;
120
+ const center = Point3d.create(box[0], box[1], box[2]);
121
+ const ux = Vector3d.create(box[3], box[4], box[5]);
122
+ const uy = Vector3d.create(box[6], box[7], box[8]);
123
+ const uz = Vector3d.create(box[9], box[10], box[11]);
124
+ const corners = [];
125
+ for (let j = 0; j < 2; j++) {
126
+ for (let k = 0; k < 2; k++) {
127
+ for (let l = 0; l < 2; l++) {
128
+ corners.push(center.plus3Scaled(ux, (j ? -1.0 : 1.0), uy, (k ? -1.0 : 1.0), uz, (l ? -1.0 : 1.0)));
129
+ }
130
+ }
131
+ }
132
+ return Range3d.createArray(corners);
133
+ }
134
+ else if (Array.isArray(boundingVolume.sphere)) {
135
+ const sphere = boundingVolume.sphere;
136
+ const center = Point3d.create(sphere[0], sphere[1], sphere[2]);
137
+ const radius = sphere[3];
138
+ return Range3d.createXYZXYZ(center.x - radius, center.y - radius, center.z - radius, center.x + radius, center.y + radius, center.z + radius);
139
+ }
140
+ return undefined;
141
+ }
142
+ /** Convert a boundingVolume into a range
143
+ * @internal
144
+ */
145
+ static maximumSizeFromGeometricTolerance(range, geometricError) {
146
+ const minToleranceRatio = .5; // Nominally the error on screen size of a tile. Increasing generally increases performance (fewer draw calls) at expense of higher load times.
147
+ return minToleranceRatio * range.diagonal().magnitude() / geometricError;
148
+ }
149
+ /** Convert a boundingVolume into a range
150
+ * @internal
151
+ */
152
+ static transformFromJson(jTrans) {
153
+ return (jTrans === undefined) ? undefined : Transform.createOriginAndMatrix(Point3d.create(jTrans[12], jTrans[13], jTrans[14]), Matrix3d.createRowValues(jTrans[0], jTrans[4], jTrans[8], jTrans[1], jTrans[5], jTrans[9], jTrans[2], jTrans[6], jTrans[10]));
154
+ }
155
+ }
156
+ //# sourceMappingURL=ThreeDTileFormatInterpreter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreeDTileFormatInterpreter.js","sourceRoot":"","sources":["../../../src/tile/ThreeDTileFormatInterpreter.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,cAAc,GAAW,sBAAsB,CAAC,WAAW,CAAC;AASlE;;;GAGG;AACH,MAAM,OAAO,2BAA2B;IACtC;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAS;QAClD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAE,CAAC;QACjC,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,IAAI,QAAqC,CAAC;QAC1C,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,kCAAkC,CAAC,CAAC;QAEpE,IAAI,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAA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ACI,MAAM,CAAC,iCAAiC,CAAC,KAAc,EAAE,cAAsB;QACpF,MAAM,iBAAiB,GAAG,EAAE,CAAC,CAAG,gJAAgJ;QAChL,OAAO,iBAAiB,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,GAAG,cAAc,CAAC;IAC3E,CAAC;IACD;;OAEG;IACI,MAAM,CAAC,iBAAiB,CAAC,MAA4B;QAC1D,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAChQ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { JsonUtils, Logger } from \"@itwin/core-bentley\";\r\nimport { Cartographic, EcefLocation } from \"@itwin/core-common\";\r\nimport { Matrix3d, Point3d, Range3d, Transform, Vector3d, YawPitchRollAngles } from \"@itwin/core-geometry\";\r\nimport { FrontendLoggerCategory } from \"../FrontendLoggerCategory\";\r\nimport { PublisherProductInfo, SpatialLocationAndExtents } from \"../RealityDataSource\";\r\n\r\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\r\n/** This interface provides information about 3dTile files for this reality data\r\n * Currently only used for debbugging\r\n * @internal\r\n */\r\nexport interface ThreeDTileFileInfo {\r\n /** the number of children at the root of this reality data */\r\n rootChildren?: number;\r\n}\r\n/**\r\n * This class provide methods used to interpret Cesium 3dTile format\r\n * @internal\r\n */\r\nexport class ThreeDTileFormatInterpreter {\r\n /** Gets reality data spatial location and extents\r\n * @param json root document file in json format\r\n * @returns spatial location and volume of interest, in meters, centered around `spatial location`\r\n * @internal\r\n */\r\n public static getSpatialLocationAndExtents(json: any): SpatialLocationAndExtents {\r\n const worldRange = new Range3d();\r\n let isGeolocated = true;\r\n let location: Cartographic | EcefLocation;\r\n Logger.logTrace(loggerCategory, \"RealityData realityModelFromJson\");\r\n\r\n if (undefined !== json.root.boundingVolume.region) {\r\n const region = JsonUtils.asArray(json.root.boundingVolume.region);\r\n\r\n Logger.logTrace(loggerCategory, \"RealityData json.root.boundingVolume.region\", () => ({ ...region }));\r\n if (undefined === region) {\r\n Logger.logError(loggerCategory, `Error realityModelFromJson - region undefined`);\r\n throw new TypeError(\"Unable to determine GeoLocation - no root Transform or Region on root.\");\r\n }\r\n const ecefLow = (Cartographic.fromRadians({ longitude: region[0], latitude: region[1], height: region[4] })).toEcef();\r\n const ecefHigh = (Cartographic.fromRadians({ longitude: region[2], latitude: region[3], height: region[5] })).toEcef();\r\n const ecefRange = Range3d.create(ecefLow, ecefHigh);\r\n const cartoCenter = Cartographic.fromRadians({ longitude: (region[0] + region[2]) / 2.0, latitude: (region[1] + region[3]) / 2.0, height: (region[4] + region[5]) / 2.0 });\r\n location = cartoCenter;\r\n const ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter);\r\n // iModelDb.setEcefLocation(ecefLocation);\r\n const ecefToWorld = ecefLocation.getTransform().inverse()!;\r\n worldRange.extendRange(Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));\r\n } else {\r\n let worldToEcefTransform = ThreeDTileFormatInterpreter.transformFromJson(json.root.transform);\r\n\r\n Logger.logTrace(loggerCategory, \"RealityData json.root.transform\", () => ({ ...worldToEcefTransform }));\r\n const range = ThreeDTileFormatInterpreter.rangeFromBoundingVolume(json.root.boundingVolume)!;\r\n if (undefined === worldToEcefTransform)\r\n worldToEcefTransform = Transform.createIdentity();\r\n\r\n const ecefRange = worldToEcefTransform.multiplyRange(range); // range in model -> range in ecef\r\n const ecefCenter = worldToEcefTransform.multiplyPoint3d(range.center); // range center in model -> range center in ecef\r\n const cartoCenter = Cartographic.fromEcef(ecefCenter); // ecef center to cartographic center\r\n const isNotNearEarthSurface = cartoCenter && (cartoCenter.height < -5000); // 5 km under ground!\r\n const earthCenterToRangeCenterRayLenght = range.center.magnitude();\r\n\r\n if (worldToEcefTransform.matrix.isIdentity && (earthCenterToRangeCenterRayLenght < 1.0E5 || isNotNearEarthSurface)) {\r\n isGeolocated = false;\r\n worldRange.extendRange(Range3d.fromJSON(ecefRange));\r\n const centerOfEarth = new EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });\r\n location = centerOfEarth;\r\n Logger.logTrace(loggerCategory, \"RealityData NOT Geolocated\", () => ({ ...location }));\r\n } else {\r\n let ecefLocation: EcefLocation;\r\n const locationOrientation = YawPitchRollAngles.tryFromTransform(worldToEcefTransform);\r\n // Fix Bug 445630: [RDV][Regression] Orientation of georeferenced Reality Mesh is wrong.\r\n // Use json.root.transform only if defined and not identity -> otherwise will use a transform computed from cartographic center.\r\n if (!worldToEcefTransform.matrix.isIdentity && locationOrientation !== undefined && locationOrientation.angles !== undefined)\r\n ecefLocation = new EcefLocation({ origin: locationOrientation.origin, orientation: locationOrientation.angles.toJSON() });\r\n else\r\n ecefLocation = EcefLocation.createFromCartographicOrigin(cartoCenter!);\r\n location = ecefLocation;\r\n Logger.logTrace(loggerCategory, \"RealityData is worldToEcefTransform.matrix.isIdentity\", () => ({ isIdentity: worldToEcefTransform!.matrix.isIdentity }));\r\n // iModelDb.setEcefLocation(ecefLocation);\r\n const ecefToWorld = ecefLocation.getTransform().inverse()!;\r\n worldRange.extendRange(Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));\r\n Logger.logTrace(loggerCategory, \"RealityData ecefToWorld\", () => ({ ...ecefToWorld }));\r\n }\r\n }\r\n const spatialLocation: SpatialLocationAndExtents = { location, worldRange, isGeolocated };\r\n return spatialLocation;\r\n }\r\n /** Gets information to identify the product and engine that create this reality data\r\n * Will return undefined if cannot be resolved\r\n * @param rootDocjson root document file in json format\r\n * @returns information to identify the product and engine that create this reality data\r\n * @alpha\r\n */\r\n public static getPublisherProductInfo(rootDocjson: any): PublisherProductInfo {\r\n const info: PublisherProductInfo = {product: \"\", engine: \"\", version: \"\"};\r\n if (rootDocjson && rootDocjson.root) {\r\n if (rootDocjson.root.SMPublisherInfo) {\r\n info.product = rootDocjson.root.SMPublisherInfo.Product ? rootDocjson.root.SMPublisherInfo.Product : \"\";\r\n info.engine = rootDocjson.root.SMPublisherInfo.Publisher ? rootDocjson.root.SMPublisherInfo.Publisher : \"\";\r\n info.version = rootDocjson.root.SMPublisherInfo[\"Publisher Version\"] ? rootDocjson.root.SMPublisherInfo[\"Publisher Version\"] : \"\" ;\r\n }\r\n }\r\n return info;\r\n }\r\n /** Gets information about 3dTile file for this reality data\r\n * Will return undefined if cannot be resolved\r\n * @param rootDocjson root document file in json format\r\n * @returns information about 3dTile file for this reality data\r\n * @internal\r\n */\r\n public static getFileInfo(rootDocjson: any): ThreeDTileFileInfo {\r\n const info: ThreeDTileFileInfo = {\r\n rootChildren: rootDocjson?.root?.children?.length ?? 0,\r\n };\r\n return info;\r\n }\r\n /** Convert a boundingVolume into a range\r\n * @param boundingVolume the bounding volume to convert\r\n * @returns the range or undefined if cannot convert\r\n * @internal\r\n */\r\n public static rangeFromBoundingVolume(boundingVolume: any): Range3d | undefined {\r\n if (undefined === boundingVolume)\r\n return undefined;\r\n if (Array.isArray(boundingVolume.box)) {\r\n const box: number[] = boundingVolume.box;\r\n const center = Point3d.create(box[0], box[1], box[2]);\r\n const ux = Vector3d.create(box[3], box[4], box[5]);\r\n const uy = Vector3d.create(box[6], box[7], box[8]);\r\n const uz = Vector3d.create(box[9], box[10], box[11]);\r\n const corners: Point3d[] = [];\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < 2; k++) {\r\n for (let l = 0; l < 2; l++) {\r\n corners.push(center.plus3Scaled(ux, (j ? -1.0 : 1.0), uy, (k ? -1.0 : 1.0), uz, (l ? -1.0 : 1.0)));\r\n }\r\n }\r\n }\r\n return Range3d.createArray(corners);\r\n } else if (Array.isArray(boundingVolume.sphere)) {\r\n const sphere: number[] = boundingVolume.sphere;\r\n const center = Point3d.create(sphere[0], sphere[1], sphere[2]);\r\n const radius = sphere[3];\r\n return Range3d.createXYZXYZ(center.x - radius, center.y - radius, center.z - radius, center.x + radius, center.y + radius, center.z + radius);\r\n }\r\n return undefined;\r\n }\r\n /** Convert a boundingVolume into a range\r\n * @internal\r\n */\r\n public static maximumSizeFromGeometricTolerance(range: Range3d, geometricError: number): number {\r\n const minToleranceRatio = .5; // Nominally the error on screen size of a tile. Increasing generally increases performance (fewer draw calls) at expense of higher load times.\r\n return minToleranceRatio * range.diagonal().magnitude() / geometricError;\r\n }\r\n /** Convert a boundingVolume into a range\r\n * @internal\r\n */\r\n public static transformFromJson(jTrans: number[] | undefined): Transform | undefined {\r\n return (jTrans === undefined) ? undefined : Transform.createOriginAndMatrix(Point3d.create(jTrans[12], jTrans[13], jTrans[14]), Matrix3d.createRowValues(jTrans[0], jTrans[4], jTrans[8], jTrans[1], jTrans[5], jTrans[9], jTrans[2], jTrans[6], jTrans[10]));\r\n }\r\n}\r\n"]}
@@ -76,4 +76,6 @@ export * from "./map/MapLayerSources";
76
76
  export * from "./map/MapTiledGraphicsProvider";
77
77
  export * from "./CesiumAssetProvider";
78
78
  export * from "./ContextShareProvider";
79
+ export * from "./ThreeDTileFormatInterpreter";
80
+ export * from "./OPCFormatInterpreter";
79
81
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":"AAIA;;GAEG;AAYH,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cA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;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC"}
@@ -89,4 +89,6 @@ export * from "./map/MapLayerSources";
89
89
  export * from "./map/MapTiledGraphicsProvider";
90
90
  export * from "./CesiumAssetProvider";
91
91
  export * from "./ContextShareProvider";
92
+ export * from "./ThreeDTileFormatInterpreter";
93
+ export * from "./OPCFormatInterpreter";
92
94
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;;;;GAQG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAo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,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\n/* The order of exports below is based on dependencies between the types in each file.\r\n * For example, IModelTileTree derives from TileTree, so TileTree must be exported first.\r\n * No file inside core-frontend should import from *any* file in /tile/ *except* for this one.\r\n * e.g.:\r\n * import { TileTree } from \"./tile/TileTree\"; // NO...\r\n * import { TileTree } from \"./tile/internal\"; // YES!\r\n * Failure to follow either of these two guidelines is very likely to produce difficult-to-debug run-time errors due\r\n * to circular dependencies.\r\n */\r\n\r\nexport * from \"./ViewFlagOverrides\";\r\nexport * from \"./map/MapCartoRectangle\";\r\nexport * from \"./map/QuadId\";\r\nexport * from \"./DisclosedTileTreeSet\";\r\nexport * from \"./Tile\";\r\nexport * from \"./LRUTileList\";\r\nexport * from \"./RealityTile\";\r\nexport * from \"./TileParams\";\r\nexport * from \"./TileContent\";\r\nexport * from \"./TileDrawArgs\";\r\nexport * from \"./RealityTileDrawArgs\";\r\nexport * from \"./GraphicsCollector\";\r\nexport * from \"./BatchedTileIdMap\";\r\nexport * from \"./TileTreeParams\";\r\nexport * from \"./TileTree\";\r\nexport * from \"./RealityTileTree\";\r\nexport * from \"./TileTreeSupplier\";\r\nexport * from \"./TileTreeOwner\";\r\nexport * from \"./TileTreeReference\";\r\nexport * from \"./TileGeometryCollector\";\r\nexport * from \"./TiledGraphicsProvider\";\r\nexport * from \"./TileAdmin\";\r\nexport * from \"./TileRequest\";\r\nexport * from \"./TileRequestChannel\";\r\nexport * from \"./IModelTileRequestChannels\";\r\nexport * from \"./TileRequestChannels\";\r\nexport * from \"./TileUsageMarker\";\r\nexport * from \"./TileUser\";\r\nexport * from \"./TileUserSet\";\r\nexport * from \"./GltfReader\";\r\nexport * from \"./I3dmReader\";\r\nexport * from \"./B3dmReader\";\r\nexport * from \"./ImdlReader\";\r\nexport * from \"./map/ArcGISTileMap\";\r\nexport * from \"./map/MapLayerAuthentication\";\r\nexport * from \"./map/ArcGisTokenGenerator\";\r\nexport * from \"./map/ArcGisTokenManager\";\r\nexport * from \"./map/MapLayerFormatRegistry\";\r\nexport * from \"./map/ArcGisUtilities\";\r\nexport * from \"./map/WmsUtilities\";\r\nexport * from \"./map/WmsCapabilities\";\r\nexport * from \"./map/WmtsCapabilities\";\r\nexport * from \"./map/MapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/ArcGISMapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/AzureMapsLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/BingImageryProvider\";\r\nexport * from \"./map/ImageryProviders/MapBoxLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/TileUrlImageryProvider\";\r\nexport * from \"./map/ImageryProviders/WmsMapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/WmtsMapLayerImageryProvider\";\r\nexport * from \"./map/MapLayerImageryFormats\";\r\nexport * from \"./map/MapLayerTileTreeReference\";\r\nexport * from \"./map/MapTileTree\";\r\nexport * from \"./map/TerrainMeshProvider\";\r\nexport * from \"./map/CesiumTerrainProvider\";\r\nexport * from \"./map/EllipsoidTerrainProvider\";\r\nexport * from \"./map/MapTile\";\r\nexport * from \"./RealityTileLoader\";\r\nexport * from \"./map/MapTileLoader\";\r\nexport * from \"./map/BingElevation\";\r\nexport * from \"./map/MapTilingScheme\";\r\nexport * from \"./map/MapTileAvailability\";\r\nexport * from \"./PntsReader\";\r\nexport * from \"./RealityModelTileTree\";\r\nexport * from \"./IModelTile\";\r\nexport * from \"./DynamicIModelTile\";\r\nexport * from \"./IModelTileTree\";\r\nexport * from \"./PrimaryTileTree\";\r\nexport * from \"./ClassifierTileTree\";\r\nexport * from \"./OrbitGtTileTree\";\r\nexport * from \"./map/ImageryTileTree\";\r\nexport * from \"./map/MapLayerSources\";\r\nexport * from \"./map/MapTiledGraphicsProvider\";\r\nexport * from \"./CesiumAssetProvider\";\r\nexport * from \"./ContextShareProvider\";\r\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tile/internal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;;;;GAQG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAA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AClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\n/* The order of exports below is based on dependencies between the types in each file.\r\n * For example, IModelTileTree derives from TileTree, so TileTree must be exported first.\r\n * No file inside core-frontend should import from *any* file in /tile/ *except* for this one.\r\n * e.g.:\r\n * import { TileTree } from \"./tile/TileTree\"; // NO...\r\n * import { TileTree } from \"./tile/internal\"; // YES!\r\n * Failure to follow either of these two guidelines is very likely to produce difficult-to-debug run-time errors due\r\n * to circular dependencies.\r\n */\r\n\r\nexport * from \"./ViewFlagOverrides\";\r\nexport * from \"./map/MapCartoRectangle\";\r\nexport * from \"./map/QuadId\";\r\nexport * from \"./DisclosedTileTreeSet\";\r\nexport * from \"./Tile\";\r\nexport * from \"./LRUTileList\";\r\nexport * from \"./RealityTile\";\r\nexport * from \"./TileParams\";\r\nexport * from \"./TileContent\";\r\nexport * from \"./TileDrawArgs\";\r\nexport * from \"./RealityTileDrawArgs\";\r\nexport * from \"./GraphicsCollector\";\r\nexport * from \"./BatchedTileIdMap\";\r\nexport * from \"./TileTreeParams\";\r\nexport * from \"./TileTree\";\r\nexport * from \"./RealityTileTree\";\r\nexport * from \"./TileTreeSupplier\";\r\nexport * from \"./TileTreeOwner\";\r\nexport * from \"./TileTreeReference\";\r\nexport * from \"./TileGeometryCollector\";\r\nexport * from \"./TiledGraphicsProvider\";\r\nexport * from \"./TileAdmin\";\r\nexport * from \"./TileRequest\";\r\nexport * from \"./TileRequestChannel\";\r\nexport * from \"./IModelTileRequestChannels\";\r\nexport * from \"./TileRequestChannels\";\r\nexport * from \"./TileUsageMarker\";\r\nexport * from \"./TileUser\";\r\nexport * from \"./TileUserSet\";\r\nexport * from \"./GltfReader\";\r\nexport * from \"./I3dmReader\";\r\nexport * from \"./B3dmReader\";\r\nexport * from \"./ImdlReader\";\r\nexport * from \"./map/ArcGISTileMap\";\r\nexport * from \"./map/MapLayerAuthentication\";\r\nexport * from \"./map/ArcGisTokenGenerator\";\r\nexport * from \"./map/ArcGisTokenManager\";\r\nexport * from \"./map/MapLayerFormatRegistry\";\r\nexport * from \"./map/ArcGisUtilities\";\r\nexport * from \"./map/WmsUtilities\";\r\nexport * from \"./map/WmsCapabilities\";\r\nexport * from \"./map/WmtsCapabilities\";\r\nexport * from \"./map/MapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/ArcGISMapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/AzureMapsLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/BingImageryProvider\";\r\nexport * from \"./map/ImageryProviders/MapBoxLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/TileUrlImageryProvider\";\r\nexport * from \"./map/ImageryProviders/WmsMapLayerImageryProvider\";\r\nexport * from \"./map/ImageryProviders/WmtsMapLayerImageryProvider\";\r\nexport * from \"./map/MapLayerImageryFormats\";\r\nexport * from \"./map/MapLayerTileTreeReference\";\r\nexport * from \"./map/MapTileTree\";\r\nexport * from \"./map/TerrainMeshProvider\";\r\nexport * from \"./map/CesiumTerrainProvider\";\r\nexport * from \"./map/EllipsoidTerrainProvider\";\r\nexport * from \"./map/MapTile\";\r\nexport * from \"./RealityTileLoader\";\r\nexport * from \"./map/MapTileLoader\";\r\nexport * from \"./map/BingElevation\";\r\nexport * from \"./map/MapTilingScheme\";\r\nexport * from \"./map/MapTileAvailability\";\r\nexport * from \"./PntsReader\";\r\nexport * from \"./RealityModelTileTree\";\r\nexport * from \"./IModelTile\";\r\nexport * from \"./DynamicIModelTile\";\r\nexport * from \"./IModelTileTree\";\r\nexport * from \"./PrimaryTileTree\";\r\nexport * from \"./ClassifierTileTree\";\r\nexport * from \"./OrbitGtTileTree\";\r\nexport * from \"./map/ImageryTileTree\";\r\nexport * from \"./map/MapLayerSources\";\r\nexport * from \"./map/MapTiledGraphicsProvider\";\r\nexport * from \"./CesiumAssetProvider\";\r\nexport * from \"./ContextShareProvider\";\r\nexport * from \"./ThreeDTileFormatInterpreter\";\r\nexport * from \"./OPCFormatInterpreter\";\r\n"]}