@itwin/core-orbitgt 4.6.0-dev.21 → 4.6.0-dev.23
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.
- package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.js +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/cjs/pointcloud/render/Block.js.map +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.js +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSManager.js +1 -1
- package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Datum.js +1 -1
- package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/cjs/spatial/geom/Bounds.js.map +1 -1
- package/lib/cjs/spatial/geom/Line.js.map +1 -1
- package/lib/cjs/spatial/geom/Transform.js.map +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.js +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/LittleEndian.js.map +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.js +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.js +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/cjs/system/collection/AList.js.map +1 -1
- package/lib/cjs/system/runtime/ALong.js +1 -1
- package/lib/cjs/system/runtime/ALong.js.map +1 -1
- package/lib/cjs/system/runtime/ASystem.js +1 -1
- package/lib/cjs/system/runtime/ASystem.js.map +1 -1
- package/lib/cjs/system/runtime/Downloader.js +1 -1
- package/lib/cjs/system/runtime/Downloader.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/cjs/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/cjs/system/runtime/Message.js +1 -1
- package/lib/cjs/system/runtime/Message.js.map +1 -1
- package/lib/cjs/system/runtime/Numbers.js +1 -1
- package/lib/cjs/system/runtime/Numbers.js.map +1 -1
- package/lib/cjs/system/runtime/Strings.js +1 -1
- package/lib/cjs/system/runtime/Strings.js.map +1 -1
- package/lib/cjs/system/storage/CacheList.js.map +1 -1
- package/lib/cjs/system/storage/ContentLoader.js +1 -1
- package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
- package/lib/cjs/system/storage/NodeFS.js.map +1 -1
- package/lib/cjs/system/storage/PageCachedFile.js.map +1 -1
- package/lib/cjs/system/storage/UrlFS.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/BlockRecord.js +1 -2
- package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFile.js +1 -2
- package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/DirectoryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/EmbeddedAttributeReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileReader.js +1 -2
- package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryReader.js +1 -2
- package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/OPCReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/PointReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileReadBuffer.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileRecord.js +1 -2
- package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeTypes.js +1 -2
- package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeValue.js +1 -2
- package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/esm/pointcloud/model/CloudPoint.js +1 -2
- package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/esm/pointcloud/model/PointDataRaw.js +1 -2
- package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/esm/pointcloud/model/ReadRequest.js +1 -2
- package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/esm/pointcloud/model/StandardAttributes.js +1 -2
- package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/esm/pointcloud/render/Block.js.map +1 -1
- package/lib/esm/pointcloud/render/DataManager.js +1 -2
- package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
- package/lib/esm/pointcloud/render/TileLoadSorter.js +1 -2
- package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/esm/pointcloud/render/ViewTree.js +1 -2
- package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/esm/spatial/crs/CRSEngine.js.map +1 -1
- package/lib/esm/spatial/crs/CRSManager.js +1 -2
- package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
- package/lib/esm/spatial/ecrs/CRS.js +1 -2
- package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
- package/lib/esm/spatial/ecrs/CoordinateSystem.js +1 -2
- package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.js +1 -2
- package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/esm/spatial/ecrs/Datum.js +1 -2
- package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
- package/lib/esm/spatial/ecrs/Ellipsoid.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineEngine.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineRegistry.js +1 -2
- package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Operation.js +1 -2
- package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/esm/spatial/ecrs/Registry.js +1 -2
- package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Transform.js +1 -2
- package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
- package/lib/esm/spatial/ecrs/Unit.js +1 -2
- package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownText.js +1 -2
- package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js +1 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +1 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js +1 -2
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js +1 -2
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js +1 -2
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js +1 -2
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/esm/spatial/geom/Bounds.js.map +1 -1
- package/lib/esm/spatial/geom/Line.js.map +1 -1
- package/lib/esm/spatial/geom/Transform.js.map +1 -1
- package/lib/esm/system/buffer/Float32Buffer.js +1 -2
- package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/esm/system/buffer/LittleEndian.js.map +1 -1
- package/lib/esm/system/buffer/Uint16Buffer.js +1 -2
- package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/esm/system/buffer/Uint8Buffer.js +1 -2
- package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/esm/system/collection/AList.js.map +1 -1
- package/lib/esm/system/runtime/ALong.js +1 -2
- package/lib/esm/system/runtime/ALong.js.map +1 -1
- package/lib/esm/system/runtime/ASystem.js +1 -2
- package/lib/esm/system/runtime/ASystem.js.map +1 -1
- package/lib/esm/system/runtime/Downloader.js +1 -2
- package/lib/esm/system/runtime/Downloader.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderNode.js.map +1 -1
- package/lib/esm/system/runtime/DownloaderXhr.js.map +1 -1
- package/lib/esm/system/runtime/Message.js +1 -2
- package/lib/esm/system/runtime/Message.js.map +1 -1
- package/lib/esm/system/runtime/Numbers.js +1 -2
- package/lib/esm/system/runtime/Numbers.js.map +1 -1
- package/lib/esm/system/runtime/Strings.js +1 -2
- package/lib/esm/system/runtime/Strings.js.map +1 -1
- package/lib/esm/system/storage/CacheList.js.map +1 -1
- package/lib/esm/system/storage/ContentLoader.js +1 -2
- package/lib/esm/system/storage/ContentLoader.js.map +1 -1
- package/lib/esm/system/storage/NodeFS.js.map +1 -1
- package/lib/esm/system/storage/PageCachedFile.js.map +1 -1
- package/lib/esm/system/storage/UrlFS.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLoader.js","sourceRoot":"","sources":["../../../../src/system/storage/ContentLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,+CAA4C;AAE5C,gDAA6C;AAE7C,2CAAwC;AAGxC;;GAEG;AACH,gBAAgB;AAChB,MAAa,aAAa;IAkBtB;;OAEG;IACH,YAAmB,WAAwB,EAAE,QAAgB;QACzD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,KAAK;QACR,IAAI,CAAC,SAAS,GAAG,IAAI,aAAK,EAAa,CAAC;QACxC,IAAI,CAAC,QAAQ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AO,IAAI,CAAC;IAChB,CAAC;;AAjGL,sCAkGC;AAjGG,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.system.storage;\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 \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { Message } from \"../runtime/Message\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\r\n\r\n/**\r\n * Class ContentLoader helps requesting and loading multiple ranges from a file with a single request to the storage service.\r\n */\r\n/** @internal */\r\nexport class ContentLoader {\r\n /** The name of this module */\r\n private static readonly MODULE: string = \"ContentLoader\";\r\n\r\n /** The storage space of the file */\r\n private _fileStorage: FileStorage;\r\n /** The name of the file */\r\n private _fileName: string;\r\n\r\n /** The list of requests */\r\n private _requests: AList<FileRange>;\r\n /** Has loading started? */\r\n private _loading: boolean;\r\n /** Has loading stopped? */\r\n private _loaded: boolean;\r\n /** The list of responses */\r\n private _responses: AList<FileContent>;\r\n\r\n /**\r\n * Create a new content loader.\r\n */\r\n public constructor(fileStorage: FileStorage, fileName: string) {\r\n this._fileStorage = fileStorage;\r\n this._fileName = fileName;\r\n this.clear();\r\n }\r\n\r\n /**\r\n * Clear the content loader for reuse.\r\n */\r\n public clear(): void {\r\n this._requests = new AList<FileRange>();\r\n this._loading = false;\r\n this._loaded = false;\r\n this._responses = null;\r\n }\r\n\r\n /**\r\n * Add a request to load a content range.\r\n */\r\n public requestFilePart(offset: ALong, size: int32): ContentLoader {\r\n this._requests.add(new FileRange(offset, size));\r\n return this;\r\n }\r\n\r\n /**\r\n * Get the total size of the data to be loaded.\r\n */\r\n public getTotalRequestSize(): int32 {\r\n let totalSize: int32 = 0;\r\n for (let i: number = 0; i < this._requests.size(); i++) totalSize += this._requests.get(i).size;\r\n return totalSize;\r\n }\r\n\r\n /**\r\n * Print info.\r\n */\r\n public printInfo(): void {\r\n Message.print(ContentLoader.MODULE, \"Requesting \" + this._requests.size() + \" parts from '\" + this._fileName + \"' with total size \" + this.getTotalRequestSize());\r\n }\r\n\r\n /**\r\n * Has all content been loaded?\r\n */\r\n public isLoaded(): boolean {\r\n return this._loaded;\r\n }\r\n\r\n /**\r\n * Has all content been loaded?\r\n */\r\n public isAvailable(): boolean {\r\n return this.isLoaded();\r\n }\r\n\r\n /**\r\n * Load all content from storage.\r\n */\r\n public async load(): Promise<ContentLoader> {\r\n this._loading = true;\r\n this.printInfo();\r\n this._responses = await this._fileStorage.readFileParts(this._fileName, this._requests);\r\n this._loaded = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Get a content range that has been loaded.\r\n */\r\n public getFilePart(offset: ALong, size: int32): ABuffer {\r\n for (let i: number = 0; i < this._responses.size(); i++) {\r\n let response: FileContent = this._responses.get(i);\r\n if (response.offset.same(offset) && (response.content.size() == size)) {\r\n return response.content;\r\n }\r\n }\r\n return null;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeFS.js","sourceRoot":"","sources":["../../../../src/system/storage/NodeFS.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAyB;AACzB,+CAA4C;AAC5C,+CAA4C;AAC5C,4CAAyC;AACzC,gDAA6C;AAC7C,+CAA4C;AAE5C,+CAA4C;AAQ5C;;GAEG;AACH,gBAAgB;AAChB,MAAa,MAAO,SAAQ,yBAAW;IACnC;;SAEK;IACL;QACI,KAAK,EAAE,CAAC;IACZ,C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EAAE,EAAE,IAAI,UAAU,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC/D,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACJ;AA7DD,wBA6DC","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\nimport * as fs from \"fs\";\r\nimport { ABuffer } from \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { ASystem } from \"../runtime/ASystem\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\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\n * Class NodeFS provides access to files using the Node platform.\r\n */\r\n/** @internal */\r\nexport class NodeFS extends FileStorage {\r\n /**\r\n * Create new storage.\r\n */\r\n public constructor() {\r\n super();\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override close(): void {\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async getFileLength(fileName: string): Promise<ALong> {\r\n const fileStats: fs.Stats = fs.statSync(fileName);\r\n return ALong.fromDouble(fileStats.size);\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\r\n const rawBuffer: ArrayBuffer = new ArrayBuffer(size);\r\n const buffer: Uint8Array = new Uint8Array(rawBuffer);\r\n const fd: number = fs.openSync(fileName, \"r\");\r\n const bytesRead: number = fs.readSync(fd, buffer, 0, size, offset.toDouble());\r\n fs.closeSync(fd);\r\n ASystem.assert0(bytesRead == size, `Expected ${size} bytes read, not ${bytesRead} from file '${fileName}' offset ${offset.toDouble()}`);\r\n return ABuffer.wrap(rawBuffer);\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\r\n const buffers: AList<FileContent> = new AList<FileContent>();\r\n const fd: number = fs.openSync(fileName, \"r\");\r\n for (let i: number = 0; i < ranges.size(); i++) {\r\n const range: FileRange = ranges.get(i);\r\n const rawBuffer: ArrayBuffer = new ArrayBuffer(range.size);\r\n const buffer: Uint8Array = new Uint8Array(rawBuffer);\r\n const bytesRead: number = fs.readSync(fd, buffer, 0, range.size, range.offset.toDouble());\r\n ASystem.assert0(bytesRead == range.size, `Expected ${range.size} bytes read, not ${bytesRead} from file '${fileName}' offset ${range.offset.toDouble()}`);\r\n buffers.add(new FileContent(range.offset, ABuffer.wrap(rawBuffer)));\r\n }\r\n fs.closeSync(fd);\r\n return buffers;\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async writeFile(fileName: string, fileContent: ABuffer): Promise<void> {\r\n const fd: number = fs.openSync(fileName, \"w\");\r\n fs.writeSync(fd, new Uint8Array(fileContent.toNativeBuffer()));\r\n fs.closeSync(fd);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCachedFile.js","sourceRoot":"","sources":["../../../../src/system/storage/PageCachedFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,+CAA4C;AAC5C,+CAA4C;AAC5C,uDAAoD;AACpD,4CAAyC;AACzC,gDAA6C;AAC7C,gDAA6C;AAC7C,2CAAwC;AACxC,+CAA4C;AAC5C,2CAAwC;AACxC,+CAA4C;AAE5C;;GAEG;AACH,gBAAgB;AAChB,MAAa,cAAe,SAAQ,yBAAW;IAW9C;;;;;;;OAOG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,QAAe,EAAE,QAAe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I,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC3C,IAAI,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD;AAvJD,wCAuJC","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.system.storage;\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 \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { StringMap } from \"../collection/StringMap\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { ASystem } from \"../runtime/ASystem\";\r\nimport { Message } from \"../runtime/Message\";\r\nimport { CacheList } from \"./CacheList\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\r\n\r\n/**\r\n * Class PageCachedFile defines a paged content cache of a single file.\r\n */\r\n/** @internal */\r\nexport class PageCachedFile extends FileStorage {\r\n\tprivate _fileStorage: FileStorage;\r\n\tprivate _fileName: string;\r\n\tprivate _fileSize: ALong;\r\n\tprivate _pageSize: int32;\r\n\tprivate _pageCount: int32;\r\n\r\n\tprivate _contentCache: CacheList<ABuffer>;\r\n\tprivate _requestCount: int32;\r\n\tprivate _requestSize: int32;\r\n\r\n\t/**\r\n\t * Create a new cached file.\r\n\t * @param fileStorage the underlying file storage.\r\n\t * @param fileName the name of the file to cache.\r\n\t * @param fileSize the length of the file to cache.\r\n\t * @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).\r\n\t * @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).\r\n\t */\r\n\tpublic constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32) {\r\n\t\tsuper();\r\n\t\tthis._fileStorage = fileStorage;\r\n\t\tthis._fileName = fileName;\r\n\t\tthis._fileSize = fileSize;\r\n\t\tthis._pageSize = pageSize;\r\n\t\tthis._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();\r\n\t\tthis._contentCache = new CacheList<ABuffer>(maxPageCount);\r\n\t\tthis._requestCount = 0;\r\n\t\tthis._requestSize = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override close(): void {\r\n\t\tthis._fileStorage.close(); // deep close\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async getFileLength(fileName: string): Promise<ALong> {\r\n\t\treturn this._fileSize;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\r\n\t\t/* Define the set of pages we need to fulfill the request */\r\n\t\tconst pageMap: StringMap<ABuffer> = new StringMap<ABuffer>();\r\n\t\t/* Create a list of missing pages */\r\n\t\tconst missingPages: AList<FileRange> = new AList<FileRange>();\r\n\t\tconst missingKeys: AList<string> = new AList<string>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Scan the needed pages of the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Try to get the page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = this._contentCache.findEntry(pageKey);\r\n\t\t\t\tif (page == null) {\r\n\t\t\t\t\t/* Do not request the same page twice */\r\n\t\t\t\t\tif (missingKeys.contains(pageKey) == false) {\r\n\t\t\t\t\t\t/* Add a request to read the missing page */\r\n\t\t\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t\t\tconst pageSize: int32 = pageOffset1.sub(pageOffset0).toInt();\r\n\t\t\t\t\t\tmissingPages.add(new FileRange(pageOffset0, pageSize));\r\n\t\t\t\t\t\tmissingKeys.add(pageKey);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t/* Keep */\r\n\t\t\t\t\tpageMap.set(pageKey, page);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Do we have to load missing pages? */\r\n\t\tif (missingPages.size() > 0) {\r\n\t\t\t/* Load all missing pages with one call to the storage */\r\n\t\t\tMessage.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);\r\n\t\t\tconst loadedPages: AList<FileContent> = await this._fileStorage.readFileParts(fileName, missingPages);\r\n\t\t\t/* Add to the cache for reuse */\r\n\t\t\tfor (let i: number = 0; i < loadedPages.size(); i++) {\r\n\t\t\t\tconst pageKey: string = missingKeys.get(i);\r\n\t\t\t\tconst pageContent: FileContent = loadedPages.get(i);\r\n\t\t\t\tthis._contentCache.addEntry(pageKey, pageContent.content);\r\n\t\t\t\tpageMap.set(pageKey, pageContent.content);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Create the responses from the cached content */\r\n\t\tconst responseList: AList<FileContent> = new AList<FileContent>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Create the response for the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst rangeExtent: ALong = range.offset.addInt(range.size);\r\n\t\t\tconst response: ABuffer = new ABuffer(range.size);\r\n\t\t\tlet responseOffset: int32 = 0;\r\n\t\t\tthis._requestCount++;\r\n\t\t\tthis._requestSize += range.size;\r\n\t\t\t/* Scan the needed pages */\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Get the next page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = pageMap.get(pageKey);\r\n\t\t\t\tASystem.assertNot(page == null, `Missing cache page ${pageKey}`);\r\n\t\t\t\t/* Get the extent of the page */\r\n\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t/* Copy the overlapping part of the page to the response */\r\n\t\t\t\tconst currentOffset: ALong = range.offset.addInt(responseOffset);\r\n\t\t\t\tconst copyOffset: int32 = currentOffset.sub(pageOffset0).toInt();\r\n\t\t\t\tconst copySize: int32 = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();\r\n\t\t\t\tABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);\r\n\t\t\t\tresponseOffset += copySize;\r\n\t\t\t}\r\n\t\t\t/* Add the response to the list */\r\n\t\t\tASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);\r\n\t\t\tresponseList.add(new FileContent(range.offset, response));\r\n\t\t}\r\n\t\treturn responseList;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\r\n\t\tconst ranges: AList<FileRange> = new AList<FileRange>();\r\n\t\tranges.add(new FileRange(offset, size));\r\n\t\tconst reponses: AList<FileContent> = await this.readFileParts(fileName, ranges);\r\n\t\tconst reponse: FileContent = reponses.get(0);\r\n\t\treturn reponse.content;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override printStatistics(clear: boolean): void {\r\n\t\tMessage.log(`Page cache of file '${this._fileName}':`);\r\n\t\tMessage.log(`Request count is ${this._requestCount}`);\r\n\t\tMessage.log(`Request size is ${this._requestSize}`);\r\n\t\tMessage.log(`Cache hit count is ${this._contentCache.hitCount}`);\r\n\t\tMessage.log(`Cache miss count is ${this._contentCache.missCount}`);\r\n\t\tif (clear) this._contentCache.hitCount = 0;\r\n\t\tif (clear) this._contentCache.missCount = 0;\r\n\t\tthis._fileStorage.printStatistics(clear);\r\n\t}\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"PageCachedFile.js","sourceRoot":"","sources":["../../../../src/system/storage/PageCachedFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,+CAA4C;AAC5C,+CAA4C;AAC5C,uDAAoD;AACpD,4CAAyC;AACzC,gDAA6C;AAC7C,gDAA6C;AAC7C,2CAAwC;AACxC,+CAA4C;AAC5C,2CAAwC;AACxC,+CAA4C;AAE5C;;GAEG;AACH,gBAAgB;AAChB,MAAa,cAAe,SAAQ,yBAAW;IAW9C;;;;;;;OAOG;IACH,YAAmB,WAAwB,EAAE,QAAgB,EAAE,QAAe,EAAE,QAAe,EAAE,YAAmB;QACnH,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAA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vJD,wCAuJC","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.system.storage;\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 \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { StringMap } from \"../collection/StringMap\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { ASystem } from \"../runtime/ASystem\";\r\nimport { Message } from \"../runtime/Message\";\r\nimport { CacheList } from \"./CacheList\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\r\n\r\n/**\r\n * Class PageCachedFile defines a paged content cache of a single file.\r\n */\r\n/** @internal */\r\nexport class PageCachedFile extends FileStorage {\r\n\tprivate _fileStorage: FileStorage;\r\n\tprivate _fileName: string;\r\n\tprivate _fileSize: ALong;\r\n\tprivate _pageSize: int32;\r\n\tprivate _pageCount: int32;\r\n\r\n\tprivate _contentCache: CacheList<ABuffer>;\r\n\tprivate _requestCount: int32;\r\n\tprivate _requestSize: int32;\r\n\r\n\t/**\r\n\t * Create a new cached file.\r\n\t * @param fileStorage the underlying file storage.\r\n\t * @param fileName the name of the file to cache.\r\n\t * @param fileSize the length of the file to cache.\r\n\t * @param pageSize the byte size of a cache page (common sizes are 32768, 65536, 131072 or 262144).\r\n\t * @param maxPageCount the maximum number of pages to cache (the oldest pages are purged when the cache is full).\r\n\t */\r\n\tpublic constructor(fileStorage: FileStorage, fileName: string, fileSize: ALong, pageSize: int32, maxPageCount: int32) {\r\n\t\tsuper();\r\n\t\tthis._fileStorage = fileStorage;\r\n\t\tthis._fileName = fileName;\r\n\t\tthis._fileSize = fileSize;\r\n\t\tthis._pageSize = pageSize;\r\n\t\tthis._pageCount = fileSize.subInt(1).divInt(this._pageSize).addInt(1).toInt();\r\n\t\tthis._contentCache = new CacheList<ABuffer>(maxPageCount);\r\n\t\tthis._requestCount = 0;\r\n\t\tthis._requestSize = 0;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override close(): void {\r\n\t\tthis._fileStorage.close(); // deep close\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async getFileLength(fileName: string): Promise<ALong> {\r\n\t\treturn this._fileSize;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFileParts(fileName: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\r\n\t\t/* Define the set of pages we need to fulfill the request */\r\n\t\tconst pageMap: StringMap<ABuffer> = new StringMap<ABuffer>();\r\n\t\t/* Create a list of missing pages */\r\n\t\tconst missingPages: AList<FileRange> = new AList<FileRange>();\r\n\t\tconst missingKeys: AList<string> = new AList<string>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Scan the needed pages of the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Try to get the page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = this._contentCache.findEntry(pageKey);\r\n\t\t\t\tif (page == null) {\r\n\t\t\t\t\t/* Do not request the same page twice */\r\n\t\t\t\t\tif (missingKeys.contains(pageKey) == false) {\r\n\t\t\t\t\t\t/* Add a request to read the missing page */\r\n\t\t\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t\t\tconst pageSize: int32 = pageOffset1.sub(pageOffset0).toInt();\r\n\t\t\t\t\t\tmissingPages.add(new FileRange(pageOffset0, pageSize));\r\n\t\t\t\t\t\tmissingKeys.add(pageKey);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t/* Keep */\r\n\t\t\t\t\tpageMap.set(pageKey, page);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Do we have to load missing pages? */\r\n\t\tif (missingPages.size() > 0) {\r\n\t\t\t/* Load all missing pages with one call to the storage */\r\n\t\t\tMessage.log(`Requesting ${missingPages.size()} missing cache pages for '${this._fileName}'`);\r\n\t\t\tconst loadedPages: AList<FileContent> = await this._fileStorage.readFileParts(fileName, missingPages);\r\n\t\t\t/* Add to the cache for reuse */\r\n\t\t\tfor (let i: number = 0; i < loadedPages.size(); i++) {\r\n\t\t\t\tconst pageKey: string = missingKeys.get(i);\r\n\t\t\t\tconst pageContent: FileContent = loadedPages.get(i);\r\n\t\t\t\tthis._contentCache.addEntry(pageKey, pageContent.content);\r\n\t\t\t\tpageMap.set(pageKey, pageContent.content);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Create the responses from the cached content */\r\n\t\tconst responseList: AList<FileContent> = new AList<FileContent>();\r\n\t\tfor (let r: number = 0; r < ranges.size(); r++) {\r\n\t\t\t/* Create the response for the next range */\r\n\t\t\tconst range: FileRange = ranges.get(r);\r\n\t\t\tconst rangeExtent: ALong = range.offset.addInt(range.size);\r\n\t\t\tconst response: ABuffer = new ABuffer(range.size);\r\n\t\t\tlet responseOffset: int32 = 0;\r\n\t\t\tthis._requestCount++;\r\n\t\t\tthis._requestSize += range.size;\r\n\t\t\t/* Scan the needed pages */\r\n\t\t\tconst page0: int32 = range.offset.divInt(this._pageSize).toInt();\r\n\t\t\tconst page1: int32 = range.offset.addInt(range.size - 1).divInt(this._pageSize).toInt() + 1; // exclusive\r\n\t\t\tfor (let i: number = page0; i < page1; i++) {\r\n\t\t\t\t/* Get the next page from the cache */\r\n\t\t\t\tconst pageKey: string = (`${i}`);\r\n\t\t\t\tconst page: ABuffer = pageMap.get(pageKey);\r\n\t\t\t\tASystem.assertNot(page == null, `Missing cache page ${pageKey}`);\r\n\t\t\t\t/* Get the extent of the page */\r\n\t\t\t\tconst pageOffset0: ALong = ALong.fromInt(this._pageSize).mulInt(i);\r\n\t\t\t\tconst pageOffset1: ALong = ALong.min(pageOffset0.addInt(this._pageSize), this._fileSize);\r\n\t\t\t\t/* Copy the overlapping part of the page to the response */\r\n\t\t\t\tconst currentOffset: ALong = range.offset.addInt(responseOffset);\r\n\t\t\t\tconst copyOffset: int32 = currentOffset.sub(pageOffset0).toInt();\r\n\t\t\t\tconst copySize: int32 = ALong.min(pageOffset1, rangeExtent).sub(currentOffset).toInt();\r\n\t\t\t\tABuffer.arrayCopy(page, copyOffset, response, responseOffset, copySize);\r\n\t\t\t\tresponseOffset += copySize;\r\n\t\t\t}\r\n\t\t\t/* Add the response to the list */\r\n\t\t\tASystem.assertNot(responseOffset != range.size, `Expected ${range.size} response size, not ${responseOffset}`);\r\n\t\t\tresponseList.add(new FileContent(range.offset, response));\r\n\t\t}\r\n\t\treturn responseList;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override async readFilePart(fileName: string, offset: ALong, size: int32): Promise<ABuffer> {\r\n\t\tconst ranges: AList<FileRange> = new AList<FileRange>();\r\n\t\tranges.add(new FileRange(offset, size));\r\n\t\tconst reponses: AList<FileContent> = await this.readFileParts(fileName, ranges);\r\n\t\tconst reponse: FileContent = reponses.get(0);\r\n\t\treturn reponse.content;\r\n\t}\r\n\r\n\t/**\r\n\t * FileStorage method.\r\n\t */\r\n\tpublic override printStatistics(clear: boolean): void {\r\n\t\tMessage.log(`Page cache of file '${this._fileName}':`);\r\n\t\tMessage.log(`Request count is ${this._requestCount}`);\r\n\t\tMessage.log(`Request size is ${this._requestSize}`);\r\n\t\tMessage.log(`Cache hit count is ${this._contentCache.hitCount}`);\r\n\t\tMessage.log(`Cache miss count is ${this._contentCache.missCount}`);\r\n\t\tif (clear) this._contentCache.hitCount = 0;\r\n\t\tif (clear) this._contentCache.missCount = 0;\r\n\t\tthis._fileStorage.printStatistics(clear);\r\n\t}\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlFS.js","sourceRoot":"","sources":["../../../../src/system/storage/UrlFS.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AASH,+CAA4C;AAC5C,uDAAoD;AACpD,4CAAyC;AACzC,gDAA6C;AAC7C,sDAAmD;AACnD,+CAA4C;AAE5C,+CAA4C;AAE5C;;GAEG;AACH,gBAAgB;AAChB,MAAa,KAAM,SAAQ,yBAAW;IASlC;;;;;;;SAOK;IACE,MAAM,CAAC,kBAAkB,CAAC,WAAmB,EAAE,aAAqB,EAAE,QAAgB,EAAE,QAAgB;QAC3G,IAAI,OAAO,GAAW,WAAW,WAAW,0BAA0B,aAAa,GAAG,QAAQ,EAAE,CAAC;QACjG,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,IAAI,QAAQ,EAAE,CAAC;QAChD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;SAEK;IACL;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,uBAAU,CAAC,QAAQ,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;SAEK;IACW,KAAK;IACrB,CAAC;IAED;;SAEK;IACW,KAAK,CAAC,aAAa,CAAC,GAAW;QAC3C,MAAM,cAAc,GAAsB,IAAI,CAAC;QAC/C,MAAM,eAAe,GAAsB,IAAI,qBAAS,EAAU,CAAC;Q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AC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAClD,IAAI,KAAK;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACjC,IAAI,KAAK;YAAE,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IACrC,CAAC;CACJ;AAtGD,sBAsGC","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\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 \"../buffer/ABuffer\";\r\nimport { AList } from \"../collection/AList\";\r\nimport { StringMap } from \"../collection/StringMap\";\r\nimport { ALong } from \"../runtime/ALong\";\r\nimport { ASystem } from \"../runtime/ASystem\";\r\nimport { Downloader } from \"../runtime/Downloader\";\r\nimport { FileContent } from \"./FileContent\";\r\nimport { FileRange } from \"./FileRange\";\r\nimport { FileStorage } from \"./FileStorage\";\r\n\r\n/**\r\n * Class UrlFS provides access to file content using URLs.\r\n */\r\n/** @internal */\r\nexport class UrlFS extends FileStorage {\r\n // the downloader to the file\r\n private _downloader: Downloader;\r\n\r\n // the number of requests that have been made to access the content of the file\r\n public requestCount: number;\r\n // the number of content bytes downloaded\r\n public responseSize: number;\r\n\r\n /**\r\n * Create the URL to access a blob file in an Azure storage account.\r\n * @param accountName the name of the Azure storage account.\r\n * @param containerName the name of the container that stores the blob file.\r\n * @param blobName the name of the blob (should start with a forward slash).\r\n * @param sasToken the SAS (shared access signature) of the blob or container (the part after the '?' character of the URL).\r\n * @return the URL.\r\n */\r\n public static getAzureBlobSasUrl(accountName: string, containerName: string, blobName: string, sasToken: string): string {\r\n let blobURL: string = `https://${accountName}.blob.core.windows.net/${containerName}${blobName}`;\r\n if (sasToken != null) blobURL += `?${sasToken}`;\r\n return blobURL;\r\n }\r\n\r\n /**\r\n * Create a new instance.\r\n */\r\n public constructor() {\r\n super();\r\n this._downloader = Downloader.INSTANCE;\r\n this.requestCount = 0;\r\n this.responseSize = 0;\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override close(): void {\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async getFileLength(url: string): Promise<ALong> {\r\n const requestHeaders: StringMap<string> = null;\r\n const responseHeaders: StringMap<string> = new StringMap<string>();\r\n await this._downloader.downloadBytes(\"HEAD\"/* method*/, url, requestHeaders, null/* postText*/, null/* postData*/, responseHeaders);\r\n const fileLength: number = parseInt(responseHeaders.get(\"content-length\"));\r\n return ALong.fromDouble(fileLength);\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async readFilePart(url: string, offset: ALong, size: int32): Promise<ABuffer> {\r\n const extent: ALong = offset.addInt(size - 1);\r\n const range: string = `bytes=${offset.toString()}-${extent.toString()}`;\r\n const requestHeaders: StringMap<string> = new StringMap<string>();\r\n requestHeaders.set(\"Range\", range);\r\n // requestHeaders.set(\"x-ms-range\",range); // https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-file-service-operations\r\n const responseHeaders: StringMap<string> = new StringMap<string>();\r\n const content: ABuffer = await this._downloader.downloadBytes(\"GET\"/* method*/, url, requestHeaders, null/* postText*/, null/* postData*/, responseHeaders);\r\n const contentLength: number = parseInt(responseHeaders.get(\"content-length\"));\r\n ASystem.assertNot(contentLength != size, `Expected ${size} bytes of content, not ${contentLength}`);\r\n ASystem.assertNot(content.size() != size, `Expected content buffer size ${size}, not ${content}`);\r\n this.requestCount++;\r\n this.responseSize += size;\r\n return content;\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override async readFileParts(url: string, ranges: AList<FileRange>): Promise<AList<FileContent>> {\r\n /* Request all file parts in parallel */\r\n const contentFetchers: Array<Promise<ABuffer>> = [];\r\n for (let i: number = 0; i < ranges.size(); i++) {\r\n const range: FileRange = ranges.get(i);\r\n const contentFetcher: Promise<ABuffer> = this.readFilePart(url, range.offset, range.size);\r\n contentFetchers.push(contentFetcher);\r\n }\r\n /* Await all requests at once */\r\n const contentResponses: Array<ABuffer> = await Promise.all(contentFetchers);\r\n /* Create the result list */\r\n const contentParts: AList<FileContent> = new AList<FileContent>();\r\n for (let i: number = 0; i < ranges.size(); i++) {\r\n const range: FileRange = ranges.get(i);\r\n const contentResponse: ABuffer = contentResponses[i];\r\n contentParts.add(new FileContent(range.offset, contentResponse));\r\n }\r\n return contentParts;\r\n }\r\n\r\n /**\r\n * FileStorage method.\r\n */\r\n public override printStatistics(clear: boolean): void {\r\n console.log(\"File url access statistics:\");\r\n console.log(`Request count ${this.requestCount}`);\r\n console.log(`Response size ${this.responseSize}`);\r\n if (clear) this.requestCount = 0;\r\n if (clear) this.responseSize = 0;\r\n }\r\n}\r\n"]}
|
|
@@ -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,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAKzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,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;
|
|
1
|
+
{"version":3,"file":"AttributeMask.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/AttributeMask.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAKzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,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,KAAK,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","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"]}
|
|
@@ -15,7 +15,7 @@ import { GridIndex } from "../../model/GridIndex";
|
|
|
15
15
|
* @version 1.0 January 2014
|
|
16
16
|
*/
|
|
17
17
|
/** @internal */
|
|
18
|
-
class BlockRecord {
|
|
18
|
+
export class BlockRecord {
|
|
19
19
|
/**
|
|
20
20
|
* No instances.
|
|
21
21
|
*/
|
|
@@ -78,5 +78,4 @@ class BlockRecord {
|
|
|
78
78
|
}
|
|
79
79
|
/** The size of the record in the file */
|
|
80
80
|
BlockRecord.RECORD_SIZE = 24;
|
|
81
|
-
export { BlockRecord };
|
|
82
81
|
//# 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,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,
|
|
1
|
+
{"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAInE,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,WAAW;IAIpB;;OAEG;IACH;IACA,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,SAAgB,EAAE,SAAgB;QAC1D,IAAI,SAAS,GAAG,CAAC;YAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QACzE,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,YAAY,CAAC,KAAY,EAAE,KAAY,EAAE,KAAY,EAAE,SAAgB;QACjF,OAAO,IAAI,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE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EAAE,UAAU,EAAE,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAClI,CAAC;;AAhED,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"]}
|
|
@@ -20,7 +20,7 @@ import { FileAccess } from "./FileAccess";
|
|
|
20
20
|
* @version 1.0 January 2014
|
|
21
21
|
*/
|
|
22
22
|
/** @internal */
|
|
23
|
-
class ContainerFile {
|
|
23
|
+
export class ContainerFile {
|
|
24
24
|
/**
|
|
25
25
|
* Create a new container file.
|
|
26
26
|
* @param fileName the name of the file.
|
|
@@ -193,5 +193,4 @@ class ContainerFile {
|
|
|
193
193
|
}
|
|
194
194
|
/** The name of this module */
|
|
195
195
|
ContainerFile.MODULE = "ContainerFile";
|
|
196
|
-
export { ContainerFile };
|
|
197
196
|
//# 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,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IAatB;;;;;;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,IAAI,CAAC,GAAW,CAAC,EA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,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,sBAAsB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QAClH,OAAO,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;;AArLD,8BAA8B;AACN,oBAAM,GAAW,eAAe,CAAC;SAFhD,aAAa","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":["../../../../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,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9H,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;;AArLD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectoryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,E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CAAC,GAAG,IAAI,CAAC;YAChB,SAAS,IAAI,CAAC,CAAC;YACf,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACnD;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,sBAAsB;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACI,kBAAkB,CAAC,YAA2B;QACjD,wBAAwB;QACxB,IAAI,QAAQ,GAAqB,IAAI,KAAK,EAAa,CAAC;QACxD,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;YAC5B,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;SAC9C;QACD,8BAA8B;QAC9B,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../../system/runtime/ASystem\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { BlockIndex } from \"../../model/BlockIndex\";\r\nimport { GridIndex } from \"../../model/GridIndex\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { BlockRecord } from \"./BlockRecord\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { DirectoryRecord } from \"./DirectoryRecord\";\r\nimport { FileAccess } from \"./FileAccess\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { FileRecord } from \"./FileRecord\";\r\nimport { TileRecord } from \"./TileRecord\";\r\n\r\n/**\r\n * Class DirectoryReader reads the tile and block directory.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class DirectoryReader {\r\n /** The file reader */\r\n private _fileReader: FileReader;\r\n /** The level */\r\n private _level: int32;\r\n\r\n /** The location of the tile directory */\r\n private _tileDirPart: ContainerFilePart;\r\n /** The location of the block directory */\r\n private _blockDirPart: ContainerFilePart;\r\n\r\n /** The directory record */\r\n private _directoryRecord: DirectoryRecord;\r\n /** The blocks (lazy loading) */\r\n private _blocks: Array<BlockIndex>;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param fileReader the file reader.\r\n * @param level the level.\r\n */\r\n public constructor(fileReader: FileReader, level: int32) {\r\n /* Store the parameters */\r\n this._fileReader = fileReader;\r\n this._level = level;\r\n /* Get the tile directory */\r\n this._tileDirPart = fileReader.getContainer().getPart(\"\" + level + \".tile.directory\");\r\n /* Get the block directory */\r\n this._blockDirPart = fileReader.getContainer().getPart(\"\" + level + \".block.directory\");\r\n /* Clear */\r\n this._directoryRecord = null;\r\n this._blocks = new Array<BlockIndex>(0);\r\n }\r\n\r\n /**\r\n * Get the directory record.\r\n * @return the directory record.\r\n */\r\n public getDirectoryRecord(): DirectoryRecord {\r\n return this._directoryRecord;\r\n }\r\n\r\n /**\r\n * Get the blocks.\r\n * @return the blocks.\r\n */\r\n public getBlocks(): Array<BlockIndex> {\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Load the data.\r\n * @param readBlockList should the list of blocks be read?\r\n * @param fileContents the file content read helper.\r\n * @return the reader.\r\n */\r\n public loadData(readBlockList: boolean, fileContents: ContentLoader): DirectoryReader {\r\n /* Read the record */\r\n let directoryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".directory\");\r\n this._directoryRecord = DirectoryRecord.readNew(directoryPart.getOffset(), directoryPart.getSize(), fileContents);\r\n /* Read the blocks? */\r\n if (readBlockList) this.readBlocks(this._fileReader.getFileRecord(), fileContents);\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * Read the blocks.\r\n * @param fileRecord the file record.\r\n * @param fileContents the file content read helper.\r\n * @return the blocks.\r\n */\r\n public readBlocks(fileRecord: FileRecord, fileContents: ContentLoader): Array<BlockIndex> {\r\n /* Request the data? */\r\n let fileAccess: FileAccess = this._blockDirPart.getFileAccess();\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n /* Allocate the blocks */\r\n this._blocks = new Array<BlockIndex>(this._directoryRecord.getBlockCount());\r\n /* Read all blocks */\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = ALong.ZERO;\r\n let tileIndex: int32 = 0;\r\n for (let i: number = 0; i < this._blocks.length; i++) {\r\n /* Read the next block */\r\n let blockIndex: BlockIndex = BlockRecord.readNew(this._level, input, i, tileIndex, pointIndex);\r\n this._blocks[i] = blockIndex;\r\n /* Advance */\r\n tileIndex += blockIndex.tileCount;\r\n pointIndex = pointIndex.add(blockIndex.pointCount);\r\n }\r\n input.close();\r\n /* We have to match the counts */\r\n ASystem.assert0(this._directoryRecord.getTileCount() == tileIndex, \"Expected \" + this._directoryRecord.getTileCount() + \" tiles, not \" + tileIndex);\r\n ASystem.assert0(pointIndex.same(this._directoryRecord.getPointCount()), \"Expected \" + this._directoryRecord.getPointCount().toDouble() + \" points, not \" + pointIndex.toDouble());\r\n /* Return the blocks */\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Read the tiles of a block.\r\n * @param block the block record.\r\n * @return the tile records.\r\n */\r\n public readTiles2(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\r\n /* Get the tile range */\r\n let tileIndex: int32 = block.tileIndex;\r\n let tileCount: int32 = block.tileCount;\r\n /* Get the file extent */\r\n let fileName: string = this._tileDirPart.getFileAccess().getFileName();\r\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\r\n let dataOffset: ALong = ALong.fromInt(TileRecord.RECORD_SIZE).mulInt(tileIndex).add(this._tileDirPart.getOffset());\r\n let dataSize: int32 = tileCount * TileRecord.RECORD_SIZE;\r\n /* Request the data? */\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(dataOffset, dataSize);\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(dataOffset, dataSize);\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = new Array<TileIndex>(tileCount);\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = block.pointIndex;\r\n for (let i: number = 0; i < tileCount; i++) {\r\n /* Read the next tile */\r\n let tile: TileIndex = new TileIndex(this._level, tileIndex, new GridIndex(0, 0, 0), ALong.ZERO, 0);\r\n TileRecord.read(tile, this._level, block.index, input, tileIndex, pointIndex);\r\n tiles[i] = tile;\r\n tileIndex += 1;\r\n pointIndex = pointIndex.addInt(tile.pointCount);\r\n }\r\n input.close();\r\n /* Return the tiles */\r\n return tiles;\r\n }\r\n\r\n /**\r\n * Get all tile indexes at this level.\r\n * @param tileFilter the optional tile filter.\r\n * @param selectionType the type of selection in the pointcloud.\r\n * @return the list of tiles.\r\n */\r\n public getAllTileIndexes2(fileContents: ContentLoader): AList<TileIndex> {\r\n /* Process all blocks */\r\n let tileList: AList<TileIndex> = new AList<TileIndex>();\r\n for (let block of this._blocks) {\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = this.readTiles2(block, fileContents);\r\n /* Add all tiles */\r\n for (let tile of tiles) tileList.add(tile);\r\n }\r\n /* Return the list of tiles */\r\n return tileList;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DirectoryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,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,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,kBAAkB,CAAC,CAAC;QACxF,WAAW;QACX,IAAI,CAAC,gBAAgB,GA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AI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,wBAAwB;YACxB,IAAI,IAAI,GAAc,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACnG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;YAC9E,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YAChB,SAAS,IAAI,CAAC,CAAC;YACf,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,sBAAsB;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACI,kBAAkB,CAAC,YAA2B;QACjD,wBAAwB;QACxB,IAAI,QAAQ,GAAqB,IAAI,KAAK,EAAa,CAAC;QACxD,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,oBAAoB;YACpB,IAAI,KAAK,GAAqB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YACnE,mBAAmB;YACnB,KAAK,IAAI,IAAI,IAAI,KAAK;gBAAE,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;QACD,8BAA8B;QAC9B,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../../system/runtime/ASystem\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { BlockIndex } from \"../../model/BlockIndex\";\r\nimport { GridIndex } from \"../../model/GridIndex\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { BlockRecord } from \"./BlockRecord\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { DirectoryRecord } from \"./DirectoryRecord\";\r\nimport { FileAccess } from \"./FileAccess\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { FileRecord } from \"./FileRecord\";\r\nimport { TileRecord } from \"./TileRecord\";\r\n\r\n/**\r\n * Class DirectoryReader reads the tile and block directory.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class DirectoryReader {\r\n /** The file reader */\r\n private _fileReader: FileReader;\r\n /** The level */\r\n private _level: int32;\r\n\r\n /** The location of the tile directory */\r\n private _tileDirPart: ContainerFilePart;\r\n /** The location of the block directory */\r\n private _blockDirPart: ContainerFilePart;\r\n\r\n /** The directory record */\r\n private _directoryRecord: DirectoryRecord;\r\n /** The blocks (lazy loading) */\r\n private _blocks: Array<BlockIndex>;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param fileReader the file reader.\r\n * @param level the level.\r\n */\r\n public constructor(fileReader: FileReader, level: int32) {\r\n /* Store the parameters */\r\n this._fileReader = fileReader;\r\n this._level = level;\r\n /* Get the tile directory */\r\n this._tileDirPart = fileReader.getContainer().getPart(\"\" + level + \".tile.directory\");\r\n /* Get the block directory */\r\n this._blockDirPart = fileReader.getContainer().getPart(\"\" + level + \".block.directory\");\r\n /* Clear */\r\n this._directoryRecord = null;\r\n this._blocks = new Array<BlockIndex>(0);\r\n }\r\n\r\n /**\r\n * Get the directory record.\r\n * @return the directory record.\r\n */\r\n public getDirectoryRecord(): DirectoryRecord {\r\n return this._directoryRecord;\r\n }\r\n\r\n /**\r\n * Get the blocks.\r\n * @return the blocks.\r\n */\r\n public getBlocks(): Array<BlockIndex> {\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Load the data.\r\n * @param readBlockList should the list of blocks be read?\r\n * @param fileContents the file content read helper.\r\n * @return the reader.\r\n */\r\n public loadData(readBlockList: boolean, fileContents: ContentLoader): DirectoryReader {\r\n /* Read the record */\r\n let directoryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".directory\");\r\n this._directoryRecord = DirectoryRecord.readNew(directoryPart.getOffset(), directoryPart.getSize(), fileContents);\r\n /* Read the blocks? */\r\n if (readBlockList) this.readBlocks(this._fileReader.getFileRecord(), fileContents);\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * Read the blocks.\r\n * @param fileRecord the file record.\r\n * @param fileContents the file content read helper.\r\n * @return the blocks.\r\n */\r\n public readBlocks(fileRecord: FileRecord, fileContents: ContentLoader): Array<BlockIndex> {\r\n /* Request the data? */\r\n let fileAccess: FileAccess = this._blockDirPart.getFileAccess();\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(this._blockDirPart.getOffset(), this._blockDirPart.getSize().toInt());\r\n /* Allocate the blocks */\r\n this._blocks = new Array<BlockIndex>(this._directoryRecord.getBlockCount());\r\n /* Read all blocks */\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = ALong.ZERO;\r\n let tileIndex: int32 = 0;\r\n for (let i: number = 0; i < this._blocks.length; i++) {\r\n /* Read the next block */\r\n let blockIndex: BlockIndex = BlockRecord.readNew(this._level, input, i, tileIndex, pointIndex);\r\n this._blocks[i] = blockIndex;\r\n /* Advance */\r\n tileIndex += blockIndex.tileCount;\r\n pointIndex = pointIndex.add(blockIndex.pointCount);\r\n }\r\n input.close();\r\n /* We have to match the counts */\r\n ASystem.assert0(this._directoryRecord.getTileCount() == tileIndex, \"Expected \" + this._directoryRecord.getTileCount() + \" tiles, not \" + tileIndex);\r\n ASystem.assert0(pointIndex.same(this._directoryRecord.getPointCount()), \"Expected \" + this._directoryRecord.getPointCount().toDouble() + \" points, not \" + pointIndex.toDouble());\r\n /* Return the blocks */\r\n return this._blocks;\r\n }\r\n\r\n /**\r\n * Read the tiles of a block.\r\n * @param block the block record.\r\n * @return the tile records.\r\n */\r\n public readTiles2(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\r\n /* Get the tile range */\r\n let tileIndex: int32 = block.tileIndex;\r\n let tileCount: int32 = block.tileCount;\r\n /* Get the file extent */\r\n let fileName: string = this._tileDirPart.getFileAccess().getFileName();\r\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\r\n let dataOffset: ALong = ALong.fromInt(TileRecord.RECORD_SIZE).mulInt(tileIndex).add(this._tileDirPart.getOffset());\r\n let dataSize: int32 = tileCount * TileRecord.RECORD_SIZE;\r\n /* Request the data? */\r\n if (fileContents.isAvailable() == false) {\r\n /* Add the range */\r\n fileContents.requestFilePart(dataOffset, dataSize);\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = fileContents.getFilePart(dataOffset, dataSize);\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = new Array<TileIndex>(tileCount);\r\n let input: ABufferInStream = new ABufferInStream(data, 0, data.size());\r\n let pointIndex: ALong = block.pointIndex;\r\n for (let i: number = 0; i < tileCount; i++) {\r\n /* Read the next tile */\r\n let tile: TileIndex = new TileIndex(this._level, tileIndex, new GridIndex(0, 0, 0), ALong.ZERO, 0);\r\n TileRecord.read(tile, this._level, block.index, input, tileIndex, pointIndex);\r\n tiles[i] = tile;\r\n tileIndex += 1;\r\n pointIndex = pointIndex.addInt(tile.pointCount);\r\n }\r\n input.close();\r\n /* Return the tiles */\r\n return tiles;\r\n }\r\n\r\n /**\r\n * Get all tile indexes at this level.\r\n * @param tileFilter the optional tile filter.\r\n * @param selectionType the type of selection in the pointcloud.\r\n * @return the list of tiles.\r\n */\r\n public getAllTileIndexes2(fileContents: ContentLoader): AList<TileIndex> {\r\n /* Process all blocks */\r\n let tileList: AList<TileIndex> = new AList<TileIndex>();\r\n for (let block of this._blocks) {\r\n /* Read the tiles */\r\n let tiles: Array<TileIndex> = this.readTiles2(block, fileContents);\r\n /* Add all tiles */\r\n for (let tile of tiles) tileList.add(tile);\r\n }\r\n /* Return the list of tiles */\r\n return tileList;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectoryRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/DirectoryRecord.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAWH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,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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5B,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,cAAc,CAAC,IAAa;QACvC,2BAA2B;QAC3B,IAAI,UAAU,GAAU,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,SAAS,GAAU,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,IAAI,UAAU,GAAU,YAAY,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,YAAY,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;CACJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { OutStream } from \"../../../system/io/OutStream\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\n\r\n/**\r\n * Class DirectoryRecord defines a directory record.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class DirectoryRecord {\r\n /** The number of points (8 byte) */\r\n private _pointCount: ALong;\r\n /** The number of tiles (4 byte) */\r\n private _tileCount: int32;\r\n /** The number of blocks (4 byte) */\r\n private _blockCount: int32;\r\n\r\n /**\r\n * Create a new record.\r\n */\r\n public constructor(pointCount: ALong, tileCount: int32, blockCount: int32) {\r\n this._pointCount = pointCount;\r\n this._tileCount = tileCount;\r\n this._blockCount = blockCount;\r\n }\r\n\r\n /**\r\n * Get the number of points.\r\n * @return the number.\r\n */\r\n public getPointCount(): ALong {\r\n return this._pointCount;\r\n }\r\n\r\n /**\r\n * Get the number of tiles.\r\n * @return the number.\r\n */\r\n public getTileCount(): int32 {\r\n return this._tileCount;\r\n }\r\n\r\n /**\r\n * Get the number of blocks.\r\n * @return the number.\r\n */\r\n public getBlockCount(): int32 {\r\n return this._blockCount;\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param data the record data.\r\n * @return the record.\r\n */\r\n private static readFromBuffer(data: ABuffer): DirectoryRecord {\r\n /* Get the record fields */\r\n let pointCount: ALong = LittleEndian.readBufferLong(data, 0);\r\n let tileCount: int32 = LittleEndian.readBufferInt(data, 8);\r\n let blockCount: int32 = LittleEndian.readBufferInt(data, 12);\r\n /* Return the record */\r\n return new DirectoryRecord(pointCount, tileCount, blockCount);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param offset the file offset to the record.\r\n * @param size the file size to the record.\r\n * @return the record.\r\n */\r\n public static readNew(offset: ALong, size: ALong, contentLoader: ContentLoader): DirectoryRecord {\r\n /* Request the data? */\r\n if (contentLoader.isLoaded() == false) {\r\n /* Add the range */\r\n contentLoader.requestFilePart(offset, size.toInt());\r\n return null;\r\n }\r\n /* Get the data */\r\n let data: ABuffer = contentLoader.getFilePart(offset, size.toInt());\r\n /* Parse the record */\r\n return DirectoryRecord.readFromBuffer(data);\r\n }\r\n\r\n /**\r\n * Write the record.\r\n * @param output the output stream.\r\n */\r\n public write(output: OutStream): void {\r\n LittleEndian.writeStreamLong(output, this._pointCount);\r\n LittleEndian.writeStreamInt(output, this._tileCount);\r\n LittleEndian.writeStreamInt(output, this._blockCount);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbeddedAttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/EmbeddedAttributeReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAYH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAyBxD;;;;;OAKG;IACH,YAAmB,SAAwB,EAAE,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AmB;YACnB,YAAY,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC3C,OAAO;SACV;QACD,wBAAwB;QACxB,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,sBAAsB;QACtB,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,cAAc,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","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":"EmbeddedAttributeReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/EmbeddedAttributeReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAYH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;;GAIG;AACH,gBAAgB;AAChB,MAAM,OAAO,uBAAwB,SAAQ,eAAe;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,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,yBAAyB;QACzB,IAAI,CAAC,eAAe,GAAG,IAAI,KAAK,CAAoB,UAAU,CAAC,CAAC;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AAkB,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,cAAc,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","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"]}
|
|
@@ -20,7 +20,7 @@ import { GeometryReader } from "./GeometryReader";
|
|
|
20
20
|
* @version 1.0 January 2014
|
|
21
21
|
*/
|
|
22
22
|
/** @internal */
|
|
23
|
-
class FileReader {
|
|
23
|
+
export class FileReader {
|
|
24
24
|
/**
|
|
25
25
|
* Create a new reader.
|
|
26
26
|
* @param fileName the name of the file.
|
|
@@ -242,5 +242,4 @@ class FileReader {
|
|
|
242
242
|
}
|
|
243
243
|
/** The name of this module */
|
|
244
244
|
FileReader.MODULE = "FileReader";
|
|
245
|
-
export { FileReader };
|
|
246
245
|
//# sourceMappingURL=FileReader.js.map
|