@itwin/core-orbitgt 5.4.0-dev.7 → 5.5.0-dev.1

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 (206) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/core-orbitgt.js.map +1 -1
  3. package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
  4. package/lib/cjs/pointcloud/format/opc/AttributeReader.js.map +1 -1
  5. package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
  6. package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
  7. package/lib/cjs/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
  8. package/lib/cjs/pointcloud/format/opc/DirectoryReader.js.map +1 -1
  9. package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
  10. package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
  11. package/lib/cjs/pointcloud/format/opc/FileAccess.js.map +1 -1
  12. package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
  13. package/lib/cjs/pointcloud/format/opc/FileRecord.js.map +1 -1
  14. package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
  15. package/lib/cjs/pointcloud/format/opc/GeometryRecord.js.map +1 -1
  16. package/lib/cjs/pointcloud/format/opc/OPCReader.js.map +1 -1
  17. package/lib/cjs/pointcloud/format/opc/PointReader.js.map +1 -1
  18. package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
  19. package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
  20. package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
  21. package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
  22. package/lib/cjs/pointcloud/model/BlockIndex.js.map +1 -1
  23. package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
  24. package/lib/cjs/pointcloud/model/Grid.js.map +1 -1
  25. package/lib/cjs/pointcloud/model/GridIndex.js.map +1 -1
  26. package/lib/cjs/pointcloud/model/PointAttribute.js.map +1 -1
  27. package/lib/cjs/pointcloud/model/PointCloudReader.js.map +1 -1
  28. package/lib/cjs/pointcloud/model/PointData.js.map +1 -1
  29. package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
  30. package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
  31. package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
  32. package/lib/cjs/pointcloud/model/TileIndex.js.map +1 -1
  33. package/lib/cjs/pointcloud/render/AViewRequest.js.map +1 -1
  34. package/lib/cjs/pointcloud/render/Block.js.map +1 -1
  35. package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
  36. package/lib/cjs/pointcloud/render/FrameData.js.map +1 -1
  37. package/lib/cjs/pointcloud/render/Level.js.map +1 -1
  38. package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
  39. package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
  40. package/lib/cjs/spatial/crs/CRSEngine.js.map +1 -1
  41. package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
  42. package/lib/cjs/spatial/ecrs/Axis.js.map +1 -1
  43. package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
  44. package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
  45. package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
  46. package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
  47. package/lib/cjs/spatial/ecrs/Ellipsoid.js.map +1 -1
  48. package/lib/cjs/spatial/ecrs/OnlineEngine.js.map +1 -1
  49. package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
  50. package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
  51. package/lib/cjs/spatial/ecrs/OperationMethod.js.map +1 -1
  52. package/lib/cjs/spatial/ecrs/ParameterValue.js.map +1 -1
  53. package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
  54. package/lib/cjs/spatial/ecrs/PrimeMeridian.js.map +1 -1
  55. package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
  56. package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
  57. package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
  58. package/lib/cjs/spatial/ecrs/VerticalModel.js.map +1 -1
  59. package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
  60. package/lib/cjs/spatial/ecrs/WellKnownTextNode.js.map +1 -1
  61. package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
  62. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
  63. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
  64. package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
  65. package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
  66. package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
  67. package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
  68. package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
  69. package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
  70. package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
  71. package/lib/cjs/spatial/geom/Bounds.js.map +1 -1
  72. package/lib/cjs/spatial/geom/Coordinate.js.map +1 -1
  73. package/lib/cjs/spatial/geom/Line.js.map +1 -1
  74. package/lib/cjs/spatial/geom/Transform.js.map +1 -1
  75. package/lib/cjs/system/buffer/ABuffer.js.map +1 -1
  76. package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
  77. package/lib/cjs/system/buffer/LittleEndian.js.map +1 -1
  78. package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
  79. package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
  80. package/lib/cjs/system/collection/AList.js.map +1 -1
  81. package/lib/cjs/system/collection/IntMap.js.map +1 -1
  82. package/lib/cjs/system/collection/StringMap.js.map +1 -1
  83. package/lib/cjs/system/io/ABufferInStream.js.map +1 -1
  84. package/lib/cjs/system/io/InStream.js.map +1 -1
  85. package/lib/cjs/system/io/OutStream.js.map +1 -1
  86. package/lib/cjs/system/runtime/ALong.js.map +1 -1
  87. package/lib/cjs/system/runtime/ASystem.js.map +1 -1
  88. package/lib/cjs/system/runtime/Downloader.js.map +1 -1
  89. package/lib/cjs/system/runtime/DownloaderNode.js.map +1 -1
  90. package/lib/cjs/system/runtime/DownloaderXhr.js.map +1 -1
  91. package/lib/cjs/system/runtime/Message.js.map +1 -1
  92. package/lib/cjs/system/runtime/Numbers.js.map +1 -1
  93. package/lib/cjs/system/runtime/Strings.js.map +1 -1
  94. package/lib/cjs/system/runtime/iComparator.js.map +1 -1
  95. package/lib/cjs/system/storage/CacheList.js.map +1 -1
  96. package/lib/cjs/system/storage/CachedItem.js.map +1 -1
  97. package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
  98. package/lib/cjs/system/storage/FileContent.js.map +1 -1
  99. package/lib/cjs/system/storage/FileRange.js.map +1 -1
  100. package/lib/cjs/system/storage/FileStorage.js.map +1 -1
  101. package/lib/cjs/system/storage/NodeFS.js.map +1 -1
  102. package/lib/cjs/system/storage/PageCachedFile.js.map +1 -1
  103. package/lib/cjs/system/storage/UrlFS.js.map +1 -1
  104. package/lib/esm/core-orbitgt.js.map +1 -1
  105. package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
  106. package/lib/esm/pointcloud/format/opc/AttributeReader.js.map +1 -1
  107. package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
  108. package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
  109. package/lib/esm/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
  110. package/lib/esm/pointcloud/format/opc/DirectoryReader.js.map +1 -1
  111. package/lib/esm/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
  112. package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
  113. package/lib/esm/pointcloud/format/opc/FileAccess.js.map +1 -1
  114. package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
  115. package/lib/esm/pointcloud/format/opc/FileRecord.js.map +1 -1
  116. package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
  117. package/lib/esm/pointcloud/format/opc/GeometryRecord.js.map +1 -1
  118. package/lib/esm/pointcloud/format/opc/OPCReader.js.map +1 -1
  119. package/lib/esm/pointcloud/format/opc/PointReader.js.map +1 -1
  120. package/lib/esm/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
  121. package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
  122. package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
  123. package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
  124. package/lib/esm/pointcloud/model/BlockIndex.js.map +1 -1
  125. package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
  126. package/lib/esm/pointcloud/model/Grid.js.map +1 -1
  127. package/lib/esm/pointcloud/model/GridIndex.js.map +1 -1
  128. package/lib/esm/pointcloud/model/PointAttribute.js.map +1 -1
  129. package/lib/esm/pointcloud/model/PointCloudReader.js.map +1 -1
  130. package/lib/esm/pointcloud/model/PointData.js.map +1 -1
  131. package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
  132. package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
  133. package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
  134. package/lib/esm/pointcloud/model/TileIndex.js.map +1 -1
  135. package/lib/esm/pointcloud/render/AViewRequest.js.map +1 -1
  136. package/lib/esm/pointcloud/render/Block.js.map +1 -1
  137. package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
  138. package/lib/esm/pointcloud/render/FrameData.js.map +1 -1
  139. package/lib/esm/pointcloud/render/Level.js.map +1 -1
  140. package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
  141. package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
  142. package/lib/esm/spatial/crs/CRSEngine.js.map +1 -1
  143. package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
  144. package/lib/esm/spatial/ecrs/Axis.js.map +1 -1
  145. package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
  146. package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
  147. package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
  148. package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
  149. package/lib/esm/spatial/ecrs/Ellipsoid.js.map +1 -1
  150. package/lib/esm/spatial/ecrs/OnlineEngine.js.map +1 -1
  151. package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
  152. package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
  153. package/lib/esm/spatial/ecrs/OperationMethod.js.map +1 -1
  154. package/lib/esm/spatial/ecrs/ParameterValue.js.map +1 -1
  155. package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
  156. package/lib/esm/spatial/ecrs/PrimeMeridian.js.map +1 -1
  157. package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
  158. package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
  159. package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
  160. package/lib/esm/spatial/ecrs/VerticalModel.js.map +1 -1
  161. package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
  162. package/lib/esm/spatial/ecrs/WellKnownTextNode.js.map +1 -1
  163. package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
  164. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
  165. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
  166. package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
  167. package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
  168. package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
  169. package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
  170. package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
  171. package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
  172. package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
  173. package/lib/esm/spatial/geom/Bounds.js.map +1 -1
  174. package/lib/esm/spatial/geom/Coordinate.js.map +1 -1
  175. package/lib/esm/spatial/geom/Line.js.map +1 -1
  176. package/lib/esm/spatial/geom/Transform.js.map +1 -1
  177. package/lib/esm/system/buffer/ABuffer.js.map +1 -1
  178. package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
  179. package/lib/esm/system/buffer/LittleEndian.js.map +1 -1
  180. package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
  181. package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
  182. package/lib/esm/system/collection/AList.js.map +1 -1
  183. package/lib/esm/system/collection/IntMap.js.map +1 -1
  184. package/lib/esm/system/collection/StringMap.js.map +1 -1
  185. package/lib/esm/system/io/ABufferInStream.js.map +1 -1
  186. package/lib/esm/system/io/InStream.js.map +1 -1
  187. package/lib/esm/system/io/OutStream.js.map +1 -1
  188. package/lib/esm/system/runtime/ALong.js.map +1 -1
  189. package/lib/esm/system/runtime/ASystem.js.map +1 -1
  190. package/lib/esm/system/runtime/Downloader.js.map +1 -1
  191. package/lib/esm/system/runtime/DownloaderNode.js.map +1 -1
  192. package/lib/esm/system/runtime/DownloaderXhr.js.map +1 -1
  193. package/lib/esm/system/runtime/Message.js.map +1 -1
  194. package/lib/esm/system/runtime/Numbers.js.map +1 -1
  195. package/lib/esm/system/runtime/Strings.js.map +1 -1
  196. package/lib/esm/system/runtime/iComparator.js.map +1 -1
  197. package/lib/esm/system/storage/CacheList.js.map +1 -1
  198. package/lib/esm/system/storage/CachedItem.js.map +1 -1
  199. package/lib/esm/system/storage/ContentLoader.js.map +1 -1
  200. package/lib/esm/system/storage/FileContent.js.map +1 -1
  201. package/lib/esm/system/storage/FileRange.js.map +1 -1
  202. package/lib/esm/system/storage/FileStorage.js.map +1 -1
  203. package/lib/esm/system/storage/NodeFS.js.map +1 -1
  204. package/lib/esm/system/storage/PageCachedFile.js.map +1 -1
  205. package/lib/esm/system/storage/UrlFS.js.map +1 -1
  206. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Change Log - @itwin/core-orbitgt
2
2
 
3
- This log was last generated on Thu, 06 Nov 2025 20:30:21 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 20 Nov 2025 22:31:49 GMT and should not be manually modified.
4
+
5
+ ## 5.3.3
6
+ Thu, 20 Nov 2025 22:30:37 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.3.2
11
+ Thu, 13 Nov 2025 23:23:23 GMT
12
+
13
+ _Version update only_
4
14
 
5
15
  ## 5.3.1
6
16
  Thu, 06 Nov 2025 20:29:06 GMT
@@ -12,6 +22,16 @@ Mon, 03 Nov 2025 19:02:35 GMT
12
22
 
13
23
  _Version update only_
14
24
 
25
+ ## 5.2.6
26
+ Thu, 13 Nov 2025 21:13:51 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 5.2.5
31
+ Thu, 13 Nov 2025 07:45:14 GMT
32
+
33
+ _Version update only_
34
+
15
35
  ## 5.2.4
16
36
  Fri, 24 Oct 2025 16:20:38 GMT
17
37
 
@@ -119,6 +139,11 @@ Fri, 13 Jun 2025 20:25:38 GMT
119
139
 
120
140
  - Upgrade compile target to ES2023 and module to ES2022
121
141
 
142
+ ## 4.11.7
143
+ Thu, 13 Nov 2025 20:49:33 GMT
144
+
145
+ _Version update only_
146
+
122
147
  ## 4.11.6
123
148
  Mon, 16 Jun 2025 15:00:15 GMT
124
149
 
