@itwin/core-frontend 4.0.0-dev.70 → 4.0.0-dev.73

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 (162) hide show
  1. package/CHANGELOG.md +74 -37
  2. package/lib/cjs/BingLocation.d.ts.map +1 -1
  3. package/lib/cjs/BingLocation.js +4 -5
  4. package/lib/cjs/BingLocation.js.map +1 -1
  5. package/lib/cjs/BriefcaseConnection.js.map +1 -1
  6. package/lib/cjs/NativeApp.d.ts.map +1 -1
  7. package/lib/cjs/NativeApp.js +0 -3
  8. package/lib/cjs/NativeApp.js.map +1 -1
  9. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -2
  10. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  11. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +6 -20
  12. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  13. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts +1 -1
  14. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts.map +1 -1
  15. package/lib/cjs/RealityDataSourceContextShareImpl.js +2 -11
  16. package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -1
  17. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +4 -2
  18. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  19. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +4 -12
  20. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  21. package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
  22. package/lib/cjs/extension/providers/RemoteExtensionProvider.js +1 -8
  23. package/lib/cjs/extension/providers/RemoteExtensionProvider.js.map +1 -1
  24. package/lib/cjs/render/primitives/PointCloudPrimitive.d.ts +1 -1
  25. package/lib/cjs/render/primitives/PointCloudPrimitive.d.ts.map +1 -1
  26. package/lib/cjs/render/primitives/PointCloudPrimitive.js.map +1 -1
  27. package/lib/cjs/render/webgl/AttributeBuffers.d.ts +1 -1
  28. package/lib/cjs/render/webgl/AttributeBuffers.d.ts.map +1 -1
  29. package/lib/cjs/render/webgl/AttributeBuffers.js.map +1 -1
  30. package/lib/cjs/render/webgl/PointCloud.js +1 -1
  31. package/lib/cjs/render/webgl/PointCloud.js.map +1 -1
  32. package/lib/cjs/request/Request.d.ts +17 -143
  33. package/lib/cjs/request/Request.d.ts.map +1 -1
  34. package/lib/cjs/request/Request.js +46 -303
  35. package/lib/cjs/request/Request.js.map +1 -1
  36. package/lib/cjs/tile/PntsReader.d.ts +5 -1
  37. package/lib/cjs/tile/PntsReader.d.ts.map +1 -1
  38. package/lib/cjs/tile/PntsReader.js +28 -25
  39. package/lib/cjs/tile/PntsReader.js.map +1 -1
  40. package/lib/cjs/tile/RealityTile.d.ts +12 -5
  41. package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
  42. package/lib/cjs/tile/RealityTile.js +149 -57
  43. package/lib/cjs/tile/RealityTile.js.map +1 -1
  44. package/lib/cjs/tile/RealityTileLoader.d.ts.map +1 -1
  45. package/lib/cjs/tile/RealityTileLoader.js +14 -3
  46. package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
  47. package/lib/cjs/tile/RealityTileTree.d.ts +1 -3
  48. package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
  49. package/lib/cjs/tile/RealityTileTree.js +8 -21
  50. package/lib/cjs/tile/RealityTileTree.js.map +1 -1
  51. package/lib/cjs/tile/TileUsageMarker.d.ts +4 -0
  52. package/lib/cjs/tile/TileUsageMarker.d.ts.map +1 -1
  53. package/lib/cjs/tile/TileUsageMarker.js +9 -1
  54. package/lib/cjs/tile/TileUsageMarker.js.map +1 -1
  55. package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
  56. package/lib/cjs/tile/map/ArcGISTileMap.js +1 -5
  57. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  58. package/lib/cjs/tile/map/BingElevation.d.ts.map +1 -1
  59. package/lib/cjs/tile/map/BingElevation.js +6 -16
  60. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  61. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  62. package/lib/cjs/tile/map/CesiumTerrainProvider.js +12 -18
  63. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  64. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  65. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +1 -3
  66. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  67. package/lib/cjs/tile/map/MapLayerSources.js +1 -1
  68. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  69. package/lib/cjs/tile/map/MapTile.d.ts +3 -1
  70. package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
  71. package/lib/cjs/tile/map/MapTile.js +4 -0
  72. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  73. package/lib/cjs/tile/map/WmsCapabilities.d.ts.map +1 -1
  74. package/lib/cjs/tile/map/WmsCapabilities.js +3 -6
  75. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  76. package/lib/cjs/tile/map/WmtsCapabilities.d.ts.map +1 -1
  77. package/lib/cjs/tile/map/WmtsCapabilities.js +3 -6
  78. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  79. package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
  80. package/lib/cjs/tools/ViewTool.js +0 -3
  81. package/lib/cjs/tools/ViewTool.js.map +1 -1
  82. package/lib/esm/BingLocation.d.ts.map +1 -1
  83. package/lib/esm/BingLocation.js +4 -5
  84. package/lib/esm/BingLocation.js.map +1 -1
  85. package/lib/esm/BriefcaseConnection.js.map +1 -1
  86. package/lib/esm/NativeApp.d.ts.map +1 -1
  87. package/lib/esm/NativeApp.js +0 -3
  88. package/lib/esm/NativeApp.js.map +1 -1
  89. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -2
  90. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  91. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +6 -20
  92. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  93. package/lib/esm/RealityDataSourceContextShareImpl.d.ts +1 -1
  94. package/lib/esm/RealityDataSourceContextShareImpl.d.ts.map +1 -1
  95. package/lib/esm/RealityDataSourceContextShareImpl.js +2 -11
  96. package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -1
  97. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +4 -2
  98. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  99. package/lib/esm/RealityDataSourceTilesetUrlImpl.js +4 -12
  100. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  101. package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
  102. package/lib/esm/extension/providers/RemoteExtensionProvider.js +1 -8
  103. package/lib/esm/extension/providers/RemoteExtensionProvider.js.map +1 -1
  104. package/lib/esm/render/primitives/PointCloudPrimitive.d.ts +1 -1
  105. package/lib/esm/render/primitives/PointCloudPrimitive.d.ts.map +1 -1
  106. package/lib/esm/render/primitives/PointCloudPrimitive.js.map +1 -1
  107. package/lib/esm/render/webgl/AttributeBuffers.d.ts +1 -1
  108. package/lib/esm/render/webgl/AttributeBuffers.d.ts.map +1 -1
  109. package/lib/esm/render/webgl/AttributeBuffers.js.map +1 -1
  110. package/lib/esm/render/webgl/PointCloud.js +1 -1
  111. package/lib/esm/render/webgl/PointCloud.js.map +1 -1
  112. package/lib/esm/request/Request.d.ts +17 -143
  113. package/lib/esm/request/Request.d.ts.map +1 -1
  114. package/lib/esm/request/Request.js +42 -275
  115. package/lib/esm/request/Request.js.map +1 -1
  116. package/lib/esm/tile/PntsReader.d.ts +5 -1
  117. package/lib/esm/tile/PntsReader.d.ts.map +1 -1
  118. package/lib/esm/tile/PntsReader.js +29 -26
  119. package/lib/esm/tile/PntsReader.js.map +1 -1
  120. package/lib/esm/tile/RealityTile.d.ts +12 -5
  121. package/lib/esm/tile/RealityTile.d.ts.map +1 -1
  122. package/lib/esm/tile/RealityTile.js +149 -57
  123. package/lib/esm/tile/RealityTile.js.map +1 -1
  124. package/lib/esm/tile/RealityTileLoader.d.ts.map +1 -1
  125. package/lib/esm/tile/RealityTileLoader.js +14 -3
  126. package/lib/esm/tile/RealityTileLoader.js.map +1 -1
  127. package/lib/esm/tile/RealityTileTree.d.ts +1 -3
  128. package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
  129. package/lib/esm/tile/RealityTileTree.js +11 -24
  130. package/lib/esm/tile/RealityTileTree.js.map +1 -1
  131. package/lib/esm/tile/TileUsageMarker.d.ts +4 -0
  132. package/lib/esm/tile/TileUsageMarker.d.ts.map +1 -1
  133. package/lib/esm/tile/TileUsageMarker.js +9 -1
  134. package/lib/esm/tile/TileUsageMarker.js.map +1 -1
  135. package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
  136. package/lib/esm/tile/map/ArcGISTileMap.js +1 -5
  137. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  138. package/lib/esm/tile/map/BingElevation.d.ts.map +1 -1
  139. package/lib/esm/tile/map/BingElevation.js +6 -16
  140. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  141. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  142. package/lib/esm/tile/map/CesiumTerrainProvider.js +12 -18
  143. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  144. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  145. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -3
  146. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  147. package/lib/esm/tile/map/MapLayerSources.js +2 -2
  148. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  149. package/lib/esm/tile/map/MapTile.d.ts +3 -1
  150. package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
  151. package/lib/esm/tile/map/MapTile.js +4 -0
  152. package/lib/esm/tile/map/MapTile.js.map +1 -1
  153. package/lib/esm/tile/map/WmsCapabilities.d.ts.map +1 -1
  154. package/lib/esm/tile/map/WmsCapabilities.js +3 -6
  155. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  156. package/lib/esm/tile/map/WmtsCapabilities.d.ts.map +1 -1
  157. package/lib/esm/tile/map/WmtsCapabilities.js +3 -6
  158. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  159. package/lib/esm/tools/ViewTool.d.ts.map +1 -1
  160. package/lib/esm/tools/ViewTool.js +0 -3
  161. package/lib/esm/tools/ViewTool.js.map +1 -1
  162. package/package.json +21 -27
