@itwin/core-orbitgt 5.0.0-dev.7 → 5.0.0-dev.72

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 (350) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/pointcloud/format/opc/AttributeMask.js +4 -0
  3. package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
  4. package/lib/cjs/pointcloud/format/opc/BlockRecord.js +2 -2
  5. package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
  6. package/lib/cjs/pointcloud/format/opc/ContainerFile.js +10 -2
  7. package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
  8. package/lib/cjs/pointcloud/format/opc/ContainerFilePart.js +8 -0
  9. package/lib/cjs/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
  10. package/lib/cjs/pointcloud/format/opc/DirectoryReader.js +12 -0
  11. package/lib/cjs/pointcloud/format/opc/DirectoryReader.js.map +1 -1
  12. package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js +6 -0
  13. package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
  14. package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js +21 -0
  15. package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
  16. package/lib/cjs/pointcloud/format/opc/FileAccess.js +6 -0
  17. package/lib/cjs/pointcloud/format/opc/FileAccess.js.map +1 -1
  18. package/lib/cjs/pointcloud/format/opc/FileReader.js +16 -2
  19. package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
  20. package/lib/cjs/pointcloud/format/opc/FileRecord.js +14 -0
  21. package/lib/cjs/pointcloud/format/opc/FileRecord.js.map +1 -1
  22. package/lib/cjs/pointcloud/format/opc/GeometryReader.js +14 -6
  23. package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
  24. package/lib/cjs/pointcloud/format/opc/GeometryRecord.js +4 -0
  25. package/lib/cjs/pointcloud/format/opc/GeometryRecord.js.map +1 -1
  26. package/lib/cjs/pointcloud/format/opc/OPCReader.js +6 -0
  27. package/lib/cjs/pointcloud/format/opc/OPCReader.js.map +1 -1
  28. package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js +4 -0
  29. package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
  30. package/lib/cjs/pointcloud/format/opc/TileRecord.js +2 -2
  31. package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
  32. package/lib/cjs/pointcloud/model/AttributeTypes.js +16 -16
  33. package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
  34. package/lib/cjs/pointcloud/model/AttributeValue.js +14 -4
  35. package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
  36. package/lib/cjs/pointcloud/model/BlockIndex.js +18 -0
  37. package/lib/cjs/pointcloud/model/BlockIndex.js.map +1 -1
  38. package/lib/cjs/pointcloud/model/CloudPoint.js +22 -2
  39. package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
  40. package/lib/cjs/pointcloud/model/Grid.js +4 -0
  41. package/lib/cjs/pointcloud/model/Grid.js.map +1 -1
  42. package/lib/cjs/pointcloud/model/GridIndex.js +6 -0
  43. package/lib/cjs/pointcloud/model/GridIndex.js.map +1 -1
  44. package/lib/cjs/pointcloud/model/PointAttribute.js +14 -0
  45. package/lib/cjs/pointcloud/model/PointAttribute.js.map +1 -1
  46. package/lib/cjs/pointcloud/model/PointData.js +4 -0
  47. package/lib/cjs/pointcloud/model/PointData.js.map +1 -1
  48. package/lib/cjs/pointcloud/model/PointDataRaw.js +8 -2
  49. package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
  50. package/lib/cjs/pointcloud/model/ReadRequest.js +28 -6
  51. package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
  52. package/lib/cjs/pointcloud/model/StandardAttributes.js +21 -21
  53. package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
  54. package/lib/cjs/pointcloud/model/TileIndex.js +16 -0
  55. package/lib/cjs/pointcloud/model/TileIndex.js.map +1 -1
  56. package/lib/cjs/pointcloud/render/Block.js +6 -0
  57. package/lib/cjs/pointcloud/render/Block.js.map +1 -1
  58. package/lib/cjs/pointcloud/render/DataManager.js +36 -6
  59. package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
  60. package/lib/cjs/pointcloud/render/FrameData.js +8 -0
  61. package/lib/cjs/pointcloud/render/FrameData.js.map +1 -1
  62. package/lib/cjs/pointcloud/render/Level.js +12 -0
  63. package/lib/cjs/pointcloud/render/Level.js.map +1 -1
  64. package/lib/cjs/pointcloud/render/TileLoadSorter.js +9 -4
  65. package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
  66. package/lib/cjs/pointcloud/render/ViewTree.js +12 -4
  67. package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
  68. package/lib/cjs/spatial/crs/CRSManager.js +2 -2
  69. package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
  70. package/lib/cjs/spatial/ecrs/Axis.js +12 -0
  71. package/lib/cjs/spatial/ecrs/Axis.js.map +1 -1
  72. package/lib/cjs/spatial/ecrs/CRS.js +68 -34
  73. package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
  74. package/lib/cjs/spatial/ecrs/CoordinateSystem.js +20 -2
  75. package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
  76. package/lib/cjs/spatial/ecrs/DataFileUnit.js +1 -1
  77. package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
  78. package/lib/cjs/spatial/ecrs/Datum.js +16 -4
  79. package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
  80. package/lib/cjs/spatial/ecrs/Ellipsoid.js +18 -0
  81. package/lib/cjs/spatial/ecrs/Ellipsoid.js.map +1 -1
  82. package/lib/cjs/spatial/ecrs/OnlineEngine.js +2 -0
  83. package/lib/cjs/spatial/ecrs/OnlineEngine.js.map +1 -1
  84. package/lib/cjs/spatial/ecrs/OnlineRegistry.js +6 -2
  85. package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
  86. package/lib/cjs/spatial/ecrs/Operation.js +28 -6
  87. package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
  88. package/lib/cjs/spatial/ecrs/OperationMethod.js +6 -0
  89. package/lib/cjs/spatial/ecrs/OperationMethod.js.map +1 -1
  90. package/lib/cjs/spatial/ecrs/ParameterValue.js +6 -0
  91. package/lib/cjs/spatial/ecrs/ParameterValue.js.map +1 -1
  92. package/lib/cjs/spatial/ecrs/ParameterValueList.js +2 -0
  93. package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
  94. package/lib/cjs/spatial/ecrs/PrimeMeridian.js +8 -0
  95. package/lib/cjs/spatial/ecrs/PrimeMeridian.js.map +1 -1
  96. package/lib/cjs/spatial/ecrs/Registry.js +17 -17
  97. package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
  98. package/lib/cjs/spatial/ecrs/Transform.js +11 -11
  99. package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
  100. package/lib/cjs/spatial/ecrs/Unit.js +40 -24
  101. package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
  102. package/lib/cjs/spatial/ecrs/WellKnownText.js +8 -8
  103. package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
  104. package/lib/cjs/spatial/ecrs/WellKnownTextNode.js +4 -0
  105. package/lib/cjs/spatial/ecrs/WellKnownTextNode.js.map +1 -1
  106. package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js +36 -2
  107. package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
  108. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js +23 -2
  109. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
  110. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +4 -2
  111. package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
  112. package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js +12 -2
  113. package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
  114. package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js +29 -6
  115. package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
  116. package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js +14 -4
  117. package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
  118. package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js +38 -4
  119. package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
  120. package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js +24 -4
  121. package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
  122. package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js +28 -4
  123. package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
  124. package/lib/cjs/spatial/ecrs/transformation/PositionVector.js +12 -2
  125. package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
  126. package/lib/cjs/spatial/geom/Bounds.js +3 -0
  127. package/lib/cjs/spatial/geom/Bounds.js.map +1 -1
  128. package/lib/cjs/spatial/geom/Coordinate.js +3 -0
  129. package/lib/cjs/spatial/geom/Coordinate.js.map +1 -1
  130. package/lib/cjs/spatial/geom/Line.js +4 -0
  131. package/lib/cjs/spatial/geom/Line.js.map +1 -1
  132. package/lib/cjs/spatial/geom/Transform.js +2 -0
  133. package/lib/cjs/spatial/geom/Transform.js.map +1 -1
  134. package/lib/cjs/system/buffer/ABuffer.js +4 -0
  135. package/lib/cjs/system/buffer/ABuffer.js.map +1 -1
  136. package/lib/cjs/system/buffer/Float32Buffer.js +8 -2
  137. package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
  138. package/lib/cjs/system/buffer/Uint16Buffer.js +8 -2
  139. package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
  140. package/lib/cjs/system/buffer/Uint8Buffer.js +8 -2
  141. package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
  142. package/lib/cjs/system/collection/AList.js +1 -0
  143. package/lib/cjs/system/collection/AList.js.map +1 -1
  144. package/lib/cjs/system/collection/IntMap.js +1 -0
  145. package/lib/cjs/system/collection/IntMap.js.map +1 -1
  146. package/lib/cjs/system/collection/StringMap.js +1 -0
  147. package/lib/cjs/system/collection/StringMap.js.map +1 -1
  148. package/lib/cjs/system/io/ABufferInStream.js +5 -0
  149. package/lib/cjs/system/io/ABufferInStream.js.map +1 -1
  150. package/lib/cjs/system/runtime/ALong.js +30 -26
  151. package/lib/cjs/system/runtime/ALong.js.map +1 -1
  152. package/lib/cjs/system/runtime/ASystem.js +1 -1
  153. package/lib/cjs/system/runtime/ASystem.js.map +1 -1
  154. package/lib/cjs/system/runtime/Downloader.js +2 -2
  155. package/lib/cjs/system/runtime/Downloader.js.map +1 -1
  156. package/lib/cjs/system/runtime/Message.js +2 -2
  157. package/lib/cjs/system/runtime/Message.js.map +1 -1
  158. package/lib/cjs/system/runtime/Numbers.js +6 -6
  159. package/lib/cjs/system/runtime/Numbers.js.map +1 -1
  160. package/lib/cjs/system/runtime/Strings.js +14 -14
  161. package/lib/cjs/system/runtime/Strings.js.map +1 -1
  162. package/lib/cjs/system/storage/CacheList.js +8 -0
  163. package/lib/cjs/system/storage/CacheList.js.map +1 -1
  164. package/lib/cjs/system/storage/CachedItem.js +6 -0
  165. package/lib/cjs/system/storage/CachedItem.js.map +1 -1
  166. package/lib/cjs/system/storage/ContentLoader.js +14 -2
  167. package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
  168. package/lib/cjs/system/storage/FileContent.js +4 -0
  169. package/lib/cjs/system/storage/FileContent.js.map +1 -1
  170. package/lib/cjs/system/storage/FileRange.js +4 -0
  171. package/lib/cjs/system/storage/FileRange.js.map +1 -1
  172. package/lib/cjs/system/storage/PageCachedFile.js +8 -0
  173. package/lib/cjs/system/storage/PageCachedFile.js.map +1 -1
  174. package/lib/cjs/system/storage/UrlFS.js +6 -0
  175. package/lib/cjs/system/storage/UrlFS.js.map +1 -1
  176. package/lib/esm/pointcloud/format/opc/AttributeMask.js +4 -0
  177. package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
  178. package/lib/esm/pointcloud/format/opc/BlockRecord.js +2 -2
  179. package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
  180. package/lib/esm/pointcloud/format/opc/ContainerFile.js +10 -2
  181. package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
  182. package/lib/esm/pointcloud/format/opc/ContainerFilePart.js +8 -0
  183. package/lib/esm/pointcloud/format/opc/ContainerFilePart.js.map +1 -1
  184. package/lib/esm/pointcloud/format/opc/DirectoryReader.js +12 -0
  185. package/lib/esm/pointcloud/format/opc/DirectoryReader.js.map +1 -1
  186. package/lib/esm/pointcloud/format/opc/DirectoryRecord.js +6 -0
  187. package/lib/esm/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
  188. package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js +21 -0
  189. package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
  190. package/lib/esm/pointcloud/format/opc/FileAccess.js +6 -0
  191. package/lib/esm/pointcloud/format/opc/FileAccess.js.map +1 -1
  192. package/lib/esm/pointcloud/format/opc/FileReader.js +16 -2
  193. package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
  194. package/lib/esm/pointcloud/format/opc/FileRecord.js +14 -0
  195. package/lib/esm/pointcloud/format/opc/FileRecord.js.map +1 -1
  196. package/lib/esm/pointcloud/format/opc/GeometryReader.js +14 -6
  197. package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
  198. package/lib/esm/pointcloud/format/opc/GeometryRecord.js +4 -0
  199. package/lib/esm/pointcloud/format/opc/GeometryRecord.js.map +1 -1
  200. package/lib/esm/pointcloud/format/opc/OPCReader.js +6 -0
  201. package/lib/esm/pointcloud/format/opc/OPCReader.js.map +1 -1
  202. package/lib/esm/pointcloud/format/opc/TileReadBuffer.js +4 -0
  203. package/lib/esm/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
  204. package/lib/esm/pointcloud/format/opc/TileRecord.js +2 -2
  205. package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
  206. package/lib/esm/pointcloud/model/AttributeTypes.js +16 -16
  207. package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
  208. package/lib/esm/pointcloud/model/AttributeValue.js +14 -4
  209. package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
  210. package/lib/esm/pointcloud/model/BlockIndex.js +18 -0
  211. package/lib/esm/pointcloud/model/BlockIndex.js.map +1 -1
  212. package/lib/esm/pointcloud/model/CloudPoint.js +22 -2
  213. package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
  214. package/lib/esm/pointcloud/model/Grid.js +4 -0
  215. package/lib/esm/pointcloud/model/Grid.js.map +1 -1
  216. package/lib/esm/pointcloud/model/GridIndex.js +6 -0
  217. package/lib/esm/pointcloud/model/GridIndex.js.map +1 -1
  218. package/lib/esm/pointcloud/model/PointAttribute.js +14 -0
  219. package/lib/esm/pointcloud/model/PointAttribute.js.map +1 -1
  220. package/lib/esm/pointcloud/model/PointData.js +4 -0
  221. package/lib/esm/pointcloud/model/PointData.js.map +1 -1
  222. package/lib/esm/pointcloud/model/PointDataRaw.js +8 -2
  223. package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
  224. package/lib/esm/pointcloud/model/ReadRequest.js +28 -6
  225. package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
  226. package/lib/esm/pointcloud/model/StandardAttributes.js +21 -21
  227. package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
  228. package/lib/esm/pointcloud/model/TileIndex.js +16 -0
  229. package/lib/esm/pointcloud/model/TileIndex.js.map +1 -1
  230. package/lib/esm/pointcloud/render/Block.js +6 -0
  231. package/lib/esm/pointcloud/render/Block.js.map +1 -1
  232. package/lib/esm/pointcloud/render/DataManager.js +36 -6
  233. package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
  234. package/lib/esm/pointcloud/render/FrameData.js +8 -0
  235. package/lib/esm/pointcloud/render/FrameData.js.map +1 -1
  236. package/lib/esm/pointcloud/render/Level.js +12 -0
  237. package/lib/esm/pointcloud/render/Level.js.map +1 -1
  238. package/lib/esm/pointcloud/render/TileLoadSorter.js +9 -4
  239. package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
  240. package/lib/esm/pointcloud/render/ViewTree.js +12 -4
  241. package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
  242. package/lib/esm/spatial/crs/CRSManager.js +2 -2
  243. package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
  244. package/lib/esm/spatial/ecrs/Axis.js +12 -0
  245. package/lib/esm/spatial/ecrs/Axis.js.map +1 -1
  246. package/lib/esm/spatial/ecrs/CRS.js +68 -34
  247. package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
  248. package/lib/esm/spatial/ecrs/CoordinateSystem.js +20 -2
  249. package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
  250. package/lib/esm/spatial/ecrs/DataFileUnit.js +1 -1
  251. package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
  252. package/lib/esm/spatial/ecrs/Datum.js +16 -4
  253. package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
  254. package/lib/esm/spatial/ecrs/Ellipsoid.js +18 -0
  255. package/lib/esm/spatial/ecrs/Ellipsoid.js.map +1 -1
  256. package/lib/esm/spatial/ecrs/OnlineEngine.js +2 -0
  257. package/lib/esm/spatial/ecrs/OnlineEngine.js.map +1 -1
  258. package/lib/esm/spatial/ecrs/OnlineRegistry.js +6 -2
  259. package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
  260. package/lib/esm/spatial/ecrs/Operation.js +28 -6
  261. package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
  262. package/lib/esm/spatial/ecrs/OperationMethod.js +6 -0
  263. package/lib/esm/spatial/ecrs/OperationMethod.js.map +1 -1
  264. package/lib/esm/spatial/ecrs/ParameterValue.js +6 -0
  265. package/lib/esm/spatial/ecrs/ParameterValue.js.map +1 -1
  266. package/lib/esm/spatial/ecrs/ParameterValueList.js +2 -0
  267. package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
  268. package/lib/esm/spatial/ecrs/PrimeMeridian.js +8 -0
  269. package/lib/esm/spatial/ecrs/PrimeMeridian.js.map +1 -1
  270. package/lib/esm/spatial/ecrs/Registry.js +17 -17
  271. package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
  272. package/lib/esm/spatial/ecrs/Transform.js +11 -11
  273. package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
  274. package/lib/esm/spatial/ecrs/Unit.js +40 -24
  275. package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
  276. package/lib/esm/spatial/ecrs/WellKnownText.js +8 -8
  277. package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
  278. package/lib/esm/spatial/ecrs/WellKnownTextNode.js +4 -0
  279. package/lib/esm/spatial/ecrs/WellKnownTextNode.js.map +1 -1
  280. package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js +36 -2
  281. package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
  282. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js +23 -2
  283. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
  284. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +4 -2
  285. package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
  286. package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js +12 -2
  287. package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
  288. package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js +29 -6
  289. package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
  290. package/lib/esm/spatial/ecrs/projection/Mercator1SP.js +14 -4
  291. package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
  292. package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js +38 -4
  293. package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
  294. package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js +24 -4
  295. package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
  296. package/lib/esm/spatial/ecrs/projection/TransverseMercator.js +28 -4
  297. package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
  298. package/lib/esm/spatial/ecrs/transformation/PositionVector.js +12 -2
  299. package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
  300. package/lib/esm/spatial/geom/Bounds.js +3 -0
  301. package/lib/esm/spatial/geom/Bounds.js.map +1 -1
  302. package/lib/esm/spatial/geom/Coordinate.js +3 -0
  303. package/lib/esm/spatial/geom/Coordinate.js.map +1 -1
  304. package/lib/esm/spatial/geom/Line.js +4 -0
  305. package/lib/esm/spatial/geom/Line.js.map +1 -1
  306. package/lib/esm/spatial/geom/Transform.js +2 -0
  307. package/lib/esm/spatial/geom/Transform.js.map +1 -1
  308. package/lib/esm/system/buffer/ABuffer.js +4 -0
  309. package/lib/esm/system/buffer/ABuffer.js.map +1 -1
  310. package/lib/esm/system/buffer/Float32Buffer.js +8 -2
  311. package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
  312. package/lib/esm/system/buffer/Uint16Buffer.js +8 -2
  313. package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
  314. package/lib/esm/system/buffer/Uint8Buffer.js +8 -2
  315. package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
  316. package/lib/esm/system/collection/AList.js +1 -0
  317. package/lib/esm/system/collection/AList.js.map +1 -1
  318. package/lib/esm/system/collection/IntMap.js +1 -0
  319. package/lib/esm/system/collection/IntMap.js.map +1 -1
  320. package/lib/esm/system/collection/StringMap.js +1 -0
  321. package/lib/esm/system/collection/StringMap.js.map +1 -1
  322. package/lib/esm/system/io/ABufferInStream.js +5 -0
  323. package/lib/esm/system/io/ABufferInStream.js.map +1 -1
  324. package/lib/esm/system/runtime/ALong.js +30 -26
  325. package/lib/esm/system/runtime/ALong.js.map +1 -1
  326. package/lib/esm/system/runtime/ASystem.js +1 -1
  327. package/lib/esm/system/runtime/ASystem.js.map +1 -1
  328. package/lib/esm/system/runtime/Downloader.js +2 -2
  329. package/lib/esm/system/runtime/Downloader.js.map +1 -1
  330. package/lib/esm/system/runtime/Message.js +2 -2
  331. package/lib/esm/system/runtime/Message.js.map +1 -1
  332. package/lib/esm/system/runtime/Numbers.js +6 -6
  333. package/lib/esm/system/runtime/Numbers.js.map +1 -1
  334. package/lib/esm/system/runtime/Strings.js +14 -14
  335. package/lib/esm/system/runtime/Strings.js.map +1 -1
  336. package/lib/esm/system/storage/CacheList.js +8 -0
  337. package/lib/esm/system/storage/CacheList.js.map +1 -1
  338. package/lib/esm/system/storage/CachedItem.js +6 -0
  339. package/lib/esm/system/storage/CachedItem.js.map +1 -1
  340. package/lib/esm/system/storage/ContentLoader.js +14 -2
  341. package/lib/esm/system/storage/ContentLoader.js.map +1 -1
  342. package/lib/esm/system/storage/FileContent.js +4 -0
  343. package/lib/esm/system/storage/FileContent.js.map +1 -1
  344. package/lib/esm/system/storage/FileRange.js +4 -0
  345. package/lib/esm/system/storage/FileRange.js.map +1 -1
  346. package/lib/esm/system/storage/PageCachedFile.js +8 -0
  347. package/lib/esm/system/storage/PageCachedFile.js.map +1 -1
  348. package/lib/esm/system/storage/UrlFS.js +6 -0
  349. package/lib/esm/system/storage/UrlFS.js.map +1 -1
  350. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  # Change Log - @itwin/core-orbitgt