@@ -1 +1 @@
1
- {"version":3,"file":"core-orbitgt.js","sourceRoot":"","sources":["../../src/core-orbitgt.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,4DAAgF;AAAvE,+GAAA,UAAU,OAAqB;AACxC,0DAA6E;AAApE,6GAAA,SAAS,OAAoB;AACtC,0DAA6E;AAApE,6GAAA,SAAS,OAAoB;AACtC,iEAAuF;AAA9E,mHAAA,YAAY,OAAuB;AAC5C,+DAAoF;AAA3E,iHAAA,WAAW,OAAsB;AAC1C,2DAA8E;AAArE,6GAAA,SAAS,OAAoB;AACtC,mDAAkE;AAAzD,qGAAA,KAAK,OAAgB;AAC9B,yDAA2E;AAAlE,2GAAA,QAAQ,OAAmB;AACpC,qEAA6F;AAApF,uHAAA,cAAc,OAAyB;AAEhD,gDAAgE;AAAvD,uGAAA,MAAM,OAAiB;AAChC,wDAA4E;AAAnE,+GAAA,UAAU,OAAqB;AACxC,4CAA0D;AAAjD,mGAAA,IAAI,OAAe;AAC5B,sDAAyE;AAAhE,6GAAA,SAAS,OAAoB;AACtC,mDAAkE;AAAzD,qGAAA,KAAK,OAAgB;AAG9B,oEAAkD;AAClD,sEAAoD;AACpD,kEAAgD;AAChD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,8DAA4C;AAC5C,gFAAgF;AAChF,6BAA6B;AAC7B,mDAAmD;AACnD,iEAA+C;AAC/C,kEAAgD;AAChD,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport { BlockIndex as OrbitGtBlockIndex } from \"./pointcloud/model/BlockIndex\";\nexport { PointData as OrbitGtPointData } from \"./pointcloud/model/PointData\";\nexport { TileIndex as OrbitGtTileIndex } from \"./pointcloud/model/TileIndex\";\nexport { AViewRequest as OrbitGtIViewRequest } from \"./pointcloud/render/AViewRequest\";\nexport { DataManager as OrbitGtDataManager } from \"./pointcloud/render/DataManager\";\nexport { FrameData as OrbitGtFrameData } from \"./pointcloud/render/FrameData\";\nexport { Level as OrbitGtLevel } from \"./pointcloud/render/Level\";\nexport { ViewTree as OrbitGtViewTree } from \"./pointcloud/render/ViewTree\";\nexport { TileLoadSorter as OrbitGtTileLoadSorter } from \"./pointcloud/render/TileLoadSorter\";\nexport { IProjectToViewForSort as OrbitGtIProjectToViewForSort } from \"./pointcloud/render/TileLoadSorter\";\nexport { Bounds as OrbitGtBounds } from \"./spatial/geom/Bounds\";\nexport { Coordinate as OrbitGtCoordinate } from \"./spatial/geom/Coordinate\";\nexport { Line as OrbitGtLine } from \"./spatial/geom/Line\";\nexport { Transform as OrbitGtTransform } from \"./spatial/geom/Transform\";\nexport { AList as OrbitGtAList } from \"./system/collection/AList\";\nexport { iComparator as OrbitGtComparator } from \"./system/runtime/iComparator\";\n\nexport * from \"./pointcloud/format/opc/OPCReader\";\nexport * from \"./pointcloud/model/PointCloudReader\";\nexport * from \"./pointcloud/model/PointDataRaw\";\nexport * from \"./spatial/crs/CRSManager\";\nexport * from \"./spatial/ecrs/OnlineEngine\";\nexport * from \"./system/runtime/ALong\";\nexport * from \"./system/runtime/Downloader\";\n// Do not export the Node specific functionality from the barrel. It will cause\n// polyfills on the frontend.\n// export * from \"./system/runtime/DownloaderNode\";\nexport * from \"./system/runtime/DownloaderXhr\";\nexport * from \"./system/storage/PageCachedFile\";\nexport * from \"./system/storage/UrlFS\";"]}
1
+ {"version":3,"file":"core-orbitgt.js","sourceRoot":"","sources":["../../src/core-orbitgt.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,4DAAgF;AAAvE,+GAAA,UAAU,OAAqB;AACxC,0DAA6E;AAApE,6GAAA,SAAS,OAAoB;AACtC,0DAA6E;AAApE,6GAAA,SAAS,OAAoB;AACtC,iEAAuF;AAA9E,mHAAA,YAAY,OAAuB;AAC5C,+DAAoF;AAA3E,iHAAA,WAAW,OAAsB;AAC1C,2DAA8E;AAArE,6GAAA,SAAS,OAAoB;AACtC,mDAAkE;AAAzD,qGAAA,KAAK,OAAgB;AAC9B,yDAA2E;AAAlE,2GAAA,QAAQ,OAAmB;AACpC,qEAA6F;AAApF,uHAAA,cAAc,OAAyB;AAEhD,gDAAgE;AAAvD,uGAAA,MAAM,OAAiB;AAChC,wDAA4E;AAAnE,+GAAA,UAAU,OAAqB;AACxC,4CAA0D;AAAjD,mGAAA,IAAI,OAAe;AAC5B,sDAAyE;AAAhE,6GAAA,SAAS,OAAoB;AACtC,mDAAkE;AAAzD,qGAAA,KAAK,OAAgB;AAG9B,oEAAkD;AAClD,sEAAoD;AACpD,kEAAgD;AAChD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,8DAA4C;AAC5C,gFAAgF;AAChF,6BAA6B;AAC7B,mDAAmD;AACnD,iEAA+C;AAC/C,kEAAgD;AAChD,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\r\nexport { BlockIndex as OrbitGtBlockIndex } from \"./pointcloud/model/BlockIndex\";\r\nexport { PointData as OrbitGtPointData } from \"./pointcloud/model/PointData\";\r\nexport { TileIndex as OrbitGtTileIndex } from \"./pointcloud/model/TileIndex\";\r\nexport { AViewRequest as OrbitGtIViewRequest } from \"./pointcloud/render/AViewRequest\";\r\nexport { DataManager as OrbitGtDataManager } from \"./pointcloud/render/DataManager\";\r\nexport { FrameData as OrbitGtFrameData } from \"./pointcloud/render/FrameData\";\r\nexport { Level as OrbitGtLevel } from \"./pointcloud/render/Level\";\r\nexport { ViewTree as OrbitGtViewTree } from \"./pointcloud/render/ViewTree\";\r\nexport { TileLoadSorter as OrbitGtTileLoadSorter } from \"./pointcloud/render/TileLoadSorter\";\r\nexport { IProjectToViewForSort as OrbitGtIProjectToViewForSort } from \"./pointcloud/render/TileLoadSorter\";\r\nexport { Bounds as OrbitGtBounds } from \"./spatial/geom/Bounds\";\r\nexport { Coordinate as OrbitGtCoordinate } from \"./spatial/geom/Coordinate\";\r\nexport { Line as OrbitGtLine } from \"./spatial/geom/Line\";\r\nexport { Transform as OrbitGtTransform } from \"./spatial/geom/Transform\";\r\nexport { AList as OrbitGtAList } from \"./system/collection/AList\";\r\nexport { iComparator as OrbitGtComparator } from \"./system/runtime/iComparator\";\r\n\r\nexport * from \"./pointcloud/format/opc/OPCReader\";\r\nexport * from \"./pointcloud/model/PointCloudReader\";\r\nexport * from \"./pointcloud/model/PointDataRaw\";\r\nexport * from \"./spatial/crs/CRSManager\";\r\nexport * from \"./spatial/ecrs/OnlineEngine\";\r\nexport * from \"./system/runtime/ALong\";\r\nexport * from \"./system/runtime/Downloader\";\r\n// Do not export the Node specific functionality from the barrel. It will cause\r\n// polyfills on the frontend.\r\n// export * from \"./system/runtime/DownloaderNode\";\r\nexport * from \"./system/runtime/DownloaderXhr\";\r\nexport * from \"./system/storage/PageCachedFile\";\r\nexport * from \"./system/storage/UrlFS\";"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeMask.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/AttributeMask.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,4DAAyD;AAKzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IACtB,wCAAwC;IACjC,UAAU,CAAwB;IACzC,oCAAoC;IAC7B,OAAO,CAAyB;IAEvC;;;OAGG;IACH,YAAmB,OAA+B;QAC9C,WAAW;QACX,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,mCAAmC;QACnC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;YAC5G,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,UAAsB;QAChD,IAAI,OAAO,GAA2B,IAAI,aAAK,EAAmB,CAAC;QACnE,KAAK,IAAI,MAAM,IAAI,UAAU,CAAC,yBAAyB,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/E,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AAhCD,sCAgCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { AList } from \"../../../system/collection/AList\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { FileReader } from \"./FileReader\";\n\n/**\n * Class AttributeMask defines a mask of attributes to read.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class AttributeMask {\n /** The definitions of the attributes */\n public attributes: Array<PointAttribute>;\n /** The readers of the attributes */\n public readers: AList<AttributeReader>;\n\n /**\n * Create a new mask.\n * @param readers the list of attribute readers (can be null).\n */\n public constructor(readers: AList<AttributeReader>) {\n /* Clear */\n this.attributes = null;\n this.readers = null;\n /* Do we have a list of readers? */\n if (readers != null) {\n this.attributes = new Array<PointAttribute>(readers.size());\n for (let i: number = 0; i < this.attributes.length; i++) this.attributes[i] = readers.get(i).getAttribute();\n this.readers = readers;\n }\n }\n\n /**\n * Read all embedded attributes of a file.\n * @param fileReader the file reader.\n * @return the mask.\n */\n public static readAllEmbedded(fileReader: FileReader): AttributeMask {\n let readers: AList<AttributeReader> = new AList<AttributeReader>();\n for (let reader of fileReader.getStaticAttributeReaders()) readers.add(reader);\n return new AttributeMask(readers);\n }\n}\n"]}
1
+ {"version":3,"file":"AttributeMask.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/AttributeMask.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,4DAAyD;AAKzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IACtB,wCAAwC;IACjC,UAAU,CAAwB;IACzC,oCAAoC;IAC7B,OAAO,CAAyB;IAEvC;;;OAGG;IACH,YAAmB,OAA+B;QAC9C,WAAW;QACX,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,mCAAmC;QACnC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;YAC5G,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,UAAsB;QAChD,IAAI,OAAO,GAA2B,IAAI,aAAK,EAAmB,CAAC;QACnE,KAAK,IAAI,MAAM,IAAI,UAAU,CAAC,yBAAyB,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/E,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AAhCD,sCAgCC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { PointAttribute } from \"../../model/PointAttribute\";\r\nimport { AttributeReader } from \"./AttributeReader\";\r\nimport { FileReader } from \"./FileReader\";\r\n\r\n/**\r\n * Class AttributeMask defines a mask of attributes to read.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class AttributeMask {\r\n /** The definitions of the attributes */\r\n public attributes: Array<PointAttribute>;\r\n /** The readers of the attributes */\r\n public readers: AList<AttributeReader>;\r\n\r\n /**\r\n * Create a new mask.\r\n * @param readers the list of attribute readers (can be null).\r\n */\r\n public constructor(readers: AList<AttributeReader>) {\r\n /* Clear */\r\n this.attributes = null;\r\n this.readers = null;\r\n /* Do we have a list of readers? */\r\n if (readers != null) {\r\n this.attributes = new Array<PointAttribute>(readers.size());\r\n for (let i: number = 0; i < this.attributes.length; i++) this.attributes[i] = readers.get(i).getAttribute();\r\n this.readers = readers;\r\n }\r\n }\r\n\r\n /**\r\n * Read all embedded attributes of a file.\r\n * @param fileReader the file reader.\r\n * @return the mask.\r\n */\r\n public static readAllEmbedded(fileReader: FileReader): AttributeMask {\r\n let readers: AList<AttributeReader> = new AList<AttributeReader>();\r\n for (let reader of fileReader.getStaticAttributeReaders()) readers.add(reader);\r\n return new AttributeMask(readers);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/AttributeReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAmBH;;;;GAIG;AACH,gBAAgB;AAChB,MAAsB,eAAe;IACjC;;OAEG;IACH;IACA,CAAC;CA6CJ;AAlDD,0CAkDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { AttributeValue } from \"../../model/AttributeValue\";\nimport { CloudPoint } from \"../../model/CloudPoint\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { ReadRequest } from \"../../model/ReadRequest\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { TileReadBuffer } from \"./TileReadBuffer\";\n\n/**\n * Class AttributeReader reads attribute data.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport abstract class AttributeReader {\n /**\n * Create a new reader.\n */\n public constructor() {\n }\n\n /**\n * Close the reader.\n */\n public abstract close(): void;\n\n /**\n * Get the attribute.\n * @return the attribute.\n */\n public abstract getAttribute(): PointAttribute;\n\n /**\n * Get the minimum value.\n * @return the minimum value.\n */\n public abstract getMinimumValue(): AttributeValue;\n\n /**\n * Get the maximum value.\n * @return the maximum value.\n */\n public abstract getMaximumValue(): AttributeValue;\n\n /**\n * Read the raw data for a tile.\n * @param level the index of the level.\n * @param tile the tile.\n * @param tileBuffer the buffer to read into.\n * @param bufferIndex the index of the attribute in the read buffer.\n * @param readRequest the read parameters (contains the result read statistics).\n */\n public abstract readTileData2(level: int32, tile: TileIndex, pointOffset: ALong, pointCount: int32, tileBuffer: TileReadBuffer, bufferIndex: int32, readRequest: ReadRequest, fileContents: ContentLoader): void;\n\n /**\n * Get an attribute value.\n * @param level the index of the level.\n * @param tile the tile.\n * @param tileBuffer the buffer that has been read.\n * @param bufferIndex the index of the attribute in the read buffer.\n * @param pointIndex the index of the point in the tile (starts at 0).\n * @param cloudPoint the point to read the attribute of.\n */\n public abstract getPointData(level: int32, tile: TileIndex, tileBuffer: TileReadBuffer, bufferIndex: int32, pointIndex: int32, cloudPoint: CloudPoint): void;\n}\n"]}
1
+ {"version":3,"file":"AttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/AttributeReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAmBH;;;;GAIG;AACH,gBAAgB;AAChB,MAAsB,eAAe;IACjC;;OAEG;IACH;IACA,CAAC;CA6CJ;AAlDD,0CAkDC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { AttributeValue } from \"../../model/AttributeValue\";\r\nimport { CloudPoint } from \"../../model/CloudPoint\";\r\nimport { PointAttribute } from \"../../model/PointAttribute\";\r\nimport { ReadRequest } from \"../../model/ReadRequest\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { TileReadBuffer } from \"./TileReadBuffer\";\r\n\r\n/**\r\n * Class AttributeReader reads attribute data.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport abstract class AttributeReader {\r\n /**\r\n * Create a new reader.\r\n */\r\n public constructor() {\r\n }\r\n\r\n /**\r\n * Close the reader.\r\n */\r\n public abstract close(): void;\r\n\r\n /**\r\n * Get the attribute.\r\n * @return the attribute.\r\n */\r\n public abstract getAttribute(): PointAttribute;\r\n\r\n /**\r\n * Get the minimum value.\r\n * @return the minimum value.\r\n */\r\n public abstract getMinimumValue(): AttributeValue;\r\n\r\n /**\r\n * Get the maximum value.\r\n * @return the maximum value.\r\n */\r\n public abstract getMaximumValue(): AttributeValue;\r\n\r\n /**\r\n * Read the raw data for a tile.\r\n * @param level the index of the level.\r\n * @param tile the tile.\r\n * @param tileBuffer the buffer to read into.\r\n * @param bufferIndex the index of the attribute in the read buffer.\r\n * @param readRequest the read parameters (contains the result read statistics).\r\n */\r\n public abstract readTileData2(level: int32, tile: TileIndex, pointOffset: ALong, pointCount: int32, tileBuffer: TileReadBuffer, bufferIndex: int32, readRequest: ReadRequest, fileContents: ContentLoader): void;\r\n\r\n /**\r\n * Get an attribute value.\r\n * @param level the index of the level.\r\n * @param tile the tile.\r\n * @param tileBuffer the buffer that has been read.\r\n * @param bufferIndex the index of the attribute in the read buffer.\r\n * @param pointIndex the index of the point in the tile (starts at 0).\r\n * @param cloudPoint the point to read the attribute of.\r\n */\r\n public abstract getPointData(level: int32, tile: TileIndex, tileBuffer: TileReadBuffer, bufferIndex: int32, pointIndex: int32, cloudPoint: CloudPoint): void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,sEAAmE;AAInE,6DAA0D;AAC1D,uDAAoD;AACpD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,WAAW;IACpB,yCAAyC;IAClC,MAAM,CAAU,WAAW,GAAU,EAAE,CAAC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CAAC,OAAO,CAAC,KAAY,EAAE,KAAe,EAAE,UAAiB,EAAE,SAAgB,EAAE,UAAiB;QACvG,qBAAqB;QACrB,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,SAAS,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,UAAU,GAAU,2BAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3D,uBAAuB;QACvB,OAAO,IAAI,uBAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,qBAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAClI,CAAC;;AAjEL,kCAkEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { OutStream } from \"../../../system/io/OutStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Numbers } from \"../../../system/runtime/Numbers\";\nimport { BlockIndex } from \"../../model/BlockIndex\";\nimport { GridIndex } from \"../../model/GridIndex\";\n\n/**\n * Class BlockRecord defines a (32x32x32) block of tiles.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class BlockRecord {\n /** The size of the record in the file */\n public static readonly RECORD_SIZE: int32 = 24;\n\n /**\n * No instances.\n */\n private constructor() {\n }\n\n /**\n * Convert a tile grid index to a block grid index.\n * @param tileIndex the tile index.\n * @param blockSize the block size.\n * @return the block index.\n */\n public static toBlockIndex1(tileIndex: int32, blockSize: int32): int32 {\n if (tileIndex < 0) return Numbers.divInt((tileIndex + 1), blockSize) - 1;\n return Numbers.divInt(tileIndex, blockSize);\n }\n\n /**\n * Convert a tile grid index to a block grid index.\n * @param tileX the x index of the tile.\n * @param tileY the y index of the tile.\n * @param tileZ the z index of the tile.\n * @param blockSize the block size.\n * @return the block index.\n */\n public static toBlockIndex(tileX: int32, tileY: int32, tileZ: int32, blockSize: int32): GridIndex {\n return new GridIndex(BlockRecord.toBlockIndex1(tileX, blockSize), BlockRecord.toBlockIndex1(tileY, blockSize), BlockRecord.toBlockIndex1(tileZ, blockSize));\n }\n\n /**\n * Write a record.\n * @param output the output stream.\n */\n public static write(block: BlockIndex, output: OutStream): void {\n let blockX: int32 = block.gridIndex.x;\n let blockY: int32 = block.gridIndex.y;\n let blockZ: int32 = block.gridIndex.z;\n LittleEndian.writeStreamInt(output, blockX);\n LittleEndian.writeStreamInt(output, blockY);\n LittleEndian.writeStreamInt(output, blockZ);\n LittleEndian.writeStreamInt(output, block.tileCount);\n LittleEndian.writeStreamLong(output, block.pointCount);\n }\n\n /**\n * Read a record.\n * @param level the level.\n * @param in the input stream from the file.\n * @param tileIndex the index of the tile.\n * @param pointIndex the index of the first point in the block.\n * @return the requested record.\n */\n public static readNew(level: int32, input: InStream, blockIndex: int32, tileIndex: int32, pointIndex: ALong): BlockIndex {\n /* Read the record */\n let blockX: int32 = LittleEndian.readStreamInt(input);\n let blockY: int32 = LittleEndian.readStreamInt(input);\n let blockZ: int32 = LittleEndian.readStreamInt(input);\n let tileCount: int32 = LittleEndian.readStreamInt(input);\n let pointCount: ALong = LittleEndian.readStreamLong(input);\n /* Create the record */\n return new BlockIndex(level, blockIndex, new GridIndex(blockX, blockY, blockZ), tileIndex, tileCount, pointIndex, pointCount);\n }\n}\n"]}
1
+ {"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,sEAAmE;AAInE,6DAA0D;AAC1D,uDAAoD;AACpD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,WAAW;IACpB,yCAAyC;IAClC,MAAM,CAAU,WAAW,GAAU,EAAE,CAAC;IAE/C;;OAEG;IACH;IACA,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,SAAgB,EAAE,SAAgB;QAC1D,IAAI,SAAS,GAAG,CAAC;YAAE,OAAO,iBAAO,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QACzE,OAAO,iBAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,YAAY,CAAC,KAAY,EAAE,KAAY,EAAE,KAAY,EAAE,SAAgB;QACjF,OAAO,IAAI,qBAAS,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IAChK,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,KAAiB,EAAE,MAAiB;QACpD,IAAI,MAAM,GAAU,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QACtC,IAAI,MAAM,GAAU,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QACtC,IAAI,MAAM,GAAU,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QACtC,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACrD,2BAAY,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,OAAO,CAAC,KAAY,EAAE,KAAe,EAAE,UAAiB,EAAE,SAAgB,EAAE,UAAiB;QACvG,qBAAqB;QACrB,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,SAAS,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,UAAU,GAAU,2BAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3D,uBAAuB;QACvB,OAAO,IAAI,uBAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,qBAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAClI,CAAC;;AAjEL,kCAkEC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { InStream } from \"../../../system/io/InStream\";\r\nimport { OutStream } from \"../../../system/io/OutStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { Numbers } from \"../../../system/runtime/Numbers\";\r\nimport { BlockIndex } from \"../../model/BlockIndex\";\r\nimport { GridIndex } from \"../../model/GridIndex\";\r\n\r\n/**\r\n * Class BlockRecord defines a (32x32x32) block of tiles.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class BlockRecord {\r\n /** The size of the record in the file */\r\n public static readonly RECORD_SIZE: int32 = 24;\r\n\r\n /**\r\n * No instances.\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * Convert a tile grid index to a block grid index.\r\n * @param tileIndex the tile index.\r\n * @param blockSize the block size.\r\n * @return the block index.\r\n */\r\n public static toBlockIndex1(tileIndex: int32, blockSize: int32): int32 {\r\n if (tileIndex < 0) return Numbers.divInt((tileIndex + 1), blockSize) - 1;\r\n return Numbers.divInt(tileIndex, blockSize);\r\n }\r\n\r\n /**\r\n * Convert a tile grid index to a block grid index.\r\n * @param tileX the x index of the tile.\r\n * @param tileY the y index of the tile.\r\n * @param tileZ the z index of the tile.\r\n * @param blockSize the block size.\r\n * @return the block index.\r\n */\r\n public static toBlockIndex(tileX: int32, tileY: int32, tileZ: int32, blockSize: int32): GridIndex {\r\n return new GridIndex(BlockRecord.toBlockIndex1(tileX, blockSize), BlockRecord.toBlockIndex1(tileY, blockSize), BlockRecord.toBlockIndex1(tileZ, blockSize));\r\n }\r\n\r\n /**\r\n * Write a record.\r\n * @param output the output stream.\r\n */\r\n public static write(block: BlockIndex, output: OutStream): void {\r\n let blockX: int32 = block.gridIndex.x;\r\n let blockY: int32 = block.gridIndex.y;\r\n let blockZ: int32 = block.gridIndex.z;\r\n LittleEndian.writeStreamInt(output, blockX);\r\n LittleEndian.writeStreamInt(output, blockY);\r\n LittleEndian.writeStreamInt(output, blockZ);\r\n LittleEndian.writeStreamInt(output, block.tileCount);\r\n LittleEndian.writeStreamLong(output, block.pointCount);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param level the level.\r\n * @param in the input stream from the file.\r\n * @param tileIndex the index of the tile.\r\n * @param pointIndex the index of the first point in the block.\r\n * @return the requested record.\r\n */\r\n public static readNew(level: int32, input: InStream, blockIndex: int32, tileIndex: int32, pointIndex: ALong): BlockIndex {\r\n /* Read the record */\r\n let blockX: int32 = LittleEndian.readStreamInt(input);\r\n let blockY: int32 = LittleEndian.readStreamInt(input);\r\n let blockZ: int32 = LittleEndian.readStreamInt(input);\r\n let tileCount: int32 = LittleEndian.readStreamInt(input);\r\n let pointCount: ALong = LittleEndian.readStreamLong(input);\r\n /* Create the record */\r\n return new BlockIndex(level, blockIndex, new GridIndex(blockX, blockY, blockZ), tileIndex, tileCount, pointIndex, pointCount);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ContainerFile.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,4DAAyD;AACzD,wEAAqE;AAErE,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,6DAA0D;AAE1D,2DAAwD;AACxD,6CAA0C;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IACtB,8BAA8B;IACtB,MAAM,CAAU,MAAM,GAAW,eAAe,CAAC;IAEzD,2BAA2B;IACnB,SAAS,CAAS;IAC1B,6BAA6B;IACrB,WAAW,CAAQ;IAC3B,iBAAiB;IACT,OAAO,CAAS;IACxB,4BAA4B;IACpB,MAAM,CAA2B;IAEzC;;;;;;OAMG;IACH,YAAmB,QAAgB,EAAE,UAAiB,EAAE,MAAc,EAAE,KAA+B;QACnG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC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AQ,EAAE,GAAG,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACxI,+BAA+B;YAC/B,IAAI,UAAU,GAAU,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnD,SAAS,GAAG,aAAK,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjD,CAAC;QACD,UAAU;QACV,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,0BAA0B;QAC1B,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,sBAAsB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QAClH,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,uBAAuB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9H,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;;AAtLL,sCAuLC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { FileAccess } from \"./FileAccess\";\n\n/**\n * Class ContainerFile defines a single file that contains multiple internal parts.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class ContainerFile {\n /** The name of this module */\n private static readonly MODULE: string = \"ContainerFile\";\n\n /** The name of the file */\n private _fileName: string;\n /** The length of the file */\n private _fileLength: ALong;\n /** The format */\n private _format: string;\n /** The parts in the file */\n private _parts: AList<ContainerFilePart>;\n\n /**\n * Create a new container file.\n * @param fileName the name of the file.\n * @param fileLength the length of the file.\n * @param format the format.\n * @param parts the parts in the file.\n */\n public constructor(fileName: string, fileLength: ALong, format: string, parts: AList<ContainerFilePart>) {\n this._fileName = fileName;\n this._fileLength = fileLength;\n this._format = format;\n this._parts = parts;\n }\n\n /**\n * Close the container file.\n * @param closeFileAccess close all file access?\n */\n public close(closeFileAccess: boolean): void {\n if (closeFileAccess) for (let i: number = 0; i < this._parts.size(); i++) this._parts.get(i).getFileAccess().close();\n this._parts.clear();\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the length of the file.\n * @return the length of the file.\n */\n public getFileLength(): ALong {\n return this._fileLength;\n }\n\n /**\n * Get the format.\n * @return the format.\n */\n public getFormat(): string {\n return this._format;\n }\n\n /**\n * Get the number of parts.\n * @return the number of parts.\n */\n public getPartCount(): int32 {\n return this._parts.size();\n }\n\n /**\n * Get the list of parts.\n * @return the list of parts.\n */\n public getParts(): AList<ContainerFilePart> {\n return this._parts;\n }\n\n /**\n * Get a part.\n * @param name the name of the part.\n * @return the part (null if not found).\n */\n public getPart(name: string): ContainerFilePart {\n /* Check all parts */\n for (let i: number = 0; i < this._parts.size(); i++) {\n /* Check the next part */\n let part: ContainerFilePart = this._parts.get(i);\n if (Strings.equals(part.getName(), name)) return part;\n }\n /* Not found */\n return null;\n }\n\n /**\n * Check if the magic marker is found.\n * @param input the input stream.\n * @param format the 4-character identifier of the format.\n * @return true if found, false if not.\n */\n private static checkMarker(input: InStream, format: string): boolean {\n let m0: int32 = LittleEndian.readStreamByte(input);\n let m1: int32 = LittleEndian.readStreamByte(input);\n let m2: int32 = LittleEndian.readStreamByte(input);\n let m3: int32 = LittleEndian.readStreamByte(input);\n if (m0 != Strings.getCharAt(format, 0)) return false;\n if (m1 != Strings.getCharAt(format, 1)) return false;\n if (m2 != Strings.getCharAt(format, 2)) return false;\n if (m3 != Strings.getCharAt(format, 3)) return false;\n return true;\n }\n\n /**\n * Read the parts of a container file.\n * @param containerFileName the name of the container file.\n * @param format the 4-character identifier of the format.\n * @return the container file.\n */\n public static async read(fileStorage: FileStorage, containerFileName: string, format: string): Promise<ContainerFile> {\n /* Existing file? */\n Message.print(ContainerFile.MODULE, \"Reading container file '\" + containerFileName + \"'\");\n let fileLength: ALong = await fileStorage.getFileLength(containerFileName);\n if (fileLength.isNegative()) {\n /* Abort */\n Message.printWarning(ContainerFile.MODULE, \"File not found\");\n return null;\n }\n /* Too short? */\n if (fileLength.subInt(16).isNegative()) {\n /* Fail */\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (too short)\");\n }\n /* Read the file header */\n let headerSize: int32 = 60 * 1024;\n if (fileLength.subInt(headerSize).isNegative()) headerSize = fileLength.toInt();\n let header: ABuffer = await fileStorage.readFilePart(containerFileName, ALong.ZERO, headerSize);\n let headerInput: ABufferInStream = new ABufferInStream(header, 0, header.size());\n /* Check the marker */\n if (ContainerFile.checkMarker(headerInput, format) == false) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (header marker)\");\n }\n /* Check the version */\n let version: int32 = LittleEndian.readStreamByte(headerInput);\n if (version != 2) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (version \" + version + \")\");\n }\n /* Reserved */\n let r1: int32 = LittleEndian.readStreamByte(headerInput);\n let r2: int32 = LittleEndian.readStreamByte(headerInput);\n let r3: int32 = LittleEndian.readStreamByte(headerInput);\n /* Get the file count */\n let fileCount: int32 = LittleEndian.readStreamInt(headerInput);\n if (fileCount < 0) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, ContainerFile.MODULE + \" : Invalid container file '\" + containerFileName + \"' (file count \" + fileCount + \")\");\n }\n /* Define the file access */\n let fileAccess: FileAccess = new FileAccess(fileStorage, containerFileName, fileLength);\n /* Read the parts */\n let maxExtent: ALong = ALong.ZERO;\n let parts: AList<ContainerFilePart> = new AList<ContainerFilePart>();\n for (let i: number = 0; i < fileCount; i++) {\n /* Read the next file */\n let partOffset: ALong = LittleEndian.readStreamLong(headerInput);\n let partLength: ALong = LittleEndian.readStreamLong(headerInput);\n let partName: string = LittleEndian.readStreamString(headerInput);\n /* Add the part */\n parts.add(new ContainerFilePart(partName, fileAccess, partOffset, partLength));\n Message.print(ContainerFile.MODULE, \"Found part '\" + partName + \"' offset \" + partOffset.toDouble() + \" size \" + partLength.toDouble());\n /* Update the maximum extent */\n let partExtent: ALong = partOffset.add(partLength);\n maxExtent = ALong.max(maxExtent, partExtent);\n }\n /* Done */\n headerInput.close();\n /* Return the container */\n Message.print(ContainerFile.MODULE, \"Found \" + parts.size() + \" parts, header size \" + headerInput.getPosition());\n Message.print(ContainerFile.MODULE, \"File size is \" + fileLength.toDouble() + \", max part extent is \" + maxExtent.toDouble());\n return new ContainerFile(containerFileName, fileLength, format, parts);\n }\n}\n"]}
1
+ {"version":3,"file":"ContainerFile.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,4DAAyD;AACzD,wEAAqE;AAErE,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,6DAA0D;AAE1D,2DAAwD;AACxD,6CAA0C;AAE1C;;;;G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U,2BAAY,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACjE,IAAI,QAAQ,GAAW,2BAAY,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;YAClE,kBAAkB;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,qCAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;YAC/E,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACxI,+BAA+B;YAC/B,IAAI,UAAU,GAAU,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnD,SAAS,GAAG,aAAK,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjD,CAAC;QACD,UAAU;QACV,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,0BAA0B;QAC1B,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,sBAAsB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QAClH,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,uBAAuB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9H,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;;AAtLL,sCAuLC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\r\nimport { InStream } from \"../../../system/io/InStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../../system/runtime/ASystem\";\r\nimport { Message } from \"../../../system/runtime/Message\";\r\nimport { Strings } from \"../../../system/runtime/Strings\";\r\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { FileAccess } from \"./FileAccess\";\r\n\r\n/**\r\n * Class ContainerFile defines a single file that contains multiple internal parts.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class ContainerFile {\r\n /** The name of this module */\r\n private static readonly MODULE: string = \"ContainerFile\";\r\n\r\n /** The name of the file */\r\n private _fileName: string;\r\n /** The length of the file */\r\n private _fileLength: ALong;\r\n /** The format */\r\n private _format: string;\r\n /** The parts in the file */\r\n private _parts: AList<ContainerFilePart>;\r\n\r\n /**\r\n * Create a new container file.\r\n * @param fileName the name of the file.\r\n * @param fileLength the length of the file.\r\n * @param format the format.\r\n * @param parts the parts in the file.\r\n */\r\n public constructor(fileName: string, fileLength: ALong, format: string, parts: AList<ContainerFilePart>) {\r\n this._fileName = fileName;\r\n this._fileLength = fileLength;\r\n this._format = format;\r\n this._parts = parts;\r\n }\r\n\r\n /**\r\n * Close the container file.\r\n * @param closeFileAccess close all file access?\r\n */\r\n public close(closeFileAccess: boolean): void {\r\n if (closeFileAccess) for (let i: number = 0; i < this._parts.size(); i++) this._parts.get(i).getFileAccess().close();\r\n this._parts.clear();\r\n }\r\n\r\n /**\r\n * Get the name of the file.\r\n * @return the name of the file.\r\n */\r\n public getFileName(): string {\r\n return this._fileName;\r\n }\r\n\r\n /**\r\n * Get the length of the file.\r\n * @return the length of the file.\r\n */\r\n public getFileLength(): ALong {\r\n return this._fileLength;\r\n }\r\n\r\n /**\r\n * Get the format.\r\n * @return the format.\r\n */\r\n public getFormat(): string {\r\n return this._format;\r\n }\r\n\r\n /**\r\n * Get the number of parts.\r\n * @return the number of parts.\r\n */\r\n public getPartCount(): int32 {\r\n return this._parts.size();\r\n }\r\n\r\n /**\r\n * Get the list of parts.\r\n * @return the list of parts.\r\n */\r\n public getParts(): AList<ContainerFilePart> {\r\n return this._parts;\r\n }\r\n\r\n /**\r\n * Get a part.\r\n * @param name the name of the part.\r\n * @return the part (null if not found).\r\n */\r\n public getPart(name: string): ContainerFilePart {\r\n /* Check all parts */\r\n for (let i: number = 0; i < this._parts.size(); i++) {\r\n /* Check the next part */\r\n let part: ContainerFilePart = this._parts.get(i);\r\n if (Strings.equals(part.getName(), name)) return part;\r\n }\r\n /* Not found */\r\n return null;\r\n }\r\n\r\n /**\r\n * Check if the magic marker is found.\r\n * @param input the input stream.\r\n * @param format the 4-character identifier of the format.\r\n * @return true if found, false if not.\r\n */\r\n private static checkMarker(input: InStream, format: string): boolean {\r\n let m0: int32 = LittleEndian.readStreamByte(input);\r\n let m1: int32 = LittleEndian.readStreamByte(input);\r\n let m2: int32 = LittleEndian.readStreamByte(input);\r\n let m3: int32 = LittleEndian.readStreamByte(input);\r\n if (m0 != Strings.getCharAt(format, 0)) return false;\r\n if (m1 != Strings.getCharAt(format, 1)) return false;\r\n if (m2 != Strings.getCharAt(format, 2)) return false;\r\n if (m3 != Strings.getCharAt(format, 3)) return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * Read the parts of a container file.\r\n * @param containerFileName the name of the container file.\r\n * @param format the 4-character identifier of the format.\r\n * @return the container file.\r\n */\r\n public static async read(fileStorage: FileStorage, containerFileName: string, format: string): Promise<ContainerFile> {\r\n /* Existing file? */\r\n Message.print(ContainerFile.MODULE, \"Reading container file '\" + containerFileName + \"'\");\r\n let fileLength: ALong = await fileStorage.getFileLength(containerFileName);\r\n if (fileLength.isNegative()) {\r\n /* Abort */\r\n Message.printWarning(ContainerFile.MODULE, \"File not found\");\r\n return null;\r\n }\r\n /* Too short? */\r\n if (fileLength.subInt(16).isNegative()) {\r\n /* Fail */\r\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (too short)\");\r\n }\r\n /* Read the file header */\r\n let headerSize: int32 = 60 * 1024;\r\n if (fileLength.subInt(headerSize).isNegative()) headerSize = fileLength.toInt();\r\n let header: ABuffer = await fileStorage.readFilePart(containerFileName, ALong.ZERO, headerSize);\r\n let headerInput: ABufferInStream = new ABufferInStream(header, 0, header.size());\r\n /* Check the marker */\r\n if (ContainerFile.checkMarker(headerInput, format) == false) {\r\n /* Fail */\r\n headerInput.close();\r\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (header marker)\");\r\n }\r\n /* Check the version */\r\n let version: int32 = LittleEndian.readStreamByte(headerInput);\r\n if (version != 2) {\r\n /* Fail */\r\n headerInput.close();\r\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (version \" + version + \")\");\r\n }\r\n /* Reserved */\r\n let r1: int32 = LittleEndian.readStreamByte(headerInput);\r\n let r2: int32 = LittleEndian.readStreamByte(headerInput);\r\n let r3: int32 = LittleEndian.readStreamByte(headerInput);\r\n /* Get the file count */\r\n let fileCount: int32 = LittleEndian.readStreamInt(headerInput);\r\n if (fileCount < 0) {\r\n /* Fail */\r\n headerInput.close();\r\n ASystem.assert0(false, ContainerFile.MODULE + \" : Invalid container file '\" + containerFileName + \"' (file count \" + fileCount + \")\");\r\n }\r\n /* Define the file access */\r\n let fileAccess: FileAccess = new FileAccess(fileStorage, containerFileName, fileLength);\r\n /* Read the parts */\r\n let maxExtent: ALong = ALong.ZERO;\r\n let parts: AList<ContainerFilePart> = new AList<ContainerFilePart>();\r\n for (let i: number = 0; i < fileCount; i++) {\r\n /* Read the next file */\r\n let partOffset: ALong = LittleEndian.readStreamLong(headerInput);\r\n let partLength: ALong = LittleEndian.readStreamLong(headerInput);\r\n let partName: string = LittleEndian.readStreamString(headerInput);\r\n /* Add the part */\r\n parts.add(new ContainerFilePart(partName, fileAccess, partOffset, partLength));\r\n Message.print(ContainerFile.MODULE, \"Found part '\" + partName + \"' offset \" + partOffset.toDouble() + \" size \" + partLength.toDouble());\r\n /* Update the maximum extent */\r\n let partExtent: ALong = partOffset.add(partLength);\r\n maxExtent = ALong.max(maxExtent, partExtent);\r\n }\r\n /* Done */\r\n headerInput.close();\r\n /* Return the container */\r\n Message.print(ContainerFile.MODULE, \"Found \" + parts.size() + \" parts, header size \" + headerInput.getPosition());\r\n Message.print(ContainerFile.MODULE, \"File size is \" + fileLength.toDouble() + \", max part extent is \" + maxExtent.toDouble());\r\n return new ContainerFile(containerFileName, fileLength, format, parts);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ContainerFilePart.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFilePart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,6DAA0D;AAG1D;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,iBAAiB;IAC1B,eAAe;IACP,KAAK,CAAS;IACtB,sBAAsB;IACd,WAAW,CAAa;IAChC,iBAAiB;IACT,OAAO,CAAQ;IACvB,eAAe;IACP,KAAK,CAAQ;IAErB;;;;;;OAMG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,MAAa,EAAE,IAAW;QAC/E,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO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AAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClL,CAAC;CACJ;AArED,8CAqEC;AAED,wBAAwB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { FileAccess } from \"./FileAccess\";\n\n/**\n * Class ContainerFilePart defines a part in a container file.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class ContainerFilePart {\n /** The name */\n private _name: string;\n /** The file access */\n private _fileAccess: FileAccess;\n /** The offset */\n private _offset: ALong;\n /** The size */\n private _size: ALong;\n\n /**\n * Create a new part.\n * @param name the name of the part.\n * @param fileAccess the file access.\n * @param offset the offset of the part.\n * @param size the size of the part.\n */\n public constructor(name: string, fileAccess: FileAccess, offset: ALong, size: ALong) {\n this._fileAccess = fileAccess;\n this._offset = offset;\n this._size = size;\n this._name = name;\n }\n\n /**\n * Get the name of the part.\n * @return the name of the part.\n */\n public getName(): string {\n return this._name;\n }\n\n /**\n * Get the file access.\n * @return the file access.\n */\n public getFileAccess(): FileAccess {\n return this._fileAccess;\n }\n\n /**\n * Get the offset of the part.\n * @return the offset of the part.\n */\n public getOffset(): ALong {\n return this._offset;\n }\n\n /**\n * Get the size of the part.\n * @return the size of the part.\n */\n public getSize(): ALong {\n return this._size;\n }\n\n /**\n * Do a range check for this part.\n * @param checkOffset the offset of the range we want to touch.\n * @param checkSize the size of the range we want to touch.\n */\n public rangeCheck(checkOffset: ALong, checkSize: ALong): void {\n let checkExtent: ALong = checkOffset.add(checkSize);\n let extent: ALong = this._offset.add(this._size);\n ASystem.assertNot(checkOffset.sub(this._offset).isNegative(), \"Range offset \" + checkOffset.toString() + \" falls before part \" + this._offset.toString() + \"..\" + extent.toString());\n ASystem.assertNot(extent.sub(checkOffset).isNegative(), \"Range offset \" + checkOffset.toString() + \" falls after part \" + this._offset.toString() + \"..\" + extent.toString());\n ASystem.assertNot(checkSize.isNegative(), \"Range size \" + checkSize.toString() + \" is negative\");\n ASystem.assertNot(extent.sub(checkExtent).isNegative(), \"Range extent \" + checkExtent.toString() + \" falls after part \" + this._offset.toString() + \"..\" + extent.toString());\n }\n}\n\n//ContainerFilePart.java\n"]}
1
+ {"version":3,"file":"ContainerFilePart.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFilePart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,6DAA0D;AAG1D;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,iBAAiB;IAC1B,eAAe;IACP,KAAK,CAAS;IACtB,sBAAsB;IACd,WAAW,CAAa;IAChC,iBAAiB;IACT,OAAO,CAAQ;IACvB,eAAe;IACP,KAAK,CAAQ;IAErB;;;;;;OAMG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,MAAa,EAAE,IAAW;QAC/E,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,WAAkB,EAAE,SAAgB;QAClD,IAAI,WAAW,GAAU,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,MAAM,GAAU,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjD,iBAAO,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,eAAe,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrL,iBAAO,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,EAAE,eAAe,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9K,iBAAO,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,aAAa,GAAG,SAAS,CAAC,QAAQ,EAAE,GAAG,cAAc,CAAC,CAAC;QACjG,iBAAO,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,EAAE,eAAe,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClL,CAAC;CACJ;AArED,8CAqEC;AAED,wBAAwB","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../../system/runtime/ASystem\";\r\nimport { FileAccess } from \"./FileAccess\";\r\n\r\n/**\r\n * Class ContainerFilePart defines a part in a container file.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class ContainerFilePart {\r\n /** The name */\r\n private _name: string;\r\n /** The file access */\r\n private _fileAccess: FileAccess;\r\n /** The offset */\r\n private _offset: ALong;\r\n /** The size */\r\n private _size: ALong;\r\n\r\n /**\r\n * Create a new part.\r\n * @param name the name of the part.\r\n * @param fileAccess the file access.\r\n * @param offset the offset of the part.\r\n * @param size the size of the part.\r\n */\r\n public constructor(name: string, fileAccess: FileAccess, offset: ALong, size: ALong) {\r\n this._fileAccess = fileAccess;\r\n this._offset = offset;\r\n this._size = size;\r\n this._name = name;\r\n }\r\n\r\n /**\r\n * Get the name of the part.\r\n * @return the name of the part.\r\n */\r\n public getName(): string {\r\n return this._name;\r\n }\r\n\r\n /**\r\n * Get the file access.\r\n * @return the file access.\r\n */\r\n public getFileAccess(): FileAccess {\r\n return this._fileAccess;\r\n }\r\n\r\n /**\r\n * Get the offset of the part.\r\n * @return the offset of the part.\r\n */\r\n public getOffset(): ALong {\r\n return this._offset;\r\n }\r\n\r\n /**\r\n * Get the size of the part.\r\n * @return the size of the part.\r\n */\r\n public getSize(): ALong {\r\n return this._size;\r\n }\r\n\r\n /**\r\n * Do a range check for this part.\r\n * @param checkOffset the offset of the range we want to touch.\r\n * @param checkSize the size of the range we want to touch.\r\n */\r\n public rangeCheck(checkOffset: ALong, checkSize: ALong): void {\r\n let checkExtent: ALong = checkOffset.add(checkSize);\r\n let extent: ALong = this._offset.add(this._size);\r\n ASystem.assertNot(checkOffset.sub(this._offset).isNegative(), \"Range offset \" + checkOffset.toString() + \" falls before part \" + this._offset.toString() + \"..\" + extent.toString());\r\n ASystem.assertNot(extent.sub(checkOffset).isNegative(), \"Range offset \" + checkOffset.toString() + \" falls after part \" + this._offset.toString() + \"..\" + extent.toString());\r\n ASystem.assertNot(checkSize.isNegative(), \"Range size \" + checkSize.toString() + \" is negative\");\r\n ASystem.assertNot(extent.sub(checkExtent).isNegative(), \"Range extent \" + checkExtent.toString() + \" falls after part \" + this._offset.toString() + \"..\" + extent.toString());\r\n }\r\n}\r\n\r\n//ContainerFilePart.java\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectoryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,4DAAyD;AACzD,wEAAqE;AACrE,yDAAsD;AACtD,6DAA0D;AAG1D,qDAAkD;AAClD,qDAAkD;AAClD,+CAA4C;AAE5C,uDAAoD;AAIpD,6CAA0C;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,eAAe;IACxB,sBAAsB;IACd,WAAW,CAAa;IAChC,gBAAgB;IACR,MAAM,CAAQ;IAEtB,yCAAyC;IACjC,YAAY,CAAoB;IACxC,0CAA0C;IAClC,aAAa,CAAoB;IAEzC,2BAA2B;IACnB,gBAAgB,CAAkB;IAC1C,gCAAgC;IACxB,OAAO,CAAoB;IAEnC;;;;OAIG;IACH,YAAmB,UAAsB,EAAE,KAAY;QACnD,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,4BAA4B;QAC5B,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,i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ACD,8BAA8B;QAC9B,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAjKD,0CAiKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { BlockIndex } from \"../../model/BlockIndex\";\nimport { GridIndex } from \"../../model/GridIndex\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { BlockRecord } from \"./BlockRecord\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { DirectoryRecord } from \"./DirectoryRecord\";\nimport { FileAccess } from \"./FileAccess\";\nimport { FileReader } from \"./FileReader\";\nimport { FileRecord } from \"./FileRecord\";\nimport { TileRecord } from \"./TileRecord\";\n\n/**\n * Class DirectoryReader reads the tile and block directory.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class DirectoryReader {\n /** The file reader */\n private _fileReader: FileReader;\n /** The level */\n private _level: int32;\n\n /** The location of the tile directory */\n private _tileDirPart: ContainerFilePart;\n /** The location of the block directory */\n private _blockDirPart: ContainerFilePart;\n\n /** The directory record */\n private _directoryRecord: DirectoryRecord;\n /** The blocks (lazy loading) */\n private _blocks: Array<BlockIndex>;\n\n /**\n * Create a new reader.\n * @param fileReader the file reader.\n * @param level the level.\n */\n public constructor(fileReader: FileReader, level: int32) {\n /* Store the parameters */\n this._fileReader = fileReader;\n this._level = level;\n /* Get the tile directory */\n this._tileDirPart = fileReader.getContainer().getPart(\"\" + level + \".tile.directory\");\n /* Get the block directory */\n this._blockDirPart = fileReader.getContainer().getPart(\"\" + level + \".block.directory\");\n /* Clear */\n this._directoryRecord = null;\n this._blocks = new Array<BlockIndex>(0);\n }\n\n /**\n * Get the directory record.\n * @return the directory record.\n */\n public getDirectoryRecord(): DirectoryRecord {\n return this._directoryRecord;\n }\n\n /**\n * Get the blocks.\n * @return the blocks.\n */\n public getBlocks(): Array<BlockIndex> {\n return this._blocks;\n }\n\n /**\n * Load the data.\n * @param readBlockList should the list of blocks be read?\n * @param fileContents the file content read helper.\n * @return the reader.\n */\n public loadData(readBlockList: boolean, fileContents: ContentLoader): DirectoryReader {\n /* Read the record */\n let directoryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".directory\");\n this._directoryRecord = DirectoryRecord.readNew(directoryPart.getOffset(), directoryPart.getSize(), fileContents);\n /* Read the blocks? */\n if (readBlockList) this.readBlocks(this._fileReader.getFileRecord(), fileContents);\n /* Return the reader */\n return this;\n }\n\n /**\n * Read the blocks.\n * @param fileRecord the file record.\n * @param fileContents the file content read helper.\n * @return the blocks.\n */\n public readBlocks(fileRecord: FileRecord, fileContents: ContentLoader): Array<BlockIndex> {\n /* Request the data? */\n let fileAccess: FileAccess = this._blockDirPart.getFileAccess();\n if (fileContents.isAvailable() == false) {\n /* Add the range */\n fileContents.requestFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\n return null;\n }\n /* Get the data */\n let data: ABuffer = fileContents.getFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\n /* Allocate the blocks */\n this._blocks = new Array<BlockIndex>(this._directoryRecord.getBlockCount());\n /* Read all blocks */\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\n let pointIndex: ALong = ALong.ZERO;\n let tileIndex: int32 = 0;\n for (let i: number = 0; i < this._blocks.length; i++) {\n /* Read the next block */\n let blockIndex: BlockIndex = BlockRecord.readNew(this._level, input, i, tileIndex, pointIndex);\n this._blocks[i] = blockIndex;\n /* Advance */\n tileIndex += blockIndex.tileCount;\n pointIndex = pointIndex.add(blockIndex.pointCount);\n }\n input.close();\n /* We have to match the counts */\n ASystem.assert0(this._directoryRecord.getTileCount() == tileIndex, \"Expected \" + this._directoryRecord.getTileCount() + \" tiles, not \" + tileIndex);\n ASystem.assert0(pointIndex.same(this._directoryRecord.getPointCount()), \"Expected \" + this._directoryRecord.getPointCount().toDouble() + \" points, not \" + pointIndex.toDouble());\n /* Return the blocks */\n return this._blocks;\n }\n\n /**\n * Read the tiles of a block.\n * @param block the block record.\n * @return the tile records.\n */\n public readTiles2(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\n /* Get the tile range */\n let tileIndex: int32 = block.tileIndex;\n let tileCount: int32 = block.tileCount;\n /* Get the file extent */\n let fileName: string = this._tileDirPart.getFileAccess().getFileName();\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\n let dataOffset: ALong = ALong.fromInt(TileRecord.RECORD_SIZE).mulInt(tileIndex).add(this._tileDirPart.getOffset());\n let dataSize: int32 = tileCount * TileRecord.RECORD_SIZE;\n /* Request the data? */\n if (fileContents.isAvailable() == false) {\n /* Add the range */\n fileContents.requestFilePart(dataOffset, dataSize);\n return null;\n }\n /* Get the data */\n let data: ABuffer = fileContents.getFilePart(dataOffset, dataSize);\n /* Read the tiles */\n let tiles: Array<TileIndex> = new Array<TileIndex>(tileCount);\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\n let pointIndex: ALong = block.pointIndex;\n for (let i: number = 0; i < tileCount; i++) {\n /* Read the next tile */\n let tile: TileIndex = new TileIndex(this._level, tileIndex, new GridIndex(0, 0, 0), ALong.ZERO, 0);\n TileRecord.read(tile, this._level, block.index, input, tileIndex, pointIndex);\n tiles[i] = tile;\n tileIndex += 1;\n pointIndex = pointIndex.addInt(tile.pointCount);\n }\n input.close();\n /* Return the tiles */\n return tiles;\n }\n\n /**\n * Get all tile indexes at this level.\n * @param tileFilter the optional tile filter.\n * @param selectionType the type of selection in the pointcloud.\n * @return the list of tiles.\n */\n public getAllTileIndexes2(fileContents: ContentLoader): AList<TileIndex> {\n /* Process all blocks */\n let tileList: AList<TileIndex> = new AList<TileIndex>();\n for (let block of this._blocks) {\n /* Read the tiles */\n let tiles: Array<TileIndex> = this.readTiles2(block, fileContents);\n /* Add all tiles */\n for (let tile of tiles) tileList.add(tile);\n }\n /* Return the list of tiles */\n return tileList;\n }\n}\n"]}
1
+ {"version":3,"file":"DirectoryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,4DAAyD;AACzD,wEAAqE;AACrE,yDAAsD;AACtD,6DAA0D;AAG1D,qDAAkD;AAClD,qDAAkD;AAClD,+CAA4C;AAE5C,uDAAoD;AAIpD,6CAA0C;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,eAAe;IACxB,sBAAsB;IACd,WAAW,CAAa;IAChC,gBAAgB;IACR,MAAM,CAAQ;IAEtB,yCAAyC;IACjC,YAAY,CAAoB;IACxC,0CAA0C;IAClC,aAAa,CAAoB;IAEzC,2BAA2B;IACnB,gBAAgB,CAAkB;IAC1C,gCAAgC;IACxB,OAAO,CAAoB;IAEnC;;;;OAIG;IACH,YAAmB,UAAsB,EAAE,KAAY;QACnD,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,4BAA4B;QAC5B,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,iBAAiB,CAAC,CAAC;QACtF,6BAA6B;QAC7B,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,kBAA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C;QACvE,IAAI,UAAU,GAAU,KAAK,CAAC,UAAU,CAAC;QACzC,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,wBAAwB;YACxB,IAAI,IAAI,GAAc,IAAI,qBAAS,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,qBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACnG,uBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;YAC9E,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YAChB,SAAS,IAAI,CAAC,CAAC;YACf,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,sBAAsB;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACI,kBAAkB,CAAC,YAA2B;QACjD,wBAAwB;QACxB,IAAI,QAAQ,GAAqB,IAAI,aAAK,EAAa,CAAC;QACxD,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,oBAAoB;YACpB,IAAI,KAAK,GAAqB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YACnE,mBAAmB;YACnB,KAAK,IAAI,IAAI,IAAI,KAAK;gBAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;QACD,8BAA8B;QAC9B,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAjKD,0CAiKC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../../system/runtime/ASystem\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { BlockIndex } from \"../../model/BlockIndex\";\r\nimport { GridIndex } from \"../../model/GridIndex\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { BlockRecord } from \"./BlockRecord\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { DirectoryRecord } from \"./DirectoryRecord\";\r\nimport { FileAccess } from \"./FileAccess\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { FileRecord } from \"./FileRecord\";\r\nimport { TileRecord } from \"./TileRecord\";\r\n\r\n/**\r\n * Class DirectoryReader reads the tile and block directory.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class DirectoryReader {\r\n /** The file reader */\r\n private _fileReader: FileReader;\r\n /** The level */\r\n private _level: int32;\r\n\r\n /** The location of the tile directory */\r\n private _tileDirPart: ContainerFilePart;\r\n /** The location of the block directory */\r\n private _blockDirPart: ContainerFilePart;\r\n\r\n /** The directory record */\r\n private _directoryRecord: DirectoryRecord;\r\n /** The blocks (lazy loading) */\r\n private _blocks: Array<BlockIndex>;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param fileReader the file reader.\r\n * @param level the level.\r\n */\r\n public constructor(fileReader: FileReader, level: int32) {\r\n /* Store the parameters */\r\n this._fileReader = fileReader;\r\n this._level = level;\r\n /* Get the tile directory */\r\n this._tileDirPart = fileReader.getContainer().getPart(\"\" + level + \".tile.directory\");\r\n /* Get the block directory */\r\n this._blockDirPart = fileReader.getContainer().getPart(\"\" + level + \".block.directory\");\r\n /* Clear */\r\n this._directoryRecord = null;\r\n this._blocks = new Array<BlockIndex>(0);\r\n }\r\n\r\n /**\r\n * Get the directory record.\r\n * @return the directory record.\r\n */\r\n public getDirectoryRecord(): DirectoryRecord {\r\n return this._directoryRecord;\r\n }\r\n\r\n /**\r\n * Get the blocks.\r\n * @return the blocks.\r\n */\r\n public getBlocks(): Array<BlockIndex> {\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Load the data.\r\n * @param readBlockList should the list of blocks be read?\r\n * @param fileContents the file content read helper.\r\n * @return the reader.\r\n */\r\n public loadData(readBlockList: boolean, fileContents: ContentLoader): DirectoryReader {\r\n /* Read the record */\r\n let directoryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".directory\");\r\n this._directoryRecord = DirectoryRecord.readNew(directoryPart.getOffset(), directoryPart.getSize(), fileContents);\r\n /* Read the blocks? */\r\n if (readBlockList) this.readBlocks(this._fileReader.getFileRecord(), fileContents);\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * Read the blocks.\r\n * @param fileRecord the file record.\r\n * @param fileContents the file content read helper.\r\n * @return the blocks.\r\n */\r\n public readBlocks(fileRecord: FileRecord, fileContents: ContentLoader): Array<BlockIndex> {\r\n /* Request the data? */\r\n let fileAccess: FileAccess = this._blockDirPart.getFileAccess();\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n /* Allocate the blocks */\r\n this._blocks = new Array<BlockIndex>(this._directoryRecord.getBlockCount());\r\n /* Read all blocks */\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = ALong.ZERO;\r\n let tileIndex: int32 = 0;\r\n for (let i: number = 0; i < this._blocks.length; i++) {\r\n /* Read the next block */\r\n let blockIndex: BlockIndex = BlockRecord.readNew(this._level, input, i, tileIndex, pointIndex);\r\n this._blocks[i] = blockIndex;\r\n /* Advance */\r\n tileIndex += blockIndex.tileCount;\r\n pointIndex = pointIndex.add(blockIndex.pointCount);\r\n }\r\n input.close();\r\n /* We have to match the counts */\r\n ASystem.assert0(this._directoryRecord.getTileCount() == tileIndex, \"Expected \" + this._directoryRecord.getTileCount() + \" tiles, not \" + tileIndex);\r\n ASystem.assert0(pointIndex.same(this._directoryRecord.getPointCount()), \"Expected \" + this._directoryRecord.getPointCount().toDouble() + \" points, not \" + pointIndex.toDouble());\r\n /* Return the blocks */\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Read the tiles of a block.\r\n * @param block the block record.\r\n * @return the tile records.\r\n */\r\n public readTiles2(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\r\n /* Get the tile range */\r\n let tileIndex: int32 = block.tileIndex;\r\n let tileCount: int32 = block.tileCount;\r\n /* Get the file extent */\r\n let fileName: string = this._tileDirPart.getFileAccess().getFileName();\r\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\r\n let dataOffset: ALong = ALong.fromInt(TileRecord.RECORD_SIZE).mulInt(tileIndex).add(this._tileDirPart.getOffset());\r\n let dataSize: int32 = tileCount * TileRecord.RECORD_SIZE;\r\n /* Request the data? */\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(dataOffset, dataSize);\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(dataOffset, dataSize);\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = new Array<TileIndex>(tileCount);\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = block.pointIndex;\r\n for (let i: number = 0; i < tileCount; i++) {\r\n /* Read the next tile */\r\n let tile: TileIndex = new TileIndex(this._level, tileIndex, new GridIndex(0, 0, 0), ALong.ZERO, 0);\r\n TileRecord.read(tile, this._level, block.index, input, tileIndex, pointIndex);\r\n tiles[i] = tile;\r\n tileIndex += 1;\r\n pointIndex = pointIndex.addInt(tile.pointCount);\r\n }\r\n input.close();\r\n /* Return the tiles */\r\n return tiles;\r\n }\r\n\r\n /**\r\n * Get all tile indexes at this level.\r\n * @param tileFilter the optional tile filter.\r\n * @param selectionType the type of selection in the pointcloud.\r\n * @return the list of tiles.\r\n */\r\n public getAllTileIndexes2(fileContents: ContentLoader): AList<TileIndex> {\r\n /* Process all blocks */\r\n let tileList: AList<TileIndex> = new AList<TileIndex>();\r\n for (let block of this._blocks) {\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = this.readTiles2(block, fileContents);\r\n /* Add all tiles */\r\n for (let tile of tiles) tileList.add(tile);\r\n }\r\n /* Return the list of tiles */\r\n return tileList;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectoryRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,sEAAmE;AAKnE;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,eAAe;IACxB,oCAAoC;IAC5B,WAAW,CAAQ;IAC3B,mCAAmC;IAC3B,UAAU,CAAQ;IAC1B,oCAAoC;IAC5B,WAAW,CAAQ;IAE3B;;OAEG;IACH,YAAmB,UAAiB,EAAE,SAAgB,EAAE,UAAiB;QACrE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WA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ACrD,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;CACJ;AAnFD,0CAmFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { OutStream } from \"../../../system/io/OutStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\n\n/**\n * Class DirectoryRecord defines a directory record.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class DirectoryRecord {\n /** The number of points (8 byte) */\n private _pointCount: ALong;\n /** The number of tiles (4 byte) */\n private _tileCount: int32;\n /** The number of blocks (4 byte) */\n private _blockCount: int32;\n\n /**\n * Create a new record.\n */\n public constructor(pointCount: ALong, tileCount: int32, blockCount: int32) {\n this._pointCount = pointCount;\n this._tileCount = tileCount;\n this._blockCount = blockCount;\n }\n\n /**\n * Get the number of points.\n * @return the number.\n */\n public getPointCount(): ALong {\n return this._pointCount;\n }\n\n /**\n * Get the number of tiles.\n * @return the number.\n */\n public getTileCount(): int32 {\n return this._tileCount;\n }\n\n /**\n * Get the number of blocks.\n * @return the number.\n */\n public getBlockCount(): int32 {\n return this._blockCount;\n }\n\n /**\n * Read a record.\n * @param data the record data.\n * @return the record.\n */\n private static readFromBuffer(data: ABuffer): DirectoryRecord {\n /* Get the record fields */\n let pointCount: ALong = LittleEndian.readBufferLong(data, 0);\n let tileCount: int32 = LittleEndian.readBufferInt(data, 8);\n let blockCount: int32 = LittleEndian.readBufferInt(data, 12);\n /* Return the record */\n return new DirectoryRecord(pointCount, tileCount, blockCount);\n }\n\n /**\n * Read a record.\n * @param offset the file offset to the record.\n * @param size the file size to the record.\n * @return the record.\n */\n public static readNew(offset: ALong, size: ALong, contentLoader: ContentLoader): DirectoryRecord {\n /* Request the data? */\n if (contentLoader.isLoaded() == false) {\n /* Add the range */\n contentLoader.requestFilePart(offset, size.toInt());\n return null;\n }\n /* Get the data */\n let data: ABuffer = contentLoader.getFilePart(offset, size.toInt());\n /* Parse the record */\n return DirectoryRecord.readFromBuffer(data);\n }\n\n /**\n * Write the record.\n * @param output the output stream.\n */\n public write(output: OutStream): void {\n LittleEndian.writeStreamLong(output, this._pointCount);\n LittleEndian.writeStreamInt(output, this._tileCount);\n LittleEndian.writeStreamInt(output, this._blockCount);\n }\n}\n"]}
1
+ {"version":3,"file":"DirectoryRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,sEAAmE;AAKnE;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,eAAe;IACxB,oCAAoC;IAC5B,WAAW,CAAQ;IAC3B,mCAAmC;IAC3B,UAAU,CAAQ;IAC1B,oCAAoC;IAC5B,WAAW,CAAQ;IAE3B;;OAEG;IACH,YAAmB,UAAiB,EAAE,SAAgB,EAAE,UAAiB;QACrE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,cAAc,CAAC,IAAa;QACvC,2BAA2B;QAC3B,IAAI,UAAU,GAAU,2BAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,SAAS,GAAU,2BAAY,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,IAAI,UAAU,GAAU,2BAAY,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7D,uBAAuB;QACvB,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,MAAa,EAAE,IAAW,EAAE,aAA4B;QAC1E,uBAAuB;QACvB,IAAI,aAAa,CAAC,QAAQ,EAAE,IAAI,KAAK,EAAE,CAAC;YACpC,mBAAmB;YACnB,aAAa,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,kBAAkB;QAClB,IAAI,IAAI,GAAY,aAAa,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACpE,sBAAsB;QACtB,OAAO,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAiB;QAC1B,2BAAY,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;CACJ;AAnFD,0CAmFC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { OutStream } from \"../../../system/io/OutStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\n\r\n/**\r\n * Class DirectoryRecord defines a directory record.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class DirectoryRecord {\r\n /** The number of points (8 byte) */\r\n private _pointCount: ALong;\r\n /** The number of tiles (4 byte) */\r\n private _tileCount: int32;\r\n /** The number of blocks (4 byte) */\r\n private _blockCount: int32;\r\n\r\n /**\r\n * Create a new record.\r\n */\r\n public constructor(pointCount: ALong, tileCount: int32, blockCount: int32) {\r\n this._pointCount = pointCount;\r\n this._tileCount = tileCount;\r\n this._blockCount = blockCount;\r\n }\r\n\r\n /**\r\n * Get the number of points.\r\n * @return the number.\r\n */\r\n public getPointCount(): ALong {\r\n return this._pointCount;\r\n }\r\n\r\n /**\r\n * Get the number of tiles.\r\n * @return the number.\r\n */\r\n public getTileCount(): int32 {\r\n return this._tileCount;\r\n }\r\n\r\n /**\r\n * Get the number of blocks.\r\n * @return the number.\r\n */\r\n public getBlockCount(): int32 {\r\n return this._blockCount;\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param data the record data.\r\n * @return the record.\r\n */\r\n private static readFromBuffer(data: ABuffer): DirectoryRecord {\r\n /* Get the record fields */\r\n let pointCount: ALong = LittleEndian.readBufferLong(data, 0);\r\n let tileCount: int32 = LittleEndian.readBufferInt(data, 8);\r\n let blockCount: int32 = LittleEndian.readBufferInt(data, 12);\r\n /* Return the record */\r\n return new DirectoryRecord(pointCount, tileCount, blockCount);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param offset the file offset to the record.\r\n * @param size the file size to the record.\r\n * @return the record.\r\n */\r\n public static readNew(offset: ALong, size: ALong, contentLoader: ContentLoader): DirectoryRecord {\r\n /* Request the data? */\r\n if (contentLoader.isLoaded() == false) {\r\n /* Add the range */\r\n contentLoader.requestFilePart(offset, size.toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = contentLoader.getFilePart(offset, size.toInt());\r\n /* Parse the record */\r\n return DirectoryRecord.readFromBuffer(data);\r\n }\r\n\r\n /**\r\n * Write the record.\r\n * @param output the output stream.\r\n */\r\n public write(output: OutStream): void {\r\n LittleEndian.writeStreamLong(output, this._pointCount);\r\n LittleEndian.writeStreamInt(output, this._tileCount);\r\n LittleEndian.writeStreamInt(output, this._blockCount);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EmbeddedAttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/EmbeddedAttributeReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,wEAAqE;AAErE,yDAAsD;AAEtD,+DAA4D;AAE5D,+DAA4D;AAE5D,uEAAoE;AAEpE,uDAAoD;AAMpD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,iCAAe;IACxD,oBAAoB;IACZ,UAAU,CAAgB;IAClC,gBAAgB;IACR,MAAM,CAAQ;IACtB,2BAA2B;IACnB,WAAW,CAAQ;IAE3B,sCAAsC;IAC9B,UAAU,CAAiB;IACnC,uCAAuC;IAC/B,SAAS,CAAiB;IAC1B,SAAS,CAAiB;IAClC,0CAA0C;IAClC,cAAc,CAAU;IAChC,8CAA8C;IACtC,kBAAkB,CAAU;IAEpC,qDAAqD;IAC7C,eAAe,CAA2B;IAClD,qDAAqD;IAC7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------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { AttributeValue } from \"../../model/AttributeValue\";\nimport { CloudPoint } from \"../../model/CloudPoint\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { ReadRequest } from \"../../model/ReadRequest\";\nimport { StandardAttributes } from \"../../model/StandardAttributes\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { ContainerFile } from \"./ContainerFile\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { FileAccess } from \"./FileAccess\";\nimport { TileReadBuffer } from \"./TileReadBuffer\";\n\n/**\n * Class EmbeddedAttributeReader reads attribute data.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class EmbeddedAttributeReader extends AttributeReader {\n /** The container */\n private _container: ContainerFile;\n /** The index */\n private _index: int32;\n /** The number of levels */\n private _levelCount: int32;\n\n /** The definition of the attribute */\n private _attribute: PointAttribute;\n /** The value range of the attribute */\n private _minValue: AttributeValue;\n private _maxValue: AttributeValue;\n /** Is this the legacy color attribute? */\n private _standardColor: boolean;\n /** Is this the legacy intensity attribute? */\n private _standardIntensity: boolean;\n\n /** The point-attribute data parts (one per level) */\n private _pointDataParts: Array<ContainerFilePart>;\n /** The block-attribute data parts (one per level) */\n private _blockDataParts: Array<ContainerFilePart>;\n /** The tile-attribute data parts (one per level) */\n private _tileDataParts: Array<ContainerFilePart>;\n\n /**\n * Create a new reader.\n * @param container the container.\n * @param index the index.\n * @param levelCount the number of levels.\n */\n public constructor(container: ContainerFile, index: int32, levelCount: int32) {\n super();\n /* Store the parameters */\n this._container = container;\n this._index = index;\n this._levelCount = levelCount;\n /* Clear */\n this._attribute = null;\n this._minValue = null;\n this._maxValue = null;\n this._standardColor = false;\n this._standardIntensity = false;\n /* Find the data parts */\n this._pointDataParts = new Array<ContainerFilePart>(levelCount);\n this._blockDataParts = new Array<ContainerFilePart>(levelCount);\n this._tileDataParts = new Array<ContainerFilePart>(levelCount);\n for (let i: number = 0; i < levelCount; i++) this._pointDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".pointdata\");\n for (let i: number = 0; i < levelCount; i++) this._blockDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".blockdata\");\n for (let i: number = 0; i < levelCount; i++) this._tileDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".tiledata\");\n }\n\n /**\n * Read the attribute information.\n * @param data the attribute data.\n */\n private readAttribute(data: ABuffer): void {\n /* Read the definition */\n this._minValue = new AttributeValue();\n this._maxValue = new AttributeValue();\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\n this._attribute = EmbeddedAttributeReader.readDefinition(input, this._minValue, this._maxValue);\n input.close();\n /* Standard attribute? */\n this._standardColor = (StandardAttributes.COLOR.hasName(this._attribute.getName()));\n if (this._standardColor) this._attribute.setStandardAttribute(true);\n this._standardIntensity = (StandardAttributes.INTENSITY.hasName(this._attribute.getName()));\n if (this._standardIntensity) this._attribute.setStandardAttribute(true);\n }\n\n /**\n * Load the data.\n * @return the reader.\n */\n public loadData(fileContents: ContentLoader): EmbeddedAttributeReader {\n /* Get the part */\n let definitionPart: ContainerFilePart = this._container.getPart(\"attribute.\" + this._index + \".definition\");\n let fileAccess: FileAccess = definitionPart.getFileAccess();\n /* Request the data? */\n if (fileContents.isAvailable() == false) {\n /* Add the range */\n fileContents.requestFilePart(definitionPart.getOffset(), definitionPart.getSize().toInt());\n return null;\n }\n /* Get the data */\n let data: ABuffer = fileContents.getFilePart(definitionPart.getOffset(), definitionPart.getSize().toInt());\n /* Read the attribute */\n this.readAttribute(data);\n /* Return the reader */\n return this;\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#close\n */\n public close(): void {\n }\n\n /**\n * Get the container.\n * @return the container.\n */\n public getContainer(): ContainerFile {\n return this._container;\n }\n\n /**\n * Get the index.\n * @return the index.\n */\n public getIndex(): int32 {\n return this._index;\n }\n\n /**\n * Read the definition of the attribute.\n */\n public static readDefinition(input: InStream, minValue: AttributeValue, maxValue: AttributeValue): PointAttribute {\n /* Read the definition */\n let name: string = LittleEndian.readStreamString(input);\n let description: string = LittleEndian.readStreamString(input);\n let type: int32 = LittleEndian.readStreamInt(input);\n let defaultValue: AttributeValue = AttributeValue.readFromStream(input, type);\n let attribute: PointAttribute = new PointAttribute(name, description, type, defaultValue);\n /* Read the value range */\n let minValue2: AttributeValue = AttributeValue.readFromStream(input, type);\n minValue2.copyTo(minValue);\n let maxValue2: AttributeValue = AttributeValue.readFromStream(input, type);\n maxValue2.copyTo(maxValue);\n /* Return the attribute */\n return attribute;\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#getAttribute\n */\n public getAttribute(): PointAttribute {\n return this._attribute;\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#getMinimumValue\n */\n public getMinimumValue(): AttributeValue {\n return this._minValue;\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#getMaximumValue\n */\n public getMaximumValue(): AttributeValue {\n return this._maxValue;\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#readTileData2\n */\n public readTileData2(level: int32, tile: TileIndex, pointOffset: ALong, pointCount: int32, tileBuffer: TileReadBuffer, bufferIndex: int32, readRequest: ReadRequest, fileContents: ContentLoader): void {\n /* Get the right part */\n let pointDataPart: ContainerFilePart = this._pointDataParts[level];\n /* Get the file extent */\n let fileName: string = pointDataPart.getFileAccess().getFileName();\n let fileSize: ALong = this._container.getFileLength();\n let offset: ALong = pointDataPart.getOffset().add(this._attribute.getTypeByteSizeForLongCount(tile.pointIndex.add(pointOffset)));\n let size: int32 = this._attribute.getTypeByteSizeForCount(pointCount);\n pointDataPart.rangeCheck(offset, ALong.fromInt(size));\n /* Request the data? */\n if (fileContents.isAvailable() == false) {\n /* Add the range */\n fileContents.requestFilePart(offset, size);\n return;\n }\n /* Add the statistics */\n readRequest.addDataSize(size);\n /* Read the content */\n let data: ABuffer = fileContents.getFilePart(offset, size);\n tileBuffer.setAttributeBuffer(bufferIndex, data);\n }\n\n /**\n * AttributeReader abstract method.\n * @see AttributeReader#getPointData\n */\n public getPointData(level: int32, tile: TileIndex, tileBuffer: TileReadBuffer, bufferIndex: int32, pointIndex: int32, cloudPoint: CloudPoint): void {\n /* Get the buffer */\n let buffer: ABuffer = tileBuffer.getAttributeBuffer(bufferIndex);\n let offset: int32 = this._attribute.getTypeByteSizeForCount(pointIndex);\n /* Read the value */\n let attribute: PointAttribute = cloudPoint.getAttribute(bufferIndex);\n let value: AttributeValue = cloudPoint.getAttributeValue(bufferIndex);\n AttributeValue.readFromBufferTo(buffer, offset, attribute.getType(), value);\n /* Standard attribute? */\n if (this._standardColor) cloudPoint.setColor(value.getColor());\n if (this._standardIntensity) cloudPoint.setIntensity(value.getInt2());\n }\n}\n"]}
1
+ {"version":3,"file":"EmbeddedAttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/EmbeddedAttributeReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,wEAAqE;AAErE,yDAAsD;AAEtD,+DAA4D;AAE5D,+DAA4D;AAE5D,uEAAoE;AAEpE,uDAAoD;AAMpD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,iCAAe;IACxD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S,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5E,yBAAyB;QACzB,IAAI,IAAI,CAAC,cAAc;YAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/D,IAAI,IAAI,CAAC,kBAAkB;YAAE,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;CACJ;AAxMD,0DAwMC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\r\nimport { InStream } from \"../../../system/io/InStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { AttributeValue } from \"../../model/AttributeValue\";\r\nimport { CloudPoint } from \"../../model/CloudPoint\";\r\nimport { PointAttribute } from \"../../model/PointAttribute\";\r\nimport { ReadRequest } from \"../../model/ReadRequest\";\r\nimport { StandardAttributes } from \"../../model/StandardAttributes\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { AttributeReader } from \"./AttributeReader\";\r\nimport { ContainerFile } from \"./ContainerFile\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { FileAccess } from \"./FileAccess\";\r\nimport { TileReadBuffer } from \"./TileReadBuffer\";\r\n\r\n/**\r\n * Class EmbeddedAttributeReader reads attribute data.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class EmbeddedAttributeReader extends AttributeReader {\r\n /** The container */\r\n private _container: ContainerFile;\r\n /** The index */\r\n private _index: int32;\r\n /** The number of levels */\r\n private _levelCount: int32;\r\n\r\n /** The definition of the attribute */\r\n private _attribute: PointAttribute;\r\n /** The value range of the attribute */\r\n private _minValue: AttributeValue;\r\n private _maxValue: AttributeValue;\r\n /** Is this the legacy color attribute? */\r\n private _standardColor: boolean;\r\n /** Is this the legacy intensity attribute? */\r\n private _standardIntensity: boolean;\r\n\r\n /** The point-attribute data parts (one per level) */\r\n private _pointDataParts: Array<ContainerFilePart>;\r\n /** The block-attribute data parts (one per level) */\r\n private _blockDataParts: Array<ContainerFilePart>;\r\n /** The tile-attribute data parts (one per level) */\r\n private _tileDataParts: Array<ContainerFilePart>;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param container the container.\r\n * @param index the index.\r\n * @param levelCount the number of levels.\r\n */\r\n public constructor(container: ContainerFile, index: int32, levelCount: int32) {\r\n super();\r\n /* Store the parameters */\r\n this._container = container;\r\n this._index = index;\r\n this._levelCount = levelCount;\r\n /* Clear */\r\n this._attribute = null;\r\n this._minValue = null;\r\n this._maxValue = null;\r\n this._standardColor = false;\r\n this._standardIntensity = false;\r\n /* Find the data parts */\r\n this._pointDataParts = new Array<ContainerFilePart>(levelCount);\r\n this._blockDataParts = new Array<ContainerFilePart>(levelCount);\r\n this._tileDataParts = new Array<ContainerFilePart>(levelCount);\r\n for (let i: number = 0; i < levelCount; i++) this._pointDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".pointdata\");\r\n for (let i: number = 0; i < levelCount; i++) this._blockDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".blockdata\");\r\n for (let i: number = 0; i < levelCount; i++) this._tileDataParts[i] = container.getPart(\"\" + i + \".attribute.\" + this._index + \".tiledata\");\r\n }\r\n\r\n /**\r\n * Read the attribute information.\r\n * @param data the attribute data.\r\n */\r\n private readAttribute(data: ABuffer): void {\r\n /* Read the definition */\r\n this._minValue = new AttributeValue();\r\n this._maxValue = new AttributeValue();\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n this._attribute = EmbeddedAttributeReader.readDefinition(input, this._minValue, this._maxValue);\r\n input.close();\r\n /* Standard attribute? */\r\n this._standardColor = (StandardAttributes.COLOR.hasName(this._attribute.getName()));\r\n if (this._standardColor) this._attribute.setStandardAttribute(true);\r\n this._standardIntensity = (StandardAttributes.INTENSITY.hasName(this._attribute.getName()));\r\n if (this._standardIntensity) this._attribute.setStandardAttribute(true);\r\n }\r\n\r\n /**\r\n * Load the data.\r\n * @return the reader.\r\n */\r\n public loadData(fileContents: ContentLoader): EmbeddedAttributeReader {\r\n /* Get the part */\r\n let definitionPart: ContainerFilePart = this._container.getPart(\"attribute.\" + this._index + \".definition\");\r\n let fileAccess: FileAccess = definitionPart.getFileAccess();\r\n /* Request the data? */\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(definitionPart.getOffset(), definitionPart.getSize().toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(definitionPart.getOffset(), definitionPart.getSize().toInt());\r\n /* Read the attribute */\r\n this.readAttribute(data);\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#close\r\n */\r\n public close(): void {\r\n }\r\n\r\n /**\r\n * Get the container.\r\n * @return the container.\r\n */\r\n public getContainer(): ContainerFile {\r\n return this._container;\r\n }\r\n\r\n /**\r\n * Get the index.\r\n * @return the index.\r\n */\r\n public getIndex(): int32 {\r\n return this._index;\r\n }\r\n\r\n /**\r\n * Read the definition of the attribute.\r\n */\r\n public static readDefinition(input: InStream, minValue: AttributeValue, maxValue: AttributeValue): PointAttribute {\r\n /* Read the definition */\r\n let name: string = LittleEndian.readStreamString(input);\r\n let description: string = LittleEndian.readStreamString(input);\r\n let type: int32 = LittleEndian.readStreamInt(input);\r\n let defaultValue: AttributeValue = AttributeValue.readFromStream(input, type);\r\n let attribute: PointAttribute = new PointAttribute(name, description, type, defaultValue);\r\n /* Read the value range */\r\n let minValue2: AttributeValue = AttributeValue.readFromStream(input, type);\r\n minValue2.copyTo(minValue);\r\n let maxValue2: AttributeValue = AttributeValue.readFromStream(input, type);\r\n maxValue2.copyTo(maxValue);\r\n /* Return the attribute */\r\n return attribute;\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#getAttribute\r\n */\r\n public getAttribute(): PointAttribute {\r\n return this._attribute;\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#getMinimumValue\r\n */\r\n public getMinimumValue(): AttributeValue {\r\n return this._minValue;\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#getMaximumValue\r\n */\r\n public getMaximumValue(): AttributeValue {\r\n return this._maxValue;\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#readTileData2\r\n */\r\n public readTileData2(level: int32, tile: TileIndex, pointOffset: ALong, pointCount: int32, tileBuffer: TileReadBuffer, bufferIndex: int32, readRequest: ReadRequest, fileContents: ContentLoader): void {\r\n /* Get the right part */\r\n let pointDataPart: ContainerFilePart = this._pointDataParts[level];\r\n /* Get the file extent */\r\n let fileName: string = pointDataPart.getFileAccess().getFileName();\r\n let fileSize: ALong = this._container.getFileLength();\r\n let offset: ALong = pointDataPart.getOffset().add(this._attribute.getTypeByteSizeForLongCount(tile.pointIndex.add(pointOffset)));\r\n let size: int32 = this._attribute.getTypeByteSizeForCount(pointCount);\r\n pointDataPart.rangeCheck(offset, ALong.fromInt(size));\r\n /* Request the data? */\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(offset, size);\r\n return;\r\n }\r\n /* Add the statistics */\r\n readRequest.addDataSize(size);\r\n /* Read the content */\r\n let data: ABuffer = fileContents.getFilePart(offset, size);\r\n tileBuffer.setAttributeBuffer(bufferIndex, data);\r\n }\r\n\r\n /**\r\n * AttributeReader abstract method.\r\n * @see AttributeReader#getPointData\r\n */\r\n public getPointData(level: int32, tile: TileIndex, tileBuffer: TileReadBuffer, bufferIndex: int32, pointIndex: int32, cloudPoint: CloudPoint): void {\r\n /* Get the buffer */\r\n let buffer: ABuffer = tileBuffer.getAttributeBuffer(bufferIndex);\r\n let offset: int32 = this._attribute.getTypeByteSizeForCount(pointIndex);\r\n /* Read the value */\r\n let attribute: PointAttribute = cloudPoint.getAttribute(bufferIndex);\r\n let value: AttributeValue = cloudPoint.getAttributeValue(bufferIndex);\r\n AttributeValue.readFromBufferTo(buffer, offset, attribute.getType(), value);\r\n /* Standard attribute? */\r\n if (this._standardColor) cloudPoint.setColor(value.getColor());\r\n if (this._standardIntensity) cloudPoint.setIntensity(value.getInt2());\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FileAccess.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileAccess.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAaH;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,8BAA8B;IACtB,YAAY,CAAc;IAClC,2BAA2B;IACnB,SAAS,CAAS;IAC1B,6BAA6B;IACrB,WAAW,CAAQ;IAE3B;;;;OAIG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,UAAiB;QAC5E,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK;IACZ,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ;AAxCD,gCAwCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\n\n/**\n * Class FileAccess provides thread-safe random-access to a file.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class FileAccess {\n /** The storage of the file */\n private _fileStorage: FileStorage;\n /** The name of the file */\n private _fileName: string;\n /** The length of the file */\n private _fileLength: ALong;\n\n /**\n * Create a new file access.\n * @param fileName the name of the file.\n * @param fileLength the length of the file.\n */\n public constructor(fileStorage: FileStorage, fileName: string, fileLength: ALong) {\n this._fileStorage = fileStorage;\n this._fileName = fileName;\n this._fileLength = fileLength;\n }\n\n /**\n * Close the file access.\n */\n public close(): void {\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the length of the file.\n * @return the length of the file.\n */\n public getFileLength(): ALong {\n return this._fileLength;\n }\n}\n"]}
1
+ {"version":3,"file":"FileAccess.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileAccess.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAaH;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,8BAA8B;IACtB,YAAY,CAAc;IAClC,2BAA2B;IACnB,SAAS,CAAS;IAC1B,6BAA6B;IACrB,WAAW,CAAQ;IAE3B;;;;OAIG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,UAAiB;QAC5E,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK;IACZ,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ;AAxCD,gCAwCC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\r\n\r\n/**\r\n * Class FileAccess provides thread-safe random-access to a file.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class FileAccess {\r\n /** The storage of the file */\r\n private _fileStorage: FileStorage;\r\n /** The name of the file */\r\n private _fileName: string;\r\n /** The length of the file */\r\n private _fileLength: ALong;\r\n\r\n /**\r\n * Create a new file access.\r\n * @param fileName the name of the file.\r\n * @param fileLength the length of the file.\r\n */\r\n public constructor(fileStorage: FileStorage, fileName: string, fileLength: ALong) {\r\n this._fileStorage = fileStorage;\r\n this._fileName = fileName;\r\n this._fileLength = fileLength;\r\n }\r\n\r\n /**\r\n * Close the file access.\r\n */\r\n public close(): void {\r\n }\r\n\r\n /**\r\n * Get the name of the file.\r\n * @return the name of the file.\r\n */\r\n public getFileName(): string {\r\n return this._fileName;\r\n }\r\n\r\n /**\r\n * Get the length of the file.\r\n * @return the length of the file.\r\n */\r\n public getFileLength(): ALong {\r\n return this._fileLength;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,yEAAsE;AAItE,mDAAgD;AAEhD,uDAAoD;AAEpD,uEAAoE;AACpE,6CAA0C;AAC1C,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,8BAA8B;IACtB,MAAM,CAAU,MAAM,GAAW,YAAY,CAAC;IAEtD,uBAAuB;IACf,YAAY,CAAc;IAClC,2BAA2B;IACnB,SAAS,CAAS;IAC1B,oBAAoB;IACZ,UAAU,CAAgB;IAElC,sBAAsB;IACd,WAAW,CAAa;IAChC,0CAA0C;IAClC,iBAAiB,CAAyB;IAClD,yCAAyC;IACjC,gBAAgB,CAAwB;IAChD,4BAA4B;IACpB,iBAAiB,CAAyB;IAElD;;;;;OAKG;IACH,YAAoB,WAAwB,EAAE,QAAgB,EAAE,SAAwB,EAAE,UAAsB;QAC5G,0BAA0B;QAC1B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,WAAW;QACX,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAwB,EAAE,QAAgB,EAAE,WAAoB;QACzF,6BAA6B;QAC7B,IAAI,SAAS,GAAkB,MAAM,6BAAa,CAAC,IA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O,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,aAAqB;QAC5C,iCAAiC;QACjC,KAAK,IAAI,eAAe,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACjD,IAAI,iBAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC;gBAAE,OAAO,eAAe,CAAC;QAClH,CAAC;QACD,eAAe;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;;AArPL,gCAsPC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { ContainerFile } from \"./ContainerFile\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { DirectoryReader } from \"./DirectoryReader\";\nimport { DirectoryRecord } from \"./DirectoryRecord\";\nimport { EmbeddedAttributeReader } from \"./EmbeddedAttributeReader\";\nimport { FileRecord } from \"./FileRecord\";\nimport { GeometryReader } from \"./GeometryReader\";\n\n/**\n * Class FileReader reads OPC files.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class FileReader {\n /** The name of this module */\n private static readonly MODULE: string = \"FileReader\";\n\n /** The file storage */\n private _fileStorage: FileStorage;\n /** The name of the file */\n private _fileName: string;\n /** The container */\n private _container: ContainerFile;\n\n /** The file record */\n private _fileRecord: FileRecord;\n /** The directory readers (1 per level) */\n private _directoryReaders: Array<DirectoryReader>;\n /** The geometry readers (1 per level) */\n private _geometryReaders: Array<GeometryReader>;\n /** The attribute readers */\n private _attributeReaders: Array<AttributeReader>;\n\n /**\n * Create a new reader.\n * @param fileName the name of the file.\n * @param container the container file.\n * @param fileRecord the file record.\n */\n private constructor(fileStorage: FileStorage, fileName: string, container: ContainerFile, fileRecord: FileRecord) {\n /* Store the parameters */\n this._fileStorage = fileStorage;\n this._fileName = fileName;\n this._container = container;\n this._fileRecord = fileRecord;\n /* Clear */\n this._directoryReaders = null;\n this._geometryReaders = null;\n this._attributeReaders = null;\n }\n\n /**\n * Open a file.\n * @param fileName the name of the file.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<FileReader> {\n /* Open the container file */\n let container: ContainerFile = await ContainerFile.read(fileStorage, fileName, \"OPC3\");\n /* Read the file record */\n let filePart: ContainerFilePart = container.getPart(\"file\");\n let fileRecord: FileRecord = await FileRecord.readNew(fileStorage, filePart.getFileAccess().getFileName(), filePart.getOffset(), filePart.getSize());\n /* Create a reader */\n let fileReader: FileReader = new FileReader(fileStorage, fileName, container, fileRecord);\n /* Open the reader */\n fileReader = await fileReader.open(lazyLoading);\n /* Return the reader */\n return fileReader;\n }\n\n /**\n * Open the reader.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n private async open(lazyLoading: boolean): Promise<FileReader> {\n /* Log */\n Message.print(FileReader.MODULE, \"Opening OPC with \" + this._fileRecord.getLevelCount() + \" levels (crs \" + this._fileRecord.getCRS() + \", lazy? \" + lazyLoading + \")\");\n Message.print(FileReader.MODULE, \"Container has \" + this._container.getPartCount() + \" parts\");\n // for(ContainerFilePart part: this._container.getParts()) Message.print(MODULE,\"Part '\"+part.getName()+\"'\");\n /* Define the content we are going to need (dozens of parts) */\n Message.print(FileReader.MODULE, \"Loading \" + this._fileRecord.getLevelCount() + \" levels and \" + this._fileRecord.getAttributeCount() + \" attributes\");\n let fileContents: ContentLoader = new ContentLoader(this._fileStorage, this._fileName);\n /* Only read the block list for the top levels? (to save memory) */\n let prefetchLevelIndex: int32 = (this._fileRecord.getLevelCount() - 6);\n if (prefetchLevelIndex < 0) prefetchLevelIndex = 0;\n if (lazyLoading == false) prefetchLevelIndex = 0;\n Message.print(FileReader.MODULE, \"Prefetching from level \" + prefetchLevelIndex);\n /* Read the directory */\n this._directoryReaders = new Array<DirectoryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let directoryReader: DirectoryReader = new DirectoryReader(this, i);\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n directoryReader.loadData(readBlockList, fileContents);\n this._directoryReaders[i] = directoryReader;\n }\n /* Read the geometry */\n this._geometryReaders = new Array<GeometryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n let geometryReader: GeometryReader = new GeometryReader(this, i);\n geometryReader.loadData(fileContents);\n this._geometryReaders[i] = geometryReader;\n }\n /* Read the attributes */\n this._attributeReaders = new Array<AttributeReader>(this._fileRecord.getAttributeCount());\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = new EmbeddedAttributeReader(this._container, i, this._fileRecord.getLevelCount());\n attributeReader.loadData(fileContents);\n this._attributeReaders[i] = attributeReader;\n }\n /* Load all data needed for the structures */\n fileContents = await fileContents.load();\n /* Read the directory */\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n this._directoryReaders[i].loadData(readBlockList, fileContents);\n }\n /* Read the geometry */\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n this._geometryReaders[i].loadData(fileContents);\n }\n /* Read the attributes */\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = <EmbeddedAttributeReader><unknown>(this._attributeReaders[i]);\n attributeReader.loadData(fileContents);\n }\n /* Log file info */\n Message.print(FileReader.MODULE, \"OPC bounds are \" + this._geometryReaders[0].getGeometryRecord().getBounds());\n let tileGridSize0: Coordinate = this._geometryReaders[0].getGeometryRecord().getTileGrid().size;\n Message.print(FileReader.MODULE, \"OPC level0 tile size is (\" + tileGridSize0.x + \",\" + tileGridSize0.y + \",\" + tileGridSize0.z + \")\");\n let totalPointCount: ALong = ALong.ZERO;\n let totalTileCount: int32 = 0;\n let totalBlockCount: int32 = 0;\n for (let i: number = 0; i < this._fileRecord.getLevelCount(); i++) {\n let directoryRecord: DirectoryRecord = this._directoryReaders[i].getDirectoryRecord();\n Message.print(FileReader.MODULE, \"Level \" + i + \" has \" + directoryRecord.getPointCount() + \" points, \" + directoryRecord.getTileCount() + \" tiles, \" + directoryRecord.getBlockCount() + \" blocks\");\n totalPointCount = totalPointCount.add(directoryRecord.getPointCount());\n totalTileCount += directoryRecord.getTileCount();\n totalBlockCount += directoryRecord.getBlockCount();\n }\n Message.print(FileReader.MODULE, \"Pointcloud has \" + totalPointCount + \" points, \" + totalTileCount + \" tiles, \" + totalBlockCount + \" blocks\");\n /* Get the attributes */\n Message.print(FileReader.MODULE, \"Pointcloud has \" + this._attributeReaders.length + \" static attributes:\");\n for (let i: number = 0; i < this._attributeReaders.length; i++) {\n Message.print(FileReader.MODULE, \"Attribute \" + i + \": \" + this._attributeReaders[i].getAttribute());\n Message.print(FileReader.MODULE, \" min: \" + this._attributeReaders[i].getMinimumValue());\n Message.print(FileReader.MODULE, \" max: \" + this._attributeReaders[i].getMaximumValue());\n }\n /* Return the reader */\n return this;\n }\n\n /**\n * Close the file.\n */\n public close(): void {\n for (let attributeReader of this._attributeReaders) attributeReader.close();\n if (this._container != null) this._container.close(true);\n this._container = null;\n }\n\n /**\n * Get the storage of the file.\n * @return the storage of the file.\n */\n public getFileStorage(): FileStorage {\n return this._fileStorage;\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the container file.\n * @return the container file.\n */\n public getContainer(): ContainerFile {\n return this._container;\n }\n\n /**\n * Get the file record.\n * @return the file record.\n */\n public getFileRecord(): FileRecord {\n return this._fileRecord;\n }\n\n /**\n * Get the number of resolution levels.\n * @return the number of resolution levels.\n */\n public getLevelCount(): int32 {\n return this._fileRecord.getLevelCount();\n }\n\n /**\n * Get a directory reader.\n * @param level the index of the level.\n * @return the directory reader.\n */\n public getDirectoryReader(level: int32): DirectoryReader {\n return this._directoryReaders[level];\n }\n\n /**\n * Get a geometry reader.\n * @param level the index of the level.\n * @return the geometry reader.\n */\n public getGeometryReader(level: int32): GeometryReader {\n return this._geometryReaders[level];\n }\n\n /**\n * Get the static attribute readers.\n * @return the static attribute readers.\n */\n public getStaticAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attribute readers.\n * @return the attribute readers.\n */\n public getAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attributes.\n * @return the attributes.\n */\n public getAttributes(): Array<PointAttribute> {\n let list: Array<PointAttribute> = new Array<PointAttribute>(this._attributeReaders.length);\n for (let i: number = 0; i < this._attributeReaders.length; i++) list[i] = this._attributeReaders[i].getAttribute();\n return list;\n }\n\n /**\n * Find an attribute reader.\n * @param attributeName the name of the attribute.\n * @return the attribute reader (null if not found).\n */\n public findAttributeReader(attributeName: string): AttributeReader {\n /* Check the static attributes */\n for (let attributeReader of this._attributeReaders) {\n if (Strings.equalsIgnoreCase(attributeReader.getAttribute().getName(), attributeName)) return attributeReader;\n }\n /* Not found */\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileReader.ts"],"names":[],"mappings":";AA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C;YACjD,IAAI,iBAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC;gBAAE,OAAO,eAAe,CAAC;QAClH,CAAC;QACD,eAAe;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;;AArPL,gCAsPC","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 OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { Message } from \"../../../system/runtime/Message\";\r\nimport { Strings } from \"../../../system/runtime/Strings\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\r\nimport { PointAttribute } from \"../../model/PointAttribute\";\r\nimport { AttributeReader } from \"./AttributeReader\";\r\nimport { ContainerFile } from \"./ContainerFile\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { DirectoryReader } from \"./DirectoryReader\";\r\nimport { DirectoryRecord } from \"./DirectoryRecord\";\r\nimport { EmbeddedAttributeReader } from \"./EmbeddedAttributeReader\";\r\nimport { FileRecord } from \"./FileRecord\";\r\nimport { GeometryReader } from \"./GeometryReader\";\r\n\r\n/**\r\n * Class FileReader reads OPC files.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class FileReader {\r\n /** The name of this module */\r\n private static readonly MODULE: string = \"FileReader\";\r\n\r\n /** The file storage */\r\n private _fileStorage: FileStorage;\r\n /** The name of the file */\r\n private _fileName: string;\r\n /** The container */\r\n private _container: ContainerFile;\r\n\r\n /** The file record */\r\n private _fileRecord: FileRecord;\r\n /** The directory readers (1 per level) */\r\n private _directoryReaders: Array<DirectoryReader>;\r\n /** The geometry readers (1 per level) */\r\n private _geometryReaders: Array<GeometryReader>;\r\n /** The attribute readers */\r\n private _attributeReaders: Array<AttributeReader>;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param fileName the name of the file.\r\n * @param container the container file.\r\n * @param fileRecord the file record.\r\n */\r\n private constructor(fileStorage: FileStorage, fileName: string, container: ContainerFile, fileRecord: FileRecord) {\r\n /* Store the parameters */\r\n this._fileStorage = fileStorage;\r\n this._fileName = fileName;\r\n this._container = container;\r\n this._fileRecord = fileRecord;\r\n /* Clear */\r\n this._directoryReaders = null;\r\n this._geometryReaders = null;\r\n this._attributeReaders = null;\r\n }\r\n\r\n /**\r\n * Open a file.\r\n * @param fileName the name of the file.\r\n * @param lazyLoading avoid early loading to keep a low memory profile?\r\n * @return the reader.\r\n */\r\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<FileReader> {\r\n /* Open the container file */\r\n let container: ContainerFile = await ContainerFile.read(fileStorage, fileName, \"OPC3\");\r\n /* Read the file record */\r\n let filePart: ContainerFilePart = container.getPart(\"file\");\r\n let fileRecord: FileRecord = await FileRecord.readNew(fileStorage, filePart.getFileAccess().getFileName(), filePart.getOffset(), filePart.getSize());\r\n /* Create a reader */\r\n let fileReader: FileReader = new FileReader(fileStorage, fileName, container, fileRecord);\r\n /* Open the reader */\r\n fileReader = await fileReader.open(lazyLoading);\r\n /* Return the reader */\r\n return fileReader;\r\n }\r\n\r\n /**\r\n * Open the reader.\r\n * @param lazyLoading avoid early loading to keep a low memory profile?\r\n * @return the reader.\r\n */\r\n private async open(lazyLoading: boolean): Promise<FileReader> {\r\n /* Log */\r\n Message.print(FileReader.MODULE, \"Opening OPC with \" + this._fileRecord.getLevelCount() + \" levels (crs \" + this._fileRecord.getCRS() + \", lazy? \" + lazyLoading + \")\");\r\n Message.print(FileReader.MODULE, \"Container has \" + this._container.getPartCount() + \" parts\");\r\n // for(ContainerFilePart part: this._container.getParts()) Message.print(MODULE,\"Part '\"+part.getName()+\"'\");\r\n /* Define the content we are going to need (dozens of parts) */\r\n Message.print(FileReader.MODULE, \"Loading \" + this._fileRecord.getLevelCount() + \" levels and \" + this._fileRecord.getAttributeCount() + \" attributes\");\r\n let fileContents: ContentLoader = new ContentLoader(this._fileStorage, this._fileName);\r\n /* Only read the block list for the top levels? (to save memory) */\r\n let prefetchLevelIndex: int32 = (this._fileRecord.getLevelCount() - 6);\r\n if (prefetchLevelIndex < 0) prefetchLevelIndex = 0;\r\n if (lazyLoading == false) prefetchLevelIndex = 0;\r\n Message.print(FileReader.MODULE, \"Prefetching from level \" + prefetchLevelIndex);\r\n /* Read the directory */\r\n this._directoryReaders = new Array<DirectoryReader>(this._fileRecord.getLevelCount());\r\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\r\n let directoryReader: DirectoryReader = new DirectoryReader(this, i);\r\n let readBlockList: boolean = (i >= prefetchLevelIndex);\r\n directoryReader.loadData(readBlockList, fileContents);\r\n this._directoryReaders[i] = directoryReader;\r\n }\r\n /* Read the geometry */\r\n this._geometryReaders = new Array<GeometryReader>(this._fileRecord.getLevelCount());\r\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\r\n let geometryReader: GeometryReader = new GeometryReader(this, i);\r\n geometryReader.loadData(fileContents);\r\n this._geometryReaders[i] = geometryReader;\r\n }\r\n /* Read the attributes */\r\n this._attributeReaders = new Array<AttributeReader>(this._fileRecord.getAttributeCount());\r\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\r\n let attributeReader: EmbeddedAttributeReader = new EmbeddedAttributeReader(this._container, i, this._fileRecord.getLevelCount());\r\n attributeReader.loadData(fileContents);\r\n this._attributeReaders[i] = attributeReader;\r\n }\r\n /* Load all data needed for the structures */\r\n fileContents = await fileContents.load();\r\n /* Read the directory */\r\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\r\n let readBlockList: boolean = (i >= prefetchLevelIndex);\r\n this._directoryReaders[i].loadData(readBlockList, fileContents);\r\n }\r\n /* Read the geometry */\r\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\r\n this._geometryReaders[i].loadData(fileContents);\r\n }\r\n /* Read the attributes */\r\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\r\n let attributeReader: EmbeddedAttributeReader = <EmbeddedAttributeReader><unknown>(this._attributeReaders[i]);\r\n attributeReader.loadData(fileContents);\r\n }\r\n /* Log file info */\r\n Message.print(FileReader.MODULE, \"OPC bounds are \" + this._geometryReaders[0].getGeometryRecord().getBounds());\r\n let tileGridSize0: Coordinate = this._geometryReaders[0].getGeometryRecord().getTileGrid().size;\r\n Message.print(FileReader.MODULE, \"OPC level0 tile size is (\" + tileGridSize0.x + \",\" + tileGridSize0.y + \",\" + tileGridSize0.z + \")\");\r\n let totalPointCount: ALong = ALong.ZERO;\r\n let totalTileCount: int32 = 0;\r\n let totalBlockCount: int32 = 0;\r\n for (let i: number = 0; i < this._fileRecord.getLevelCount(); i++) {\r\n let directoryRecord: DirectoryRecord = this._directoryReaders[i].getDirectoryRecord();\r\n Message.print(FileReader.MODULE, \"Level \" + i + \" has \" + directoryRecord.getPointCount() + \" points, \" + directoryRecord.getTileCount() + \" tiles, \" + directoryRecord.getBlockCount() + \" blocks\");\r\n totalPointCount = totalPointCount.add(directoryRecord.getPointCount());\r\n totalTileCount += directoryRecord.getTileCount();\r\n totalBlockCount += directoryRecord.getBlockCount();\r\n }\r\n Message.print(FileReader.MODULE, \"Pointcloud has \" + totalPointCount + \" points, \" + totalTileCount + \" tiles, \" + totalBlockCount + \" blocks\");\r\n /* Get the attributes */\r\n Message.print(FileReader.MODULE, \"Pointcloud has \" + this._attributeReaders.length + \" static attributes:\");\r\n for (let i: number = 0; i < this._attributeReaders.length; i++) {\r\n Message.print(FileReader.MODULE, \"Attribute \" + i + \": \" + this._attributeReaders[i].getAttribute());\r\n Message.print(FileReader.MODULE, \" min: \" + this._attributeReaders[i].getMinimumValue());\r\n Message.print(FileReader.MODULE, \" max: \" + this._attributeReaders[i].getMaximumValue());\r\n }\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * Close the file.\r\n */\r\n public close(): void {\r\n for (let attributeReader of this._attributeReaders) attributeReader.close();\r\n if (this._container != null) this._container.close(true);\r\n this._container = null;\r\n }\r\n\r\n /**\r\n * Get the storage of the file.\r\n * @return the storage of the file.\r\n */\r\n public getFileStorage(): FileStorage {\r\n return this._fileStorage;\r\n }\r\n\r\n /**\r\n * Get the name of the file.\r\n * @return the name of the file.\r\n */\r\n public getFileName(): string {\r\n return this._fileName;\r\n }\r\n\r\n /**\r\n * Get the container file.\r\n * @return the container file.\r\n */\r\n public getContainer(): ContainerFile {\r\n return this._container;\r\n }\r\n\r\n /**\r\n * Get the file record.\r\n * @return the file record.\r\n */\r\n public getFileRecord(): FileRecord {\r\n return this._fileRecord;\r\n }\r\n\r\n /**\r\n * Get the number of resolution levels.\r\n * @return the number of resolution levels.\r\n */\r\n public getLevelCount(): int32 {\r\n return this._fileRecord.getLevelCount();\r\n }\r\n\r\n /**\r\n * Get a directory reader.\r\n * @param level the index of the level.\r\n * @return the directory reader.\r\n */\r\n public getDirectoryReader(level: int32): DirectoryReader {\r\n return this._directoryReaders[level];\r\n }\r\n\r\n /**\r\n * Get a geometry reader.\r\n * @param level the index of the level.\r\n * @return the geometry reader.\r\n */\r\n public getGeometryReader(level: int32): GeometryReader {\r\n return this._geometryReaders[level];\r\n }\r\n\r\n /**\r\n * Get the static attribute readers.\r\n * @return the static attribute readers.\r\n */\r\n public getStaticAttributeReaders(): Array<AttributeReader> {\r\n return this._attributeReaders;\r\n }\r\n\r\n /**\r\n * Get the attribute readers.\r\n * @return the attribute readers.\r\n */\r\n public getAttributeReaders(): Array<AttributeReader> {\r\n return this._attributeReaders;\r\n }\r\n\r\n /**\r\n * Get the attributes.\r\n * @return the attributes.\r\n */\r\n public getAttributes(): Array<PointAttribute> {\r\n let list: Array<PointAttribute> = new Array<PointAttribute>(this._attributeReaders.length);\r\n for (let i: number = 0; i < this._attributeReaders.length; i++) list[i] = this._attributeReaders[i].getAttribute();\r\n return list;\r\n }\r\n\r\n /**\r\n * Find an attribute reader.\r\n * @param attributeName the name of the attribute.\r\n * @return the attribute reader (null if not found).\r\n */\r\n public findAttributeReader(attributeName: string): AttributeReader {\r\n /* Check the static attributes */\r\n for (let attributeReader of this._attributeReaders) {\r\n if (Strings.equalsIgnoreCase(attributeReader.getAttribute().getName(), attributeName)) return attributeReader;\r\n }\r\n /* Not found */\r\n return null;\r\n }\r\n}\r\n"]}