@@ -1,3 +1,6 @@
1
+ /** @packageDocumentation
2
+ * @module Tiles
3
+ */
1
4
  import { GuidString } from "@itwin/core-bentley";
2
5
  import { RealityData, RealityDataSourceKey, RealityDataSourceProps } from "@itwin/core-common";
3
6
  import { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from "./RealityDataSource";
@@ -33,7 +36,6 @@ export declare class RealityDataSourceTilesetUrlImpl implements RealityDataSourc
33
36
  */
34
37
  get realityDataType(): string | undefined;
35
38
  private setBaseUrl;
36
- private _doRequest;
37
39
  /**
38
40
  * This method returns the URL to access the actual 3d tiles from the service provider.
39
41
  * @returns string containing the URL to reality data.
@@ -43,7 +45,7 @@ export declare class RealityDataSourceTilesetUrlImpl implements RealityDataSourc
43
45
  /**
44
46
  * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
45
47
  */
46
- getTileContent(name: string): Promise<any>;
48
+ getTileContent(name: string): Promise<ArrayBuffer>;
47
49
  /**
48
50
  * 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.
49
51
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Reality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Q,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI5E,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAU3E;;OAEG;IACU,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM/D;;OAEG;IACU,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAM7C,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI1D;;;;OAIG;IACU,4BAA4B,IAAI,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAQ3F;;;;;OAKG;IACU,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;CAIlF"}
@@ -5,9 +5,9 @@
5
5
  /** @packageDocumentation
6
6
  * @module Tiles
7
7
  */
8
- import { request } from "./request/Request";
9
8
  import { assert, BentleyStatus } from "@itwin/core-bentley";
10
9
  import { IModelError, RealityDataFormat, RealityDataProvider } from "@itwin/core-common";
10
+ import { request } from "./request/Request";
11
11
  import { ThreeDTileFormatInterpreter } from "./tile/internal";
12
12
  /** This class provides access to the reality data provider services.
13
13
  * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.
@@ -67,14 +67,6 @@ export class RealityDataSourceTilesetUrlImpl {
67
67
  else
68
68
  this._baseUrl = `${urlParts.join("/")}/`;
69
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
70
  /**
79
71
  * This method returns the URL to access the actual 3d tiles from the service provider.
80
72
  * @returns string containing the URL to reality data.
@@ -88,21 +80,21 @@ export class RealityDataSourceTilesetUrlImpl {
88
80
  throw new IModelError(BentleyStatus.ERROR, "Unable to get service url");
89
81
  // The following is only if the reality data is not stored on PW Context Share.
90
82
  this.setBaseUrl(url);
91
- return this._doRequest(url, "json");
83
+ return request(url, "json");
92
84
  }
93
85
  /**
94
86
  * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
95
87
  */
96
88
  async getTileContent(name) {
97
89
  const tileUrl = this._baseUrl + name;
98
- return this._doRequest(tileUrl, "arraybuffer");
90
+ return request(tileUrl, "arraybuffer");
99
91
  }
100
92
  /**
101
93
  * 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
94
  */
103
95
  async getTileJson(name) {
104
96
  const tileUrl = this._baseUrl + name;
105
- return this._doRequest(tileUrl, "json");
97
+ return request(tileUrl, "json");
106
98
  }
107
99
  getTileContentType(url) {
108
100
  return url.endsWith("json") ? "tileset" : "tile";
@@ -1 +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,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;;;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 public getTileContentType(url: string): \"tile\" | \"tileset\" {\r\n return url.endsWith(\"json\") ? \"tileset\" : \"tile\";\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"]}
1
+ {"version":3,"file":"RealityDataSourceTilesetUrlImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUrlImpl.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAc,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAe,iBAAiB,EAAE,mBAAmB,EAAgD,MAAM,oBAAoB,CAAC;AAEpJ,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CA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AAI,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 { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\r\nimport { IModelError, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\n\r\nimport { request } from \"./request/Request\";\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\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 request(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<ArrayBuffer> {\r\n const tileUrl = this._baseUrl + name;\r\n\r\n return request(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 request(tileUrl, \"json\");\r\n }\r\n\r\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\r\n return url.endsWith(\"json\") ? \"tileset\" : \"tile\";\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteExtensionProvider.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/RemoteExtensionProvider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAItB;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAInD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,4DAA4D;IAC5D,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAEJ,MAAM,EAAE,4BAA4B;IAIjE;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvC;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAWvD"}
1
+ {"version":3,"file":"RemoteExtensionProvider.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/RemoteExtensionProvider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAItB;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAInD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,4DAA4D;IAC5D,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAEJ,MAAM,EAAE,4BAA4B;IAIjE;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvC;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAIvD"}
@@ -23,14 +23,7 @@ export class RemoteExtensionProvider {
23
23
  * Throws an error if the provided manifestUrl is not accessible.
24
24
  */
25
25
  async getManifest() {
26
- const options = { method: "GET" };
27
- const response = await request(this._props.manifestUrl, options);
28
- const data = response.body || (() => {
29
- if (!response.text)
30
- throw new Error("Manifest file was empty.");
31
- return JSON.parse(response.text);
32
- })();
33
- return data;
26
+ return request(this._props.manifestUrl, "json");
34
27
  }
35
28
  }
36
29
  //# sourceMappingURL=RemoteExtensionProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteExtensionProvider.js","sourceRoot":"","sources":["../../../../src/extension/providers/RemoteExtensionProvider.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAkB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAanD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAIlC,YAA6B,MAAoC;QAApC,WAAM,GAAN,MAAM,CAA8B;QAC/D,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;QACtB,MAAM,OAAO,GAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,IAAI;gBAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC;CAEF","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\nimport type {\r\n ExtensionManifest,\r\n ExtensionProvider,\r\n} from \"../Extension\";\r\nimport { request, RequestOptions } from \"../../request/Request\";\r\nimport { loadScript } from \"./ExtensionLoadScript\";\r\n\r\n/**\r\n * Required props for a remote extension provider\r\n * @alpha\r\n */\r\nexport interface RemoteExtensionProviderProps {\r\n /** URL where the extension entry point can be loaded from */\r\n jsUrl: string;\r\n /** URL where the manifest (package.json) can be loaded from */\r\n manifestUrl: string;\r\n}\r\n\r\n/**\r\n * Implements a \"remote\" extension.\r\n * Remote extensions are hosted on an external server.\r\n * The execute() and getManifest() methods are used by the ExtensionAdmin to load and execute the extension.\r\n * @alpha\r\n */\r\nexport class RemoteExtensionProvider implements ExtensionProvider {\r\n /** The name of the server where the extension is hosted. */\r\n public readonly hostname: string;\r\n\r\n constructor(private readonly _props: RemoteExtensionProviderProps) {\r\n this.hostname = new URL(this._props.jsUrl).hostname.replace(\"www\", \"\");\r\n }\r\n\r\n /**\r\n * Attempts to execute an extension.\r\n * Throws an error if the provided jsUrl is not accessible.\r\n */\r\n public async execute(): Promise<string> {\r\n return loadScript(this._props.jsUrl);\r\n }\r\n\r\n /**\r\n * Attempts to fetch an extension's manifest (package.json) file.\r\n * Throws an error if the provided manifestUrl is not accessible.\r\n */\r\n public async getManifest(): Promise<ExtensionManifest> {\r\n const options: RequestOptions = { method: \"GET\" };\r\n const response = await request(this._props.manifestUrl, options);\r\n const data = response.body || (() => {\r\n if (!response.text)\r\n throw new Error(\"Manifest file was empty.\");\r\n return JSON.parse(response.text);\r\n })();\r\n return data;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"RemoteExtensionProvider.js","sourceRoot":"","sources":["../../../../src/extension/providers/RemoteExtensionProvider.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAanD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAIlC,YAA6B,MAAoC;QAApC,WAAM,GAAN,MAAM,CAA8B;QAC/D,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;QACtB,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CAEF","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\nimport type {\r\n ExtensionManifest,\r\n ExtensionProvider,\r\n} from \"../Extension\";\r\nimport { request } from \"../../request/Request\";\r\nimport { loadScript } from \"./ExtensionLoadScript\";\r\n\r\n/**\r\n * Required props for a remote extension provider\r\n * @alpha\r\n */\r\nexport interface RemoteExtensionProviderProps {\r\n /** URL where the extension entry point can be loaded from */\r\n jsUrl: string;\r\n /** URL where the manifest (package.json) can be loaded from */\r\n manifestUrl: string;\r\n}\r\n\r\n/**\r\n * Implements a \"remote\" extension.\r\n * Remote extensions are hosted on an external server.\r\n * The execute() and getManifest() methods are used by the ExtensionAdmin to load and execute the extension.\r\n * @alpha\r\n */\r\nexport class RemoteExtensionProvider implements ExtensionProvider {\r\n /** The name of the server where the extension is hosted. */\r\n public readonly hostname: string;\r\n\r\n constructor(private readonly _props: RemoteExtensionProviderProps) {\r\n this.hostname = new URL(this._props.jsUrl).hostname.replace(\"www\", \"\");\r\n }\r\n\r\n /**\r\n * Attempts to execute an extension.\r\n * Throws an error if the provided jsUrl is not accessible.\r\n */\r\n public async execute(): Promise<string> {\r\n return loadScript(this._props.jsUrl);\r\n }\r\n\r\n /**\r\n * Attempts to fetch an extension's manifest (package.json) file.\r\n * Throws an error if the provided manifestUrl is not accessible.\r\n */\r\n public async getManifest(): Promise<ExtensionManifest> {\r\n return request(this._props.manifestUrl, \"json\");\r\n }\r\n\r\n}\r\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { FeatureIndex, QParams3d } from "@itwin/core-common";