2
2
 
3
- This log was last generated on Thu, 14 Nov 2024 18:13:56 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 18 Feb 2025 17:30:07 GMT and should not be manually modified.
4
+
5
+ ## 4.10.7
6
+ Tue, 18 Feb 2025 17:27:03 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.10.6
11
+ Fri, 24 Jan 2025 08:02:40 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.10.5
16
+ Tue, 21 Jan 2025 21:56:45 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.10.4
21
+ Mon, 13 Jan 2025 14:06:43 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.10.3
26
+ Mon, 06 Jan 2025 14:00:13 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 4.10.2
31
+ Thu, 21 Nov 2024 15:22:20 GMT
32
+
33
+ _Version update only_
4
34
 
5
35
  ## 4.10.1
6
36
  Thu, 14 Nov 2024 18:11:00 GMT
@@ -16,6 +16,10 @@ const AList_1 = require("../../../system/collection/AList");
16
16
  */
17
17
  /** @internal */
18
18
  class AttributeMask {
19
+ /** The definitions of the attributes */
20
+ attributes;
21
+ /** The readers of the attributes */
22
+ readers;
19
23
  /**
20
24
  * Create a new mask.
21
25
  * @param readers the list of attribute readers (can be null).
@@ -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;IAMtB;;;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
+ {"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"]}
@@ -19,6 +19,8 @@ const GridIndex_1 = require("../../model/GridIndex");
19
19
  */
20
20
  /** @internal */
21
21
  class BlockRecord {
22
+ /** The size of the record in the file */
23
+ static RECORD_SIZE = 24;
22
24
  /**
23
25
  * No instances.
24
26
  */
@@ -80,6 +82,4 @@ class BlockRecord {
80
82
  }
81
83
  }
82
84
  exports.BlockRecord = BlockRecord;
83
- /** The size of the record in the file */
84
- BlockRecord.RECORD_SIZE = 24;
85
85
  //# sourceMappingURL=BlockRecord.js.map
@@ -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;IAIpB;;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,IA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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;AAjEG,yCAAyC;AAClB,uBAAW,GAAU,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module 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
+ {"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":";AAAA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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"]}
@@ -24,6 +24,16 @@ const FileAccess_1 = require("./FileAccess");
24
24
  */
