@itwin/core-frontend 3.1.0-dev.26 → 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,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RealityDataSourceTilesetUrlImpl = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ /** @packageDocumentation
9
+ * @module Tiles
10
+ */
11
+ const Request_1 = require("./request/Request");
12
+ const core_bentley_1 = require("@itwin/core-bentley");
13
+ const core_common_1 = require("@itwin/core-common");
14
+ const internal_1 = require("./tile/internal");
15
+ /** This class provides access to the reality data provider services.
16
+ * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
17
+ * The key provided at the creation determines if this is ProjectWise Context Share reference.
18
+ * If not then it is considered local (ex: C:\temp\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)
19
+ * There is a one to one relationship between a reality data and the instances of present class.
20
+ * @internal
21
+ */
22
+ class RealityDataSourceTilesetUrlImpl {
23
+ /** Construct a new reality data source.
24
+ * @param props JSON representation of the reality data source
25
+ */
26
+ constructor(props) {
27
+ /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/
28
+ this._baseUrl = "";
29
+ (0, core_bentley_1.assert)(props.sourceKey.provider === core_common_1.RealityDataProvider.TilesetUrl || props.sourceKey.provider === core_common_1.RealityDataProvider.OrbitGtBlob);
30
+ this.key = props.sourceKey;
31
+ this._tilesetUrl = this.key.id;
32
+ }
33
+ /**
34
+ * Create an instance of this class from a source key and iTwin context/
35
+ */
36
+ static async createFromKey(sourceKey, _iTwinId) {
37
+ if (sourceKey.provider !== core_common_1.RealityDataProvider.TilesetUrl)
38
+ return undefined;
39
+ const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });
40
+ return rdSource;
41
+ }
42
+ get isContextShare() {
43
+ return false;
44
+ }
45
+ /**
46
+ * Returns Reality Data if available
47
+ */
48
+ get realityData() {
49
+ return undefined;
50
+ }
51
+ get realityDataId() {
52
+ return undefined;
53
+ }
54
+ /**
55
+ * Returns Reality Data type if available
56
+ */
57
+ get realityDataType() {
58
+ return undefined;
59
+ }
60
+ // This is to set the root url from the provided root document path.
61
+ // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,
62
+ // otherwise the full path to root document is given.
63
+ // The base URL contains the base URL from which tile relative path are constructed.
64
+ // The tile's path root will need to be reinserted for child tiles to return a 200
65
+ setBaseUrl(url) {
66
+ const urlParts = url.split("/");
67
+ urlParts.pop();
68
+ if (urlParts.length === 0)
69
+ this._baseUrl = "";
70
+ else
71
+ this._baseUrl = `${urlParts.join("/")}/`;
72
+ }
73
+ async _doRequest(url, responseType) {
74
+ const options = {
75
+ method: "GET",
76
+ responseType,
77
+ };
78
+ const data = await (0, Request_1.request)(url, options);
79
+ return data.body;
80
+ }
81
+ /**
82
+ * This method returns the URL to access the actual 3d tiles from the service provider.
83
+ * @returns string containing the URL to reality data.
84
+ */
85
+ async getServiceUrl(_iTwinId) {
86
+ return this._tilesetUrl;
87
+ }
88
+ async getRootDocument(iTwinId) {
89
+ const url = await this.getServiceUrl(iTwinId);
90
+ if (!url)
91
+ throw new core_common_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Unable to get service url");
92
+ // The following is only if the reality data is not stored on PW Context Share.
93
+ this.setBaseUrl(url);
94
+ return this._doRequest(url, "json");
95
+ }
96
+ /**
97
+ * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
98
+ */
99
+ async getTileContent(name) {
100
+ const tileUrl = this._baseUrl + name;
101
+ return this._doRequest(tileUrl, "arraybuffer");
102
+ }
103
+ /**
104
+ * 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.
105
+ */
106
+ async getTileJson(name) {
107
+ const tileUrl = this._baseUrl + name;
108
+ return this._doRequest(tileUrl, "json");
109
+ }
110
+ /**
111
+ * Gets spatial location and extents of this reality data source
112
+ * @returns spatial location and extents
113
+ * @internal
114
+ */
115
+ async getSpatialLocationAndExtents() {
116
+ let spatialLocation;
117
+ if (this.key.format === core_common_1.RealityDataFormat.ThreeDTile) {
118
+ const rootDocument = await this.getRootDocument(undefined);
119
+ spatialLocation = internal_1.ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);
120
+ }
121
+ return spatialLocation;
122
+ }
123
+ /**
124
+ * Gets information to identify the product and engine that create this reality data
125
+ * Will return undefined if cannot be resolved
126
+ * @returns information to identify the product and engine that create this reality data
127
+ * @alpha
128
+ */
129
+ async getPublisherProductInfo() {
130
+ let publisherInfo;
131
+ return publisherInfo;
132
+ }
133
+ }
134
+ exports.RealityDataSourceTilesetUrlImpl = RealityDataSourceTilesetUrlImpl;
135
+ //# 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,+CAA4D;AAC5D,sDAAwE;AACxE,oDAAoJ;AAGpJ,8CAA8D;AAE9D;;;;;;EAME;AACF,MAAa,+BAA+B;IAO1C;;OAEG;IACH,YAAsB,KAA6B;QANnD,sIAAsI;QAC9H,aAAQ,GAAW,EAAE,CAAC;QAM5B,IAAA,qBAAM,EAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,WAAW,CAAC,CAAC;QACpI,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,CA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C1B,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,yBAAW,CAAC,4BAAa,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,+BAAiB,CAAC,UAAU,EAAE;YACpD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YAC3D,eAAe,GAAG,sCAA2B,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;AA/HD,0EA+HC","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,81 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OPCFormatInterpreter = void 0;
8
+ const core_common_1 = require("@itwin/core-common");
9
+ const core_geometry_1 = require("@itwin/core-geometry");
10
+ const core_orbitgt_1 = require("@itwin/core-orbitgt");
11
+ const FrontendLoggerCategory_1 = require("../FrontendLoggerCategory");
12
+ const DownloaderNode_1 = require("@itwin/core-orbitgt/lib/cjs/system/runtime/DownloaderNode");
13
+ const core_bentley_1 = require("@itwin/core-bentley");
14
+ const loggerCategory = FrontendLoggerCategory_1.FrontendLoggerCategory.RealityData;
15
+ /**
16
+ * This class provide methods used to interpret Orbit Point Cloud (OPC) format
17
+ * @internal
18
+ */
19
+ class OPCFormatInterpreter {
20
+ /** Gets an OPC file reader from a blobFileUrl
21
+ * @param blobFileURL the name of the file.
22
+ * @returns return a file reader open to read provided blob file
23
+ * @internal
24
+ */
25
+ static async getFileReaderFromBlobFileURL(blobFileURL) {
26
+ if (core_orbitgt_1.Downloader.INSTANCE == null)
27
+ core_orbitgt_1.Downloader.INSTANCE = new DownloaderNode_1.DownloaderNode();
28
+ if (core_orbitgt_1.CRSManager.ENGINE == null)
29
+ core_orbitgt_1.CRSManager.ENGINE = await core_orbitgt_1.OnlineEngine.create();
30
+ // let blobFileURL: string = rdUrl;
31
+ // if (accountName.length > 0) blobFileURL = UrlFS.getAzureBlobSasUrl(opcConfig.accountName, opcConfig.containerName, opcConfig.blobFileName, opcConfig.sasToken);
32
+ const urlFS = new core_orbitgt_1.UrlFS();
33
+ // wrap a caching layer (16 MB) around the blob file
34
+ const blobFileSize = await urlFS.getFileLength(blobFileURL);
35
+ core_bentley_1.Logger.logTrace(loggerCategory, `OPC File Size is ${blobFileSize}`);
36
+ const blobFile = new core_orbitgt_1.PageCachedFile(urlFS, blobFileURL, blobFileSize, 128 * 1024 /* pageSize */, 128 /* maxPageCount */);
37
+ const fileReader = await core_orbitgt_1.OPCReader.openFile(blobFile, blobFileURL, true /* lazyLoading */);
38
+ return fileReader;
39
+ }
40
+ /** Gets reality data spatial location and extents
41
+ * @param fileReader a file reader instance obtains from call to getFileReaderFromBlobFileURL
42
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
43
+ * @internal
44
+ */
45
+ static async getSpatialLocationAndExtents(fileReader) {
46
+ let worldRange = new core_geometry_1.Range3d();
47
+ let location;
48
+ let isGeolocated = true;
49
+ const bounds = fileReader.getFileBounds();
50
+ worldRange = core_geometry_1.Range3d.createXYZXYZ(bounds.getMinX(), bounds.getMinY(), bounds.getMinZ(), bounds.getMaxX(), bounds.getMaxY(), bounds.getMaxZ());
51
+ isGeolocated = false;
52
+ const fileCrs = fileReader.getFileCRS();
53
+ if (fileCrs) {
54
+ await core_orbitgt_1.CRSManager.ENGINE.prepareForArea(fileCrs, bounds);
55
+ const wgs84ECEFCrs = "4978";
56
+ await core_orbitgt_1.CRSManager.ENGINE.prepareForArea(wgs84ECEFCrs, new core_orbitgt_1.OrbitGtBounds());
57
+ const ecefBounds = core_orbitgt_1.CRSManager.transformBounds(bounds, fileCrs, wgs84ECEFCrs);
58
+ const ecefRange = core_geometry_1.Range3d.createXYZXYZ(ecefBounds.getMinX(), ecefBounds.getMinY(), ecefBounds.getMinZ(), ecefBounds.getMaxX(), ecefBounds.getMaxY(), ecefBounds.getMaxZ());
59
+ const ecefCenter = ecefRange.localXYZToWorld(.5, .5, .5);
60
+ const cartoCenter = core_common_1.Cartographic.fromEcef(ecefCenter);
61
+ cartoCenter.height = 0;
62
+ const ecefLocation = core_common_1.EcefLocation.createFromCartographicOrigin(cartoCenter);
63
+ location = ecefLocation;
64
+ // this.iModelDb.setEcefLocation(ecefLocation);
65
+ const ecefToWorld = ecefLocation.getTransform().inverse();
66
+ worldRange = ecefToWorld.multiplyRange(ecefRange);
67
+ isGeolocated = true;
68
+ }
69
+ else {
70
+ // NoGCS case
71
+ isGeolocated = false;
72
+ const centerOfEarth = new core_common_1.EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });
73
+ location = centerOfEarth;
74
+ core_bentley_1.Logger.logTrace(loggerCategory, "OPC RealityData NOT Geolocated", () => ({ ...location }));
75
+ }
76
+ const spatialLocation = { location, worldRange, isGeolocated };
77
+ return spatialLocation;
78
+ }
79
+ }
80
+ exports.OPCFormatInterpreter = OPCFormatInterpreter;
81
+ //# 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,oDAAgE;AAChE,wDAA+C;AAC/C,sDAAqJ;AACrJ,sEAAmE;AACnE,8FAA2F;AAC3F,sDAA6C;AAG7C,MAAM,cAAc,GAAW,+CAAsB,CAAC,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAa,oBAAoB;IAC/B;;;;OAIG;IACI,MAAM,CAAC,KAAK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IAAI,0BAAY,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,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,qBAAM,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;AA/DD,oDA+DC","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,160 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ThreeDTileFormatInterpreter = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_common_1 = require("@itwin/core-common");
10
+ const core_geometry_1 = require("@itwin/core-geometry");
11
+ const FrontendLoggerCategory_1 = require("../FrontendLoggerCategory");
12
+ const loggerCategory = FrontendLoggerCategory_1.FrontendLoggerCategory.RealityData;
13
+ /**
14
+ * This class provide methods used to interpret Cesium 3dTile format
15
+ * @internal
16
+ */
17
+ class ThreeDTileFormatInterpreter {
18
+ /** Gets reality data spatial location and extents
19
+ * @param json root document file in json format
20
+ * @returns spatial location and volume of interest, in meters, centered around `spatial location`
21
+ * @internal
22
+ */
23
+ static getSpatialLocationAndExtents(json) {
24
+ const worldRange = new core_geometry_1.Range3d();
25
+ let isGeolocated = true;
26
+ let location;
27
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData realityModelFromJson");
28
+ if (undefined !== json.root.boundingVolume.region) {
29
+ const region = core_bentley_1.JsonUtils.asArray(json.root.boundingVolume.region);
30
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData json.root.boundingVolume.region", () => ({ ...region }));
31
+ if (undefined === region) {
32
+ core_bentley_1.Logger.logError(loggerCategory, `Error realityModelFromJson - region undefined`);
33
+ throw new TypeError("Unable to determine GeoLocation - no root Transform or Region on root.");
34
+ }
35
+ const ecefLow = (core_common_1.Cartographic.fromRadians({ longitude: region[0], latitude: region[1], height: region[4] })).toEcef();
36
+ const ecefHigh = (core_common_1.Cartographic.fromRadians({ longitude: region[2], latitude: region[3], height: region[5] })).toEcef();
37
+ const ecefRange = core_geometry_1.Range3d.create(ecefLow, ecefHigh);
38
+ const cartoCenter = core_common_1.Cartographic.fromRadians({ longitude: (region[0] + region[2]) / 2.0, latitude: (region[1] + region[3]) / 2.0, height: (region[4] + region[5]) / 2.0 });
39
+ location = cartoCenter;
40
+ const ecefLocation = core_common_1.EcefLocation.createFromCartographicOrigin(cartoCenter);
41
+ // iModelDb.setEcefLocation(ecefLocation);
42
+ const ecefToWorld = ecefLocation.getTransform().inverse();
43
+ worldRange.extendRange(core_geometry_1.Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));
44
+ }
45
+ else {
46
+ let worldToEcefTransform = ThreeDTileFormatInterpreter.transformFromJson(json.root.transform);
47
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData json.root.transform", () => ({ ...worldToEcefTransform }));
48
+ const range = ThreeDTileFormatInterpreter.rangeFromBoundingVolume(json.root.boundingVolume);
49
+ if (undefined === worldToEcefTransform)
50
+ worldToEcefTransform = core_geometry_1.Transform.createIdentity();
51
+ const ecefRange = worldToEcefTransform.multiplyRange(range); // range in model -> range in ecef
52
+ const ecefCenter = worldToEcefTransform.multiplyPoint3d(range.center); // range center in model -> range center in ecef
53
+ const cartoCenter = core_common_1.Cartographic.fromEcef(ecefCenter); // ecef center to cartographic center
54
+ const isNotNearEarthSurface = cartoCenter && (cartoCenter.height < -5000); // 5 km under ground!
55
+ const earthCenterToRangeCenterRayLenght = range.center.magnitude();
56
+ if (worldToEcefTransform.matrix.isIdentity && (earthCenterToRangeCenterRayLenght < 1.0E5 || isNotNearEarthSurface)) {
57
+ isGeolocated = false;
58
+ worldRange.extendRange(core_geometry_1.Range3d.fromJSON(ecefRange));
59
+ const centerOfEarth = new core_common_1.EcefLocation({ origin: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { yaw: 0.0, pitch: 0.0, roll: 0.0 } });
60
+ location = centerOfEarth;
61
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData NOT Geolocated", () => ({ ...location }));
62
+ }
63
+ else {
64
+ let ecefLocation;
65
+ const locationOrientation = core_geometry_1.YawPitchRollAngles.tryFromTransform(worldToEcefTransform);
66
+ // Fix Bug 445630: [RDV][Regression] Orientation of georeferenced Reality Mesh is wrong.
67
+ // Use json.root.transform only if defined and not identity -> otherwise will use a transform computed from cartographic center.
68
+ if (!worldToEcefTransform.matrix.isIdentity && locationOrientation !== undefined && locationOrientation.angles !== undefined)
69
+ ecefLocation = new core_common_1.EcefLocation({ origin: locationOrientation.origin, orientation: locationOrientation.angles.toJSON() });
70
+ else
71
+ ecefLocation = core_common_1.EcefLocation.createFromCartographicOrigin(cartoCenter);
72
+ location = ecefLocation;
73
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData is worldToEcefTransform.matrix.isIdentity", () => ({ isIdentity: worldToEcefTransform.matrix.isIdentity }));
74
+ // iModelDb.setEcefLocation(ecefLocation);
75
+ const ecefToWorld = ecefLocation.getTransform().inverse();
76
+ worldRange.extendRange(core_geometry_1.Range3d.fromJSON(ecefToWorld.multiplyRange(ecefRange)));
77
+ core_bentley_1.Logger.logTrace(loggerCategory, "RealityData ecefToWorld", () => ({ ...ecefToWorld }));
78
+ }
79
+ }
80
+ const spatialLocation = { location, worldRange, isGeolocated };
81
+ return spatialLocation;
82
+ }
83
+ /** Gets information to identify the product and engine that create this reality data
84
+ * Will return undefined if cannot be resolved
85
+ * @param rootDocjson root document file in json format
86
+ * @returns information to identify the product and engine that create this reality data
87
+ * @alpha
88
+ */
89
+ static getPublisherProductInfo(rootDocjson) {
90
+ const info = { product: "", engine: "", version: "" };
91
+ if (rootDocjson && rootDocjson.root) {
92
+ if (rootDocjson.root.SMPublisherInfo) {
93
+ info.product = rootDocjson.root.SMPublisherInfo.Product ? rootDocjson.root.SMPublisherInfo.Product : "";
94
+ info.engine = rootDocjson.root.SMPublisherInfo.Publisher ? rootDocjson.root.SMPublisherInfo.Publisher : "";
95
+ info.version = rootDocjson.root.SMPublisherInfo["Publisher Version"] ? rootDocjson.root.SMPublisherInfo["Publisher Version"] : "";
96
+ }
97
+ }
98
+ return info;
99
+ }
100
+ /** Gets information about 3dTile file for this reality data
101
+ * Will return undefined if cannot be resolved
102
+ * @param rootDocjson root document file in json format
103
+ * @returns information about 3dTile file for this reality data
104
+ * @internal
105
+ */
106
+ static getFileInfo(rootDocjson) {
107
+ var _a, _b, _c;
108
+ const info = {
109
+ 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,
110
+ };
111
+ return info;
112
+ }
113
+ /** Convert a boundingVolume into a range
114
+ * @param boundingVolume the bounding volume to convert
115
+ * @returns the range or undefined if cannot convert
116
+ * @internal
117
+ */
118
+ static rangeFromBoundingVolume(boundingVolume) {
119
+ if (undefined === boundingVolume)
120
+ return undefined;
121
+ if (Array.isArray(boundingVolume.box)) {
122
+ const box = boundingVolume.box;
123
+ const center = core_geometry_1.Point3d.create(box[0], box[1], box[2]);
124
+ const ux = core_geometry_1.Vector3d.create(box[3], box[4], box[5]);
125
+ const uy = core_geometry_1.Vector3d.create(box[6], box[7], box[8]);
126
+ const uz = core_geometry_1.Vector3d.create(box[9], box[10], box[11]);
127
+ const corners = [];
128
+ for (let j = 0; j < 2; j++) {
129
+ for (let k = 0; k < 2; k++) {
130
+ for (let l = 0; l < 2; l++) {
131
+ corners.push(center.plus3Scaled(ux, (j ? -1.0 : 1.0), uy, (k ? -1.0 : 1.0), uz, (l ? -1.0 : 1.0)));
132
+ }
133
+ }
134
+ }
135
+ return core_geometry_1.Range3d.createArray(corners);
136
+ }
137
+ else if (Array.isArray(boundingVolume.sphere)) {
138
+ const sphere = boundingVolume.sphere;
139
+ const center = core_geometry_1.Point3d.create(sphere[0], sphere[1], sphere[2]);
140
+ const radius = sphere[3];
141
+ return core_geometry_1.Range3d.createXYZXYZ(center.x - radius, center.y - radius, center.z - radius, center.x + radius, center.y + radius, center.z + radius);
142
+ }
143
+ return undefined;
144
+ }
145
+ /** Convert a boundingVolume into a range
146
+ * @internal
147
+ */
148
+ static maximumSizeFromGeometricTolerance(range, geometricError) {
149
+ 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.
150
+ return minToleranceRatio * range.diagonal().magnitude() / geometricError;
151
+ }
152
+ /** Convert a boundingVolume into a range
153
+ * @internal
154
+ */
155
+ static transformFromJson(jTrans) {
156
+ return (jTrans === undefined) ? undefined : core_geometry_1.Transform.createOriginAndMatrix(core_geometry_1.Point3d.create(jTrans[12], jTrans[13], jTrans[14]), core_geometry_1.Matrix3d.createRowValues(jTrans[0], jTrans[4], jTrans[8], jTrans[1], jTrans[5], jTrans[9], jTrans[2], jTrans[6], jTrans[10]));
157
+ }
158
+ }
159
+ exports.ThreeDTileFormatInterpreter = ThreeDTileFormatInterpreter;
160
+ //# 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,sDAAwD;AACxD,oDAAgE;AAChE,wDAA2G;AAC3G,sEAAmE;AAGnE,MAAM,cAAc,GAAW,+CAAsB,CAAC,WAAW,CAAC;AASlE;;;GAGG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAS;QAClD,MAAM,UAA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AAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;SAC/I;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;OAEG;IACI,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,yBAAS,CAAC,qBAAqB,CAAC,uBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,wBAAQ,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;AA9ID,kEA8IC","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,CAA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C,CAAC;AAC3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;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"}
@@ -101,4 +101,6 @@ __exportStar(require("./map/MapLayerSources"), exports);
101
101
  __exportStar(require("./map/MapTiledGraphicsProvider"), exports);