5
5
  export interface PointCloudArgs {
6
- positions: Uint8Array | Uint16Array;
6
+ positions: Uint8Array | Uint16Array | Float32Array;
7
7
  qparams: QParams3d;
8
8
  colors: Uint8Array;
9
9
  features: FeatureIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"PointCloudPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/render/primitives/PointCloudPrimitive.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,UAAU,GAAG,WAAW,CAAC;IACpC,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC;CAC5B"}
1
+ {"version":3,"file":"PointCloudPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/render/primitives/PointCloudPrimitive.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;IACnD,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"PointCloudPrimitive.js","sourceRoot":"","sources":["../../../../src/render/primitives/PointCloudPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Rendering\r\n */\r\n\r\nimport { FeatureIndex, QParams3d } from \"@itwin/core-common\";\r\n\r\nexport interface PointCloudArgs {\r\n positions: Uint8Array | Uint16Array;\r\n qparams: QParams3d;\r\n colors: Uint8Array;\r\n features: FeatureIndex;\r\n voxelSize: number;\r\n colorFormat: \"bgr\" | \"rgb\";\r\n}\r\n"]}
1
+ {"version":3,"file":"PointCloudPrimitive.js","sourceRoot":"","sources":["../../../../src/render/primitives/PointCloudPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","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 Rendering\r\n */\r\n\r\nimport { FeatureIndex, QParams3d } from \"@itwin/core-common\";\r\n\r\nexport interface PointCloudArgs {\r\n positions: Uint8Array | Uint16Array | Float32Array;\r\n qparams: QParams3d;\r\n colors: Uint8Array;\r\n features: FeatureIndex;\r\n voxelSize: number;\r\n colorFormat: \"bgr\" | \"rgb\";\r\n}\r\n"]}
@@ -140,7 +140,7 @@ export declare class QBufferHandle3d extends BufferHandle {
140
140
  /** The quantization scale in x, y, and z */
141
141
  readonly scale: Float32Array;
142
142
  constructor(qParams: QParams3d);
143
- static create(qParams: QParams3d, data: Uint16Array | Uint8Array): QBufferHandle3d | undefined;
143
+ static create(qParams: QParams3d, data: Uint16Array | Uint8Array | Float32Array): QBufferHandle3d | undefined;
144
144
  }
145
145
  export {};