25
25
  /** @internal */
26
26
  class ContainerFile {
27
+ /** The name of this module */
28
+ static MODULE = "ContainerFile";
29
+ /** The name of the file */
30
+ _fileName;
31
+ /** The length of the file */
32
+ _fileLength;
33
+ /** The format */
34
+ _format;
35
+ /** The parts in the file */
36
+ _parts;
27
37
  /**
28
38
  * Create a new container file.
29
39
  * @param fileName the name of the file.
@@ -195,6 +205,4 @@ class ContainerFile {
195
205
  }
196
206
  }
197
207
  exports.ContainerFile = ContainerFile;
198
- /** The name of this module */
199
- ContainerFile.MODULE = "ContainerFile";
200
208
  //# sourceMappingURL=ContainerFile.js.map
@@ -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;IAatB;;;;;;OAMG;IACH,Y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AAO,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;AAtLG,8BAA8B;AACN,oBAAM,GAAW,eAAe,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module 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
+ {"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;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAwB;QACjC,IAAI,eAAe;YAAE,KAAK,IA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U,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"]}
@@ -16,6 +16,14 @@ const ASystem_1 = require("../../../system/runtime/ASystem");
16
16
  */
17
17
  /** @internal */
18
18
  class ContainerFilePart {
19
+ /** The name */
20
+ _name;
21
+ /** The file access */
22
+ _fileAccess;
23
+ /** The offset */
24
+ _offset;
25
+ /** The size */
26
+ _size;
19
27
  /**
20
28
  * Create a new part.
21
29
  * @param name the name of the part.
@@ -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;IAU1B;;;;;;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
+ {"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"]}
@@ -24,6 +24,18 @@ const TileRecord_1 = require("./TileRecord");
24
24
  */
25
25
  /** @internal */
26
26
  class DirectoryReader {
27
+ /** The file reader */
28
+ _fileReader;
29
+ /** The level */
30
+ _level;
31
+ /** The location of the tile directory */
32
+ _tileDirPart;
33
+ /** The location of the block directory */
34
+ _blockDirPart;
35
+ /** The directory record */
36
+ _directoryRecord;
37
+ /** The blocks (lazy loading) */
38
+ _blocks;
27
39
  /**
28
40
  * Create a new reader.
29
41
  * @param fileReader the file reader.
@@ -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;IAgBxB;;;;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,OAA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------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @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
+ {"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;;;;OA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K,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"]}
@@ -16,6 +16,12 @@ const LittleEndian_1 = require("../../../system/buffer/LittleEndian");
16
16
  */
17
17
  /** @internal */
18
18
  class DirectoryRecord {
19
+ /** The number of points (8 byte) */
20
+ _pointCount;
21
+ /** The number of tiles (4 byte) */
22
+ _tileCount;
23
+ /** The number of blocks (4 byte) */
24
+ _blockCount;
19
25
  /**
20
26
  * Create a new record.
21
27
  */
@@ -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;IAQxB;;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
+ {"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"]}
@@ -22,6 +22,27 @@ const AttributeReader_1 = require("./AttributeReader");
22
22
  */
23
23
  /** @internal */
24
24
  class EmbeddedAttributeReader extends AttributeReader_1.AttributeReader {
25
+ /** The container */
26
+ _container;
27
+ /** The index */
28
+ _index;
29
+ /** The number of levels */
30
+ _levelCount;
31
+ /** The definition of the attribute */
32
+ _attribute;
33
+ /** The value range of the attribute */
34
+ _minValue;
35
+ _maxValue;
36
+ /** Is this the legacy color attribute? */
37
+ _standardColor;
38
+ /** Is this the legacy intensity attribute? */
39
+ _standardIntensity;
40
+ /** The point-attribute data parts (one per level) */
41
+ _pointDataParts;
42
+ /** The block-attribute data parts (one per level) */
43
+ _blockDataParts;
44
+ /** The tile-attribute data parts (one per level) */
45
+ _tileDataParts;
25
46
  /**
26
47
  * Create a new reader.
27
48
  * @param container the container.
@@ -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;IAyBxD;;;;;OAKG;IACH,YAAmB,SAAwB,EAAE,KAAY,EAAE,UAAiB;QACxE,KAAK,EAAE,CAAC;QACR,0BAA0B;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,WAAW;QACX,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IAAI,IAAI,GAAY,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3D,UAAU,CAAC,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,KAAY,EAAE,IAAe,EAAE,UAA0B,EAAE,WAAkB,EAAE,UAAiB,EAAE,UAAsB;QACxI,oBAAoB;QACpB,IAAI,MAAM,GAAY,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACjE,IAAI,MAAM,GAAU,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACxE,oBAAoB;QACpB,IAAI,SAAS,GAAmB,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACrE,IAAI,KAAK,GAAmB,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACtE,+BAAc,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,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
+ {"version":3,"file":"EmbeddedAttributeRe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AI,MAAM,GAAU,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QACxE,oBAAoB;QACpB,IAAI,SAAS,GAAmB,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACrE,IAAI,KAAK,GAAmB,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACtE,+BAAc,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,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"]}
@@ -15,6 +15,12 @@ exports.FileAccess = void 0;
15
15
  */
16
16
  /** @internal */
17
17
  class FileAccess {
18
+ /** The storage of the file */
19
+ _fileStorage;
20
+ /** The name of the file */
21
+ _fileName;
22
+ /** The length of the file */
23
+ _fileLength;
18
24
  /**
19
25
  * Create a new file access.
20
26
  * @param fileName the name of the file.
@@ -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;IAQnB;;;;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
+ {"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"]}
@@ -24,6 +24,22 @@ const GeometryReader_1 = require("./GeometryReader");
24
24
  */
25
25
  /** @internal */
26
26
  class FileReader {
27
+ /** The name of this module */
28
+ static MODULE = "FileReader";
29
+ /** The file storage */
30
+ _fileStorage;
31
+ /** The name of the file */
32
+ _fileName;
33
+ /** The container */
34
+ _container;
35
+ /** The file record */
36
+ _fileRecord;
37
+ /** The directory readers (1 per level) */
38
+ _directoryReaders;
39
+ /** The geometry readers (1 per level) */
40
+ _geometryReaders;
41
+ /** The attribute readers */
42
+ _attributeReaders;
27
43
  /**
28
44
  * Create a new reader.
29
45
  * @param fileName the name of the file.
@@ -244,6 +260,4 @@ class FileReader {
244
260
  }
245
261
  }
246
262
  exports.FileReader = FileReader;
247
- /** The name of this module */
248
- FileReader.MODULE = "FileReader";
249
263
  //# sourceMappingURL=FileReader.js.map