@itwin/core-orbitgt 5.5.0-dev.2 → 5.5.0-dev.5
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/CHANGELOG.md +6 -1
- package/lib/cjs/core-orbitgt.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/AttributeReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFilePart.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/FileAccess.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileRecord.js.map +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.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/cjs/pointcloud/model/BlockIndex.js.map +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/cjs/pointcloud/model/Grid.js.map +1 -1
- package/lib/cjs/pointcloud/model/GridIndex.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointAttribute.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointCloudReader.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointData.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/cjs/pointcloud/model/TileIndex.js.map +1 -1
- package/lib/cjs/pointcloud/render/AViewRequest.js.map +1 -1
- package/lib/cjs/pointcloud/render/Block.js.map +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
- package/lib/cjs/pointcloud/render/FrameData.js.map +1 -1
- package/lib/cjs/pointcloud/render/Level.js.map +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +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.map +1 -1
- package/lib/cjs/spatial/ecrs/Axis.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +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.map +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OperationMethod.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValue.js.map +1 -1
- package/lib/cjs/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/cjs/spatial/ecrs/PrimeMeridian.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/VerticalModel.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownTextNode.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +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/Coordinate.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/ABuffer.js.map +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.map +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/collection/IntMap.js.map +1 -1
- package/lib/cjs/system/collection/StringMap.js.map +1 -1
- package/lib/cjs/system/io/ABufferInStream.js.map +1 -1
- package/lib/cjs/system/io/InStream.js.map +1 -1
- package/lib/cjs/system/io/OutStream.js.map +1 -1
- package/lib/cjs/system/runtime/ALong.js.map +1 -1
- package/lib/cjs/system/runtime/ASystem.js.map +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.map +1 -1
- package/lib/cjs/system/runtime/Numbers.js.map +1 -1
- package/lib/cjs/system/runtime/Strings.js.map +1 -1
- package/lib/cjs/system/runtime/iComparator.js.map +1 -1
- package/lib/cjs/system/storage/CacheList.js.map +1 -1
- package/lib/cjs/system/storage/CachedItem.js.map +1 -1
- package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
- package/lib/cjs/system/storage/FileContent.js.map +1 -1
- package/lib/cjs/system/storage/FileRange.js.map +1 -1
- package/lib/cjs/system/storage/FileStorage.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/core-orbitgt.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeMask.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/AttributeReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFilePart.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/FileAccess.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileRecord.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/esm/pointcloud/model/BlockIndex.js.map +1 -1
- package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/esm/pointcloud/model/Grid.js.map +1 -1
- package/lib/esm/pointcloud/model/GridIndex.js.map +1 -1
- package/lib/esm/pointcloud/model/PointAttribute.js.map +1 -1
- package/lib/esm/pointcloud/model/PointCloudReader.js.map +1 -1
- package/lib/esm/pointcloud/model/PointData.js.map +1 -1
- package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/esm/pointcloud/model/TileIndex.js.map +1 -1
- package/lib/esm/pointcloud/render/AViewRequest.js.map +1 -1
- package/lib/esm/pointcloud/render/Block.js.map +1 -1
- package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
- package/lib/esm/pointcloud/render/FrameData.js.map +1 -1
- package/lib/esm/pointcloud/render/Level.js.map +1 -1
- package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/spatial/ecrs/Axis.js.map +1 -1
- package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
- package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
- package/lib/esm/spatial/ecrs/OperationMethod.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValue.js.map +1 -1
- package/lib/esm/spatial/ecrs/ParameterValueList.js.map +1 -1
- package/lib/esm/spatial/ecrs/PrimeMeridian.js.map +1 -1
- package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
- package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
- package/lib/esm/spatial/ecrs/VerticalModel.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownTextNode.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- 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/Coordinate.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/ABuffer.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/esm/system/collection/AList.js.map +1 -1
- package/lib/esm/system/collection/IntMap.js.map +1 -1
- package/lib/esm/system/collection/StringMap.js.map +1 -1
- package/lib/esm/system/io/ABufferInStream.js.map +1 -1
- package/lib/esm/system/io/InStream.js.map +1 -1
- package/lib/esm/system/io/OutStream.js.map +1 -1
- package/lib/esm/system/runtime/ALong.js.map +1 -1
- package/lib/esm/system/runtime/ASystem.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/system/runtime/Numbers.js.map +1 -1
- package/lib/esm/system/runtime/Strings.js.map +1 -1
- package/lib/esm/system/runtime/iComparator.js.map +1 -1
- package/lib/esm/system/storage/CacheList.js.map +1 -1
- package/lib/esm/system/storage/CachedItem.js.map +1 -1
- package/lib/esm/system/storage/ContentLoader.js.map +1 -1
- package/lib/esm/system/storage/FileContent.js.map +1 -1
- package/lib/esm/system/storage/FileRange.js.map +1 -1
- package/lib/esm/system/storage/FileStorage.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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/GeometryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,sEAAmE;AACnE,oEAAiE;AACjE,yDAAsD;AAStD,qDAAkD;AAGlD;;;;GAIG;AACH,gBAAgB;AACh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AAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAChG,CAAC;aACI,CAAC;YACF,qCAAqC;YACrC,SAAS,CAAC,QAAQ,GAAG,IAAI,2BAAY,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAClG,CAAC;IACL,CAAC;;AA7JL,wCA8JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { Uint16Buffer } from \"../../../system/buffer/Uint16Buffer\";\nimport { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { CloudPoint } from \"../../model/CloudPoint\";\nimport { Grid } from \"../../model/Grid\";\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\nimport { ReadRequest } from \"../../model/ReadRequest\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { FileReader } from \"./FileReader\";\nimport { GeometryRecord } from \"./GeometryRecord\";\nimport { TileReadBuffer } from \"./TileReadBuffer\";\n\n/**\n * Class GeometryReader reads geometry data.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class GeometryReader {\n /** The size of the high-resolution record in the file */\n public static readonly RECORD_SIZE_HR: int32 = 6;\n /** The size of the low-resolution record in the file */\n public static readonly RECORD_SIZE_LR: int32 = 3;\n\n /** The number of bins (subdivisions) in a multi-resolution tile */\n public static readonly MR_BIN_COUNT: int32 = 64;\n\n /** The file reader */\n private _fileReader: FileReader;\n /** The level */\n private _level: int32;\n\n /** The geometry record */\n private _geometryRecord: GeometryRecord;\n /** The location of the geometry data */\n private _geometryDataPart: ContainerFilePart;\n\n /**\n * Create a new reader.\n * @param opcReader the file reader.\n * @param level the level.\n */\n public constructor(fileReader: FileReader, level: int32) {\n /* Store the parameters */\n this._fileReader = fileReader;\n this._level = level;\n /* Get the geometry data */\n this._geometryRecord = null;\n this._geometryDataPart = fileReader.getContainer().getPart(\"\" + level + \".geometry.data\");\n }\n\n /**\n * Load the data.\n * @return the reader.\n */\n public loadData(fileContents: ContentLoader): GeometryReader {\n /* Read the record */\n let geometryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".geometry.definition\");\n this._geometryRecord = GeometryRecord.readNew(geometryPart.getOffset(), geometryPart.getSize(), fileContents);\n /* Return the reader */\n return this;\n }\n\n /**\n * Get the geometry record.\n * @return the geometry record.\n */\n public getGeometryRecord(): GeometryRecord {\n return this._geometryRecord;\n }\n\n /**\n * Read the raw data for a tile.\n * @param tile the tile.\n * @param tileBuffer the buffer to read into.\n * @param readRequest the read parameters (contains the result read statistics).\n */\n public readTileData2(tile: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, readRequest: ReadRequest, fileContents: ContentLoader): void {\n /* What resolution do we have? */\n let lowResolution: boolean = (this._level > 0);\n let recordSize: int32 = (lowResolution) ? GeometryReader.RECORD_SIZE_LR : GeometryReader.RECORD_SIZE_HR;\n /* Get the file extent */\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\n let offset: ALong = tile.pointIndex.addInt(pointOffset).mulInt(recordSize).add(this._geometryDataPart.getOffset());\n let size: int32 = pointCount * recordSize;\n this._geometryDataPart.rangeCheck(offset, ALong.fromInt(size));\n /* Request the data? */\n if (fileContents.isAvailable() == false) {\n /* Add the range */\n fileContents.requestFilePart(offset, size);\n return;\n }\n /* Update the statistics */\n readRequest.addDataSize(size);\n /* Read the content */\n let data: ABuffer = fileContents.getFilePart(offset, size);\n tileBuffer.setGeometryBuffer(data);\n }\n\n /**\n * Convert a low-resolution coordinate to a high-resolution one.\n * @param local the low-resolution coordinate.\n * @return the high-resolution coordinate.\n */\n public static lowToHighResolution(local: int32): int32 {\n return (local << 8) + (128);\n }\n\n /**\n * Get geometry data.\n * @param tile the tile.\n * @param tileBuffer the buffer that has been read.\n * @param pointIndex the index of the point to read.\n * @param cloudPoint the point to read the geometry of.\n */\n public getPointData(tile: TileIndex, tileBuffer: TileReadBuffer, pointIndex: int32, cloudPoint: CloudPoint): void {\n /* What resolution do we have? */\n let lowResolution: boolean = (this._level > 0);\n let recordSize: int32 = (lowResolution) ? GeometryReader.RECORD_SIZE_LR : GeometryReader.RECORD_SIZE_HR;\n /* Get the buffer */\n let buffer: ABuffer = tileBuffer.getGeometryBuffer();\n let offset: int32 = (pointIndex * recordSize);\n /* Read the local position */\n let lx: int32;\n let ly: int32;\n let lz: int32;\n if (lowResolution) {\n /* Read the 8-bit local position */\n lx = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\n offset++;\n ly = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\n offset++;\n lz = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\n }\n else {\n /* Read the 16-bit local position */\n lx = LittleEndian.readBufferShort(buffer, offset);\n offset += 2;\n ly = LittleEndian.readBufferShort(buffer, offset);\n offset += 2;\n lz = LittleEndian.readBufferShort(buffer, offset);\n }\n /* Get the grid */\n let grid: Grid = this._geometryRecord.getTileGrid();\n /* Get the tile position */\n let tileX0: float64 = grid.p0.x + (tile.gridIndex.x * grid.size.x);\n let tileY0: float64 = grid.p0.y + (tile.gridIndex.y * grid.size.y);\n let tileZ0: float64 = grid.p0.z + (tile.gridIndex.z * grid.size.z);\n /* Get the coordinate scale factors */\n let scaleX: float64 = grid.size.x / 65536.0;\n let scaleY: float64 = grid.size.y / 65536.0;\n let scaleZ: float64 = grid.size.z / 65536.0;\n /* Set the position */\n cloudPoint.setX(tileX0 + scaleX * lx);\n cloudPoint.setY(tileY0 + scaleY * ly);\n cloudPoint.setZ(tileZ0 + scaleZ * lz);\n }\n\n /**\n * Get geometry data.\n * @param tile the tile.\n * @param tileBuffer the buffer that has been read.\n * @param pointData the point data.\n */\n public getPointDataRaw(tile: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw): void {\n /* What resolution do we have? */\n let lowResolution: boolean = (this._level > 0);\n if (lowResolution) {\n /* Straight copy of the raw buffer */\n pointData.points8 = new Uint8Buffer(tileBuffer.getGeometryBuffer(), 0, 3 * tile.pointCount);\n }\n else {\n /* Straight copy of the raw buffer */\n pointData.points16 = new Uint16Buffer(tileBuffer.getGeometryBuffer(), 0, 3 * tile.pointCount);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GeometryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/GeometryReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,sEAAmE;AACnE,oEAAiE;AACjE,yDAAsD;AAStD,qDAAkD;AAGlD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,yDAAyD;IAClD,MAAM,CAAU,cAAc,GAAU,CAAC,CAAC;IACjD,wDAAwD;IACjD,MAAM,CAAU,cAAc,GAAU,CAAC,CAAC;IAEjD,mEAAmE;IAC5D,MAAM,CAAU,YAAY,GAAU,EAAE,CAAC;IAEhD,sBAAsB;IACd,WAAW,CAAa;IAChC,gBAAgB;IACR,MAAM,CAAQ;IAEtB,0BAA0B;IAClB,eAAe,CAAiB;IACxC,wCAAwC;IAChC,iBAAiB,CAAoB;IAE7C;;;;OAIG;IACH,YAAmB,UAAsB,EAAE,KAAY;QACnD,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU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AC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnE,sCAAsC;QACtC,IAAI,MAAM,GAAY,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC;QAC5C,IAAI,MAAM,GAAY,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC;QAC5C,IAAI,MAAM,GAAY,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC;QAC5C,sBAAsB;QACtB,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACI,eAAe,CAAC,IAAe,EAAE,UAA0B,EAAE,SAAuB;QACvF,iCAAiC;QACjC,IAAI,aAAa,GAAY,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/C,IAAI,aAAa,EAAE,CAAC;YAChB,qCAAqC;YACrC,SAAS,CAAC,OAAO,GAAG,IAAI,yBAAW,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAChG,CAAC;aACI,CAAC;YACF,qCAAqC;YACrC,SAAS,CAAC,QAAQ,GAAG,IAAI,2BAAY,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAClG,CAAC;IACL,CAAC;;AA7JL,wCA8JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module OrbitGT\r\n */\r\n\r\n//package orbitgt.pointcloud.format.opc;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\r\nimport { Uint16Buffer } from \"../../../system/buffer/Uint16Buffer\";\r\nimport { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { CloudPoint } from \"../../model/CloudPoint\";\r\nimport { Grid } from \"../../model/Grid\";\r\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\r\nimport { ReadRequest } from \"../../model/ReadRequest\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { ContainerFilePart } from \"./ContainerFilePart\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { GeometryRecord } from \"./GeometryRecord\";\r\nimport { TileReadBuffer } from \"./TileReadBuffer\";\r\n\r\n/**\r\n * Class GeometryReader reads geometry data.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class GeometryReader {\r\n /** The size of the high-resolution record in the file */\r\n public static readonly RECORD_SIZE_HR: int32 = 6;\r\n /** The size of the low-resolution record in the file */\r\n public static readonly RECORD_SIZE_LR: int32 = 3;\r\n\r\n /** The number of bins (subdivisions) in a multi-resolution tile */\r\n public static readonly MR_BIN_COUNT: int32 = 64;\r\n\r\n /** The file reader */\r\n private _fileReader: FileReader;\r\n /** The level */\r\n private _level: int32;\r\n\r\n /** The geometry record */\r\n private _geometryRecord: GeometryRecord;\r\n /** The location of the geometry data */\r\n private _geometryDataPart: ContainerFilePart;\r\n\r\n /**\r\n * Create a new reader.\r\n * @param opcReader 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 geometry data */\r\n this._geometryRecord = null;\r\n this._geometryDataPart = fileReader.getContainer().getPart(\"\" + level + \".geometry.data\");\r\n }\r\n\r\n /**\r\n * Load the data.\r\n * @return the reader.\r\n */\r\n public loadData(fileContents: ContentLoader): GeometryReader {\r\n /* Read the record */\r\n let geometryPart: ContainerFilePart = this._fileReader.getContainer().getPart(\"\" + this._level + \".geometry.definition\");\r\n this._geometryRecord = GeometryRecord.readNew(geometryPart.getOffset(), geometryPart.getSize(), fileContents);\r\n /* Return the reader */\r\n return this;\r\n }\r\n\r\n /**\r\n * Get the geometry record.\r\n * @return the geometry record.\r\n */\r\n public getGeometryRecord(): GeometryRecord {\r\n return this._geometryRecord;\r\n }\r\n\r\n /**\r\n * Read the raw data for a tile.\r\n * @param tile the tile.\r\n * @param tileBuffer the buffer to read into.\r\n * @param readRequest the read parameters (contains the result read statistics).\r\n */\r\n public readTileData2(tile: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, readRequest: ReadRequest, fileContents: ContentLoader): void {\r\n /* What resolution do we have? */\r\n let lowResolution: boolean = (this._level > 0);\r\n let recordSize: int32 = (lowResolution) ? GeometryReader.RECORD_SIZE_LR : GeometryReader.RECORD_SIZE_HR;\r\n /* Get the file extent */\r\n let fileSize: ALong = this._fileReader.getContainer().getFileLength();\r\n let offset: ALong = tile.pointIndex.addInt(pointOffset).mulInt(recordSize).add(this._geometryDataPart.getOffset());\r\n let size: int32 = pointCount * recordSize;\r\n this._geometryDataPart.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 /* Update the statistics */\r\n readRequest.addDataSize(size);\r\n /* Read the content */\r\n let data: ABuffer = fileContents.getFilePart(offset, size);\r\n tileBuffer.setGeometryBuffer(data);\r\n }\r\n\r\n /**\r\n * Convert a low-resolution coordinate to a high-resolution one.\r\n * @param local the low-resolution coordinate.\r\n * @return the high-resolution coordinate.\r\n */\r\n public static lowToHighResolution(local: int32): int32 {\r\n return (local << 8) + (128);\r\n }\r\n\r\n /**\r\n * Get geometry data.\r\n * @param tile the tile.\r\n * @param tileBuffer the buffer that has been read.\r\n * @param pointIndex the index of the point to read.\r\n * @param cloudPoint the point to read the geometry of.\r\n */\r\n public getPointData(tile: TileIndex, tileBuffer: TileReadBuffer, pointIndex: int32, cloudPoint: CloudPoint): void {\r\n /* What resolution do we have? */\r\n let lowResolution: boolean = (this._level > 0);\r\n let recordSize: int32 = (lowResolution) ? GeometryReader.RECORD_SIZE_LR : GeometryReader.RECORD_SIZE_HR;\r\n /* Get the buffer */\r\n let buffer: ABuffer = tileBuffer.getGeometryBuffer();\r\n let offset: int32 = (pointIndex * recordSize);\r\n /* Read the local position */\r\n let lx: int32;\r\n let ly: int32;\r\n let lz: int32;\r\n if (lowResolution) {\r\n /* Read the 8-bit local position */\r\n lx = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\r\n offset++;\r\n ly = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\r\n offset++;\r\n lz = GeometryReader.lowToHighResolution(LittleEndian.readBufferByte(buffer, offset));\r\n }\r\n else {\r\n /* Read the 16-bit local position */\r\n lx = LittleEndian.readBufferShort(buffer, offset);\r\n offset += 2;\r\n ly = LittleEndian.readBufferShort(buffer, offset);\r\n offset += 2;\r\n lz = LittleEndian.readBufferShort(buffer, offset);\r\n }\r\n /* Get the grid */\r\n let grid: Grid = this._geometryRecord.getTileGrid();\r\n /* Get the tile position */\r\n let tileX0: float64 = grid.p0.x + (tile.gridIndex.x * grid.size.x);\r\n let tileY0: float64 = grid.p0.y + (tile.gridIndex.y * grid.size.y);\r\n let tileZ0: float64 = grid.p0.z + (tile.gridIndex.z * grid.size.z);\r\n /* Get the coordinate scale factors */\r\n let scaleX: float64 = grid.size.x / 65536.0;\r\n let scaleY: float64 = grid.size.y / 65536.0;\r\n let scaleZ: float64 = grid.size.z / 65536.0;\r\n /* Set the position */\r\n cloudPoint.setX(tileX0 + scaleX * lx);\r\n cloudPoint.setY(tileY0 + scaleY * ly);\r\n cloudPoint.setZ(tileZ0 + scaleZ * lz);\r\n }\r\n\r\n /**\r\n * Get geometry data.\r\n * @param tile the tile.\r\n * @param tileBuffer the buffer that has been read.\r\n * @param pointData the point data.\r\n */\r\n public getPointDataRaw(tile: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw): void {\r\n /* What resolution do we have? */\r\n let lowResolution: boolean = (this._level > 0);\r\n if (lowResolution) {\r\n /* Straight copy of the raw buffer */\r\n pointData.points8 = new Uint8Buffer(tileBuffer.getGeometryBuffer(), 0, 3 * tile.pointCount);\r\n }\r\n else {\r\n /* Straight copy of the raw buffer */\r\n pointData.points16 = new Uint16Buffer(tileBuffer.getGeometryBuffer(), 0, 3 * tile.pointCount);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/GeometryRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,yDAAsD;AACtD,iEAA8D;AAE9D,sEAAmE;AAInE,2CAAwC;AAExC;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,2BAA2B;IACnB,OAAO,CAAS;IACxB,8BAA8B;IACtB,SAAS,CAAO;IAExB;;OAEG;IACH,YAAmB,MAAc,EAAE,QAAc;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IA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AAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;CACJ;AA/FD,wCA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Bounds } from \"../../../spatial/geom/Bounds\";\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { OutStream } from \"../../../system/io/OutStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { Grid } from \"../../model/Grid\";\n\n/**\n * Class GeometryRecord defines a geometry record.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class GeometryRecord {\n /** The bounds (48 byte) */\n private _bounds: Bounds;\n /** The tile grid (48 byte) */\n private _tileGrid: Grid;\n\n /**\n * Create a new record.\n */\n public constructor(bounds: Bounds, tileGrid: Grid) {\n this._bounds = bounds;\n this._tileGrid = tileGrid;\n }\n\n /**\n * Get the bounds.\n * @return the bounds.\n */\n public getBounds(): Bounds {\n return this._bounds;\n }\n\n /**\n * Get the tile grid.\n * @return the tile grid.\n */\n public getTileGrid(): Grid {\n return this._tileGrid;\n }\n\n /**\n * Read a record.\n * @param data the record data.\n * @return the record.\n */\n private static readFromBuffer(data: ABuffer): GeometryRecord {\n /* Get the record fields */\n let minX: float64 = LittleEndian.readBufferDouble(data, 0);\n let maxX: float64 = LittleEndian.readBufferDouble(data, 8);\n let minY: float64 = LittleEndian.readBufferDouble(data, 16);\n let maxY: float64 = LittleEndian.readBufferDouble(data, 24);\n let minZ: float64 = LittleEndian.readBufferDouble(data, 32);\n let maxZ: float64 = LittleEndian.readBufferDouble(data, 40);\n let bounds: Bounds = new Bounds();\n bounds.addXYZ(minX, minY, minZ);\n bounds.addXYZ(maxX, maxY, maxZ);\n let gridX0: float64 = LittleEndian.readBufferDouble(data, 48);\n let gridY0: float64 = LittleEndian.readBufferDouble(data, 56);\n let gridZ0: float64 = LittleEndian.readBufferDouble(data, 64);\n let gridSX: float64 = LittleEndian.readBufferDouble(data, 72);\n let gridSY: float64 = LittleEndian.readBufferDouble(data, 80);\n let gridSZ: float64 = LittleEndian.readBufferDouble(data, 88);\n let tileGrid: Grid = new Grid(new Coordinate(gridX0, gridY0, gridZ0), new Coordinate(gridSX, gridSY, gridSZ));\n /* Return the record */\n return new GeometryRecord(bounds, tileGrid);\n }\n\n /**\n * Read a record.\n * @param fileAccess the access to the file.\n * @param offset the file offset to the record.\n * @param size the file size to the record.\n * @return the record.\n */\n public static readNew(offset: ALong, size: ALong, contentLoader: ContentLoader): GeometryRecord {\n /* Request the data? */\n if (contentLoader.isLoaded() == false) {\n /* Add the range */\n contentLoader.requestFilePart(offset, size.toInt());\n return null;\n }\n /* Get the data */\n let data: ABuffer = contentLoader.getFilePart(offset, size.toInt());\n /* Parse the record */\n return GeometryRecord.readFromBuffer(data);\n }\n\n /**\n * Write the record.\n * @param out the output stream.\n */\n public write(output: OutStream): void {\n LittleEndian.writeStreamDouble(output, this._bounds.min.x);\n LittleEndian.writeStreamDouble(output, this._bounds.max.x);\n LittleEndian.writeStreamDouble(output, this._bounds.min.y);\n LittleEndian.writeStreamDouble(output, this._bounds.max.y);\n LittleEndian.writeStreamDouble(output, this._bounds.min.z);\n LittleEndian.writeStreamDouble(output, this._bounds.max.z);\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.x);\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.y);\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.z);\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.x);\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.y);\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.z);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GeometryRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/GeometryRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,yDAAsD;AACtD,iEAA8D;AAE9D,sEAAmE;AAInE,2CAAwC;AAExC;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,2BAA2B;IACnB,OAAO,CAAS;IACxB,8BAA8B;IACtB,SAAS,CAAO;IAExB;;OAEG;IACH,YAAmB,MAAc,EAAE,QAAc;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAA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I,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;CACJ;AA/FD,wCA+FC","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 { Bounds } from \"../../../spatial/geom/Bounds\";\r\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\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\nimport { Grid } from \"../../model/Grid\";\r\n\r\n/**\r\n * Class GeometryRecord defines a geometry record.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class GeometryRecord {\r\n /** The bounds (48 byte) */\r\n private _bounds: Bounds;\r\n /** The tile grid (48 byte) */\r\n private _tileGrid: Grid;\r\n\r\n /**\r\n * Create a new record.\r\n */\r\n public constructor(bounds: Bounds, tileGrid: Grid) {\r\n this._bounds = bounds;\r\n this._tileGrid = tileGrid;\r\n }\r\n\r\n /**\r\n * Get the bounds.\r\n * @return the bounds.\r\n */\r\n public getBounds(): Bounds {\r\n return this._bounds;\r\n }\r\n\r\n /**\r\n * Get the tile grid.\r\n * @return the tile grid.\r\n */\r\n public getTileGrid(): Grid {\r\n return this._tileGrid;\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): GeometryRecord {\r\n /* Get the record fields */\r\n let minX: float64 = LittleEndian.readBufferDouble(data, 0);\r\n let maxX: float64 = LittleEndian.readBufferDouble(data, 8);\r\n let minY: float64 = LittleEndian.readBufferDouble(data, 16);\r\n let maxY: float64 = LittleEndian.readBufferDouble(data, 24);\r\n let minZ: float64 = LittleEndian.readBufferDouble(data, 32);\r\n let maxZ: float64 = LittleEndian.readBufferDouble(data, 40);\r\n let bounds: Bounds = new Bounds();\r\n bounds.addXYZ(minX, minY, minZ);\r\n bounds.addXYZ(maxX, maxY, maxZ);\r\n let gridX0: float64 = LittleEndian.readBufferDouble(data, 48);\r\n let gridY0: float64 = LittleEndian.readBufferDouble(data, 56);\r\n let gridZ0: float64 = LittleEndian.readBufferDouble(data, 64);\r\n let gridSX: float64 = LittleEndian.readBufferDouble(data, 72);\r\n let gridSY: float64 = LittleEndian.readBufferDouble(data, 80);\r\n let gridSZ: float64 = LittleEndian.readBufferDouble(data, 88);\r\n let tileGrid: Grid = new Grid(new Coordinate(gridX0, gridY0, gridZ0), new Coordinate(gridSX, gridSY, gridSZ));\r\n /* Return the record */\r\n return new GeometryRecord(bounds, tileGrid);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param fileAccess the access to the file.\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): GeometryRecord {\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 GeometryRecord.readFromBuffer(data);\r\n }\r\n\r\n /**\r\n * Write the record.\r\n * @param out the output stream.\r\n */\r\n public write(output: OutStream): void {\r\n LittleEndian.writeStreamDouble(output, this._bounds.min.x);\r\n LittleEndian.writeStreamDouble(output, this._bounds.max.x);\r\n LittleEndian.writeStreamDouble(output, this._bounds.min.y);\r\n LittleEndian.writeStreamDouble(output, this._bounds.max.y);\r\n LittleEndian.writeStreamDouble(output, this._bounds.min.z);\r\n LittleEndian.writeStreamDouble(output, this._bounds.max.z);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.x);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.y);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.p0.z);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.x);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.y);\r\n LittleEndian.writeStreamDouble(output, this._tileGrid.size.z);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OPCReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/OPCReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,iEAA8D;AAC9D,4DAAyD;AAEzD,oEAAiE;AACjE,4DAAyD;AAEzD,6DAA0D;AAE1D,6DAA0D;AAQ1D,mEAAgE;AAEhE,2DAAwD;AACxD,yDAAsD;AACtD,uEAAoE;AAEpE,mDAAgD;AAGhD,6CAA0C;AAC1C,+CAA4C;AAC5C,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,SAAU,SAAQ,mCAAgB;IAC3C,sBAAsB;IACd,WAAW,CAAa;IAChC,mCAAmC;IAC3B,YAAY,CAAQ;IAC5B,2BAA2B;IACnB,WAAW,CAAQ;IAE3B;;;;;SAKK;IACE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAwB,EAAE,QAAgB,EAAE,WAAoB;QACzF,mBAAmB;QACnB,MAAM,UAAU,GAAe,MAAM,uBAAU,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7F,uBAAuB;QACvB,OAAO,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;SAEK;IACL,YAAoB,UAAsB,EAAE,WAAkB,EAAE,UAAiB;QAC7E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;;SAGK;IACE,aAAa;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;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AAC,CAAC;gBAC9C,CAAC;YACL,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,oBAAoB;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;SAGK;IACW,gBAAgB,CAAC,WAAkB,EAAE,UAAiB;QAClE,0BAA0B;QAC1B,iBAAO,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,EAAE,wBAAwB,WAAW,EAAE,CAAC,CAAC;QACzE,iBAAO,CAAC,OAAO,CAAC,UAAU,GAAG,CAAC,EAAE,uBAAuB,UAAU,EAAE,CAAC,CAAC;QACrE,iBAAO,CAAC,OAAO,CAAC,WAAW,GAAG,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,eAAe,WAAW,IAAI,UAAU,oBAAoB,IAAI,CAAC,WAAW,SAAS,CAAC,CAAC;QACrJ,yBAAyB;QACzB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,GAAG,WAAW,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC;CACJ;AA7SD,8BA6SC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n// package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Bounds } from \"../../../spatial/geom/Bounds\";\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { Uint16Buffer } from \"../../../system/buffer/Uint16Buffer\";\nimport { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { AttributeValue } from \"../../model/AttributeValue\";\nimport { BlockIndex } from \"../../model/BlockIndex\";\nimport { CloudPoint } from \"../../model/CloudPoint\";\nimport { Grid } from \"../../model/Grid\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { PointCloudReader } from \"../../model/PointCloudReader\";\nimport { PointData } from \"../../model/PointData\";\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\nimport { ReadRequest } from \"../../model/ReadRequest\";\nimport { StandardAttributes } from \"../../model/StandardAttributes\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { AttributeMask } from \"./AttributeMask\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { DirectoryReader } from \"./DirectoryReader\";\nimport { FileReader } from \"./FileReader\";\nimport { PointReader } from \"./PointReader\";\nimport { TileReadBuffer } from \"./TileReadBuffer\";\n\n/**\n * Class OPCReader reads pointcloud files.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class OPCReader extends PointCloudReader {\n /** The file reader */\n private _fileReader: FileReader;\n /** The index of the first level */\n private _levelOffset: int32;\n /** The number of levels */\n private _levelCount: int32;\n\n /**\n * Create a new reader for a file.\n * @param fileName the name of the file.\n * @param lazyLoading avoid early loading of all block indexes to keep a low memory profile? Lazy loading only loads the block indexes of the top 6 levels (see CLOUD-1152 issue)\n * @return the reader.\n */\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<OPCReader> {\n /* Open the file */\n const fileReader: FileReader = await FileReader.openFile(fileStorage, fileName, lazyLoading);\n /* Create the reader */\n return new OPCReader(fileReader, 0, fileReader.getLevelCount());\n }\n\n /**\n * Create a new reader.\n */\n private constructor(fileReader: FileReader, levelOffset: int32, levelCount: int32) {\n super();\n this._fileReader = fileReader;\n this._levelOffset = levelOffset;\n this._levelCount = levelCount;\n }\n\n /**\n * Get the file reader.\n * @return the file reader.\n */\n public getFileReader(): FileReader {\n return this._fileReader;\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#close\n */\n public override close(): void {\n if (this._fileReader != null) this._fileReader.close();\n this._fileReader = null;\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getProperty\n */\n public override getProperty(propertyName: string): Object {\n if (propertyName == null) return null;\n if (Strings.equalsIgnoreCase(propertyName, \"metricCellSize\")) return new Coordinate(this._fileReader.getFileRecord().getMetricCellSize(), 0.0, 0.0);\n return null;\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getFileStorage\n */\n public override getFileStorage(): FileStorage {\n return this._fileReader.getFileStorage();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getFileName\n */\n public override getFileName(): string {\n return this._fileReader.getFileName();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getFileCRS\n */\n public override getFileCRS(): string {\n return this._fileReader.getFileRecord().getCRS();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getFileBounds\n */\n public override getFileBounds(): Bounds {\n return this._fileReader.getGeometryReader(0).getGeometryRecord().getBounds();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getPointAttributes\n */\n public override getPointAttributes(): Array<PointAttribute> {\n return this._fileReader.getAttributes();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getMinAttributeValue\n */\n public override getMinAttributeValue(attribute: PointAttribute): AttributeValue {\n for (const reader of this._fileReader.getAttributeReaders()) if (reader.getAttribute().hasName(attribute.getName())) return reader.getMinimumValue();\n return null;\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getMaxAttributeValue\n */\n public override getMaxAttributeValue(attribute: PointAttribute): AttributeValue {\n for (const reader of this._fileReader.getAttributeReaders()) if (reader.getAttribute().hasName(attribute.getName())) return reader.getMaximumValue();\n return null;\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getLevelCount\n */\n public override getLevelCount(): int32 {\n return this._fileReader.getLevelCount();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getLevelPointCount\n */\n public override getLevelPointCount(level: int32): ALong {\n return this._fileReader.getDirectoryReader(level).getDirectoryRecord().getPointCount();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getLevelPointBounds\n */\n public override getLevelPointBounds(level: int32): Bounds {\n return this._fileReader.getGeometryReader(level).getGeometryRecord().getBounds();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getLevelBlockGrid\n */\n public override getLevelBlockGrid(level: int32): Grid {\n return this.getLevelTileGrid(level).scale(this._fileReader.getFileRecord().getBlockSize());\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#getLevelTileGrid\n */\n public override getLevelTileGrid(level: int32): Grid {\n return this._fileReader.getGeometryReader(level).getGeometryRecord().getTileGrid();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#peekBlockIndexes\n */\n public override peekBlockIndexes(level: int32): Array<BlockIndex> {\n return this._fileReader.getDirectoryReader(level).getBlocks();\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#readBlockIndexes\n */\n public override readBlockIndexes(level: int32, fileContents: ContentLoader): Array<BlockIndex> {\n /* Get the directory reader */\n const directoryReader: DirectoryReader = this._fileReader.getDirectoryReader(level);\n /* Already read all blocks? */\n const blocks: Array<BlockIndex> = directoryReader.getBlocks();\n if (blocks.length > 0) return blocks;\n /* Delegate to the directory reader */\n return directoryReader.readBlocks(this._fileReader.getFileRecord(), fileContents);\n }\n\n /**\n * PointCloudReader method.\n * @see PointCloudReader#readTileIndexes\n */\n public override readTileIndexes(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\n return this._fileReader.getDirectoryReader(block.level).readTiles2(block, fileContents);\n }\n\n /**\n * Get the attribute mask to use for reading.\n * @param parameters the read parameters.\n * @return the attribute mask.\n */\n private getAttributeMask(parameters: ReadRequest): AttributeMask {\n /* Make a list of readers */\n const readers: AList<AttributeReader> = new AList<AttributeReader>();\n /* Should we read all attributes? */\n if (parameters.readAllExtraAttributes()) {\n /* Read all attributes */\n for (const reader of this._fileReader.getAttributeReaders()) readers.add(reader);\n } else {\n /* Read color? */\n if (parameters.readColor()) {\n const reader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.COLOR.getName());\n if (reader != null) readers.add(reader);\n }\n /* Read intensity? */\n if (parameters.readIntensity()) {\n const reader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.INTENSITY.getName());\n if (reader != null) readers.add(reader);\n }\n /* Read the extra attributes */\n const extraAttributes: AList<string> = parameters.getExtraAttributes();\n for (let i: number = 0; i < extraAttributes.size(); i++) {\n /* Get the name of the extra attribute */\n const extraAttribute: string = extraAttributes.get(i);\n /* Did we already add the color? */\n if (parameters.readColor() && Strings.equalsIgnoreCase(extraAttribute, StandardAttributes.COLOR.getName())) continue;\n /* Did we already add the intensity? */\n if (parameters.readIntensity() && Strings.equalsIgnoreCase(extraAttribute, StandardAttributes.INTENSITY.getName())) continue;\n /* Find the attribute reader */\n const reader: AttributeReader = this._fileReader.findAttributeReader(extraAttribute);\n /* Add the reader */\n if (reader != null) readers.add(reader);\n }\n }\n /* Create the mask */\n return new AttributeMask(readers);\n }\n\n /**\n * PointCloudReader interface method.\n * @see PointCloudReader#readPoints\n */\n public override readPoints(tileIndex: TileIndex, readRequest: ReadRequest, fileContents: ContentLoader): AList<CloudPoint> {\n /* Create the attribute mask */\n const attributeMask: AttributeMask = this.getAttributeMask(readRequest);\n /* Create the read buffer */\n const tileBuffer: TileReadBuffer = new TileReadBuffer(attributeMask.attributes.length);\n /* Read the points in the tile */\n const pointOffset: int32 = 0;\n const pointCount: int32 = tileIndex.pointCount;\n return PointReader.readTilePoints(this.getFileReader(), readRequest, attributeMask, tileIndex.level, tileIndex, pointOffset, pointCount, tileBuffer, fileContents);\n }\n\n /**\n * PointCloudReader interface method.\n * @see PointCloudReader#readPointData\n */\n public override readPointData(tileIndex: TileIndex, dataFormat: int32, accessTime: float64, fileContents: ContentLoader): PointData {\n /* 16-bit XYZ geometry and 8-bit RGB colors? */\n if (dataFormat == PointDataRaw.TYPE) {\n /* Create the attribute mask */\n const readRequest: ReadRequest = ReadRequest.READ_GEOMETRY_AND_COLOR;\n const readers: AList<AttributeReader> = new AList<AttributeReader>();\n const colorReader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.COLOR.getName());\n if (colorReader != null) readers.add(colorReader);\n const attributeMask: AttributeMask = new AttributeMask(readers);\n /* Has the data been loaded? */\n let tileBuffer: TileReadBuffer = null;\n let pointData: PointDataRaw = null;\n if (fileContents.isAvailable()) {\n /* Create the read buffer */\n tileBuffer = new TileReadBuffer(attributeMask.attributes.length);\n /* Create the point data buffer */\n const tileGrid: Grid = this._fileReader.getGeometryReader(tileIndex.level).getGeometryRecord().getTileGrid();\n const tileBounds: Bounds = tileGrid.getCellBounds(tileIndex.gridIndex);\n pointData = new PointDataRaw(tileIndex, tileBounds, null, null, null);\n }\n /* Fill the point data buffer */\n PointReader.readTilePointsRaw(this.getFileReader(), readRequest, attributeMask, tileIndex, tileBuffer, pointData, fileContents);\n /* Missing color channel after data load? */\n if (fileContents.isAvailable() && (pointData.colors == null)) {\n /* Define the default RGB color (0xE6C60D) */\n const defaultR: int32 = 230;\n const defaultG: int32 = 198;\n const defaultB: int32 = 13;\n /* Create a default color buffer (BGR sample sequence) */\n pointData.colors = Uint8Buffer.wrap(new ABuffer(3 * tileIndex.pointCount));\n for (let i: number = 0; i < tileIndex.pointCount; i++) {\n pointData.colors.set(3 * i + 0, defaultB);\n pointData.colors.set(3 * i + 1, defaultG);\n pointData.colors.set(3 * i + 2, defaultR);\n }\n }\n return pointData;\n }\n /* Unknown format */\n return null;\n }\n\n /**\n * PointCloudReader interface method.\n * @see PointCloudReader#clipToLevelRange\n */\n public override clipToLevelRange(levelOffset: int32, levelCount: int32): PointCloudReader {\n /* Check the parameters */\n ASystem.assert0(levelOffset >= 0, `Invalid level offset ${levelOffset}`);\n ASystem.assert0(levelCount > 0, `Invalid level count ${levelCount}`);\n ASystem.assert0(levelOffset + levelCount <= this._levelCount, `Level range ${levelOffset}+${levelCount} not possible in ${this._levelCount} levels`);\n /* Create a new reader */\n return new OPCReader(this._fileReader, this._levelOffset + levelOffset, levelCount);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OPCReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/OPCReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,iEAA8D;AAC9D,4DAAyD;AAEzD,oEAAiE;AACjE,4DAAyD;AAEzD,6DAA0D;AAE1D,6DAA0D;AAQ1D,mEAAgE;AAEhE,2DAAwD;AACxD,yDAAsD;AACtD,uEAAoE;AAEpE,mDAAgD;AAGhD,6CAA0C;AAC1C,+CAA4C;AAC5C,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,SAAU,SAAQ,mCAAgB;IAC3C,sBAAsB;IACd,WAAW,CAAa;IAChC,mCAAmC;IAC3B,YAAY,CAAQ;IAC5B,2BAA2B;IACnB,WAAW,CAAQ;IAE3B;;;;;SAKK;IACE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAwB,EAAE,QAAgB,EAAE,WAAoB;QACzF,mBAAmB;QACnB,MAAM,UAAU,GAAe,MAAM,uBAAU,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7F,uBAAuB;QACvB,OAAO,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;SAEK;IACL,YAAoB,UAAsB,EAAE,WAAkB,EAAE,UAAiB;QAC7E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,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C,EAAE,QAAQ,CAAC,CAAC;oBAC1C,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC9C,CAAC;YACL,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,oBAAoB;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;SAGK;IACW,gBAAgB,CAAC,WAAkB,EAAE,UAAiB;QAClE,0BAA0B;QAC1B,iBAAO,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,EAAE,wBAAwB,WAAW,EAAE,CAAC,CAAC;QACzE,iBAAO,CAAC,OAAO,CAAC,UAAU,GAAG,CAAC,EAAE,uBAAuB,UAAU,EAAE,CAAC,CAAC;QACrE,iBAAO,CAAC,OAAO,CAAC,WAAW,GAAG,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,eAAe,WAAW,IAAI,UAAU,oBAAoB,IAAI,CAAC,WAAW,SAAS,CAAC,CAAC;QACrJ,yBAAyB;QACzB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,GAAG,WAAW,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC;CACJ;AA7SD,8BA6SC","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 { Bounds } from \"../../../spatial/geom/Bounds\";\r\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\r\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\r\nimport { Uint16Buffer } from \"../../../system/buffer/Uint16Buffer\";\r\nimport { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\r\nimport { AList } from \"../../../system/collection/AList\";\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 { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\r\nimport { AttributeValue } from \"../../model/AttributeValue\";\r\nimport { BlockIndex } from \"../../model/BlockIndex\";\r\nimport { CloudPoint } from \"../../model/CloudPoint\";\r\nimport { Grid } from \"../../model/Grid\";\r\nimport { PointAttribute } from \"../../model/PointAttribute\";\r\nimport { PointCloudReader } from \"../../model/PointCloudReader\";\r\nimport { PointData } from \"../../model/PointData\";\r\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\r\nimport { ReadRequest } from \"../../model/ReadRequest\";\r\nimport { StandardAttributes } from \"../../model/StandardAttributes\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { AttributeMask } from \"./AttributeMask\";\r\nimport { AttributeReader } from \"./AttributeReader\";\r\nimport { DirectoryReader } from \"./DirectoryReader\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { PointReader } from \"./PointReader\";\r\nimport { TileReadBuffer } from \"./TileReadBuffer\";\r\n\r\n/**\r\n * Class OPCReader reads pointcloud files.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class OPCReader extends PointCloudReader {\r\n /** The file reader */\r\n private _fileReader: FileReader;\r\n /** The index of the first level */\r\n private _levelOffset: int32;\r\n /** The number of levels */\r\n private _levelCount: int32;\r\n\r\n /**\r\n * Create a new reader for a file.\r\n * @param fileName the name of the file.\r\n * @param lazyLoading avoid early loading of all block indexes to keep a low memory profile? Lazy loading only loads the block indexes of the top 6 levels (see CLOUD-1152 issue)\r\n * @return the reader.\r\n */\r\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<OPCReader> {\r\n /* Open the file */\r\n const fileReader: FileReader = await FileReader.openFile(fileStorage, fileName, lazyLoading);\r\n /* Create the reader */\r\n return new OPCReader(fileReader, 0, fileReader.getLevelCount());\r\n }\r\n\r\n /**\r\n * Create a new reader.\r\n */\r\n private constructor(fileReader: FileReader, levelOffset: int32, levelCount: int32) {\r\n super();\r\n this._fileReader = fileReader;\r\n this._levelOffset = levelOffset;\r\n this._levelCount = levelCount;\r\n }\r\n\r\n /**\r\n * Get the file reader.\r\n * @return the file reader.\r\n */\r\n public getFileReader(): FileReader {\r\n return this._fileReader;\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#close\r\n */\r\n public override close(): void {\r\n if (this._fileReader != null) this._fileReader.close();\r\n this._fileReader = null;\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getProperty\r\n */\r\n public override getProperty(propertyName: string): Object {\r\n if (propertyName == null) return null;\r\n if (Strings.equalsIgnoreCase(propertyName, \"metricCellSize\")) return new Coordinate(this._fileReader.getFileRecord().getMetricCellSize(), 0.0, 0.0);\r\n return null;\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getFileStorage\r\n */\r\n public override getFileStorage(): FileStorage {\r\n return this._fileReader.getFileStorage();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getFileName\r\n */\r\n public override getFileName(): string {\r\n return this._fileReader.getFileName();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getFileCRS\r\n */\r\n public override getFileCRS(): string {\r\n return this._fileReader.getFileRecord().getCRS();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getFileBounds\r\n */\r\n public override getFileBounds(): Bounds {\r\n return this._fileReader.getGeometryReader(0).getGeometryRecord().getBounds();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getPointAttributes\r\n */\r\n public override getPointAttributes(): Array<PointAttribute> {\r\n return this._fileReader.getAttributes();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getMinAttributeValue\r\n */\r\n public override getMinAttributeValue(attribute: PointAttribute): AttributeValue {\r\n for (const reader of this._fileReader.getAttributeReaders()) if (reader.getAttribute().hasName(attribute.getName())) return reader.getMinimumValue();\r\n return null;\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getMaxAttributeValue\r\n */\r\n public override getMaxAttributeValue(attribute: PointAttribute): AttributeValue {\r\n for (const reader of this._fileReader.getAttributeReaders()) if (reader.getAttribute().hasName(attribute.getName())) return reader.getMaximumValue();\r\n return null;\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getLevelCount\r\n */\r\n public override getLevelCount(): int32 {\r\n return this._fileReader.getLevelCount();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getLevelPointCount\r\n */\r\n public override getLevelPointCount(level: int32): ALong {\r\n return this._fileReader.getDirectoryReader(level).getDirectoryRecord().getPointCount();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getLevelPointBounds\r\n */\r\n public override getLevelPointBounds(level: int32): Bounds {\r\n return this._fileReader.getGeometryReader(level).getGeometryRecord().getBounds();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getLevelBlockGrid\r\n */\r\n public override getLevelBlockGrid(level: int32): Grid {\r\n return this.getLevelTileGrid(level).scale(this._fileReader.getFileRecord().getBlockSize());\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#getLevelTileGrid\r\n */\r\n public override getLevelTileGrid(level: int32): Grid {\r\n return this._fileReader.getGeometryReader(level).getGeometryRecord().getTileGrid();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#peekBlockIndexes\r\n */\r\n public override peekBlockIndexes(level: int32): Array<BlockIndex> {\r\n return this._fileReader.getDirectoryReader(level).getBlocks();\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#readBlockIndexes\r\n */\r\n public override readBlockIndexes(level: int32, fileContents: ContentLoader): Array<BlockIndex> {\r\n /* Get the directory reader */\r\n const directoryReader: DirectoryReader = this._fileReader.getDirectoryReader(level);\r\n /* Already read all blocks? */\r\n const blocks: Array<BlockIndex> = directoryReader.getBlocks();\r\n if (blocks.length > 0) return blocks;\r\n /* Delegate to the directory reader */\r\n return directoryReader.readBlocks(this._fileReader.getFileRecord(), fileContents);\r\n }\r\n\r\n /**\r\n * PointCloudReader method.\r\n * @see PointCloudReader#readTileIndexes\r\n */\r\n public override readTileIndexes(block: BlockIndex, fileContents: ContentLoader): Array<TileIndex> {\r\n return this._fileReader.getDirectoryReader(block.level).readTiles2(block, fileContents);\r\n }\r\n\r\n /**\r\n * Get the attribute mask to use for reading.\r\n * @param parameters the read parameters.\r\n * @return the attribute mask.\r\n */\r\n private getAttributeMask(parameters: ReadRequest): AttributeMask {\r\n /* Make a list of readers */\r\n const readers: AList<AttributeReader> = new AList<AttributeReader>();\r\n /* Should we read all attributes? */\r\n if (parameters.readAllExtraAttributes()) {\r\n /* Read all attributes */\r\n for (const reader of this._fileReader.getAttributeReaders()) readers.add(reader);\r\n } else {\r\n /* Read color? */\r\n if (parameters.readColor()) {\r\n const reader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.COLOR.getName());\r\n if (reader != null) readers.add(reader);\r\n }\r\n /* Read intensity? */\r\n if (parameters.readIntensity()) {\r\n const reader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.INTENSITY.getName());\r\n if (reader != null) readers.add(reader);\r\n }\r\n /* Read the extra attributes */\r\n const extraAttributes: AList<string> = parameters.getExtraAttributes();\r\n for (let i: number = 0; i < extraAttributes.size(); i++) {\r\n /* Get the name of the extra attribute */\r\n const extraAttribute: string = extraAttributes.get(i);\r\n /* Did we already add the color? */\r\n if (parameters.readColor() && Strings.equalsIgnoreCase(extraAttribute, StandardAttributes.COLOR.getName())) continue;\r\n /* Did we already add the intensity? */\r\n if (parameters.readIntensity() && Strings.equalsIgnoreCase(extraAttribute, StandardAttributes.INTENSITY.getName())) continue;\r\n /* Find the attribute reader */\r\n const reader: AttributeReader = this._fileReader.findAttributeReader(extraAttribute);\r\n /* Add the reader */\r\n if (reader != null) readers.add(reader);\r\n }\r\n }\r\n /* Create the mask */\r\n return new AttributeMask(readers);\r\n }\r\n\r\n /**\r\n * PointCloudReader interface method.\r\n * @see PointCloudReader#readPoints\r\n */\r\n public override readPoints(tileIndex: TileIndex, readRequest: ReadRequest, fileContents: ContentLoader): AList<CloudPoint> {\r\n /* Create the attribute mask */\r\n const attributeMask: AttributeMask = this.getAttributeMask(readRequest);\r\n /* Create the read buffer */\r\n const tileBuffer: TileReadBuffer = new TileReadBuffer(attributeMask.attributes.length);\r\n /* Read the points in the tile */\r\n const pointOffset: int32 = 0;\r\n const pointCount: int32 = tileIndex.pointCount;\r\n return PointReader.readTilePoints(this.getFileReader(), readRequest, attributeMask, tileIndex.level, tileIndex, pointOffset, pointCount, tileBuffer, fileContents);\r\n }\r\n\r\n /**\r\n * PointCloudReader interface method.\r\n * @see PointCloudReader#readPointData\r\n */\r\n public override readPointData(tileIndex: TileIndex, dataFormat: int32, accessTime: float64, fileContents: ContentLoader): PointData {\r\n /* 16-bit XYZ geometry and 8-bit RGB colors? */\r\n if (dataFormat == PointDataRaw.TYPE) {\r\n /* Create the attribute mask */\r\n const readRequest: ReadRequest = ReadRequest.READ_GEOMETRY_AND_COLOR;\r\n const readers: AList<AttributeReader> = new AList<AttributeReader>();\r\n const colorReader: AttributeReader = this._fileReader.findAttributeReader(StandardAttributes.COLOR.getName());\r\n if (colorReader != null) readers.add(colorReader);\r\n const attributeMask: AttributeMask = new AttributeMask(readers);\r\n /* Has the data been loaded? */\r\n let tileBuffer: TileReadBuffer = null;\r\n let pointData: PointDataRaw = null;\r\n if (fileContents.isAvailable()) {\r\n /* Create the read buffer */\r\n tileBuffer = new TileReadBuffer(attributeMask.attributes.length);\r\n /* Create the point data buffer */\r\n const tileGrid: Grid = this._fileReader.getGeometryReader(tileIndex.level).getGeometryRecord().getTileGrid();\r\n const tileBounds: Bounds = tileGrid.getCellBounds(tileIndex.gridIndex);\r\n pointData = new PointDataRaw(tileIndex, tileBounds, null, null, null);\r\n }\r\n /* Fill the point data buffer */\r\n PointReader.readTilePointsRaw(this.getFileReader(), readRequest, attributeMask, tileIndex, tileBuffer, pointData, fileContents);\r\n /* Missing color channel after data load? */\r\n if (fileContents.isAvailable() && (pointData.colors == null)) {\r\n /* Define the default RGB color (0xE6C60D) */\r\n const defaultR: int32 = 230;\r\n const defaultG: int32 = 198;\r\n const defaultB: int32 = 13;\r\n /* Create a default color buffer (BGR sample sequence) */\r\n pointData.colors = Uint8Buffer.wrap(new ABuffer(3 * tileIndex.pointCount));\r\n for (let i: number = 0; i < tileIndex.pointCount; i++) {\r\n pointData.colors.set(3 * i + 0, defaultB);\r\n pointData.colors.set(3 * i + 1, defaultG);\r\n pointData.colors.set(3 * i + 2, defaultR);\r\n }\r\n }\r\n return pointData;\r\n }\r\n /* Unknown format */\r\n return null;\r\n }\r\n\r\n /**\r\n * PointCloudReader interface method.\r\n * @see PointCloudReader#clipToLevelRange\r\n */\r\n public override clipToLevelRange(levelOffset: int32, levelCount: int32): PointCloudReader {\r\n /* Check the parameters */\r\n ASystem.assert0(levelOffset >= 0, `Invalid level offset ${levelOffset}`);\r\n ASystem.assert0(levelCount > 0, `Invalid level count ${levelCount}`);\r\n ASystem.assert0(levelOffset + levelCount <= this._levelCount, `Level range ${levelOffset}+${levelCount} not possible in ${this._levelCount} levels`);\r\n /* Create a new reader */\r\n return new OPCReader(this._fileReader, this._levelOffset + levelOffset, levelCount);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointReader.js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,KAAK,CAAC,CAAC;QAChF,cAAc,CAAC,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAClE,qBAAqB;QACrB,IAAI,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,EAAE,CAAC;YACrC,uFAAuF;YACvF,SAAS,CAAC,MAAM,GAAG,IAAI,yBAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;QACvG,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,iBAAiB,CAAC,MAAkB,EAAE,WAAwB,EAAE,aAA4B,EAAE,UAAqB,EAAE,UAA0B,EAAE,SAAuB,EAAE,YAA2B;QAC/M,wBAAwB;QACxB,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAC/I,yBAAyB;QACzB,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACtH,CAAC;CACJ;AAnID,kCAmIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { CloudPoint } from \"../../model/CloudPoint\";\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\nimport { ReadRequest } from \"../../model/ReadRequest\";\nimport { TileIndex } from \"../../model/TileIndex\";\nimport { AttributeMask } from \"./AttributeMask\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { FileReader } from \"./FileReader\";\nimport { GeometryReader } from \"./GeometryReader\";\nimport { TileReadBuffer } from \"./TileReadBuffer\";\n\n/**\n * Class PointReader reads points from tiles.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class PointReader {\n /**\n * No instances.\n */\n private constructor() { }\n\n /**\n * Read the data of a tile.\n * @param reader the file reader.\n * @param readRequest the read request parameters.\n * @param attributeMask the attribute mask for reading.\n * @param level the index of the level to read from.\n * @param tileRecord the tile record.\n * @param tileBuffer the buffer to help reading.\n */\n private static readTileData(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContents: ContentLoader): void {\n /* Should we read the geometry? */\n let geometryReader: GeometryReader = null;\n if (readRequest.readGeometry()) {\n /* Read all geometry data */\n geometryReader = reader.getGeometryReader(level);\n geometryReader.readTileData2(tileRecord, pointOffset, pointCount, tileBuffer, readRequest, fileContents);\n }\n /* Read all attribute data */\n let attributeReaders: AList<AttributeReader> = attributeMask.readers;\n for (let i: number = 0; i < attributeReaders.size(); i++) {\n let attributeReader: AttributeReader = attributeReaders.get(i);\n attributeReader.readTileData2(level, tileRecord, ALong.fromInt(pointOffset), pointCount, tileBuffer, i, readRequest, fileContents);\n }\n }\n\n /**\n * Parse the data of a tile.\n * @return the parsed tile data.\n */\n private static parseTileData(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContents: ContentLoader): AList<CloudPoint> {\n /* We should have the file content */\n if (fileContents.isAvailable() == false) return null;\n /* Should we read the geometry? */\n let geometryReader: GeometryReader = null;\n if (readRequest.readGeometry()) {\n /* Read all geometry data */\n geometryReader = reader.getGeometryReader(level);\n }\n /* Read all attribute data */\n let attributeReaders: AList<AttributeReader> = attributeMask.readers;\n /* Thinning? */\n let thinning: int32 = readRequest.getThinning();\n if (thinning < 2) thinning = 0;\n /* Process all points */\n let cloudPointList: AList<CloudPoint> = new AList<CloudPoint>();\n for (let i: number = 0; i < pointCount; i++) {\n /* Create a point */\n let cloudPoint: CloudPoint = CloudPoint.createWithAttributes(attributeMask.attributes);\n /* Thinning? */\n if ((thinning != 0) && (i % thinning != 0)) {\n /* Skip */\n continue;\n }\n /* Get the point index */\n let pointIndex: ALong = tileRecord.pointIndex.addInt(pointOffset + i);\n /* Set the index */\n cloudPoint.setIndex(pointIndex);\n /* Set the geometry */\n if (readRequest.readGeometry()) geometryReader.getPointData(tileRecord, tileBuffer, i, cloudPoint);\n /* Set the attributes */\n for (let j: number = 0; j < attributeReaders.size(); j++) {\n let attributeReader: AttributeReader = attributeReaders.get(j);\n attributeReader.getPointData(level, tileRecord, tileBuffer, j, i, cloudPoint);\n }\n /* Process the point */\n cloudPointList.add(cloudPoint);\n }\n /* Return the list */\n return cloudPointList;\n }\n\n /**\n * Read some points of a tile.\n * @param reader the file reader.\n * @param readRequest the read request parameters.\n * @param attributeMask the attribute mask for reading.\n * @param level the index of the level to read from.\n * @param tileRecord the tile record.\n * @param tileBuffer the buffer to help reading.\n * @param processor the point processor.\n * @param fileContens the file contents.\n * @return the tile points.\n */\n public static readTilePoints(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContens: ContentLoader): AList<CloudPoint> {\n /* Read the tile data */\n PointReader.readTileData(reader, readRequest, attributeMask, level, tileRecord, pointOffset, pointCount, tileBuffer, fileContens);\n /* Parse the tile data */\n return PointReader.parseTileData(reader, readRequest, attributeMask, level, tileRecord, pointOffset, pointCount, tileBuffer, fileContens);\n }\n\n /**\n * Parse the data of a tile.\n * @return the parsed tile data.\n */\n private static parseTileDataRaw(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, tileRecord: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw, fileContents: ContentLoader): void {\n /* We should have the file content */\n if (fileContents.isAvailable() == false) return;\n /* Read the geometry */\n let geometryReader: GeometryReader = reader.getGeometryReader(tileRecord.level);\n geometryReader.getPointDataRaw(tileRecord, tileBuffer, pointData);\n /* Read the color? */\n if (tileBuffer.getAttributeCount() > 0) {\n /* Little-endian encoding makes 24-bit RGB values to be written as BGR byte sequence */\n pointData.colors = new Uint8Buffer(tileBuffer.getAttributeBuffer(0), 0, 3 * tileRecord.pointCount);\n }\n }\n\n /**\n * Read some points of a tile.\n * @param reader the file reader.\n * @param readRequest the read request parameters.\n * @param attributeMask the attribute mask for reading.\n * @param level the index of the level to read from.\n * @param tileRecord the tile record.\n * @param tileBuffer the buffer to help reading.\n * @param processor the point processor.\n * @param fileContens the file contents.\n * @return the tile points.\n */\n public static readTilePointsRaw(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, tileRecord: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw, fileContents: ContentLoader): void {\n /* Read the tile data */\n PointReader.readTileData(reader, readRequest, attributeMask, tileRecord.level, tileRecord, 0, tileRecord.pointCount, tileBuffer, fileContents);\n /* Parse the tile data */\n PointReader.parseTileDataRaw(reader, readRequest, attributeMask, tileRecord, tileBuffer, pointData, fileContents);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PointReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/PointReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,oEAAiE;AACjE,4DAAyD;AACzD,yDAAsD;AAEtD,uDAAoD;AAUpD;;;;GAIG;AACH,gB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uF;YACvF,SAAS,CAAC,MAAM,GAAG,IAAI,yBAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;QACvG,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,iBAAiB,CAAC,MAAkB,EAAE,WAAwB,EAAE,aAA4B,EAAE,UAAqB,EAAE,UAA0B,EAAE,SAAuB,EAAE,YAA2B;QAC/M,wBAAwB;QACxB,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAC/I,yBAAyB;QACzB,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACtH,CAAC;CACJ;AAnID,kCAmIC","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 { Uint8Buffer } from \"../../../system/buffer/Uint8Buffer\";\r\nimport { AList } from \"../../../system/collection/AList\";\r\nimport { ALong } from \"../../../system/runtime/ALong\";\r\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { CloudPoint } from \"../../model/CloudPoint\";\r\nimport { PointDataRaw } from \"../../model/PointDataRaw\";\r\nimport { ReadRequest } from \"../../model/ReadRequest\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\nimport { AttributeMask } from \"./AttributeMask\";\r\nimport { AttributeReader } from \"./AttributeReader\";\r\nimport { FileReader } from \"./FileReader\";\r\nimport { GeometryReader } from \"./GeometryReader\";\r\nimport { TileReadBuffer } from \"./TileReadBuffer\";\r\n\r\n/**\r\n * Class PointReader reads points from tiles.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class PointReader {\r\n /**\r\n * No instances.\r\n */\r\n private constructor() { }\r\n\r\n /**\r\n * Read the data of a tile.\r\n * @param reader the file reader.\r\n * @param readRequest the read request parameters.\r\n * @param attributeMask the attribute mask for reading.\r\n * @param level the index of the level to read from.\r\n * @param tileRecord the tile record.\r\n * @param tileBuffer the buffer to help reading.\r\n */\r\n private static readTileData(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContents: ContentLoader): void {\r\n /* Should we read the geometry? */\r\n let geometryReader: GeometryReader = null;\r\n if (readRequest.readGeometry()) {\r\n /* Read all geometry data */\r\n geometryReader = reader.getGeometryReader(level);\r\n geometryReader.readTileData2(tileRecord, pointOffset, pointCount, tileBuffer, readRequest, fileContents);\r\n }\r\n /* Read all attribute data */\r\n let attributeReaders: AList<AttributeReader> = attributeMask.readers;\r\n for (let i: number = 0; i < attributeReaders.size(); i++) {\r\n let attributeReader: AttributeReader = attributeReaders.get(i);\r\n attributeReader.readTileData2(level, tileRecord, ALong.fromInt(pointOffset), pointCount, tileBuffer, i, readRequest, fileContents);\r\n }\r\n }\r\n\r\n /**\r\n * Parse the data of a tile.\r\n * @return the parsed tile data.\r\n */\r\n private static parseTileData(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContents: ContentLoader): AList<CloudPoint> {\r\n /* We should have the file content */\r\n if (fileContents.isAvailable() == false) return null;\r\n /* Should we read the geometry? */\r\n let geometryReader: GeometryReader = null;\r\n if (readRequest.readGeometry()) {\r\n /* Read all geometry data */\r\n geometryReader = reader.getGeometryReader(level);\r\n }\r\n /* Read all attribute data */\r\n let attributeReaders: AList<AttributeReader> = attributeMask.readers;\r\n /* Thinning? */\r\n let thinning: int32 = readRequest.getThinning();\r\n if (thinning < 2) thinning = 0;\r\n /* Process all points */\r\n let cloudPointList: AList<CloudPoint> = new AList<CloudPoint>();\r\n for (let i: number = 0; i < pointCount; i++) {\r\n /* Create a point */\r\n let cloudPoint: CloudPoint = CloudPoint.createWithAttributes(attributeMask.attributes);\r\n /* Thinning? */\r\n if ((thinning != 0) && (i % thinning != 0)) {\r\n /* Skip */\r\n continue;\r\n }\r\n /* Get the point index */\r\n let pointIndex: ALong = tileRecord.pointIndex.addInt(pointOffset + i);\r\n /* Set the index */\r\n cloudPoint.setIndex(pointIndex);\r\n /* Set the geometry */\r\n if (readRequest.readGeometry()) geometryReader.getPointData(tileRecord, tileBuffer, i, cloudPoint);\r\n /* Set the attributes */\r\n for (let j: number = 0; j < attributeReaders.size(); j++) {\r\n let attributeReader: AttributeReader = attributeReaders.get(j);\r\n attributeReader.getPointData(level, tileRecord, tileBuffer, j, i, cloudPoint);\r\n }\r\n /* Process the point */\r\n cloudPointList.add(cloudPoint);\r\n }\r\n /* Return the list */\r\n return cloudPointList;\r\n }\r\n\r\n /**\r\n * Read some points of a tile.\r\n * @param reader the file reader.\r\n * @param readRequest the read request parameters.\r\n * @param attributeMask the attribute mask for reading.\r\n * @param level the index of the level to read from.\r\n * @param tileRecord the tile record.\r\n * @param tileBuffer the buffer to help reading.\r\n * @param processor the point processor.\r\n * @param fileContens the file contents.\r\n * @return the tile points.\r\n */\r\n public static readTilePoints(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, level: int32, tileRecord: TileIndex, pointOffset: int32, pointCount: int32, tileBuffer: TileReadBuffer, fileContens: ContentLoader): AList<CloudPoint> {\r\n /* Read the tile data */\r\n PointReader.readTileData(reader, readRequest, attributeMask, level, tileRecord, pointOffset, pointCount, tileBuffer, fileContens);\r\n /* Parse the tile data */\r\n return PointReader.parseTileData(reader, readRequest, attributeMask, level, tileRecord, pointOffset, pointCount, tileBuffer, fileContens);\r\n }\r\n\r\n /**\r\n * Parse the data of a tile.\r\n * @return the parsed tile data.\r\n */\r\n private static parseTileDataRaw(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, tileRecord: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw, fileContents: ContentLoader): void {\r\n /* We should have the file content */\r\n if (fileContents.isAvailable() == false) return;\r\n /* Read the geometry */\r\n let geometryReader: GeometryReader = reader.getGeometryReader(tileRecord.level);\r\n geometryReader.getPointDataRaw(tileRecord, tileBuffer, pointData);\r\n /* Read the color? */\r\n if (tileBuffer.getAttributeCount() > 0) {\r\n /* Little-endian encoding makes 24-bit RGB values to be written as BGR byte sequence */\r\n pointData.colors = new Uint8Buffer(tileBuffer.getAttributeBuffer(0), 0, 3 * tileRecord.pointCount);\r\n }\r\n }\r\n\r\n /**\r\n * Read some points of a tile.\r\n * @param reader the file reader.\r\n * @param readRequest the read request parameters.\r\n * @param attributeMask the attribute mask for reading.\r\n * @param level the index of the level to read from.\r\n * @param tileRecord the tile record.\r\n * @param tileBuffer the buffer to help reading.\r\n * @param processor the point processor.\r\n * @param fileContens the file contents.\r\n * @return the tile points.\r\n */\r\n public static readTilePointsRaw(reader: FileReader, readRequest: ReadRequest, attributeMask: AttributeMask, tileRecord: TileIndex, tileBuffer: TileReadBuffer, pointData: PointDataRaw, fileContents: ContentLoader): void {\r\n /* Read the tile data */\r\n PointReader.readTileData(reader, readRequest, attributeMask, tileRecord.level, tileRecord, 0, tileRecord.pointCount, tileBuffer, fileContents);\r\n /* Parse the tile data */\r\n PointReader.parseTileDataRaw(reader, readRequest, attributeMask, tileRecord, tileBuffer, pointData, fileContents);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileReadBuffer.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/TileReadBuffer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,4DAAyD;AAEzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,0BAA0B;IAClB,eAAe,CAAU;IACjC,4BAA4B;IACpB,iBAAiB,CAAiB;IAE1C;;;OAGG;IACH,YAAmB,cAAqB;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,oBAAoB;QACjD,IAAI,CAAC,iBAAiB,GAAG,IAAI,KAAK,CAAU,cAAc,CAAC,CAAC;QAC5D,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,oBAAoB;IAC3G,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,MAAe;QACpC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,IAAW;QACrC,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,eAAe,GAAG,IAAI,iBAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,cAAqB;QAC3C,OAAO,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,uBAAuB,CAAC,cAAqB,EAAE,IAAW;QAC7D,IAAI,eAAe,GAAY,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACtE,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;YAChC,eAAe,GAAG,IAAI,iBAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;YAC3C,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;QAC7D,CAAC;QACD,OAAO,eAAe,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,cAAqB,EAAE,MAAe;QAC5D,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IACpD,CAAC;CACJ;AApFD,wCAoFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\n\n/**\n * Class TileReadBuffer defines a memory buffer for reading a sequence of tiles.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class TileReadBuffer {\n /** The geometry buffer */\n private _geometryBuffer: ABuffer;\n /** The attribute buffers */\n private _attributeBuffers: Array<ABuffer>;\n\n /**\n * Create a new buffer.\n * @param attributeCount the number of attributes.\n */\n public constructor(attributeCount: int32) {\n this._geometryBuffer = null; //new ABuffer(1024);\n this._attributeBuffers = new Array<ABuffer>(attributeCount);\n for (let i: number = 0; i < attributeCount; i++) this._attributeBuffers[i] = null; //new ABuffer(1024);\n }\n\n /**\n * Get the geometry buffer.\n * @return the buffer.\n */\n public getGeometryBuffer(): ABuffer {\n return this._geometryBuffer;\n }\n\n /**\n * Set the geometry buffer.\n * @param buffer the buffer.\n */\n public setGeometryBuffer(buffer: ABuffer): void {\n this._geometryBuffer = buffer;\n }\n\n /**\n * Get the geometry buffer.\n * @param size the mimumum size of the buffer.\n * @return the buffer.\n */\n public getSizedGeometryBuffer(size: int32): ABuffer {\n if (this._geometryBuffer.size() < size) {\n this._geometryBuffer = new ABuffer(size + 1024);\n }\n return this._geometryBuffer;\n }\n\n /**\n * Get the attribute count.\n * @return the attribute count.\n */\n public getAttributeCount(): int32 {\n return this._attributeBuffers.length;\n }\n\n /**\n * Get an attribute buffer.\n * @param attributeIndex the index of the attribute.\n * @return the buffer.\n */\n public getAttributeBuffer(attributeIndex: int32): ABuffer {\n return this._attributeBuffers[attributeIndex];\n }\n\n /**\n * Get an attribute buffer.\n * @param attributeIndex the index of the attribute.\n * @param size the mimumum size of the buffer.\n * @return the buffer.\n */\n public getSizedAttributeBuffer(attributeIndex: int32, size: int32): ABuffer {\n let attributeBuffer: ABuffer = this._attributeBuffers[attributeIndex];\n if (attributeBuffer.size() < size) {\n attributeBuffer = new ABuffer(size + 1024);\n this._attributeBuffers[attributeIndex] = attributeBuffer;\n }\n return attributeBuffer;\n }\n\n /**\n * Set an attribute buffer.\n * @param attributeIndex the index of the attribute.\n * @param buffer the buffer.\n */\n public setAttributeBuffer(attributeIndex: int32, buffer: ABuffer): void {\n this._attributeBuffers[attributeIndex] = buffer;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TileReadBuffer.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/TileReadBuffer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,4DAAyD;AAEzD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,0BAA0B;IAClB,eAAe,CAAU;IACjC,4BAA4B;IACpB,iBAAiB,CAAiB;IAE1C;;;OAGG;IACH,YAAmB,cAAqB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7D,CAAC;QACD,OAAO,eAAe,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,cAAqB,EAAE,MAAe;QAC5D,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IACpD,CAAC;CACJ;AApFD,wCAoFC","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\n\r\n/**\r\n * Class TileReadBuffer defines a memory buffer for reading a sequence of tiles.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class TileReadBuffer {\r\n /** The geometry buffer */\r\n private _geometryBuffer: ABuffer;\r\n /** The attribute buffers */\r\n private _attributeBuffers: Array<ABuffer>;\r\n\r\n /**\r\n * Create a new buffer.\r\n * @param attributeCount the number of attributes.\r\n */\r\n public constructor(attributeCount: int32) {\r\n this._geometryBuffer = null; //new ABuffer(1024);\r\n this._attributeBuffers = new Array<ABuffer>(attributeCount);\r\n for (let i: number = 0; i < attributeCount; i++) this._attributeBuffers[i] = null; //new ABuffer(1024);\r\n }\r\n\r\n /**\r\n * Get the geometry buffer.\r\n * @return the buffer.\r\n */\r\n public getGeometryBuffer(): ABuffer {\r\n return this._geometryBuffer;\r\n }\r\n\r\n /**\r\n * Set the geometry buffer.\r\n * @param buffer the buffer.\r\n */\r\n public setGeometryBuffer(buffer: ABuffer): void {\r\n this._geometryBuffer = buffer;\r\n }\r\n\r\n /**\r\n * Get the geometry buffer.\r\n * @param size the mimumum size of the buffer.\r\n * @return the buffer.\r\n */\r\n public getSizedGeometryBuffer(size: int32): ABuffer {\r\n if (this._geometryBuffer.size() < size) {\r\n this._geometryBuffer = new ABuffer(size + 1024);\r\n }\r\n return this._geometryBuffer;\r\n }\r\n\r\n /**\r\n * Get the attribute count.\r\n * @return the attribute count.\r\n */\r\n public getAttributeCount(): int32 {\r\n return this._attributeBuffers.length;\r\n }\r\n\r\n /**\r\n * Get an attribute buffer.\r\n * @param attributeIndex the index of the attribute.\r\n * @return the buffer.\r\n */\r\n public getAttributeBuffer(attributeIndex: int32): ABuffer {\r\n return this._attributeBuffers[attributeIndex];\r\n }\r\n\r\n /**\r\n * Get an attribute buffer.\r\n * @param attributeIndex the index of the attribute.\r\n * @param size the mimumum size of the buffer.\r\n * @return the buffer.\r\n */\r\n public getSizedAttributeBuffer(attributeIndex: int32, size: int32): ABuffer {\r\n let attributeBuffer: ABuffer = this._attributeBuffers[attributeIndex];\r\n if (attributeBuffer.size() < size) {\r\n attributeBuffer = new ABuffer(size + 1024);\r\n this._attributeBuffers[attributeIndex] = attributeBuffer;\r\n }\r\n return attributeBuffer;\r\n }\r\n\r\n /**\r\n * Set an attribute buffer.\r\n * @param attributeIndex the index of the attribute.\r\n * @param buffer the buffer.\r\n */\r\n public setAttributeBuffer(attributeIndex: int32, buffer: ABuffer): void {\r\n this._attributeBuffers[attributeIndex] = buffer;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/TileRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,sEAAmE;AAKnE,6DAA0D;AAG1D,qDAAkD;AAClD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,yCAAyC;IAClC,MAAM,CAAU,WAAW,GAAU,EAAE,CAAC;IAE/C;;OAEG;IACH;IACA,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAA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CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,OAAO,iBAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,KAAgB;QAC5C,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO,IAAI,qBAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;;AAvIL,gCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { OutStream } from \"../../../system/io/OutStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Numbers } from \"../../../system/runtime/Numbers\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { Grid } from \"../../model/Grid\";\nimport { GridIndex } from \"../../model/GridIndex\";\nimport { TileIndex } from \"../../model/TileIndex\";\n\n/**\n * Class TileRecord defines a tile index record.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class TileRecord {\n /** The size of the record in the file */\n public static readonly RECORD_SIZE: int32 = 16;\n\n /**\n * No instances.\n */\n private constructor() {\n }\n\n /**\n * Check if this tile has a certain index.\n * @param tileX the tile x index.\n * @param tileY the tile y index.\n * @param tileZ the tile Z index.\n * @return true if the tile has the index.\n */\n public static isTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\n return (tileX == tile.gridIndex.x && tileY == tile.gridIndex.y && tileZ == tile.gridIndex.z);\n }\n\n /**\n * Check if this tile is located after a certain index.\n * @param tileX the tile x index.\n * @param tileY the tile y index.\n * @param tileZ the tile Z index.\n * @return true if the tile is after the index.\n */\n public static isAfterTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\n if (tile.gridIndex.x < tileX) return false;\n if (tile.gridIndex.x > tileX) return true;\n if (tile.gridIndex.y < tileY) return false;\n if (tile.gridIndex.y > tileY) return true;\n if (tile.gridIndex.z < tileZ) return false;\n if (tile.gridIndex.z > tileZ) return true;\n return false;\n }\n\n /**\n * Check if this tile is located before a certain index.\n * @param tileX the tile x index.\n * @param tileY the tile y index.\n * @param tileZ the tile Z index.\n * @return true if the tile is before the index.\n */\n public static isBeforeTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\n if (tile.gridIndex.x < tileX) return true;\n if (tile.gridIndex.x > tileX) return false;\n if (tile.gridIndex.y < tileY) return true;\n if (tile.gridIndex.y > tileY) return false;\n if (tile.gridIndex.z < tileZ) return true;\n if (tile.gridIndex.z > tileZ) return false;\n return false;\n }\n\n /**\n * Write a record.\n * @param output the output stream.\n */\n public static write(tile: TileIndex, output: OutStream): void {\n let tileX: int32 = tile.gridIndex.x;\n let tileY: int32 = tile.gridIndex.y;\n let tileZ: int32 = tile.gridIndex.z;\n LittleEndian.writeStreamInt(output, tileX);\n LittleEndian.writeStreamInt(output, tileY);\n LittleEndian.writeStreamInt(output, tileZ);\n LittleEndian.writeStreamInt(output, tile.pointCount);\n }\n\n /**\n * Read a record.\n * @param tileGrid the grid.\n * @param stream the data stream from the file.\n * @param tileIndex the index of the tile.\n * @param pointIndex the index of the first point in the tile.\n * @return the requested record.\n */\n public static readNew(level: int32, tileGrid: Grid, stream: InStream, tileIndex: int32, pointIndex: ALong): TileIndex {\n /* Read the record */\n let tileX: int32 = LittleEndian.readStreamInt(stream);\n let tileY: int32 = LittleEndian.readStreamInt(stream);\n let tileZ: int32 = LittleEndian.readStreamInt(stream);\n let pointCount: int32 = LittleEndian.readStreamInt(stream);\n /* Create the record */\n return new TileIndex(level, tileIndex, new GridIndex(tileX, tileY, tileZ), pointIndex, pointCount);\n }\n\n /**\n * Read a record.\n * @param in the input stream.\n * @param tileIndex the index of the tile.\n * @param pointIndex the index of the first point in the tile.\n */\n public static read(tile: TileIndex, level: int32, blockIndex: int32, stream: InStream, tileIndex: int32, pointIndex: ALong): void {\n tile.level = level;\n tile.index = tileIndex;\n tile.gridIndex.x = LittleEndian.readStreamInt(stream);\n tile.gridIndex.y = LittleEndian.readStreamInt(stream);\n tile.gridIndex.z = LittleEndian.readStreamInt(stream);\n tile.pointCount = LittleEndian.readStreamInt(stream);\n tile.pointIndex = pointIndex;\n }\n\n /**\n * Get the squared distance to a grid cell.\n * @param reference the reference point.\n * @return the squared distance.\n */\n public static distanceSq(tile: TileIndex, reference: GridIndex): int32 {\n let dx: int32 = (tile.gridIndex.x - reference.x);\n let dy: int32 = (tile.gridIndex.y - reference.y);\n let dz: int32 = (tile.gridIndex.z - reference.z);\n return (dx * dx) + (dy * dy) + (dz * dz);\n }\n\n /**\n * Get a next-level index.\n * @param index the index at the current level.\n * @return the next-level index.\n */\n private static getNextLevelIndex1(index: int32): int32 {\n if (index < 0) return Numbers.divInt(index - 1, 2);\n return Numbers.divInt(index, 2);\n }\n\n /**\n * Get a next-level index.\n * @param index the index at the current level.\n * @return the next-level index.\n */\n public static getNextLevelIndex(index: GridIndex): GridIndex {\n let nextX: int32 = TileRecord.getNextLevelIndex1(index.x);\n let nextY: int32 = TileRecord.getNextLevelIndex1(index.y);\n let nextZ: int32 = TileRecord.getNextLevelIndex1(index.z);\n return new GridIndex(nextX, nextY, nextZ);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TileRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/TileRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,sEAAmE;AAKnE,6DAA0D;AAG1D,qDAAkD;AAClD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,yCAAyC;IAClC,MAAM,CAAU,WAAW,GAAU,EAAE,CAAC;IAE/C;;OAEG;IACH;IACA,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,KAAY,EAAE,KAAY,EAAE,KAAY;QAC1E,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,WAAW,CAAC,IAAe,EAAE,KAAY,EAAE,KAAY,EAAE,KAAY;QAC/E,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,IAAI,CAAC;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,IAAI,CAAC;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,IAAI,CAA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jD,IAAI,EAAE,GAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,EAAE,GAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,kBAAkB,CAAC,KAAY;QAC1C,IAAI,KAAK,GAAG,CAAC;YAAE,OAAO,iBAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,OAAO,iBAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,KAAgB;QAC5C,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,KAAK,GAAU,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO,IAAI,qBAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;;AAvIL,gCAwIC","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 { AList } from \"../../../system/collection/AList\";\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 { ContentLoader } from \"../../../system/storage/ContentLoader\";\r\nimport { Grid } from \"../../model/Grid\";\r\nimport { GridIndex } from \"../../model/GridIndex\";\r\nimport { TileIndex } from \"../../model/TileIndex\";\r\n\r\n/**\r\n * Class TileRecord defines a tile index record.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class TileRecord {\r\n /** The size of the record in the file */\r\n public static readonly RECORD_SIZE: int32 = 16;\r\n\r\n /**\r\n * No instances.\r\n */\r\n private constructor() {\r\n }\r\n\r\n /**\r\n * Check if this tile has a certain index.\r\n * @param tileX the tile x index.\r\n * @param tileY the tile y index.\r\n * @param tileZ the tile Z index.\r\n * @return true if the tile has the index.\r\n */\r\n public static isTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\r\n return (tileX == tile.gridIndex.x && tileY == tile.gridIndex.y && tileZ == tile.gridIndex.z);\r\n }\r\n\r\n /**\r\n * Check if this tile is located after a certain index.\r\n * @param tileX the tile x index.\r\n * @param tileY the tile y index.\r\n * @param tileZ the tile Z index.\r\n * @return true if the tile is after the index.\r\n */\r\n public static isAfterTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\r\n if (tile.gridIndex.x < tileX) return false;\r\n if (tile.gridIndex.x > tileX) return true;\r\n if (tile.gridIndex.y < tileY) return false;\r\n if (tile.gridIndex.y > tileY) return true;\r\n if (tile.gridIndex.z < tileZ) return false;\r\n if (tile.gridIndex.z > tileZ) return true;\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if this tile is located before a certain index.\r\n * @param tileX the tile x index.\r\n * @param tileY the tile y index.\r\n * @param tileZ the tile Z index.\r\n * @return true if the tile is before the index.\r\n */\r\n public static isBeforeTile(tile: TileIndex, tileX: int32, tileY: int32, tileZ: int32): boolean {\r\n if (tile.gridIndex.x < tileX) return true;\r\n if (tile.gridIndex.x > tileX) return false;\r\n if (tile.gridIndex.y < tileY) return true;\r\n if (tile.gridIndex.y > tileY) return false;\r\n if (tile.gridIndex.z < tileZ) return true;\r\n if (tile.gridIndex.z > tileZ) return false;\r\n return false;\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(tile: TileIndex, output: OutStream): void {\r\n let tileX: int32 = tile.gridIndex.x;\r\n let tileY: int32 = tile.gridIndex.y;\r\n let tileZ: int32 = tile.gridIndex.z;\r\n LittleEndian.writeStreamInt(output, tileX);\r\n LittleEndian.writeStreamInt(output, tileY);\r\n LittleEndian.writeStreamInt(output, tileZ);\r\n LittleEndian.writeStreamInt(output, tile.pointCount);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param tileGrid the grid.\r\n * @param stream the data 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 tile.\r\n * @return the requested record.\r\n */\r\n public static readNew(level: int32, tileGrid: Grid, stream: InStream, tileIndex: int32, pointIndex: ALong): TileIndex {\r\n /* Read the record */\r\n let tileX: int32 = LittleEndian.readStreamInt(stream);\r\n let tileY: int32 = LittleEndian.readStreamInt(stream);\r\n let tileZ: int32 = LittleEndian.readStreamInt(stream);\r\n let pointCount: int32 = LittleEndian.readStreamInt(stream);\r\n /* Create the record */\r\n return new TileIndex(level, tileIndex, new GridIndex(tileX, tileY, tileZ), pointIndex, pointCount);\r\n }\r\n\r\n /**\r\n * Read a record.\r\n * @param in the input stream.\r\n * @param tileIndex the index of the tile.\r\n * @param pointIndex the index of the first point in the tile.\r\n */\r\n public static read(tile: TileIndex, level: int32, blockIndex: int32, stream: InStream, tileIndex: int32, pointIndex: ALong): void {\r\n tile.level = level;\r\n tile.index = tileIndex;\r\n tile.gridIndex.x = LittleEndian.readStreamInt(stream);\r\n tile.gridIndex.y = LittleEndian.readStreamInt(stream);\r\n tile.gridIndex.z = LittleEndian.readStreamInt(stream);\r\n tile.pointCount = LittleEndian.readStreamInt(stream);\r\n tile.pointIndex = pointIndex;\r\n }\r\n\r\n /**\r\n * Get the squared distance to a grid cell.\r\n * @param reference the reference point.\r\n * @return the squared distance.\r\n */\r\n public static distanceSq(tile: TileIndex, reference: GridIndex): int32 {\r\n let dx: int32 = (tile.gridIndex.x - reference.x);\r\n let dy: int32 = (tile.gridIndex.y - reference.y);\r\n let dz: int32 = (tile.gridIndex.z - reference.z);\r\n return (dx * dx) + (dy * dy) + (dz * dz);\r\n }\r\n\r\n /**\r\n * Get a next-level index.\r\n * @param index the index at the current level.\r\n * @return the next-level index.\r\n */\r\n private static getNextLevelIndex1(index: int32): int32 {\r\n if (index < 0) return Numbers.divInt(index - 1, 2);\r\n return Numbers.divInt(index, 2);\r\n }\r\n\r\n /**\r\n * Get a next-level index.\r\n * @param index the index at the current level.\r\n * @return the next-level index.\r\n */\r\n public static getNextLevelIndex(index: GridIndex): GridIndex {\r\n let nextX: int32 = TileRecord.getNextLevelIndex1(index.x);\r\n let nextY: int32 = TileRecord.getNextLevelIndex1(index.y);\r\n let nextZ: int32 = TileRecord.getNextLevelIndex1(index.z);\r\n return new GridIndex(nextX, nextY, nextZ);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeTypes.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/AttributeTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH;;GAEG;AACH,gBAAgB;AAChB,MAAa,cAAc;IAC1B,6BAA6B;IACtB,MAAM,CAAU,YAAY,GAAU,CAAC,CAAC;IAC/C,8BAA8B;IACvB,MAAM,CAAU,SAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;IACvB,MAAM,CAAU,SAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;IACvB,MAAM,CAAU,SAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;IACvB,MAAM,CAAU,SAAS,GAAU,CAAC,CAAC;IAC5C,4BAA4B;IACrB,MAAM,CAAU,WAAW,GAAU,CAAC,CAAC;IAC9C,4BAA4B;IACrB,MAAM,CAAU,WAAW,GAAU,CAAC,CAAC;IAC9C,4BAA4B;IACrB,MAAM,CAAU,UAAU,GAAU,CAAC,CAAC;IAE7C;;OAEG;IACH;IACA,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,IAAW;QACpC,IAAI,IAAI,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC;QAC7B,IAAI,IAAI,IAAI,cAAc,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QAC1D,IAAI,IAAI,IAAI,cAAc,CAAC,SAAS;YAAE,OAAO,MAAM,CAAC;QACpD,IAAI,IAAI,IAAI,cAAc,CAAC,SAAS;YAAE,OAAO,MAAM,CAAC;QACpD,IAAI,IAAI,IAAI,cAAc,CAAC,SAAS;YAAE,OAAO,MAAM,CAAC;QACpD,IAAI,IAAI,IAAI,cAAc,CAAC,SAAS;YAAE,OAAO,MAAM,CAAC;QACpD,IAAI,IAAI,IAAI,cAAc,CAAC,WAAW;YAAE,OAAO,QAAQ,CAAC;QACxD,IAAI,IAAI,IAAI,cAAc,CAAC,WAAW;YAAE,OAAO,QAAQ,CAAC;QACxD,IAAI,IAAI,IAAI,cAAc,CAAC,UAAU;YAAE,OAAO,OAAO,CAAC;QACtD,OAAO,EAAE,GAAG,IAAI,CAAC;IAClB,CAAC;;AAxCF,wCAyCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.model;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n/**\n * Class AttributeTypes defines the possible types of pointcloud attributes.\n */\n/** @internal */\nexport class AttributeTypes {\n\t/** The 1-bit boolean type */\n\tpublic static readonly TYPE_BOOLEAN: int32 = 1;\n\t/** The 1-byte integer type */\n\tpublic static readonly TYPE_INT1: int32 = 2;\n\t/** The 2-byte integer type */\n\tpublic static readonly TYPE_INT2: int32 = 3;\n\t/** The 4-byte integer type */\n\tpublic static readonly TYPE_INT4: int32 = 4;\n\t/** The 8-byte integer type */\n\tpublic static readonly TYPE_INT8: int32 = 5;\n\t/** The 4-byte float type */\n\tpublic static readonly TYPE_FLOAT4: int32 = 6;\n\t/** The 8-byte float type */\n\tpublic static readonly TYPE_FLOAT8: int32 = 7;\n\t/** The 3-byte color type */\n\tpublic static readonly TYPE_COLOR: int32 = 8;\n\n\t/**\n\t * No instances.\n\t */\n\tprivate constructor() {\n\t}\n\n\t/**\n\t * Get the name of a type.\n\t * @param type the type of attributes.\n\t * @return the name.\n\t */\n\tpublic static getTypeName(type: int32): string {\n\t\tif (type <= 0) return \"none\";\n\t\tif (type == AttributeTypes.TYPE_BOOLEAN) return \"boolean\";\n\t\tif (type == AttributeTypes.TYPE_INT1) return \"int1\";\n\t\tif (type == AttributeTypes.TYPE_INT2) return \"int2\";\n\t\tif (type == AttributeTypes.TYPE_INT4) return \"int4\";\n\t\tif (type == AttributeTypes.TYPE_INT8) return \"int8\";\n\t\tif (type == AttributeTypes.TYPE_FLOAT4) return \"float4\";\n\t\tif (type == AttributeTypes.TYPE_FLOAT8) return \"float8\";\n\t\tif (type == AttributeTypes.TYPE_COLOR) return \"color\";\n\t\treturn \"\" + type;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AttributeTypes.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/AttributeTypes.ts"],"names":[],"mappings":";AAAA;;;+F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;IAClB,CAAC;;AAxCF,wCAyCC","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.model;\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 AttributeTypes defines the possible types of pointcloud attributes.\r\n */\r\n/** @internal */\r\nexport class AttributeTypes {\r\n\t/** The 1-bit boolean type */\r\n\tpublic static readonly TYPE_BOOLEAN: int32 = 1;\r\n\t/** The 1-byte integer type */\r\n\tpublic static readonly TYPE_INT1: int32 = 2;\r\n\t/** The 2-byte integer type */\r\n\tpublic static readonly TYPE_INT2: int32 = 3;\r\n\t/** The 4-byte integer type */\r\n\tpublic static readonly TYPE_INT4: int32 = 4;\r\n\t/** The 8-byte integer type */\r\n\tpublic static readonly TYPE_INT8: int32 = 5;\r\n\t/** The 4-byte float type */\r\n\tpublic static readonly TYPE_FLOAT4: int32 = 6;\r\n\t/** The 8-byte float type */\r\n\tpublic static readonly TYPE_FLOAT8: int32 = 7;\r\n\t/** The 3-byte color type */\r\n\tpublic static readonly TYPE_COLOR: int32 = 8;\r\n\r\n\t/**\r\n\t * No instances.\r\n\t */\r\n\tprivate constructor() {\r\n\t}\r\n\r\n\t/**\r\n\t * Get the name of a type.\r\n\t * @param type the type of attributes.\r\n\t * @return the name.\r\n\t */\r\n\tpublic static getTypeName(type: int32): string {\r\n\t\tif (type <= 0) return \"none\";\r\n\t\tif (type == AttributeTypes.TYPE_BOOLEAN) return \"boolean\";\r\n\t\tif (type == AttributeTypes.TYPE_INT1) return \"int1\";\r\n\t\tif (type == AttributeTypes.TYPE_INT2) return \"int2\";\r\n\t\tif (type == AttributeTypes.TYPE_INT4) return \"int4\";\r\n\t\tif (type == AttributeTypes.TYPE_INT8) return \"int8\";\r\n\t\tif (type == AttributeTypes.TYPE_FLOAT4) return \"float4\";\r\n\t\tif (type == AttributeTypes.TYPE_FLOAT8) return \"float8\";\r\n\t\tif (type == AttributeTypes.TYPE_COLOR) return \"color\";\r\n\t\treturn \"\" + type;\r\n\t}\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeValue.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/AttributeValue.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,mEAAgE;AAGhE,sDAAmD;AACnD,0DAAuD;AACvD,0DAAuD;AACvD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,wBAAwB;IACjB,MAAM,CAAU,KAAK,GAAmB,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnF,uBAAuB;IAChB,MAAM,CAAU,IAAI,GAAmB,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAEjF,eAAe;IACP,KAAK,CAAQ;IACrB,iDAAiD;IACzC,QAAQ,CAAQ;IACxB,+BAA+B;IACvB,QAAQ,CAAQ;IACxB,iCAAiC;IACzB,QAAQ,CAAU;IAC1B,iCAAiC;IACzB,QAAQ,CAAU;IAE1B;;OAEG;IACH;QACI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,aAAK,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,KAAc;QACtC,IAAI,MAAM,GAAmB,IAAI,cAAc,EAAE,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,C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AC,CAAC;aACrG,IAAI,aAAa,IAAI,+BAAc,CAAC,WAAW;YAAE,2BAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;aAC1G,IAAI,aAAa,IAAI,+BAAc,CAAC,WAAW;YAAE,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;aAC3G,IAAI,aAAa,IAAI,+BAAc,CAAC,UAAU;YAAE,2BAAY,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;;YACvG,iBAAO,CAAC,SAAS,CAAC,IAAI,EAAE,oCAAoC,GAAG,aAAa,CAAC,CAAC;IACvF,CAAC;;AAtcL,wCAucC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.model;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { ABuffer } from \"../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../system/buffer/LittleEndian\";\nimport { InStream } from \"../../system/io/InStream\";\nimport { OutStream } from \"../../system/io/OutStream\";\nimport { ALong } from \"../../system/runtime/ALong\";\nimport { ASystem } from \"../../system/runtime/ASystem\";\nimport { Numbers } from \"../../system/runtime/Numbers\";\nimport { AttributeTypes } from \"./AttributeTypes\";\n\n/**\n * Class AttributeValue holds a single (typed) attribute value.\n *\n * @version 1.0 August 2013\n */\n/** @internal */\nexport class AttributeValue {\n /** The 'false' value */\n public static readonly FALSE: AttributeValue = AttributeValue.createBoolean(false);\n /** The 'true' value */\n public static readonly TRUE: AttributeValue = AttributeValue.createBoolean(true);\n\n /** The type */\n private _type: int32;\n /** The value for boolean/int1/int2/int4 types */\n private _valueI4: int32;\n /** The value for int8 types */\n private _valueI8: ALong;\n /** The value for float4 types */\n private _valueF4: float32;\n /** The value for float8 types */\n private _valueF8: float64;\n\n /**\n * Create a new (empty) value.\n */\n public constructor() {\n this._type = 0;\n this._valueI4 = 0;\n this._valueI8 = ALong.ZERO;\n this._valueF4 = 0.0;\n this._valueF8 = 0.0;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createBoolean(value: boolean): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setBoolean(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createInt1(value: int32): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setInt1(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createInt2(value: int32): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setInt2(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createInt4(value: int32): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setInt4(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createInt8(value: ALong): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setInt8(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createFloat4(value: float32): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setFloat4(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createFloat8(value: float64): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setFloat8(value);\n return avalue;\n }\n\n /**\n * Create a new value.\n * @param value the value.\n */\n public static createColor(value: int32): AttributeValue {\n let avalue: AttributeValue = new AttributeValue();\n avalue.setColor(value);\n return avalue;\n }\n\n /**\n * Get the type.\n * @return the type.\n */\n public getType(): int32 {\n return this._type;\n }\n\n /**\n * Clear the value.\n */\n public clear(): void {\n this._type = 0;\n }\n\n /**\n * Is this an empty value?\n * @return true for empty.\n */\n public isEmpty(): boolean {\n return (this._type == 0);\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getBoolean(): boolean {\n return (this._valueI4 != 0);\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getBooleanAsInt(): int32 {\n return this._valueI4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setBoolean(value: boolean): void {\n this._type = AttributeTypes.TYPE_BOOLEAN;\n if (value) this._valueI4 = 1;\n else this._valueI4 = 0;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setBooleanFromInt(value: int32): void {\n this._type = AttributeTypes.TYPE_BOOLEAN;\n if (value == 0) this._valueI4 = 0;\n else this._valueI4 = 1;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getInt1(): int32 {\n return this._valueI4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setInt1(value: int32): void {\n this._type = AttributeTypes.TYPE_INT1;\n this._valueI4 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getInt2(): int32 {\n return this._valueI4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setInt2(value: int32): void {\n this._type = AttributeTypes.TYPE_INT2;\n this._valueI4 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getInt4(): int32 {\n return this._valueI4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setInt4(value: int32): void {\n this._type = AttributeTypes.TYPE_INT4;\n this._valueI4 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getInt8(): ALong {\n return this._valueI8;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setInt8(value: ALong): void {\n this._type = AttributeTypes.TYPE_INT8;\n this._valueI8 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getFloat4(): float32 {\n return this._valueF4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setFloat4(value: float32): void {\n this._type = AttributeTypes.TYPE_FLOAT4;\n this._valueF4 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getFloat8(): float64 {\n return this._valueF8;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setFloat8(value: float64): void {\n this._type = AttributeTypes.TYPE_FLOAT8;\n this._valueF8 = value;\n }\n\n /**\n * Get the value.\n * @return the value.\n */\n public getColor(): int32 {\n return this._valueI4;\n }\n\n /**\n * Set the value.\n * @param value the new value.\n */\n public setColor(value: int32): void {\n this._type = AttributeTypes.TYPE_COLOR;\n this._valueI4 = value;\n }\n\n /**\n * Check if the value equals another value.\n * @param other the other value.\n * @return true if same.\n */\n public same(other: AttributeValue): boolean {\n /* Check the type */\n if (other._type != this._type) return false;\n /* Check the value */\n if (this._type == AttributeTypes.TYPE_BOOLEAN) return (other._valueI4 == this._valueI4);\n if (this._type == AttributeTypes.TYPE_INT1) return (other._valueI4 == this._valueI4);\n if (this._type == AttributeTypes.TYPE_INT2) return (other._valueI4 == this._valueI4);\n if (this._type == AttributeTypes.TYPE_INT4) return (other._valueI4 == this._valueI4);\n if (this._type == AttributeTypes.TYPE_INT8) return (other._valueI8.same(this._valueI8));\n if (this._type == AttributeTypes.TYPE_FLOAT4) return (other._valueF4 == this._valueF4);\n if (this._type == AttributeTypes.TYPE_FLOAT8) return (other._valueF8 == this._valueF8);\n if (this._type == AttributeTypes.TYPE_COLOR) return (other._valueI4 == this._valueI4);\n /* Empty value */\n return true;\n }\n\n /**\n * Copy to another value.\n * @param other the other value to copy to.\n */\n public copyTo(other: AttributeValue): void {\n /* Copy the type */\n other._type = this._type;\n /* Check the value */\n if (this._type == AttributeTypes.TYPE_BOOLEAN) { other._valueI4 = this._valueI4; return; }\n if (this._type == AttributeTypes.TYPE_INT1) { other._valueI4 = this._valueI4; return; }\n if (this._type == AttributeTypes.TYPE_INT2) { other._valueI4 = this._valueI4; return; }\n if (this._type == AttributeTypes.TYPE_INT4) { other._valueI4 = this._valueI4; return; }\n if (this._type == AttributeTypes.TYPE_INT8) { other._valueI8 = this._valueI8; return; }\n if (this._type == AttributeTypes.TYPE_FLOAT4) { other._valueF4 = this._valueF4; return; }\n if (this._type == AttributeTypes.TYPE_FLOAT8) { other._valueF8 = this._valueF8; return; }\n if (this._type == AttributeTypes.TYPE_COLOR) { other._valueI4 = this._valueI4; return; }\n /* Empty value */\n }\n\n /**\n * Copy the value.\n * @return the copied value.\n */\n public copy(): AttributeValue {\n let copy: AttributeValue = new AttributeValue();\n this.copyTo(copy);\n return copy;\n }\n\n /**\n * Copy a list of values.\n * @return the copied values.\n */\n public static copyList(list: Array<AttributeValue>): Array<AttributeValue> {\n if (list == null) return null;\n let list2: Array<AttributeValue> = new Array<AttributeValue>(list.length);\n for (let i: number = 0; i < list.length; i++) list2[i] = list[i].copy();\n return list2;\n }\n\n /**\n * Get the value as a string.\n * @return the string.\n */\n public asString(): string {\n if (this._type == AttributeTypes.TYPE_BOOLEAN) return \"\" + this.getBoolean();\n else if (this._type == AttributeTypes.TYPE_INT1) return \"\" + this.getInt1();\n else if (this._type == AttributeTypes.TYPE_INT2) return \"\" + this.getInt2();\n else if (this._type == AttributeTypes.TYPE_INT4) return \"\" + this.getInt4();\n else if (this._type == AttributeTypes.TYPE_INT8) return \"\" + this.getInt8().toString();\n else if (this._type == AttributeTypes.TYPE_FLOAT4) return \"\" + this.getFloat4();\n else if (this._type == AttributeTypes.TYPE_FLOAT8) return \"\" + this.getFloat8();\n else if (this._type == AttributeTypes.TYPE_COLOR) return Numbers.rgbToString(this.getColor());\n return \"\";\n }\n\n /**\n * The standard toString method.\n * @see Object#toString\n */\n public toString(): string {\n return \"[AttributeValue:type=\" + AttributeTypes.getTypeName(this._type) + \",value=\" + this.asString() + \"]\";\n }\n\n /**\n * Create a default attribute value.\n * @param type the type of value.\n * @return a default value.\n */\n public static createDefault(type: int32): AttributeValue {\n if (type == AttributeTypes.TYPE_BOOLEAN) return AttributeValue.createBoolean(false);\n if (type == AttributeTypes.TYPE_INT1) return AttributeValue.createInt1(0);\n if (type == AttributeTypes.TYPE_INT2) return AttributeValue.createInt2(0);\n if (type == AttributeTypes.TYPE_INT4) return AttributeValue.createInt4(0);\n if (type == AttributeTypes.TYPE_INT8) return AttributeValue.createInt8(ALong.ZERO);\n if (type == AttributeTypes.TYPE_FLOAT4) return AttributeValue.createFloat4(0.0);\n if (type == AttributeTypes.TYPE_FLOAT8) return AttributeValue.createFloat8(0.0);\n if (type == AttributeTypes.TYPE_COLOR) return AttributeValue.createColor(0);\n ASystem.assertNot(true, \"Cannot create attribute value of type \" + type);\n return null;\n }\n\n /**\n * Read an attribute value.\n * @param buffer the buffer to read from.\n * @param bufferOffset the buffer offset to read from.\n * @param attributeType the type of the attribute.\n * @param the value to read into.\n */\n public static readFromBufferTo(buffer: ABuffer, bufferOffset: int32, attributeType: int32, value: AttributeValue): void {\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) value.setBoolean(LittleEndian.readBufferByte(buffer, bufferOffset) != 0);\n else if (attributeType == AttributeTypes.TYPE_INT1) value.setInt1(LittleEndian.readBufferByte(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_INT2) value.setInt2(LittleEndian.readBufferShort(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_INT4) value.setInt4(LittleEndian.readBufferInt(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_INT8) value.setInt8(LittleEndian.readBufferLong(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) value.setFloat4(LittleEndian.readBufferFloat(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) value.setFloat8(LittleEndian.readBufferDouble(buffer, bufferOffset));\n else if (attributeType == AttributeTypes.TYPE_COLOR) value.setColor(LittleEndian.readBufferInt3(buffer, bufferOffset));\n else ASystem.assertNot(true, \"Cannot read attribute value type \" + attributeType);\n }\n\n /**\n * Read an attribute value.\n * @param input the input stream to read from.\n * @param attributeType the type of the attribute.\n * @param the value to read into.\n */\n public static readFromStreamTo(stream: InStream, attributeType: int32, value: AttributeValue): void {\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) value.setBoolean(LittleEndian.readStreamByte(stream) != 0);\n else if (attributeType == AttributeTypes.TYPE_INT1) value.setInt1(LittleEndian.readStreamByte(stream));\n else if (attributeType == AttributeTypes.TYPE_INT2) value.setInt2(LittleEndian.readStreamShort(stream));\n else if (attributeType == AttributeTypes.TYPE_INT4) value.setInt4(LittleEndian.readStreamInt(stream));\n else if (attributeType == AttributeTypes.TYPE_INT8) value.setInt8(LittleEndian.readStreamLong(stream));\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) value.setFloat4(LittleEndian.readStreamFloat(stream));\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) value.setFloat8(LittleEndian.readStreamDouble(stream));\n else if (attributeType == AttributeTypes.TYPE_COLOR) value.setColor(LittleEndian.readStreamInt3(stream));\n else ASystem.assertNot(true, \"Cannot read attribute value type \" + attributeType);\n }\n\n /**\n * Read an attribute value.\n * @param input the input stream to read from.\n * @param attributeType the type of the attribute.\n * @return the value.\n */\n public static readFromStream(stream: InStream, attributeType: int32): AttributeValue {\n let value: AttributeValue = new AttributeValue();\n AttributeValue.readFromStreamTo(stream, attributeType, value);\n return value;\n }\n\n /**\n * Write an attribute value.\n * @param output the output stream to write to.\n * @param attributeType the type of the attribute.\n * @param value the value of the attribute.\n */\n public static writeToStream(stream: OutStream, attributeType: int32, value: AttributeValue): void {\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) LittleEndian.writeStreamByte(stream, value.getBooleanAsInt());\n else if (attributeType == AttributeTypes.TYPE_INT1) LittleEndian.writeStreamByte(stream, value.getInt1());\n else if (attributeType == AttributeTypes.TYPE_INT2) LittleEndian.writeStreamShort(stream, value.getInt2());\n else if (attributeType == AttributeTypes.TYPE_INT4) LittleEndian.writeStreamInt(stream, value.getInt4());\n else if (attributeType == AttributeTypes.TYPE_INT8) LittleEndian.writeStreamLong(stream, value.getInt8());\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) LittleEndian.writeStreamFloat(stream, value.getFloat4());\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) LittleEndian.writeStreamDouble(stream, value.getFloat8());\n else if (attributeType == AttributeTypes.TYPE_COLOR) LittleEndian.writeStreamInt3(stream, value.getColor());\n else ASystem.assertNot(true, \"Cannot write attribute value type \" + attributeType);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AttributeValue.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/AttributeValue.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH,mEAAgE;AAGhE,sDAAmD;AACnD,0DAAuD;AACvD,0DAAuD;AACvD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,cAAc;IACvB,wBAAwB;IACjB,MAAM,CAAU,KAAK,GAAmB,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnF,uBAAuB;IAChB,MAAM,CAAU,IAAI,GAAmB,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAEjF,eAAe;IACP,KAAK,CAAQ;IACrB,iDAAiD;IACzC,QAAQ,CAAQ;IACxB,+BAA+B;IACvB,QAAQ,CAAQ;IACxB,iCAAiC;IACzB,QAAQ,CAAU;IAC1B,iCAAiC;IACzB,QAAQ,CAAU;IAE1B;;OAEG;IACH;QACI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,aAAK,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,KAAc;QACtC,IAAI,MAAM,GAAmB,IAAI,cAAc,EAAE,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,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AAO,EAAE,CAAC,CAAC;aACrG,IAAI,aAAa,IAAI,+BAAc,CAAC,WAAW;YAAE,2BAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;aAC1G,IAAI,aAAa,IAAI,+BAAc,CAAC,WAAW;YAAE,2BAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;aAC3G,IAAI,aAAa,IAAI,+BAAc,CAAC,UAAU;YAAE,2BAAY,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;;YACvG,iBAAO,CAAC,SAAS,CAAC,IAAI,EAAE,oCAAoC,GAAG,aAAa,CAAC,CAAC;IACvF,CAAC;;AAtcL,wCAucC","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.model;\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 { InStream } from \"../../system/io/InStream\";\r\nimport { OutStream } from \"../../system/io/OutStream\";\r\nimport { ALong } from \"../../system/runtime/ALong\";\r\nimport { ASystem } from \"../../system/runtime/ASystem\";\r\nimport { Numbers } from \"../../system/runtime/Numbers\";\r\nimport { AttributeTypes } from \"./AttributeTypes\";\r\n\r\n/**\r\n * Class AttributeValue holds a single (typed) attribute value.\r\n *\r\n * @version 1.0 August 2013\r\n */\r\n/** @internal */\r\nexport class AttributeValue {\r\n /** The 'false' value */\r\n public static readonly FALSE: AttributeValue = AttributeValue.createBoolean(false);\r\n /** The 'true' value */\r\n public static readonly TRUE: AttributeValue = AttributeValue.createBoolean(true);\r\n\r\n /** The type */\r\n private _type: int32;\r\n /** The value for boolean/int1/int2/int4 types */\r\n private _valueI4: int32;\r\n /** The value for int8 types */\r\n private _valueI8: ALong;\r\n /** The value for float4 types */\r\n private _valueF4: float32;\r\n /** The value for float8 types */\r\n private _valueF8: float64;\r\n\r\n /**\r\n * Create a new (empty) value.\r\n */\r\n public constructor() {\r\n this._type = 0;\r\n this._valueI4 = 0;\r\n this._valueI8 = ALong.ZERO;\r\n this._valueF4 = 0.0;\r\n this._valueF8 = 0.0;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createBoolean(value: boolean): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setBoolean(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createInt1(value: int32): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setInt1(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createInt2(value: int32): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setInt2(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createInt4(value: int32): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setInt4(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createInt8(value: ALong): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setInt8(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createFloat4(value: float32): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setFloat4(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createFloat8(value: float64): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setFloat8(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Create a new value.\r\n * @param value the value.\r\n */\r\n public static createColor(value: int32): AttributeValue {\r\n let avalue: AttributeValue = new AttributeValue();\r\n avalue.setColor(value);\r\n return avalue;\r\n }\r\n\r\n /**\r\n * Get the type.\r\n * @return the type.\r\n */\r\n public getType(): int32 {\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Clear the value.\r\n */\r\n public clear(): void {\r\n this._type = 0;\r\n }\r\n\r\n /**\r\n * Is this an empty value?\r\n * @return true for empty.\r\n */\r\n public isEmpty(): boolean {\r\n return (this._type == 0);\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getBoolean(): boolean {\r\n return (this._valueI4 != 0);\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getBooleanAsInt(): int32 {\r\n return this._valueI4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setBoolean(value: boolean): void {\r\n this._type = AttributeTypes.TYPE_BOOLEAN;\r\n if (value) this._valueI4 = 1;\r\n else this._valueI4 = 0;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setBooleanFromInt(value: int32): void {\r\n this._type = AttributeTypes.TYPE_BOOLEAN;\r\n if (value == 0) this._valueI4 = 0;\r\n else this._valueI4 = 1;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getInt1(): int32 {\r\n return this._valueI4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setInt1(value: int32): void {\r\n this._type = AttributeTypes.TYPE_INT1;\r\n this._valueI4 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getInt2(): int32 {\r\n return this._valueI4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setInt2(value: int32): void {\r\n this._type = AttributeTypes.TYPE_INT2;\r\n this._valueI4 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getInt4(): int32 {\r\n return this._valueI4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setInt4(value: int32): void {\r\n this._type = AttributeTypes.TYPE_INT4;\r\n this._valueI4 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getInt8(): ALong {\r\n return this._valueI8;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setInt8(value: ALong): void {\r\n this._type = AttributeTypes.TYPE_INT8;\r\n this._valueI8 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getFloat4(): float32 {\r\n return this._valueF4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setFloat4(value: float32): void {\r\n this._type = AttributeTypes.TYPE_FLOAT4;\r\n this._valueF4 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getFloat8(): float64 {\r\n return this._valueF8;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setFloat8(value: float64): void {\r\n this._type = AttributeTypes.TYPE_FLOAT8;\r\n this._valueF8 = value;\r\n }\r\n\r\n /**\r\n * Get the value.\r\n * @return the value.\r\n */\r\n public getColor(): int32 {\r\n return this._valueI4;\r\n }\r\n\r\n /**\r\n * Set the value.\r\n * @param value the new value.\r\n */\r\n public setColor(value: int32): void {\r\n this._type = AttributeTypes.TYPE_COLOR;\r\n this._valueI4 = value;\r\n }\r\n\r\n /**\r\n * Check if the value equals another value.\r\n * @param other the other value.\r\n * @return true if same.\r\n */\r\n public same(other: AttributeValue): boolean {\r\n /* Check the type */\r\n if (other._type != this._type) return false;\r\n /* Check the value */\r\n if (this._type == AttributeTypes.TYPE_BOOLEAN) return (other._valueI4 == this._valueI4);\r\n if (this._type == AttributeTypes.TYPE_INT1) return (other._valueI4 == this._valueI4);\r\n if (this._type == AttributeTypes.TYPE_INT2) return (other._valueI4 == this._valueI4);\r\n if (this._type == AttributeTypes.TYPE_INT4) return (other._valueI4 == this._valueI4);\r\n if (this._type == AttributeTypes.TYPE_INT8) return (other._valueI8.same(this._valueI8));\r\n if (this._type == AttributeTypes.TYPE_FLOAT4) return (other._valueF4 == this._valueF4);\r\n if (this._type == AttributeTypes.TYPE_FLOAT8) return (other._valueF8 == this._valueF8);\r\n if (this._type == AttributeTypes.TYPE_COLOR) return (other._valueI4 == this._valueI4);\r\n /* Empty value */\r\n return true;\r\n }\r\n\r\n /**\r\n * Copy to another value.\r\n * @param other the other value to copy to.\r\n */\r\n public copyTo(other: AttributeValue): void {\r\n /* Copy the type */\r\n other._type = this._type;\r\n /* Check the value */\r\n if (this._type == AttributeTypes.TYPE_BOOLEAN) { other._valueI4 = this._valueI4; return; }\r\n if (this._type == AttributeTypes.TYPE_INT1) { other._valueI4 = this._valueI4; return; }\r\n if (this._type == AttributeTypes.TYPE_INT2) { other._valueI4 = this._valueI4; return; }\r\n if (this._type == AttributeTypes.TYPE_INT4) { other._valueI4 = this._valueI4; return; }\r\n if (this._type == AttributeTypes.TYPE_INT8) { other._valueI8 = this._valueI8; return; }\r\n if (this._type == AttributeTypes.TYPE_FLOAT4) { other._valueF4 = this._valueF4; return; }\r\n if (this._type == AttributeTypes.TYPE_FLOAT8) { other._valueF8 = this._valueF8; return; }\r\n if (this._type == AttributeTypes.TYPE_COLOR) { other._valueI4 = this._valueI4; return; }\r\n /* Empty value */\r\n }\r\n\r\n /**\r\n * Copy the value.\r\n * @return the copied value.\r\n */\r\n public copy(): AttributeValue {\r\n let copy: AttributeValue = new AttributeValue();\r\n this.copyTo(copy);\r\n return copy;\r\n }\r\n\r\n /**\r\n * Copy a list of values.\r\n * @return the copied values.\r\n */\r\n public static copyList(list: Array<AttributeValue>): Array<AttributeValue> {\r\n if (list == null) return null;\r\n let list2: Array<AttributeValue> = new Array<AttributeValue>(list.length);\r\n for (let i: number = 0; i < list.length; i++) list2[i] = list[i].copy();\r\n return list2;\r\n }\r\n\r\n /**\r\n * Get the value as a string.\r\n * @return the string.\r\n */\r\n public asString(): string {\r\n if (this._type == AttributeTypes.TYPE_BOOLEAN) return \"\" + this.getBoolean();\r\n else if (this._type == AttributeTypes.TYPE_INT1) return \"\" + this.getInt1();\r\n else if (this._type == AttributeTypes.TYPE_INT2) return \"\" + this.getInt2();\r\n else if (this._type == AttributeTypes.TYPE_INT4) return \"\" + this.getInt4();\r\n else if (this._type == AttributeTypes.TYPE_INT8) return \"\" + this.getInt8().toString();\r\n else if (this._type == AttributeTypes.TYPE_FLOAT4) return \"\" + this.getFloat4();\r\n else if (this._type == AttributeTypes.TYPE_FLOAT8) return \"\" + this.getFloat8();\r\n else if (this._type == AttributeTypes.TYPE_COLOR) return Numbers.rgbToString(this.getColor());\r\n return \"\";\r\n }\r\n\r\n /**\r\n * The standard toString method.\r\n * @see Object#toString\r\n */\r\n public toString(): string {\r\n return \"[AttributeValue:type=\" + AttributeTypes.getTypeName(this._type) + \",value=\" + this.asString() + \"]\";\r\n }\r\n\r\n /**\r\n * Create a default attribute value.\r\n * @param type the type of value.\r\n * @return a default value.\r\n */\r\n public static createDefault(type: int32): AttributeValue {\r\n if (type == AttributeTypes.TYPE_BOOLEAN) return AttributeValue.createBoolean(false);\r\n if (type == AttributeTypes.TYPE_INT1) return AttributeValue.createInt1(0);\r\n if (type == AttributeTypes.TYPE_INT2) return AttributeValue.createInt2(0);\r\n if (type == AttributeTypes.TYPE_INT4) return AttributeValue.createInt4(0);\r\n if (type == AttributeTypes.TYPE_INT8) return AttributeValue.createInt8(ALong.ZERO);\r\n if (type == AttributeTypes.TYPE_FLOAT4) return AttributeValue.createFloat4(0.0);\r\n if (type == AttributeTypes.TYPE_FLOAT8) return AttributeValue.createFloat8(0.0);\r\n if (type == AttributeTypes.TYPE_COLOR) return AttributeValue.createColor(0);\r\n ASystem.assertNot(true, \"Cannot create attribute value of type \" + type);\r\n return null;\r\n }\r\n\r\n /**\r\n * Read an attribute value.\r\n * @param buffer the buffer to read from.\r\n * @param bufferOffset the buffer offset to read from.\r\n * @param attributeType the type of the attribute.\r\n * @param the value to read into.\r\n */\r\n public static readFromBufferTo(buffer: ABuffer, bufferOffset: int32, attributeType: int32, value: AttributeValue): void {\r\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) value.setBoolean(LittleEndian.readBufferByte(buffer, bufferOffset) != 0);\r\n else if (attributeType == AttributeTypes.TYPE_INT1) value.setInt1(LittleEndian.readBufferByte(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_INT2) value.setInt2(LittleEndian.readBufferShort(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_INT4) value.setInt4(LittleEndian.readBufferInt(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_INT8) value.setInt8(LittleEndian.readBufferLong(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) value.setFloat4(LittleEndian.readBufferFloat(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) value.setFloat8(LittleEndian.readBufferDouble(buffer, bufferOffset));\r\n else if (attributeType == AttributeTypes.TYPE_COLOR) value.setColor(LittleEndian.readBufferInt3(buffer, bufferOffset));\r\n else ASystem.assertNot(true, \"Cannot read attribute value type \" + attributeType);\r\n }\r\n\r\n /**\r\n * Read an attribute value.\r\n * @param input the input stream to read from.\r\n * @param attributeType the type of the attribute.\r\n * @param the value to read into.\r\n */\r\n public static readFromStreamTo(stream: InStream, attributeType: int32, value: AttributeValue): void {\r\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) value.setBoolean(LittleEndian.readStreamByte(stream) != 0);\r\n else if (attributeType == AttributeTypes.TYPE_INT1) value.setInt1(LittleEndian.readStreamByte(stream));\r\n else if (attributeType == AttributeTypes.TYPE_INT2) value.setInt2(LittleEndian.readStreamShort(stream));\r\n else if (attributeType == AttributeTypes.TYPE_INT4) value.setInt4(LittleEndian.readStreamInt(stream));\r\n else if (attributeType == AttributeTypes.TYPE_INT8) value.setInt8(LittleEndian.readStreamLong(stream));\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) value.setFloat4(LittleEndian.readStreamFloat(stream));\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) value.setFloat8(LittleEndian.readStreamDouble(stream));\r\n else if (attributeType == AttributeTypes.TYPE_COLOR) value.setColor(LittleEndian.readStreamInt3(stream));\r\n else ASystem.assertNot(true, \"Cannot read attribute value type \" + attributeType);\r\n }\r\n\r\n /**\r\n * Read an attribute value.\r\n * @param input the input stream to read from.\r\n * @param attributeType the type of the attribute.\r\n * @return the value.\r\n */\r\n public static readFromStream(stream: InStream, attributeType: int32): AttributeValue {\r\n let value: AttributeValue = new AttributeValue();\r\n AttributeValue.readFromStreamTo(stream, attributeType, value);\r\n return value;\r\n }\r\n\r\n /**\r\n * Write an attribute value.\r\n * @param output the output stream to write to.\r\n * @param attributeType the type of the attribute.\r\n * @param value the value of the attribute.\r\n */\r\n public static writeToStream(stream: OutStream, attributeType: int32, value: AttributeValue): void {\r\n if (attributeType == AttributeTypes.TYPE_BOOLEAN) LittleEndian.writeStreamByte(stream, value.getBooleanAsInt());\r\n else if (attributeType == AttributeTypes.TYPE_INT1) LittleEndian.writeStreamByte(stream, value.getInt1());\r\n else if (attributeType == AttributeTypes.TYPE_INT2) LittleEndian.writeStreamShort(stream, value.getInt2());\r\n else if (attributeType == AttributeTypes.TYPE_INT4) LittleEndian.writeStreamInt(stream, value.getInt4());\r\n else if (attributeType == AttributeTypes.TYPE_INT8) LittleEndian.writeStreamLong(stream, value.getInt8());\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT4) LittleEndian.writeStreamFloat(stream, value.getFloat4());\r\n else if (attributeType == AttributeTypes.TYPE_FLOAT8) LittleEndian.writeStreamDouble(stream, value.getFloat8());\r\n else if (attributeType == AttributeTypes.TYPE_COLOR) LittleEndian.writeStreamInt3(stream, value.getColor());\r\n else ASystem.assertNot(true, \"Cannot write attribute value type \" + attributeType);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockIndex.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/BlockIndex.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAcH;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,gBAAgB;IACT,KAAK,CAAQ;IACpB,kCAAkC;IAC3B,GAAG,CAAS;IACnB,0CAA0C;IACnC,KAAK,CAAQ;IACpB,qBAAqB;IACd,SAAS,CAAY;IAC5B,yDAAyD;IAClD,SAAS,CAAQ;IACxB,qBAAqB;IACd,SAAS,CAAQ;IACxB,0DAA0D;IACnD,UAAU,CAAQ;IACzB,sBAAsB;IACf,UAAU,CAAQ;IACzB,2BAA2B;IACpB,UAAU,CAAU;IAE3B;;OAEG;IACH,YAAmB,KAAY,EAAE,KAAY,EAAE,SAAoB,EAAE,SAAgB,EAAE,SAAgB,EAAE,UAAiB,EAAE,UAAiB;QACzI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,KAAiB;QACzB,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,MAAM;QACT,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACvG,CAAC;CACJ;AAnDD,gCAmDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.model;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ALong } from \"../../system/runtime/ALong\";\nimport { GridIndex } from \"./GridIndex\";\n\n/**\n * Class BlockIndex defines a block index in a pointcloud file.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class BlockIndex {\n /** The level */\n public level: int32;\n /** The unique key of the block */\n public key: string;\n /** The index of the block in the level */\n public index: int32;\n /** The grid index */\n public gridIndex: GridIndex;\n /** The index of the first tile in the block (derived) */\n public tileIndex: int32;\n /** The tile count */\n public tileCount: int32;\n /** The index of the first point in the block (derived) */\n public pointIndex: ALong;\n /** The point count */\n public pointCount: ALong;\n /** The last access time */\n public accessTime: float64;\n\n /**\n * Create a new index.\n */\n public constructor(level: int32, index: int32, gridIndex: GridIndex, tileIndex: int32, tileCount: int32, pointIndex: ALong, pointCount: ALong) {\n this.level = level;\n this.index = index;\n this.gridIndex = gridIndex;\n this.tileIndex = tileIndex;\n this.tileCount = tileCount;\n this.pointIndex = pointIndex;\n this.pointCount = pointCount;\n this.accessTime = 0.0;\n this.key = (\"L\" + this.level + \",B:\" + this.index);\n }\n\n /**\n * Check if two indexes are the same.\n * @param other another index.\n * @return true if same.\n */\n public same(other: BlockIndex): boolean {\n return (other.level == this.level) && (other.index == this.index);\n }\n\n /**\n * Get the unique key of the block in the pointcloud file.\n * @return the unique key (combines level and grid index).\n */\n public getKey(): string {\n return \"B\" + this.level + \"/\" + this.gridIndex.x + \"/\" + this.gridIndex.y + \"/\" + this.gridIndex.z;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BlockIndex.js","sourceRoot":"","sources":["../../../../src/pointcloud/model/BlockIndex.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAcH;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,gBAAgB;IACT,KAAK,CAAQ;IACpB,kCAAkC;IAC3B,GAAG,CAAS;IACnB,0CAA0C;IACnC,KAAK,CAAQ;IACpB,qBAAqB;IACd,SAAS,CAAY;IAC5B,yDAAyD;IAClD,SAAS,CAAQ;IACxB,qBAAqB;IACd,SAAS,CAAQ;IACxB,0DAA0D;IACnD,UAAU,CAAQ;IACzB,sBAAsB;IACf,UAAU,CAAQ;IACzB,2BAA2B;IACpB,UAAU,CAAU;IAE3B;;OAEG;IACH,YAAmB,KAAY,EAAE,KAAY,EAAE,SAAoB,EAAE,SAAgB,EAAE,SAAgB,EAAE,UAAiB,EAAE,UAAiB;QACzI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,KAAiB;QACzB,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,MAAM;QACT,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACvG,CAAC;CACJ;AAnDD,gCAmDC","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.model;\r\n\r\ntype int8 = number;\r\ntype int16 = number;\r\ntype int32 = number;\r\ntype float32 = number;\r\ntype float64 = number;\r\n\r\n\r\nimport { ALong } from \"../../system/runtime/ALong\";\r\nimport { GridIndex } from \"./GridIndex\";\r\n\r\n/**\r\n * Class BlockIndex defines a block index in a pointcloud file.\r\n *\r\n * @version 1.0 January 2014\r\n */\r\n/** @internal */\r\nexport class BlockIndex {\r\n /** The level */\r\n public level: int32;\r\n /** The unique key of the block */\r\n public key: string;\r\n /** The index of the block in the level */\r\n public index: int32;\r\n /** The grid index */\r\n public gridIndex: GridIndex;\r\n /** The index of the first tile in the block (derived) */\r\n public tileIndex: int32;\r\n /** The tile count */\r\n public tileCount: int32;\r\n /** The index of the first point in the block (derived) */\r\n public pointIndex: ALong;\r\n /** The point count */\r\n public pointCount: ALong;\r\n /** The last access time */\r\n public accessTime: float64;\r\n\r\n /**\r\n * Create a new index.\r\n */\r\n public constructor(level: int32, index: int32, gridIndex: GridIndex, tileIndex: int32, tileCount: int32, pointIndex: ALong, pointCount: ALong) {\r\n this.level = level;\r\n this.index = index;\r\n this.gridIndex = gridIndex;\r\n this.tileIndex = tileIndex;\r\n this.tileCount = tileCount;\r\n this.pointIndex = pointIndex;\r\n this.pointCount = pointCount;\r\n this.accessTime = 0.0;\r\n this.key = (\"L\" + this.level + \",B:\" + this.index);\r\n }\r\n\r\n /**\r\n * Check if two indexes are the same.\r\n * @param other another index.\r\n * @return true if same.\r\n */\r\n public same(other: BlockIndex): boolean {\r\n return (other.level == this.level) && (other.index == this.index);\r\n }\r\n\r\n /**\r\n * Get the unique key of the block in the pointcloud file.\r\n * @return the unique key (combines level and grid index).\r\n */\r\n public getKey(): string {\r\n return \"B\" + this.level + \"/\" + this.gridIndex.x + \"/\" + this.gridIndex.y + \"/\" + this.gridIndex.z;\r\n }\r\n}\r\n"]}
|