146
146
  //# sourceMappingURL=AttributeBuffers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeBuffers.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/AttributeBuffers.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG1B,6HAA6H;AAC7H,UAAU,mBAAmB;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED,iFAAiF;AACjF,cAAM,mBAAmB;IACvB,OAAO;WACO,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,mBAAmB;WAG7E,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,mBAAmB;CAOvE;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,4GAA4G;IAC5G,YAAY,EAAE,OAAO,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,0IAA0I;IAC1I,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,yBAAiB,gBAAgB,CAAC;IAChC,SAAgB,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,M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YAAmB,OAAkB;QACnC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAkB,EAAE,IAAiB;QACxD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAM/C,YAAmB,OAAkB;QACnC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAkB,EAAE,IAA8B;QACrE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,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 WebGL\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport { QParams2d, QParams3d } from \"@itwin/core-common\";\r\nimport { WebGLDisposable } from \"./Disposable\";\r\nimport { GL } from \"./GL\";\r\nimport { System } from \"./System\";\r\n\r\n/** Describes a connection between a BufferHandle and an arbitrary number of attributes associated with that BufferHandle. */\r\ninterface BufferHandleLinkage {\r\n buffer: BufferHandle;\r\n params: BufferParameters[]; // If empty, means no vertex attrib details are necessary (index buffer probably)\r\n}\r\n\r\n/** Provides convenience methods for creating a BufferHandleLinkage interface. */\r\nclass BufferHandleLinkage {\r\n private constructor() { }\r\n public static create(buffer: BufferHandle, params: BufferParameters[]): BufferHandleLinkage {\r\n return { buffer, params };\r\n }\r\n public static clone(linkage: BufferHandleLinkage): BufferHandleLinkage {\r\n const clonedParams: BufferParameters[] = [];\r\n for (const param of linkage.params) {\r\n clonedParams.push(BufferParameters.clone(param));\r\n }\r\n return BufferHandleLinkage.create(linkage.buffer, clonedParams);\r\n }\r\n}\r\n\r\n/**\r\n * Describes the binding state of a BufferHandle when added to a BuffersContainer. See the WebGL function 'vertexAttribPointer'.\r\n * @internal\r\n */\r\nexport interface BufferParameters {\r\n /** Index used for binding attribute location for the associated BufferHandle. */\r\n glAttribLoc: number;\r\n /** Number of components for the attribute (1, 2, 3, or 4). */\r\n glSize: number;\r\n /** Data type of each component. */\r\n glType: number;\r\n /** If true, WebGL will normalize integer data values into a certain range (see WebGL specs for details). */\r\n glNormalized: boolean;\r\n /** Offset in bytes between the beginning of consecutive vertex attributes. */\r\n glStride: number;\r\n /** Offset in bytes of the first component in the vertex attribute array. */\r\n glOffset: number;\r\n /** Specifies whether the attribute is instanced. If so, the WebGL instancing extension function 'vertexAttribDivisor' will be called. */\r\n glInstanced: boolean;\r\n}\r\n\r\n/**\r\n * Provides convenience methods for creating a BuffersParameter interface.\r\n * @internal\r\n */\r\nexport namespace BufferParameters {\r\n export function create(glAttribLoc: number, glSize: number, glType: number, glNormalized: boolean, glStride: number, glOffset: number, glInstanced: boolean): BufferParameters {\r\n return { glAttribLoc, glSize, glType, glNormalized, glStride, glOffset, glInstanced };\r\n }\r\n\r\n export function clone(params: BufferParameters): BufferParameters {\r\n return BufferParameters.create(params.glAttribLoc, params.glSize, params.glType, params.glNormalized, params.glStride, params.glOffset, params.glInstanced);\r\n }\r\n}\r\n\r\n/**\r\n * An abstract class which specifies an interface for binding and unbinding vertex buffers and their associated state.\r\n * @internal\r\n */\r\nexport class BuffersContainer implements WebGLDisposable {\r\n public readonly linkages: BufferHandleLinkage[] = [];\r\n protected readonly _vao: VAOHandle;\r\n private readonly _context: WebGL2RenderingContext;\r\n\r\n public static create(): BuffersContainer {\r\n return new BuffersContainer(System.instance.context);\r\n }\r\n\r\n private constructor(context: WebGL2RenderingContext) {\r\n this._context = context;\r\n this._vao = new VAOHandle(this._context);\r\n }\r\n\r\n // NB: BufferHandle objects contained within BufferHandleLinkage entries are disposed where they are created because they could be shared among multiple BuffersContainer objects.\r\n public dispose(): void {\r\n this._vao.dispose();\r\n }\r\n\r\n public get isDisposed(): boolean {\r\n return this._vao.isDisposed;\r\n }\r\n\r\n public addBuffer(buffer: BufferHandle, params: BufferParameters[]): void {\r\n const linkage = BufferHandleLinkage.create(buffer, params);\r\n this.linkages.push(linkage);\r\n this._bindLinkage(linkage);\r\n }\r\n\r\n public appendLinkages(linkages: BufferHandleLinkage[]): void {\r\n for (const linkage of linkages) {\r\n this.linkages.push(BufferHandleLinkage.clone(linkage));\r\n this._bindLinkage(linkage);\r\n }\r\n }\r\n\r\n private _bindLinkage(linkage: BufferHandleLinkage) {\r\n this.bind();\r\n linkage.buffer.bind();\r\n for (const p of linkage.params) {\r\n System.instance.context.enableVertexAttribArray(p.glAttribLoc);\r\n if (p.glInstanced) {\r\n System.instance.vertexAttribDivisor(p.glAttribLoc, 1);\r\n }\r\n System.instance.context.vertexAttribPointer(p.glAttribLoc, p.glSize, p.glType, p.glNormalized, p.glStride, p.glOffset);\r\n }\r\n this.unbind();\r\n }\r\n\r\n public bind(): void {\r\n this._vao.bind();\r\n }\r\n\r\n public unbind(): void {\r\n VAOHandle.unbind(this._context);\r\n }\r\n}\r\n\r\n/** A handle to a WebGLVertexArrayObjectOES.\r\n * The WebGLVertexArrayObjectOES is allocated by the constructor and should be freed by a call to dispose().\r\n * @internal\r\n */\r\nexport class VAOHandle implements WebGLDisposable {\r\n private _context: WebGL2RenderingContext;\r\n private _arrayObject?: WebGLVertexArrayObjectOES;\r\n\r\n /** Allocates the WebGLVertexArrayObjectOES using the supplied context. Free the WebGLVertexArrayObjectOES using dispose() */\r\n public constructor(context: WebGL2RenderingContext) {\r\n this._context = context;\r\n const arrayObject = this._context.createVertexArray();\r\n\r\n // vaoExt.createVertexArrayOES() returns WebGLVertexArrayObjectOES | null...\r\n if (null !== arrayObject) {\r\n this._arrayObject = arrayObject;\r\n } else {\r\n this._arrayObject = undefined;\r\n }\r\n\r\n assert(!this.isDisposed);\r\n }\r\n\r\n public get isDisposed(): boolean { return this._arrayObject === undefined; }\r\n\r\n /** Frees the WebGL vertex array object */\r\n public dispose(): void {\r\n if (!this.isDisposed) {\r\n this._context.deleteVertexArray(this._arrayObject!);\r\n this._arrayObject = undefined;\r\n }\r\n }\r\n\r\n /** Binds this vertex array object */\r\n public bind(): void {\r\n if (undefined !== this._arrayObject) {\r\n this._context.bindVertexArray(this._arrayObject);\r\n }\r\n }\r\n\r\n /** Ensures no vertex array object is bound */\r\n public static unbind(context: WebGL2RenderingContext): void {\r\n context.bindVertexArray(null);\r\n }\r\n}\r\n\r\n/**\r\n * A handle to a WebGLBuffer, such as a vertex or index buffer.\r\n * The WebGLBuffer is allocated by the constructor and should be freed by a call to dispose().\r\n * @internal\r\n */\r\nexport class BufferHandle implements WebGLDisposable {\r\n private _target: GL.Buffer.Target;\r\n private _glBuffer?: WebGLBuffer;\r\n private _bytesUsed = 0;\r\n\r\n /** Allocates the WebGLBuffer using the supplied context. Free the WebGLBuffer using dispose() */\r\n public constructor(target: GL.Buffer.Target) {\r\n this._target = target;\r\n const glBuffer = System.instance.context.createBuffer();\r\n\r\n // gl.createBuffer() returns WebGLBuffer | null...\r\n if (null !== glBuffer) {\r\n this._glBuffer = glBuffer;\r\n } else {\r\n this._glBuffer = undefined;\r\n }\r\n\r\n assert(!this.isDisposed);\r\n }\r\n\r\n public get isDisposed(): boolean { return this._glBuffer === undefined; }\r\n public get bytesUsed(): number { return this._bytesUsed; }\r\n\r\n /** Frees the WebGL buffer */\r\n public dispose(): void {\r\n if (!this.isDisposed) {\r\n System.instance.context.deleteBuffer(this._glBuffer!);\r\n this._glBuffer = undefined;\r\n this._bytesUsed = 0;\r\n }\r\n }\r\n\r\n /** Binds this buffer to the target specified during construction */\r\n public bind(): void {\r\n if (undefined !== this._glBuffer) {\r\n System.instance.context.bindBuffer(this._target, this._glBuffer);\r\n }\r\n }\r\n\r\n /** Sets the specified target to be bound to no buffer */\r\n public unbind(): void { System.instance.context.bindBuffer(this._target, null); }\r\n\r\n /** Binds this buffer to the target specified at construction and sets the buffer's data store. */\r\n public bindData(data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw): void {\r\n this.bind();\r\n System.instance.context.bufferData(this._target, data, usage);\r\n this.unbind();\r\n this._bytesUsed = data.byteLength;\r\n }\r\n\r\n /** Creates a BufferHandle and binds its data */\r\n public static createBuffer(target: GL.Buffer.Target, data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw): BufferHandle | undefined {\r\n const handle = new BufferHandle(target);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data, usage);\r\n return handle;\r\n }\r\n /** Creates a BufferHandle and binds its data */\r\n public static createArrayBuffer(data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw) {\r\n return BufferHandle.createBuffer(GL.Buffer.Target.ArrayBuffer, data, usage);\r\n }\r\n\r\n public isBound(binding: GL.Buffer.Binding) { return System.instance.context.getParameter(binding) === this._glBuffer; }\r\n}\r\n\r\nfunction setScale(index: number, value: number, array: Float32Array) {\r\n array[index] = 0.0 !== value ? 1.0 / value : value;\r\n}\r\n\r\n/**\r\n * Converts 2d quantization parameters to a format appropriate for submittal to the GPU.\r\n * params[0] = origin.x\r\n * params[1] = origin.y\r\n * params[2] = scale.x\r\n * params[3] = scale.y\r\n * @internal\r\n */\r\nexport function qparams2dToArray(params: QParams2d): Float32Array {\r\n const arr = new Float32Array(4);\r\n\r\n arr[0] = params.origin.x;\r\n arr[1] = params.origin.y;\r\n setScale(2, params.scale.x, arr);\r\n setScale(3, params.scale.y, arr);\r\n\r\n return arr;\r\n}\r\n\r\n/** @internal */\r\nexport function qorigin3dToArray(qorigin: Point3d): Float32Array {\r\n const origin = new Float32Array(3);\r\n origin[0] = qorigin.x;\r\n origin[1] = qorigin.y;\r\n origin[2] = qorigin.z;\r\n return origin;\r\n}\r\n\r\n/** @internal */\r\nexport function qscale3dToArray(qscale: Point3d): Float32Array {\r\n const scale = new Float32Array(3);\r\n setScale(0, qscale.x, scale);\r\n setScale(1, qscale.y, scale);\r\n setScale(2, qscale.z, scale);\r\n return scale;\r\n}\r\n\r\n/** Converts 3d quantization params to a pair of Float32Arrays\r\n * @internal\r\n */\r\nexport function qparams3dToArray(params: QParams3d): { origin: Float32Array, scale: Float32Array } {\r\n const origin = qorigin3dToArray(params.origin);\r\n const scale = qscale3dToArray(params.scale);\r\n return { origin, scale };\r\n}\r\n\r\n/** A handle to a WebGLBuffer intended to hold quantized 2d points\r\n * @internal\r\n */\r\nexport class QBufferHandle2d extends BufferHandle {\r\n public readonly params: Float32Array;\r\n\r\n public constructor(qParams: QParams2d) {\r\n super(GL.Buffer.Target.ArrayBuffer);\r\n this.params = qparams2dToArray(qParams);\r\n }\r\n\r\n public static create(qParams: QParams2d, data: Uint16Array): QBufferHandle2d | undefined {\r\n const handle = new QBufferHandle2d(qParams);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data);\r\n return handle;\r\n }\r\n}\r\n\r\n/* A handle to a WebGLBuffer intended to hold quantized 3d points\r\n * @internal\r\n */\r\nexport class QBufferHandle3d extends BufferHandle {\r\n /** The quantization origin in x, y, and z */\r\n public readonly origin: Float32Array;\r\n /** The quantization scale in x, y, and z */\r\n public readonly scale: Float32Array;\r\n\r\n public constructor(qParams: QParams3d) {\r\n super(GL.Buffer.Target.ArrayBuffer);\r\n this.origin = qorigin3dToArray(qParams.origin);\r\n this.scale = qscale3dToArray(qParams.scale);\r\n }\r\n\r\n public static create(qParams: QParams3d, data: Uint16Array | Uint8Array): QBufferHandle3d | undefined {\r\n const handle = new QBufferHandle3d(qParams);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data);\r\n return handle;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AttributeBuffers.js","sourceRoot":"","sources":["../../../../src/render/webgl/AttributeBuffers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC,iFAAiF;AACjF,MAAM,mBAAmB;IACvB,gBAAwB,CAAC;IAClB,MAAM,CAAC,MAAM,CAAC,MAAoB,EAAE,MAA0B;QACnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC5B,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,OAA4B;QAC9C,MAAM,YAAY,GAAuB,EAAE,CAAC;QAC5C,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,MAAM,EAAE;YAClC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SAClD;QACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACF;AAuBD;;;GAG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,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAkB,EAAE,IAAiB;QACxD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAM/C,YAAmB,OAAkB;QACnC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,OAAkB,EAAE,IAA6C;QACpF,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,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 WebGL\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport { QParams2d, QParams3d } from \"@itwin/core-common\";\r\nimport { WebGLDisposable } from \"./Disposable\";\r\nimport { GL } from \"./GL\";\r\nimport { System } from \"./System\";\r\n\r\n/** Describes a connection between a BufferHandle and an arbitrary number of attributes associated with that BufferHandle. */\r\ninterface BufferHandleLinkage {\r\n buffer: BufferHandle;\r\n params: BufferParameters[]; // If empty, means no vertex attrib details are necessary (index buffer probably)\r\n}\r\n\r\n/** Provides convenience methods for creating a BufferHandleLinkage interface. */\r\nclass BufferHandleLinkage {\r\n private constructor() { }\r\n public static create(buffer: BufferHandle, params: BufferParameters[]): BufferHandleLinkage {\r\n return { buffer, params };\r\n }\r\n public static clone(linkage: BufferHandleLinkage): BufferHandleLinkage {\r\n const clonedParams: BufferParameters[] = [];\r\n for (const param of linkage.params) {\r\n clonedParams.push(BufferParameters.clone(param));\r\n }\r\n return BufferHandleLinkage.create(linkage.buffer, clonedParams);\r\n }\r\n}\r\n\r\n/**\r\n * Describes the binding state of a BufferHandle when added to a BuffersContainer. See the WebGL function 'vertexAttribPointer'.\r\n * @internal\r\n */\r\nexport interface BufferParameters {\r\n /** Index used for binding attribute location for the associated BufferHandle. */\r\n glAttribLoc: number;\r\n /** Number of components for the attribute (1, 2, 3, or 4). */\r\n glSize: number;\r\n /** Data type of each component. */\r\n glType: number;\r\n /** If true, WebGL will normalize integer data values into a certain range (see WebGL specs for details). */\r\n glNormalized: boolean;\r\n /** Offset in bytes between the beginning of consecutive vertex attributes. */\r\n glStride: number;\r\n /** Offset in bytes of the first component in the vertex attribute array. */\r\n glOffset: number;\r\n /** Specifies whether the attribute is instanced. If so, the WebGL instancing extension function 'vertexAttribDivisor' will be called. */\r\n glInstanced: boolean;\r\n}\r\n\r\n/**\r\n * Provides convenience methods for creating a BuffersParameter interface.\r\n * @internal\r\n */\r\nexport namespace BufferParameters {\r\n export function create(glAttribLoc: number, glSize: number, glType: number, glNormalized: boolean, glStride: number, glOffset: number, glInstanced: boolean): BufferParameters {\r\n return { glAttribLoc, glSize, glType, glNormalized, glStride, glOffset, glInstanced };\r\n }\r\n\r\n export function clone(params: BufferParameters): BufferParameters {\r\n return BufferParameters.create(params.glAttribLoc, params.glSize, params.glType, params.glNormalized, params.glStride, params.glOffset, params.glInstanced);\r\n }\r\n}\r\n\r\n/**\r\n * An abstract class which specifies an interface for binding and unbinding vertex buffers and their associated state.\r\n * @internal\r\n */\r\nexport class BuffersContainer implements WebGLDisposable {\r\n public readonly linkages: BufferHandleLinkage[] = [];\r\n protected readonly _vao: VAOHandle;\r\n private readonly _context: WebGL2RenderingContext;\r\n\r\n public static create(): BuffersContainer {\r\n return new BuffersContainer(System.instance.context);\r\n }\r\n\r\n private constructor(context: WebGL2RenderingContext) {\r\n this._context = context;\r\n this._vao = new VAOHandle(this._context);\r\n }\r\n\r\n // NB: BufferHandle objects contained within BufferHandleLinkage entries are disposed where they are created because they could be shared among multiple BuffersContainer objects.\r\n public dispose(): void {\r\n this._vao.dispose();\r\n }\r\n\r\n public get isDisposed(): boolean {\r\n return this._vao.isDisposed;\r\n }\r\n\r\n public addBuffer(buffer: BufferHandle, params: BufferParameters[]): void {\r\n const linkage = BufferHandleLinkage.create(buffer, params);\r\n this.linkages.push(linkage);\r\n this._bindLinkage(linkage);\r\n }\r\n\r\n public appendLinkages(linkages: BufferHandleLinkage[]): void {\r\n for (const linkage of linkages) {\r\n this.linkages.push(BufferHandleLinkage.clone(linkage));\r\n this._bindLinkage(linkage);\r\n }\r\n }\r\n\r\n private _bindLinkage(linkage: BufferHandleLinkage) {\r\n this.bind();\r\n linkage.buffer.bind();\r\n for (const p of linkage.params) {\r\n System.instance.context.enableVertexAttribArray(p.glAttribLoc);\r\n if (p.glInstanced) {\r\n System.instance.vertexAttribDivisor(p.glAttribLoc, 1);\r\n }\r\n System.instance.context.vertexAttribPointer(p.glAttribLoc, p.glSize, p.glType, p.glNormalized, p.glStride, p.glOffset);\r\n }\r\n this.unbind();\r\n }\r\n\r\n public bind(): void {\r\n this._vao.bind();\r\n }\r\n\r\n public unbind(): void {\r\n VAOHandle.unbind(this._context);\r\n }\r\n}\r\n\r\n/** A handle to a WebGLVertexArrayObjectOES.\r\n * The WebGLVertexArrayObjectOES is allocated by the constructor and should be freed by a call to dispose().\r\n * @internal\r\n */\r\nexport class VAOHandle implements WebGLDisposable {\r\n private _context: WebGL2RenderingContext;\r\n private _arrayObject?: WebGLVertexArrayObjectOES;\r\n\r\n /** Allocates the WebGLVertexArrayObjectOES using the supplied context. Free the WebGLVertexArrayObjectOES using dispose() */\r\n public constructor(context: WebGL2RenderingContext) {\r\n this._context = context;\r\n const arrayObject = this._context.createVertexArray();\r\n\r\n // vaoExt.createVertexArrayOES() returns WebGLVertexArrayObjectOES | null...\r\n if (null !== arrayObject) {\r\n this._arrayObject = arrayObject;\r\n } else {\r\n this._arrayObject = undefined;\r\n }\r\n\r\n assert(!this.isDisposed);\r\n }\r\n\r\n public get isDisposed(): boolean { return this._arrayObject === undefined; }\r\n\r\n /** Frees the WebGL vertex array object */\r\n public dispose(): void {\r\n if (!this.isDisposed) {\r\n this._context.deleteVertexArray(this._arrayObject!);\r\n this._arrayObject = undefined;\r\n }\r\n }\r\n\r\n /** Binds this vertex array object */\r\n public bind(): void {\r\n if (undefined !== this._arrayObject) {\r\n this._context.bindVertexArray(this._arrayObject);\r\n }\r\n }\r\n\r\n /** Ensures no vertex array object is bound */\r\n public static unbind(context: WebGL2RenderingContext): void {\r\n context.bindVertexArray(null);\r\n }\r\n}\r\n\r\n/**\r\n * A handle to a WebGLBuffer, such as a vertex or index buffer.\r\n * The WebGLBuffer is allocated by the constructor and should be freed by a call to dispose().\r\n * @internal\r\n */\r\nexport class BufferHandle implements WebGLDisposable {\r\n private _target: GL.Buffer.Target;\r\n private _glBuffer?: WebGLBuffer;\r\n private _bytesUsed = 0;\r\n\r\n /** Allocates the WebGLBuffer using the supplied context. Free the WebGLBuffer using dispose() */\r\n public constructor(target: GL.Buffer.Target) {\r\n this._target = target;\r\n const glBuffer = System.instance.context.createBuffer();\r\n\r\n // gl.createBuffer() returns WebGLBuffer | null...\r\n if (null !== glBuffer) {\r\n this._glBuffer = glBuffer;\r\n } else {\r\n this._glBuffer = undefined;\r\n }\r\n\r\n assert(!this.isDisposed);\r\n }\r\n\r\n public get isDisposed(): boolean { return this._glBuffer === undefined; }\r\n public get bytesUsed(): number { return this._bytesUsed; }\r\n\r\n /** Frees the WebGL buffer */\r\n public dispose(): void {\r\n if (!this.isDisposed) {\r\n System.instance.context.deleteBuffer(this._glBuffer!);\r\n this._glBuffer = undefined;\r\n this._bytesUsed = 0;\r\n }\r\n }\r\n\r\n /** Binds this buffer to the target specified during construction */\r\n public bind(): void {\r\n if (undefined !== this._glBuffer) {\r\n System.instance.context.bindBuffer(this._target, this._glBuffer);\r\n }\r\n }\r\n\r\n /** Sets the specified target to be bound to no buffer */\r\n public unbind(): void { System.instance.context.bindBuffer(this._target, null); }\r\n\r\n /** Binds this buffer to the target specified at construction and sets the buffer's data store. */\r\n public bindData(data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw): void {\r\n this.bind();\r\n System.instance.context.bufferData(this._target, data, usage);\r\n this.unbind();\r\n this._bytesUsed = data.byteLength;\r\n }\r\n\r\n /** Creates a BufferHandle and binds its data */\r\n public static createBuffer(target: GL.Buffer.Target, data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw): BufferHandle | undefined {\r\n const handle = new BufferHandle(target);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data, usage);\r\n return handle;\r\n }\r\n /** Creates a BufferHandle and binds its data */\r\n public static createArrayBuffer(data: BufferSource, usage: GL.Buffer.Usage = GL.Buffer.Usage.StaticDraw) {\r\n return BufferHandle.createBuffer(GL.Buffer.Target.ArrayBuffer, data, usage);\r\n }\r\n\r\n public isBound(binding: GL.Buffer.Binding) { return System.instance.context.getParameter(binding) === this._glBuffer; }\r\n}\r\n\r\nfunction setScale(index: number, value: number, array: Float32Array) {\r\n array[index] = 0.0 !== value ? 1.0 / value : value;\r\n}\r\n\r\n/**\r\n * Converts 2d quantization parameters to a format appropriate for submittal to the GPU.\r\n * params[0] = origin.x\r\n * params[1] = origin.y\r\n * params[2] = scale.x\r\n * params[3] = scale.y\r\n * @internal\r\n */\r\nexport function qparams2dToArray(params: QParams2d): Float32Array {\r\n const arr = new Float32Array(4);\r\n\r\n arr[0] = params.origin.x;\r\n arr[1] = params.origin.y;\r\n setScale(2, params.scale.x, arr);\r\n setScale(3, params.scale.y, arr);\r\n\r\n return arr;\r\n}\r\n\r\n/** @internal */\r\nexport function qorigin3dToArray(qorigin: Point3d): Float32Array {\r\n const origin = new Float32Array(3);\r\n origin[0] = qorigin.x;\r\n origin[1] = qorigin.y;\r\n origin[2] = qorigin.z;\r\n return origin;\r\n}\r\n\r\n/** @internal */\r\nexport function qscale3dToArray(qscale: Point3d): Float32Array {\r\n const scale = new Float32Array(3);\r\n setScale(0, qscale.x, scale);\r\n setScale(1, qscale.y, scale);\r\n setScale(2, qscale.z, scale);\r\n return scale;\r\n}\r\n\r\n/** Converts 3d quantization params to a pair of Float32Arrays\r\n * @internal\r\n */\r\nexport function qparams3dToArray(params: QParams3d): { origin: Float32Array, scale: Float32Array } {\r\n const origin = qorigin3dToArray(params.origin);\r\n const scale = qscale3dToArray(params.scale);\r\n return { origin, scale };\r\n}\r\n\r\n/** A handle to a WebGLBuffer intended to hold quantized 2d points\r\n * @internal\r\n */\r\nexport class QBufferHandle2d extends BufferHandle {\r\n public readonly params: Float32Array;\r\n\r\n public constructor(qParams: QParams2d) {\r\n super(GL.Buffer.Target.ArrayBuffer);\r\n this.params = qparams2dToArray(qParams);\r\n }\r\n\r\n public static create(qParams: QParams2d, data: Uint16Array): QBufferHandle2d | undefined {\r\n const handle = new QBufferHandle2d(qParams);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data);\r\n return handle;\r\n }\r\n}\r\n\r\n/* A handle to a WebGLBuffer intended to hold quantized 3d points\r\n * @internal\r\n */\r\nexport class QBufferHandle3d extends BufferHandle {\r\n /** The quantization origin in x, y, and z */\r\n public readonly origin: Float32Array;\r\n /** The quantization scale in x, y, and z */\r\n public readonly scale: Float32Array;\r\n\r\n public constructor(qParams: QParams3d) {\r\n super(GL.Buffer.Target.ArrayBuffer);\r\n this.origin = qorigin3dToArray(qParams.origin);\r\n this.scale = qscale3dToArray(qParams.scale);\r\n }\r\n\r\n public static create(qParams: QParams3d, data: Uint16Array | Uint8Array | Float32Array): QBufferHandle3d | undefined {\r\n const handle = new QBufferHandle3d(qParams);\r\n if (handle.isDisposed) {\r\n return undefined;\r\n }\r\n\r\n handle.bindData(data);\r\n return handle;\r\n }\r\n}\r\n"]}