102
102
  __exportStar(require("./CesiumAssetProvider"), exports);
103
103
  __exportStar(require("./ContextShareProvider"), exports);
104
+ __exportStar(require("./ThreeDTileFormatInterpreter"), exports);
105
+ __exportStar(require("./OPCFormatInterpreter"), exports);
104
106
  //# 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,sDAAoC;AACpC,0DAAwC;AACxC,+CAA6B;AAC7B,yDAAuC;AACvC,yCAAuB;AACvB,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,6CAA2B;AAC3B,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,sDAAoC;AACpC,0DAAwC;AACxC,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,uDAAqC;AACrC,8DAA4C;AAC5C,wDAAsC;AACtC,oDAAkC;AAClC,6CAA2B;AAC3B,gDAA8B;AAC9B,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,sDAAoC;AACpC,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,+DAA6C;AAC7C,wDAAsC;AACtC,qDAAmC;AACnC,wDAAsC;AACtC,yDAAuC;AACvC,gEAA8C;AAC9C,uFAAqE;AACrE,uFAAqE;AACrE,6EAA2D;AAC3D,oFAAkE;AAClE,gFAA8D;AAC9D,oFAAkE;AAClE,qFAAmE;AACnE,+DAA6C;AAC7C,kEAAgD;AAChD,oDAAkC;AAClC,4DAA0C;AAC1C,8DAA4C;AAC5C,iEAA+C;AAC/C,gDAA8B;AAC9B,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,wDAAsC;AACtC,4DAA0C;AAC1C,+CAA6B;AAC7B,yDAAuC;AACvC,+CAA6B;AAC7B,sDAAoC;AACpC,mDAAiC;AACjC,oDAAkC;AAClC,uDAAqC;AACrC,oDAAkC;AAClC,wDAAsC;AACtC,wDAAsC;AACtC,iEAA+C;AAC/C,wDAAsC;AACtC,yDAAuC","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":"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AAuC;AACvC,gEAA8C;AAC9C,yDAAuC","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"]}