@@ -29,7 +29,7 @@ export class PointCloudGeometry extends CachedGeometry {
29
29
  this._vertices = QBufferHandle3d.create(pointCloud.qparams, pointCloud.positions);
30
30
  const attrPos = AttributeMap.findAttribute("a_pos", 2 /* TechniqueId.PointCloud */, false);
31
31
  assert(undefined !== attrPos);
32
- const vertexDataType = (pointCloud.positions instanceof Uint8Array) ? GL.DataType.UnsignedByte : GL.DataType.UnsignedShort;
32
+ const vertexDataType = (pointCloud.positions instanceof Float32Array) ? GL.DataType.Float : ((pointCloud.positions instanceof Uint8Array) ? GL.DataType.UnsignedByte : GL.DataType.UnsignedShort);
33
33
  this.buffers.addBuffer(this._vertices, [BufferParameters.create(attrPos.location, 3, vertexDataType, false, 0, 0, false)]);
34
34
  this._vertexCount = pointCloud.positions.length / 3;
35
35
  this._hasFeatures = FeatureIndexType.Empty !== pointCloud.features.type;
@@ -1 +1 @@
1
- {"version":3,"file":"PointCloud.js","sourceRoot":"","sources":["../../../../src/render/webgl/PointCloud.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB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------------------------------------------------\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\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, dispose } from \"@itwin/core-bentley\";\r\nimport { FeatureIndexType } from \"@itwin/core-common\";\r\nimport { PointCloudArgs } from \"../primitives/PointCloudPrimitive\";\r\nimport { RenderMemory } from \"../RenderMemory\";\r\nimport { AttributeMap } from \"./AttributeMap\";\r\nimport { CachedGeometry } from \"./CachedGeometry\";\r\nimport { ShaderProgramParams } from \"./DrawCommand\";\r\nimport { GL } from \"./GL\";\r\nimport { BufferHandle, BufferParameters, BuffersContainer, QBufferHandle3d } from \"./AttributeBuffers\";\r\nimport { Pass, RenderOrder } from \"./RenderFlags\";\r\nimport { System } from \"./System\";\r\nimport { Target } from \"./Target\";\r\nimport { TechniqueId } from \"./TechniqueId\";\r\n\r\n/** @internal */\r\nexport class PointCloudGeometry extends CachedGeometry {\r\n public readonly buffers: BuffersContainer;\r\n private readonly _vertices: QBufferHandle3d;\r\n private readonly _vertexCount: number;\r\n private readonly _colorHandle: BufferHandle | undefined = undefined;\r\n private readonly _hasFeatures: boolean;\r\n\r\n public readonly voxelSize: number;\r\n public readonly colorIsBgr: boolean;\r\n\r\n public get isDisposed(): boolean { return this.buffers.isDisposed && this._vertices.isDisposed; }\r\n public override get asPointCloud(): PointCloudGeometry | undefined { return this; }\r\n public override get supportsThematicDisplay() { return true; }\r\n public get overrideColorMix() { return .5; } // This could be a setting from either the mesh or the override if required.\r\n\r\n public dispose() {\r\n dispose(this.buffers);\r\n dispose(this._vertices);\r\n }\r\n\r\n constructor(pointCloud: PointCloudArgs) {\r\n super();\r\n this.buffers = BuffersContainer.create();\r\n this._vertices = QBufferHandle3d.create(pointCloud.qparams, pointCloud.positions) as QBufferHandle3d;\r\n const attrPos = AttributeMap.findAttribute(\"a_pos\", TechniqueId.PointCloud, false);\r\n assert(undefined !== attrPos);\r\n const vertexDataType = (pointCloud.positions instanceof Uint8Array) ? GL.DataType.UnsignedByte : GL.DataType.UnsignedShort;\r\n this.buffers.addBuffer(this._vertices, [BufferParameters.create(attrPos.location, 3, vertexDataType, false, 0, 0, false)]);\r\n this._vertexCount = pointCloud.positions.length / 3;\r\n this._hasFeatures = FeatureIndexType.Empty !== pointCloud.features.type;\r\n this.voxelSize = pointCloud.voxelSize;\r\n this.colorIsBgr = \"bgr\" === pointCloud.colorFormat;\r\n\r\n if (undefined !== pointCloud.colors) {\r\n this._colorHandle = BufferHandle.createArrayBuffer(pointCloud.colors);\r\n const attrColor = AttributeMap.findAttribute(\"a_color\", TechniqueId.PointCloud, false);\r\n assert(undefined !== attrColor);\r\n this.buffers.addBuffer(this._colorHandle!, [BufferParameters.create(attrColor.location, 3, GL.DataType.UnsignedByte, true, 0, 0, false)]);\r\n }\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n const bytesUsed = this._vertices.bytesUsed + (undefined !== this._colorHandle ? this._colorHandle.bytesUsed : 0);\r\n stats.addPointCloud(bytesUsed);\r\n }\r\n\r\n protected _wantWoWReversal(_target: Target): boolean { return false; }\r\n\r\n public get techniqueId(): TechniqueId { return TechniqueId.PointCloud; }\r\n public override getPass(target: Target): Pass {\r\n // Point clouds don't cast shadows.\r\n return target.isDrawingShadowMap ? \"none\" : \"point-clouds\";\r\n }\r\n public get renderOrder(): RenderOrder { return RenderOrder.Linear; }\r\n public get qOrigin(): Float32Array { return this._vertices.origin; }\r\n public get qScale(): Float32Array { return this._vertices.scale; }\r\n public get colors(): BufferHandle | undefined { return this._colorHandle; }\r\n public override get hasFeatures() { return this._hasFeatures; }\r\n public override get hasBakedLighting() { return true; }\r\n\r\n public draw(): void {\r\n this.buffers.bind();\r\n System.instance.context.drawArrays(GL.PrimitiveType.Points, 0, this._vertexCount);\r\n this.buffers.unbind();\r\n }\r\n\r\n // ###TODO delete this.\r\n public override getLineWeight(_params: ShaderProgramParams): number {\r\n // If line weight < 0 it is real size in meters (voxel size).\r\n return (this.voxelSize > 0) ? - this.voxelSize : 1;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PointCloud.js","sourceRoot":"","sources":["../../../../src/render/webgl/PointCloud.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,gBAAgB;AAChB,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IAUpD,IAAW,UAAU,KAAc,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,IAAoB,YAAY,KAAqC,OAAO,IAAI,CAAC,CAAC,CAAC;IACnF,IAAoB,uBAAuB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAC9D,IAAW,gBAAgB,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,CAAK,4EAA4E;IAEtH,OAAO;QACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;IAED,YAAY,UAA0B;QACpC,KAAK,EAAE,CAAC;QAjBO,iBAAY,GAA6B,SAAS,CAAC;QAkBlE,IAAI,CAAC,OAAO,GAAG,gBAAgB,CA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K,OAAO,IAAI,CAAC,CAAC,CAAC;IAEhD,IAAI;QACT,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;IAED,uBAAuB;IACP,aAAa,CAAC,OAA4B;QACxD,6DAA6D;QAC7D,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,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\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, dispose } from \"@itwin/core-bentley\";\r\nimport { FeatureIndexType } from \"@itwin/core-common\";\r\nimport { PointCloudArgs } from \"../primitives/PointCloudPrimitive\";\r\nimport { RenderMemory } from \"../RenderMemory\";\r\nimport { AttributeMap } from \"./AttributeMap\";\r\nimport { CachedGeometry } from \"./CachedGeometry\";\r\nimport { ShaderProgramParams } from \"./DrawCommand\";\r\nimport { GL } from \"./GL\";\r\nimport { BufferHandle, BufferParameters, BuffersContainer, QBufferHandle3d } from \"./AttributeBuffers\";\r\nimport { Pass, RenderOrder } from \"./RenderFlags\";\r\nimport { System } from \"./System\";\r\nimport { Target } from \"./Target\";\r\nimport { TechniqueId } from \"./TechniqueId\";\r\n\r\n/** @internal */\r\nexport class PointCloudGeometry extends CachedGeometry {\r\n public readonly buffers: BuffersContainer;\r\n private readonly _vertices: QBufferHandle3d;\r\n private readonly _vertexCount: number;\r\n private readonly _colorHandle: BufferHandle | undefined = undefined;\r\n private readonly _hasFeatures: boolean;\r\n\r\n public readonly voxelSize: number;\r\n public readonly colorIsBgr: boolean;\r\n\r\n public get isDisposed(): boolean { return this.buffers.isDisposed && this._vertices.isDisposed; }\r\n public override get asPointCloud(): PointCloudGeometry | undefined { return this; }\r\n public override get supportsThematicDisplay() { return true; }\r\n public get overrideColorMix() { return .5; } // This could be a setting from either the mesh or the override if required.\r\n\r\n public dispose() {\r\n dispose(this.buffers);\r\n dispose(this._vertices);\r\n }\r\n\r\n constructor(pointCloud: PointCloudArgs) {\r\n super();\r\n this.buffers = BuffersContainer.create();\r\n this._vertices = QBufferHandle3d.create(pointCloud.qparams, pointCloud.positions) as QBufferHandle3d;\r\n const attrPos = AttributeMap.findAttribute(\"a_pos\", TechniqueId.PointCloud, false);\r\n assert(undefined !== attrPos);\r\n const vertexDataType = (pointCloud.positions instanceof Float32Array) ? GL.DataType.Float : ((pointCloud.positions instanceof Uint8Array) ? GL.DataType.UnsignedByte : GL.DataType.UnsignedShort);\r\n this.buffers.addBuffer(this._vertices, [BufferParameters.create(attrPos.location, 3, vertexDataType, false, 0, 0, false)]);\r\n this._vertexCount = pointCloud.positions.length / 3;\r\n this._hasFeatures = FeatureIndexType.Empty !== pointCloud.features.type;\r\n this.voxelSize = pointCloud.voxelSize;\r\n this.colorIsBgr = \"bgr\" === pointCloud.colorFormat;\r\n\r\n if (undefined !== pointCloud.colors) {\r\n this._colorHandle = BufferHandle.createArrayBuffer(pointCloud.colors);\r\n const attrColor = AttributeMap.findAttribute(\"a_color\", TechniqueId.PointCloud, false);\r\n assert(undefined !== attrColor);\r\n this.buffers.addBuffer(this._colorHandle!, [BufferParameters.create(attrColor.location, 3, GL.DataType.UnsignedByte, true, 0, 0, false)]);\r\n }\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n const bytesUsed = this._vertices.bytesUsed + (undefined !== this._colorHandle ? this._colorHandle.bytesUsed : 0);\r\n stats.addPointCloud(bytesUsed);\r\n }\r\n\r\n protected _wantWoWReversal(_target: Target): boolean { return false; }\r\n\r\n public get techniqueId(): TechniqueId { return TechniqueId.PointCloud; }\r\n public override getPass(target: Target): Pass {\r\n // Point clouds don't cast shadows.\r\n return target.isDrawingShadowMap ? \"none\" : \"point-clouds\";\r\n }\r\n public get renderOrder(): RenderOrder { return RenderOrder.Linear; }\r\n public get qOrigin(): Float32Array { return this._vertices.origin; }\r\n public get qScale(): Float32Array { return this._vertices.scale; }\r\n public get colors(): BufferHandle | undefined { return this._colorHandle; }\r\n public override get hasFeatures() { return this._hasFeatures; }\r\n public override get hasBakedLighting() { return true; }\r\n\r\n public draw(): void {\r\n this.buffers.bind();\r\n System.instance.context.drawArrays(GL.PrimitiveType.Points, 0, this._vertexCount);\r\n this.buffers.unbind();\r\n }\r\n\r\n // ###TODO delete this.\r\n public override getLineWeight(_params: ShaderProgramParams): number {\r\n // If line weight < 0 it is real size in meters (voxel size).\r\n return (this.voxelSize > 0) ? - this.voxelSize : 1;\r\n }\r\n}\r\n"]}
@@ -1,167 +1,41 @@
1
- /// <reference types="node" />
2
- import * as https from "https";
3
- import { BentleyError, GetMetaDataFunction, HttpStatus } from "@itwin/core-bentley";
4
- /** @internal */
5
- export declare const requestIdHeaderName = "X-Correlation-Id";
6
1
  /** @internal */
7
2
  export interface RequestBasicCredentials {
8
3
  user: string;
9
4
  password: string;
10
5
  }
11
- /** Typical option to query REST API. Note that services may not quite support these fields,
12
- * and the interface is only provided as a hint.
13
- * @internal
14
- */
15
- export interface RequestQueryOptions {
16
- /**
17
- * Select string used by the query (use the mapped EC property names, and not TypeScript property names)
18
- * Example: "Name,Size,Description"
19
- */
20
- $select?: string;
21
- /**
22
- * Filter string used by the query (use the mapped EC property names, and not TypeScript property names)
23
- * Example: "Name like '*.pdf' and Size lt 1000"
24
- */
25
- $filter?: string;
26
- /** Sets the limit on the number of entries to be returned by the query */
27
- $top?: number;
28
- /** Sets the number of entries to be skipped */
29
- $skip?: number;
30
- /**
31
- * Orders the return values (use the mapped EC property names, and not TypeScript property names)
32
- * Example: "Size desc"
33
- */
34
- $orderby?: string;
35
- /**
36
- * Sets the limit on the number of entries to be returned by a single response.
37
- * Can be used with a Top option. For example if Top is set to 1000 and PageSize
38
- * is set to 100 then 10 requests will be performed to get result.
39
- */
40
- $pageSize?: number;
41
- }
42
- /** @internal */
43
- export interface RequestQueryStringifyOptions {
44
- delimiter?: string;
45
- encode?: boolean;
46
- }
47
- /** Option to control the time outs
48
- * Use a short response timeout to detect unresponsive networks quickly, and a long deadline to give time for downloads on slow,
49
- * but reliable, networks. Note that both of these timers limit how long uploads of attached files are allowed to take. Use long
50
- * timeouts if you're uploading files.
6
+ /** Error object that's thrown if the status is *not* in the range of 200-299 (inclusive).
51
7
  * @internal
52
8
  */
53
- export interface RequestTimeoutOptions {
54
- /** Sets a deadline (in milliseconds) for the entire request (including all uploads, redirects, server processing time) to complete.
55
- * If the response isn't fully downloaded within that time, the request will be aborted
56
- */
57
- deadline?: number;
58
- /** Sets maximum time (in milliseconds) to wait for the first byte to arrive from the server, but it does not limit how long the entire
59
- * download can take. Response timeout should be at least few seconds longer than just the time it takes the server to respond, because
60
- * it also includes time to make DNS lookup, TCP/IP and TLS connections, and time to upload request data.
61
- */
62
- response?: number;
9
+ export declare class HttpResponseError extends Error {
10
+ status: number;
11
+ responseText?: string | undefined;
12
+ constructor(status: number, responseText?: string | undefined);
63
13
  }
64
14
  /** @internal */
65
15
  export interface RequestOptions {
66
- method: string;
16
+ retryCount?: number;
67
17
  headers?: any;
18
+ timeout?: number;
68
19
  auth?: RequestBasicCredentials;
69
- body?: any;
70
- qs?: any | RequestQueryOptions;
71
- responseType?: string;
72
- timeout?: RequestTimeoutOptions;
73
- stream?: any;
74
- readStream?: any;
75
- buffer?: any;
76
- parser?: any;
77
- accept?: string;
78
- redirects?: number;
79
- errorCallback?: (response: any) => ResponseError;
80
- retryCallback?: (error: any, response: any) => boolean;
81
- progressCallback?: ProgressCallback;
82
- agent?: https.Agent;
83
- retries?: number;
84
- useCorsProxy?: boolean;
85
20
  }
86
- /** Response object if the request was successful. Note that the status within the range of 200-299 are considered as a success.
21
+ /** @internal */
22
+ export declare function request(url: string, responseType: "arraybuffer", options?: RequestOptions): Promise<ArrayBuffer>;
23
+ /** @internal */
24
+ export declare function request(url: string, responseType: "json", options?: RequestOptions): Promise<any>;
25
+ /** @internal */
26
+ export declare function request(url: string, responseType: "text", options?: RequestOptions): Promise<string>;
27
+ /**
87
28
  * @internal
29
+ * @deprecated in 4.0. Use [[DownloadProgressInfo]].
88
30
  */
89
- export interface Response {
90
- body: any;
91
- text: string | undefined;
92
- header: any;
93
- status: number;
94
- }
95
- /** @internal */
96
31
  export interface ProgressInfo {
97
32
  percent?: number;
98
33
  total?: number;
99
34
  loaded: number;
100
35
  }
101
- /** @internal */
102
- export type ProgressCallback = (progress: ProgressInfo) => void;
103
- /** @internal */
104
- export declare class RequestGlobalOptions {
105
- static httpsProxy?: https.Agent;
106
- /** Creates an agent for any user defined proxy using the supplied additional options. Returns undefined if user hasn't defined a proxy.
107
- * @internal
108
- */
109
- static createHttpsProxy: (additionalOptions?: https.AgentOptions) => https.Agent | undefined;
110
- static maxRetries: number;
111
- static timeout: RequestTimeoutOptions;
112
- static online: boolean;
113
- }
114
- /** Error object that's thrown/rejected if the Request fails due to a network error, or if the status is *not* in the range of 200-299 (inclusive)
115
- * @internal
116
- */
117
- export declare class ResponseError extends BentleyError {
118
- protected _data?: any;
119
- status?: number;
120
- description?: string;
121
- constructor(errorNumber: number | HttpStatus, message?: string, getMetaData?: GetMetaDataFunction);
122
- /**
123
- * Parses error from server's response
124
- * @param response Http response from the server.
125
- * @returns Parsed error.
126
- * @internal
127
- */
128
- static parse(response: any, log?: boolean): ResponseError;
129
- /**
130
- * Decides whether request should be retried or not
131
- * @param error Error returned by request
132
- * @param response Response returned by request
133
- * @internal
134
- */
135
- static shouldRetry(error: any, response: any): boolean;
136
- /**
137
- * @internal
138
- */
139
- static parseHttpStatus(statusType: number): HttpStatus;
140
- /**
141
- * @internal
142
- */
143
- logMessage(): string;
144
- /**
145
- * Logs this error
146
- * @internal
147
- */
148
- log(): void;
149
- }
150
- /** Wrapper around making HTTP requests with the specific options.
151
- *
152
- * Usable in both a browser and node based environment.
153
- *
154
- * @param url Server URL to address the request
155
- * @param options Options to pass to the request
156
- * @returns Resolves to the response from the server
157
- * @throws ResponseError if the request fails due to network issues, or if the returned status is *outside* the range of 200-299 (inclusive)
158
- * @internal
159
- */
160
- export declare function request(url: string, options: RequestOptions): Promise<Response>;
161
36
  /**
162
- * fetch json from HTTP request
163
- * @param url server URL to address the request
164
37
  * @internal
38
+ * @deprecated in 4.0. Use [[OnDownloadProgress]].
165
39
  */
166
- export declare function getJson(url: string): Promise<any>;
40
+ export type ProgressCallback = (progress: ProgressInfo) => void;
167
41
  //# sourceMappingURL=Request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../src/request/Request.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAoB,MAAM,qBAAqB,CAAC;AAQtG,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;O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