@itwin/core-orbitgt 5.0.0-dev.32 → 5.0.0-dev.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js +2 -2
- package/lib/cjs/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js +2 -2
- package/lib/cjs/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/FileReader.js +2 -2
- package/lib/cjs/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js +6 -6
- package/lib/cjs/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/cjs/pointcloud/format/opc/TileRecord.js +2 -2
- package/lib/cjs/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeTypes.js +16 -16
- package/lib/cjs/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/cjs/pointcloud/model/AttributeValue.js +4 -4
- package/lib/cjs/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/cjs/pointcloud/model/CloudPoint.js +2 -2
- package/lib/cjs/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/cjs/pointcloud/model/PointDataRaw.js +2 -2
- package/lib/cjs/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/cjs/pointcloud/model/ReadRequest.js +6 -6
- package/lib/cjs/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/cjs/pointcloud/model/StandardAttributes.js +21 -21
- package/lib/cjs/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/cjs/pointcloud/render/DataManager.js +6 -6
- package/lib/cjs/pointcloud/render/DataManager.js.map +1 -1
- package/lib/cjs/pointcloud/render/TileLoadSorter.js +2 -2
- package/lib/cjs/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/cjs/pointcloud/render/ViewTree.js +4 -4
- package/lib/cjs/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/cjs/spatial/crs/CRSManager.js +2 -2
- package/lib/cjs/spatial/crs/CRSManager.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CRS.js +34 -34
- package/lib/cjs/spatial/ecrs/CRS.js.map +1 -1
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js +2 -2
- package/lib/cjs/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js +1 -1
- package/lib/cjs/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Datum.js +4 -4
- package/lib/cjs/spatial/ecrs/Datum.js.map +1 -1
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js +2 -2
- package/lib/cjs/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Operation.js +6 -6
- package/lib/cjs/spatial/ecrs/Operation.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Registry.js +17 -17
- package/lib/cjs/spatial/ecrs/Registry.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Transform.js +11 -11
- package/lib/cjs/spatial/ecrs/Transform.js.map +1 -1
- package/lib/cjs/spatial/ecrs/Unit.js +24 -24
- package/lib/cjs/spatial/ecrs/Unit.js.map +1 -1
- package/lib/cjs/spatial/ecrs/WellKnownText.js +8 -8
- package/lib/cjs/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js +2 -2
- package/lib/cjs/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js +2 -2
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +2 -2
- package/lib/cjs/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js +2 -2
- package/lib/cjs/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js +6 -6
- package/lib/cjs/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js +4 -4
- package/lib/cjs/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js +4 -4
- package/lib/cjs/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js +4 -4
- package/lib/cjs/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js +4 -4
- package/lib/cjs/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js +2 -2
- package/lib/cjs/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/cjs/system/buffer/Float32Buffer.js +2 -2
- package/lib/cjs/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/Uint16Buffer.js +2 -2
- package/lib/cjs/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/cjs/system/buffer/Uint8Buffer.js +2 -2
- package/lib/cjs/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/cjs/system/runtime/ALong.js +26 -26
- package/lib/cjs/system/runtime/ALong.js.map +1 -1
- package/lib/cjs/system/runtime/ASystem.js +1 -1
- package/lib/cjs/system/runtime/ASystem.js.map +1 -1
- package/lib/cjs/system/runtime/Downloader.js +2 -2
- package/lib/cjs/system/runtime/Downloader.js.map +1 -1
- package/lib/cjs/system/runtime/Message.js +2 -2
- package/lib/cjs/system/runtime/Message.js.map +1 -1
- package/lib/cjs/system/runtime/Numbers.js +6 -6
- package/lib/cjs/system/runtime/Numbers.js.map +1 -1
- package/lib/cjs/system/runtime/Strings.js +14 -14
- package/lib/cjs/system/runtime/Strings.js.map +1 -1
- package/lib/cjs/system/storage/ContentLoader.js +2 -2
- package/lib/cjs/system/storage/ContentLoader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/BlockRecord.js +2 -2
- package/lib/esm/pointcloud/format/opc/BlockRecord.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/ContainerFile.js +2 -2
- package/lib/esm/pointcloud/format/opc/ContainerFile.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/FileReader.js +2 -2
- package/lib/esm/pointcloud/format/opc/FileReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/GeometryReader.js +6 -6
- package/lib/esm/pointcloud/format/opc/GeometryReader.js.map +1 -1
- package/lib/esm/pointcloud/format/opc/TileRecord.js +2 -2
- package/lib/esm/pointcloud/format/opc/TileRecord.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeTypes.js +16 -16
- package/lib/esm/pointcloud/model/AttributeTypes.js.map +1 -1
- package/lib/esm/pointcloud/model/AttributeValue.js +4 -4
- package/lib/esm/pointcloud/model/AttributeValue.js.map +1 -1
- package/lib/esm/pointcloud/model/CloudPoint.js +2 -2
- package/lib/esm/pointcloud/model/CloudPoint.js.map +1 -1
- package/lib/esm/pointcloud/model/PointDataRaw.js +2 -2
- package/lib/esm/pointcloud/model/PointDataRaw.js.map +1 -1
- package/lib/esm/pointcloud/model/ReadRequest.js +6 -6
- package/lib/esm/pointcloud/model/ReadRequest.js.map +1 -1
- package/lib/esm/pointcloud/model/StandardAttributes.js +21 -21
- package/lib/esm/pointcloud/model/StandardAttributes.js.map +1 -1
- package/lib/esm/pointcloud/render/DataManager.js +6 -6
- package/lib/esm/pointcloud/render/DataManager.js.map +1 -1
- package/lib/esm/pointcloud/render/TileLoadSorter.js +2 -2
- package/lib/esm/pointcloud/render/TileLoadSorter.js.map +1 -1
- package/lib/esm/pointcloud/render/ViewTree.js +4 -4
- package/lib/esm/pointcloud/render/ViewTree.js.map +1 -1
- package/lib/esm/spatial/crs/CRSManager.js +2 -2
- package/lib/esm/spatial/crs/CRSManager.js.map +1 -1
- package/lib/esm/spatial/ecrs/CRS.js +34 -34
- package/lib/esm/spatial/ecrs/CRS.js.map +1 -1
- package/lib/esm/spatial/ecrs/CoordinateSystem.js +2 -2
- package/lib/esm/spatial/ecrs/CoordinateSystem.js.map +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.js +1 -1
- package/lib/esm/spatial/ecrs/DataFileUnit.js.map +1 -1
- package/lib/esm/spatial/ecrs/Datum.js +4 -4
- package/lib/esm/spatial/ecrs/Datum.js.map +1 -1
- package/lib/esm/spatial/ecrs/OnlineRegistry.js +2 -2
- package/lib/esm/spatial/ecrs/OnlineRegistry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Operation.js +6 -6
- package/lib/esm/spatial/ecrs/Operation.js.map +1 -1
- package/lib/esm/spatial/ecrs/Registry.js +17 -17
- package/lib/esm/spatial/ecrs/Registry.js.map +1 -1
- package/lib/esm/spatial/ecrs/Transform.js +11 -11
- package/lib/esm/spatial/ecrs/Transform.js.map +1 -1
- package/lib/esm/spatial/ecrs/Unit.js +24 -24
- package/lib/esm/spatial/ecrs/Unit.js.map +1 -1
- package/lib/esm/spatial/ecrs/WellKnownText.js +8 -8
- package/lib/esm/spatial/ecrs/WellKnownText.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js +2 -2
- package/lib/esm/spatial/ecrs/projection/HotineObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js +2 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js +2 -2
- package/lib/esm/spatial/ecrs/projection/KrovakObliqueConformalConicEN.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js +2 -2
- package/lib/esm/spatial/ecrs/projection/LambertConical1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js +6 -6
- package/lib/esm/spatial/ecrs/projection/LambertConical2SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js +4 -4
- package/lib/esm/spatial/ecrs/projection/Mercator1SP.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js +4 -4
- package/lib/esm/spatial/ecrs/projection/ObliqueMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js +4 -4
- package/lib/esm/spatial/ecrs/projection/ObliqueStereographic.js.map +1 -1
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js +4 -4
- package/lib/esm/spatial/ecrs/projection/TransverseMercator.js.map +1 -1
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js +2 -2
- package/lib/esm/spatial/ecrs/transformation/PositionVector.js.map +1 -1
- package/lib/esm/system/buffer/Float32Buffer.js +2 -2
- package/lib/esm/system/buffer/Float32Buffer.js.map +1 -1
- package/lib/esm/system/buffer/Uint16Buffer.js +2 -2
- package/lib/esm/system/buffer/Uint16Buffer.js.map +1 -1
- package/lib/esm/system/buffer/Uint8Buffer.js +2 -2
- package/lib/esm/system/buffer/Uint8Buffer.js.map +1 -1
- package/lib/esm/system/runtime/ALong.js +26 -26
- package/lib/esm/system/runtime/ALong.js.map +1 -1
- package/lib/esm/system/runtime/ASystem.js +1 -1
- package/lib/esm/system/runtime/ASystem.js.map +1 -1
- package/lib/esm/system/runtime/Downloader.js +2 -2
- package/lib/esm/system/runtime/Downloader.js.map +1 -1
- package/lib/esm/system/runtime/Message.js +2 -2
- package/lib/esm/system/runtime/Message.js.map +1 -1
- package/lib/esm/system/runtime/Numbers.js +6 -6
- package/lib/esm/system/runtime/Numbers.js.map +1 -1
- package/lib/esm/system/runtime/Strings.js +14 -14
- package/lib/esm/system/runtime/Strings.js.map +1 -1
- package/lib/esm/system/storage/ContentLoader.js +2 -2
- package/lib/esm/system/storage/ContentLoader.js.map +1 -1
- package/package.json +4 -4
|
@@ -19,6 +19,8 @@ const GridIndex_1 = require("../../model/GridIndex");
|
|
|
19
19
|
*/
|
|
20
20
|
/** @internal */
|
|
21
21
|
class BlockRecord {
|
|
22
|
+
/** The size of the record in the file */
|
|
23
|
+
static { this.RECORD_SIZE = 24; }
|
|
22
24
|
/**
|
|
23
25
|
* No instances.
|
|
24
26
|
*/
|
|
@@ -80,6 +82,4 @@ class BlockRecord {
|
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
exports.BlockRecord = BlockRecord;
|
|
83
|
-
/** The size of the record in the file */
|
|
84
|
-
BlockRecord.RECORD_SIZE = 24;
|
|
85
85
|
//# sourceMappingURL=BlockRecord.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,sEAAmE;AAInE,6DAA0D;AAC1D,uDAAoD;AACpD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"BlockRecord.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/BlockRecord.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAUH,sEAAmE;AAInE,6DAA0D;AAC1D,uDAAoD;AACpD,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,WAAW;IACpB,yCAAyC;aAClB,gBAAW,GAAU,EAAE,CAAC;IAE/C;;OAEG;IACH;IACA,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,SAAgB,EAAE,SAAgB;QAC1D,IAAI,SAAS,GAAG,CAAC;YAAE,OAAO,iBAAO,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QACzE,OAAO,i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AAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,SAAS,GAAU,2BAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,UAAU,GAAU,2BAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3D,uBAAuB;QACvB,OAAO,IAAI,uBAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,qBAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAClI,CAAC;;AAjEL,kCAkEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { OutStream } from \"../../../system/io/OutStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Numbers } from \"../../../system/runtime/Numbers\";\nimport { BlockIndex } from \"../../model/BlockIndex\";\nimport { GridIndex } from \"../../model/GridIndex\";\n\n/**\n * Class BlockRecord defines a (32x32x32) block of tiles.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class BlockRecord {\n /** The size of the record in the file */\n public static readonly RECORD_SIZE: int32 = 24;\n\n /**\n * No instances.\n */\n private constructor() {\n }\n\n /**\n * Convert a tile grid index to a block grid index.\n * @param tileIndex the tile index.\n * @param blockSize the block size.\n * @return the block index.\n */\n public static toBlockIndex1(tileIndex: int32, blockSize: int32): int32 {\n if (tileIndex < 0) return Numbers.divInt((tileIndex + 1), blockSize) - 1;\n return Numbers.divInt(tileIndex, blockSize);\n }\n\n /**\n * Convert a tile grid index to a block grid index.\n * @param tileX the x index of the tile.\n * @param tileY the y index of the tile.\n * @param tileZ the z index of the tile.\n * @param blockSize the block size.\n * @return the block index.\n */\n public static toBlockIndex(tileX: int32, tileY: int32, tileZ: int32, blockSize: int32): GridIndex {\n return new GridIndex(BlockRecord.toBlockIndex1(tileX, blockSize), BlockRecord.toBlockIndex1(tileY, blockSize), BlockRecord.toBlockIndex1(tileZ, blockSize));\n }\n\n /**\n * Write a record.\n * @param output the output stream.\n */\n public static write(block: BlockIndex, output: OutStream): void {\n let blockX: int32 = block.gridIndex.x;\n let blockY: int32 = block.gridIndex.y;\n let blockZ: int32 = block.gridIndex.z;\n LittleEndian.writeStreamInt(output, blockX);\n LittleEndian.writeStreamInt(output, blockY);\n LittleEndian.writeStreamInt(output, blockZ);\n LittleEndian.writeStreamInt(output, block.tileCount);\n LittleEndian.writeStreamLong(output, block.pointCount);\n }\n\n /**\n * Read a record.\n * @param level the level.\n * @param in the input stream from the file.\n * @param tileIndex the index of the tile.\n * @param pointIndex the index of the first point in the block.\n * @return the requested record.\n */\n public static readNew(level: int32, input: InStream, blockIndex: int32, tileIndex: int32, pointIndex: ALong): BlockIndex {\n /* Read the record */\n let blockX: int32 = LittleEndian.readStreamInt(input);\n let blockY: int32 = LittleEndian.readStreamInt(input);\n let blockZ: int32 = LittleEndian.readStreamInt(input);\n let tileCount: int32 = LittleEndian.readStreamInt(input);\n let pointCount: ALong = LittleEndian.readStreamLong(input);\n /* Create the record */\n return new BlockIndex(level, blockIndex, new GridIndex(blockX, blockY, blockZ), tileIndex, tileCount, pointIndex, pointCount);\n }\n}\n"]}
|
|
@@ -24,6 +24,8 @@ const FileAccess_1 = require("./FileAccess");
|
|
|
24
24
|
*/
|
|
25
25
|
/** @internal */
|
|
26
26
|
class ContainerFile {
|
|
27
|
+
/** The name of this module */
|
|
28
|
+
static { this.MODULE = "ContainerFile"; }
|
|
27
29
|
/**
|
|
28
30
|
* Create a new container file.
|
|
29
31
|
* @param fileName the name of the file.
|
|
@@ -195,6 +197,4 @@ class ContainerFile {
|
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
199
|
exports.ContainerFile = ContainerFile;
|
|
198
|
-
/** The name of this module */
|
|
199
|
-
ContainerFile.MODULE = "ContainerFile";
|
|
200
200
|
//# sourceMappingURL=ContainerFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerFile.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,4DAAyD;AACzD,wEAAqE;AAErE,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,6DAA0D;AAE1D,2DAAwD;AACxD,6CAA0C;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IAatB;;;;;;OAMG;IACH,YAAmB,QAAgB,EAAE,UAAiB,EAAE,MAAc,EAAE,KAA+B;QACnG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAwB;QACjC,IAAI,eAAe;YAAE,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC;QACrH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IAC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AuB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9H,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;;AAtLL,sCAuLC;AAtLG,8BAA8B;AACN,oBAAM,GAAW,eAAe,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { FileAccess } from \"./FileAccess\";\n\n/**\n * Class ContainerFile defines a single file that contains multiple internal parts.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class ContainerFile {\n /** The name of this module */\n private static readonly MODULE: string = \"ContainerFile\";\n\n /** The name of the file */\n private _fileName: string;\n /** The length of the file */\n private _fileLength: ALong;\n /** The format */\n private _format: string;\n /** The parts in the file */\n private _parts: AList<ContainerFilePart>;\n\n /**\n * Create a new container file.\n * @param fileName the name of the file.\n * @param fileLength the length of the file.\n * @param format the format.\n * @param parts the parts in the file.\n */\n public constructor(fileName: string, fileLength: ALong, format: string, parts: AList<ContainerFilePart>) {\n this._fileName = fileName;\n this._fileLength = fileLength;\n this._format = format;\n this._parts = parts;\n }\n\n /**\n * Close the container file.\n * @param closeFileAccess close all file access?\n */\n public close(closeFileAccess: boolean): void {\n if (closeFileAccess) for (let i: number = 0; i < this._parts.size(); i++) this._parts.get(i).getFileAccess().close();\n this._parts.clear();\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the length of the file.\n * @return the length of the file.\n */\n public getFileLength(): ALong {\n return this._fileLength;\n }\n\n /**\n * Get the format.\n * @return the format.\n */\n public getFormat(): string {\n return this._format;\n }\n\n /**\n * Get the number of parts.\n * @return the number of parts.\n */\n public getPartCount(): int32 {\n return this._parts.size();\n }\n\n /**\n * Get the list of parts.\n * @return the list of parts.\n */\n public getParts(): AList<ContainerFilePart> {\n return this._parts;\n }\n\n /**\n * Get a part.\n * @param name the name of the part.\n * @return the part (null if not found).\n */\n public getPart(name: string): ContainerFilePart {\n /* Check all parts */\n for (let i: number = 0; i < this._parts.size(); i++) {\n /* Check the next part */\n let part: ContainerFilePart = this._parts.get(i);\n if (Strings.equals(part.getName(), name)) return part;\n }\n /* Not found */\n return null;\n }\n\n /**\n * Check if the magic marker is found.\n * @param input the input stream.\n * @param format the 4-character identifier of the format.\n * @return true if found, false if not.\n */\n private static checkMarker(input: InStream, format: string): boolean {\n let m0: int32 = LittleEndian.readStreamByte(input);\n let m1: int32 = LittleEndian.readStreamByte(input);\n let m2: int32 = LittleEndian.readStreamByte(input);\n let m3: int32 = LittleEndian.readStreamByte(input);\n if (m0 != Strings.getCharAt(format, 0)) return false;\n if (m1 != Strings.getCharAt(format, 1)) return false;\n if (m2 != Strings.getCharAt(format, 2)) return false;\n if (m3 != Strings.getCharAt(format, 3)) return false;\n return true;\n }\n\n /**\n * Read the parts of a container file.\n * @param containerFileName the name of the container file.\n * @param format the 4-character identifier of the format.\n * @return the container file.\n */\n public static async read(fileStorage: FileStorage, containerFileName: string, format: string): Promise<ContainerFile> {\n /* Existing file? */\n Message.print(ContainerFile.MODULE, \"Reading container file '\" + containerFileName + \"'\");\n let fileLength: ALong = await fileStorage.getFileLength(containerFileName);\n if (fileLength.isNegative()) {\n /* Abort */\n Message.printWarning(ContainerFile.MODULE, \"File not found\");\n return null;\n }\n /* Too short? */\n if (fileLength.subInt(16).isNegative()) {\n /* Fail */\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (too short)\");\n }\n /* Read the file header */\n let headerSize: int32 = 60 * 1024;\n if (fileLength.subInt(headerSize).isNegative()) headerSize = fileLength.toInt();\n let header: ABuffer = await fileStorage.readFilePart(containerFileName, ALong.ZERO, headerSize);\n let headerInput: ABufferInStream = new ABufferInStream(header, 0, header.size());\n /* Check the marker */\n if (ContainerFile.checkMarker(headerInput, format) == false) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (header marker)\");\n }\n /* Check the version */\n let version: int32 = LittleEndian.readStreamByte(headerInput);\n if (version != 2) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (version \" + version + \")\");\n }\n /* Reserved */\n let r1: int32 = LittleEndian.readStreamByte(headerInput);\n let r2: int32 = LittleEndian.readStreamByte(headerInput);\n let r3: int32 = LittleEndian.readStreamByte(headerInput);\n /* Get the file count */\n let fileCount: int32 = LittleEndian.readStreamInt(headerInput);\n if (fileCount < 0) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, ContainerFile.MODULE + \" : Invalid container file '\" + containerFileName + \"' (file count \" + fileCount + \")\");\n }\n /* Define the file access */\n let fileAccess: FileAccess = new FileAccess(fileStorage, containerFileName, fileLength);\n /* Read the parts */\n let maxExtent: ALong = ALong.ZERO;\n let parts: AList<ContainerFilePart> = new AList<ContainerFilePart>();\n for (let i: number = 0; i < fileCount; i++) {\n /* Read the next file */\n let partOffset: ALong = LittleEndian.readStreamLong(headerInput);\n let partLength: ALong = LittleEndian.readStreamLong(headerInput);\n let partName: string = LittleEndian.readStreamString(headerInput);\n /* Add the part */\n parts.add(new ContainerFilePart(partName, fileAccess, partOffset, partLength));\n Message.print(ContainerFile.MODULE, \"Found part '\" + partName + \"' offset \" + partOffset.toDouble() + \" size \" + partLength.toDouble());\n /* Update the maximum extent */\n let partExtent: ALong = partOffset.add(partLength);\n maxExtent = ALong.max(maxExtent, partExtent);\n }\n /* Done */\n headerInput.close();\n /* Return the container */\n Message.print(ContainerFile.MODULE, \"Found \" + parts.size() + \" parts, header size \" + headerInput.getPosition());\n Message.print(ContainerFile.MODULE, \"File size is \" + fileLength.toDouble() + \", max part extent is \" + maxExtent.toDouble());\n return new ContainerFile(containerFileName, fileLength, format, parts);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContainerFile.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/ContainerFile.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,sEAAmE;AACnE,4DAAyD;AACzD,wEAAqE;AAErE,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,6DAA0D;AAE1D,2DAAwD;AACxD,6CAA0C;AAE1C;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,aAAa;IACtB,8BAA8B;aACN,WAAM,GAAW,eAAe,CAAC;IAWzD;;;;;;OAMG;IACH,YAAmB,QAAgB,EAAE,UAAiB,EAAE,MAAc,EAAE,KAA+B;QACnG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAwB;QACjC,IAAI,eAAe;YAAE,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,C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0B;QAC1B,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,sBAAsB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QAClH,iBAAO,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,uBAAuB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9H,OAAO,IAAI,aAAa,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;;AAtLL,sCAuLC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\n\nimport { ABuffer } from \"../../../system/buffer/ABuffer\";\nimport { LittleEndian } from \"../../../system/buffer/LittleEndian\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ABufferInStream } from \"../../../system/io/ABufferInStream\";\nimport { InStream } from \"../../../system/io/InStream\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { ASystem } from \"../../../system/runtime/ASystem\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { FileAccess } from \"./FileAccess\";\n\n/**\n * Class ContainerFile defines a single file that contains multiple internal parts.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class ContainerFile {\n /** The name of this module */\n private static readonly MODULE: string = \"ContainerFile\";\n\n /** The name of the file */\n private _fileName: string;\n /** The length of the file */\n private _fileLength: ALong;\n /** The format */\n private _format: string;\n /** The parts in the file */\n private _parts: AList<ContainerFilePart>;\n\n /**\n * Create a new container file.\n * @param fileName the name of the file.\n * @param fileLength the length of the file.\n * @param format the format.\n * @param parts the parts in the file.\n */\n public constructor(fileName: string, fileLength: ALong, format: string, parts: AList<ContainerFilePart>) {\n this._fileName = fileName;\n this._fileLength = fileLength;\n this._format = format;\n this._parts = parts;\n }\n\n /**\n * Close the container file.\n * @param closeFileAccess close all file access?\n */\n public close(closeFileAccess: boolean): void {\n if (closeFileAccess) for (let i: number = 0; i < this._parts.size(); i++) this._parts.get(i).getFileAccess().close();\n this._parts.clear();\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the length of the file.\n * @return the length of the file.\n */\n public getFileLength(): ALong {\n return this._fileLength;\n }\n\n /**\n * Get the format.\n * @return the format.\n */\n public getFormat(): string {\n return this._format;\n }\n\n /**\n * Get the number of parts.\n * @return the number of parts.\n */\n public getPartCount(): int32 {\n return this._parts.size();\n }\n\n /**\n * Get the list of parts.\n * @return the list of parts.\n */\n public getParts(): AList<ContainerFilePart> {\n return this._parts;\n }\n\n /**\n * Get a part.\n * @param name the name of the part.\n * @return the part (null if not found).\n */\n public getPart(name: string): ContainerFilePart {\n /* Check all parts */\n for (let i: number = 0; i < this._parts.size(); i++) {\n /* Check the next part */\n let part: ContainerFilePart = this._parts.get(i);\n if (Strings.equals(part.getName(), name)) return part;\n }\n /* Not found */\n return null;\n }\n\n /**\n * Check if the magic marker is found.\n * @param input the input stream.\n * @param format the 4-character identifier of the format.\n * @return true if found, false if not.\n */\n private static checkMarker(input: InStream, format: string): boolean {\n let m0: int32 = LittleEndian.readStreamByte(input);\n let m1: int32 = LittleEndian.readStreamByte(input);\n let m2: int32 = LittleEndian.readStreamByte(input);\n let m3: int32 = LittleEndian.readStreamByte(input);\n if (m0 != Strings.getCharAt(format, 0)) return false;\n if (m1 != Strings.getCharAt(format, 1)) return false;\n if (m2 != Strings.getCharAt(format, 2)) return false;\n if (m3 != Strings.getCharAt(format, 3)) return false;\n return true;\n }\n\n /**\n * Read the parts of a container file.\n * @param containerFileName the name of the container file.\n * @param format the 4-character identifier of the format.\n * @return the container file.\n */\n public static async read(fileStorage: FileStorage, containerFileName: string, format: string): Promise<ContainerFile> {\n /* Existing file? */\n Message.print(ContainerFile.MODULE, \"Reading container file '\" + containerFileName + \"'\");\n let fileLength: ALong = await fileStorage.getFileLength(containerFileName);\n if (fileLength.isNegative()) {\n /* Abort */\n Message.printWarning(ContainerFile.MODULE, \"File not found\");\n return null;\n }\n /* Too short? */\n if (fileLength.subInt(16).isNegative()) {\n /* Fail */\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (too short)\");\n }\n /* Read the file header */\n let headerSize: int32 = 60 * 1024;\n if (fileLength.subInt(headerSize).isNegative()) headerSize = fileLength.toInt();\n let header: ABuffer = await fileStorage.readFilePart(containerFileName, ALong.ZERO, headerSize);\n let headerInput: ABufferInStream = new ABufferInStream(header, 0, header.size());\n /* Check the marker */\n if (ContainerFile.checkMarker(headerInput, format) == false) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (header marker)\");\n }\n /* Check the version */\n let version: int32 = LittleEndian.readStreamByte(headerInput);\n if (version != 2) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, \"Invalid container file '\" + containerFileName + \"' (version \" + version + \")\");\n }\n /* Reserved */\n let r1: int32 = LittleEndian.readStreamByte(headerInput);\n let r2: int32 = LittleEndian.readStreamByte(headerInput);\n let r3: int32 = LittleEndian.readStreamByte(headerInput);\n /* Get the file count */\n let fileCount: int32 = LittleEndian.readStreamInt(headerInput);\n if (fileCount < 0) {\n /* Fail */\n headerInput.close();\n ASystem.assert0(false, ContainerFile.MODULE + \" : Invalid container file '\" + containerFileName + \"' (file count \" + fileCount + \")\");\n }\n /* Define the file access */\n let fileAccess: FileAccess = new FileAccess(fileStorage, containerFileName, fileLength);\n /* Read the parts */\n let maxExtent: ALong = ALong.ZERO;\n let parts: AList<ContainerFilePart> = new AList<ContainerFilePart>();\n for (let i: number = 0; i < fileCount; i++) {\n /* Read the next file */\n let partOffset: ALong = LittleEndian.readStreamLong(headerInput);\n let partLength: ALong = LittleEndian.readStreamLong(headerInput);\n let partName: string = LittleEndian.readStreamString(headerInput);\n /* Add the part */\n parts.add(new ContainerFilePart(partName, fileAccess, partOffset, partLength));\n Message.print(ContainerFile.MODULE, \"Found part '\" + partName + \"' offset \" + partOffset.toDouble() + \" size \" + partLength.toDouble());\n /* Update the maximum extent */\n let partExtent: ALong = partOffset.add(partLength);\n maxExtent = ALong.max(maxExtent, partExtent);\n }\n /* Done */\n headerInput.close();\n /* Return the container */\n Message.print(ContainerFile.MODULE, \"Found \" + parts.size() + \" parts, header size \" + headerInput.getPosition());\n Message.print(ContainerFile.MODULE, \"File size is \" + fileLength.toDouble() + \", max part extent is \" + maxExtent.toDouble());\n return new ContainerFile(containerFileName, fileLength, format, parts);\n }\n}\n"]}
|
|
@@ -24,6 +24,8 @@ const GeometryReader_1 = require("./GeometryReader");
|
|
|
24
24
|
*/
|
|
25
25
|
/** @internal */
|
|
26
26
|
class FileReader {
|
|
27
|
+
/** The name of this module */
|
|
28
|
+
static { this.MODULE = "FileReader"; }
|
|
27
29
|
/**
|
|
28
30
|
* Create a new reader.
|
|
29
31
|
* @param fileName the name of the file.
|
|
@@ -244,6 +246,4 @@ class FileReader {
|
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
248
|
exports.FileReader = FileReader;
|
|
247
|
-
/** The name of this module */
|
|
248
|
-
FileReader.MODULE = "FileReader";
|
|
249
249
|
//# sourceMappingURL=FileReader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAE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a;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,KAAY;QAClC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,KAAY;QACjC,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,yBAAyB;QAC5B,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,mBAAmB;QACtB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,IAAI,IAAI,GAA0B,IAAI,KAAK,CAAiB,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC3F,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QACnH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,aAAqB;QAC5C,iCAAiC;QACjC,KAAK,IAAI,eAAe,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACjD,IAAI,iBAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC;gBAAE,OAAO,eAAe,CAAC;QAClH,CAAC;QACD,eAAe;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;;AArPL,gCAsPC;AArPG,8BAA8B;AACN,iBAAM,GAAW,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { ContainerFile } from \"./ContainerFile\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { DirectoryReader } from \"./DirectoryReader\";\nimport { DirectoryRecord } from \"./DirectoryRecord\";\nimport { EmbeddedAttributeReader } from \"./EmbeddedAttributeReader\";\nimport { FileRecord } from \"./FileRecord\";\nimport { GeometryReader } from \"./GeometryReader\";\n\n/**\n * Class FileReader reads OPC files.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class FileReader {\n /** The name of this module */\n private static readonly MODULE: string = \"FileReader\";\n\n /** The file storage */\n private _fileStorage: FileStorage;\n /** The name of the file */\n private _fileName: string;\n /** The container */\n private _container: ContainerFile;\n\n /** The file record */\n private _fileRecord: FileRecord;\n /** The directory readers (1 per level) */\n private _directoryReaders: Array<DirectoryReader>;\n /** The geometry readers (1 per level) */\n private _geometryReaders: Array<GeometryReader>;\n /** The attribute readers */\n private _attributeReaders: Array<AttributeReader>;\n\n /**\n * Create a new reader.\n * @param fileName the name of the file.\n * @param container the container file.\n * @param fileRecord the file record.\n */\n private constructor(fileStorage: FileStorage, fileName: string, container: ContainerFile, fileRecord: FileRecord) {\n /* Store the parameters */\n this._fileStorage = fileStorage;\n this._fileName = fileName;\n this._container = container;\n this._fileRecord = fileRecord;\n /* Clear */\n this._directoryReaders = null;\n this._geometryReaders = null;\n this._attributeReaders = null;\n }\n\n /**\n * Open a file.\n * @param fileName the name of the file.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<FileReader> {\n /* Open the container file */\n let container: ContainerFile = await ContainerFile.read(fileStorage, fileName, \"OPC3\");\n /* Read the file record */\n let filePart: ContainerFilePart = container.getPart(\"file\");\n let fileRecord: FileRecord = await FileRecord.readNew(fileStorage, filePart.getFileAccess().getFileName(), filePart.getOffset(), filePart.getSize());\n /* Create a reader */\n let fileReader: FileReader = new FileReader(fileStorage, fileName, container, fileRecord);\n /* Open the reader */\n fileReader = await fileReader.open(lazyLoading);\n /* Return the reader */\n return fileReader;\n }\n\n /**\n * Open the reader.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n private async open(lazyLoading: boolean): Promise<FileReader> {\n /* Log */\n Message.print(FileReader.MODULE, \"Opening OPC with \" + this._fileRecord.getLevelCount() + \" levels (crs \" + this._fileRecord.getCRS() + \", lazy? \" + lazyLoading + \")\");\n Message.print(FileReader.MODULE, \"Container has \" + this._container.getPartCount() + \" parts\");\n // for(ContainerFilePart part: this._container.getParts()) Message.print(MODULE,\"Part '\"+part.getName()+\"'\");\n /* Define the content we are going to need (dozens of parts) */\n Message.print(FileReader.MODULE, \"Loading \" + this._fileRecord.getLevelCount() + \" levels and \" + this._fileRecord.getAttributeCount() + \" attributes\");\n let fileContents: ContentLoader = new ContentLoader(this._fileStorage, this._fileName);\n /* Only read the block list for the top levels? (to save memory) */\n let prefetchLevelIndex: int32 = (this._fileRecord.getLevelCount() - 6);\n if (prefetchLevelIndex < 0) prefetchLevelIndex = 0;\n if (lazyLoading == false) prefetchLevelIndex = 0;\n Message.print(FileReader.MODULE, \"Prefetching from level \" + prefetchLevelIndex);\n /* Read the directory */\n this._directoryReaders = new Array<DirectoryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let directoryReader: DirectoryReader = new DirectoryReader(this, i);\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n directoryReader.loadData(readBlockList, fileContents);\n this._directoryReaders[i] = directoryReader;\n }\n /* Read the geometry */\n this._geometryReaders = new Array<GeometryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n let geometryReader: GeometryReader = new GeometryReader(this, i);\n geometryReader.loadData(fileContents);\n this._geometryReaders[i] = geometryReader;\n }\n /* Read the attributes */\n this._attributeReaders = new Array<AttributeReader>(this._fileRecord.getAttributeCount());\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = new EmbeddedAttributeReader(this._container, i, this._fileRecord.getLevelCount());\n attributeReader.loadData(fileContents);\n this._attributeReaders[i] = attributeReader;\n }\n /* Load all data needed for the structures */\n fileContents = await fileContents.load();\n /* Read the directory */\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n this._directoryReaders[i].loadData(readBlockList, fileContents);\n }\n /* Read the geometry */\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n this._geometryReaders[i].loadData(fileContents);\n }\n /* Read the attributes */\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = <EmbeddedAttributeReader><unknown>(this._attributeReaders[i]);\n attributeReader.loadData(fileContents);\n }\n /* Log file info */\n Message.print(FileReader.MODULE, \"OPC bounds are \" + this._geometryReaders[0].getGeometryRecord().getBounds());\n let tileGridSize0: Coordinate = this._geometryReaders[0].getGeometryRecord().getTileGrid().size;\n Message.print(FileReader.MODULE, \"OPC level0 tile size is (\" + tileGridSize0.x + \",\" + tileGridSize0.y + \",\" + tileGridSize0.z + \")\");\n let totalPointCount: ALong = ALong.ZERO;\n let totalTileCount: int32 = 0;\n let totalBlockCount: int32 = 0;\n for (let i: number = 0; i < this._fileRecord.getLevelCount(); i++) {\n let directoryRecord: DirectoryRecord = this._directoryReaders[i].getDirectoryRecord();\n Message.print(FileReader.MODULE, \"Level \" + i + \" has \" + directoryRecord.getPointCount() + \" points, \" + directoryRecord.getTileCount() + \" tiles, \" + directoryRecord.getBlockCount() + \" blocks\");\n totalPointCount = totalPointCount.add(directoryRecord.getPointCount());\n totalTileCount += directoryRecord.getTileCount();\n totalBlockCount += directoryRecord.getBlockCount();\n }\n Message.print(FileReader.MODULE, \"Pointcloud has \" + totalPointCount + \" points, \" + totalTileCount + \" tiles, \" + totalBlockCount + \" blocks\");\n /* Get the attributes */\n Message.print(FileReader.MODULE, \"Pointcloud has \" + this._attributeReaders.length + \" static attributes:\");\n for (let i: number = 0; i < this._attributeReaders.length; i++) {\n Message.print(FileReader.MODULE, \"Attribute \" + i + \": \" + this._attributeReaders[i].getAttribute());\n Message.print(FileReader.MODULE, \" min: \" + this._attributeReaders[i].getMinimumValue());\n Message.print(FileReader.MODULE, \" max: \" + this._attributeReaders[i].getMaximumValue());\n }\n /* Return the reader */\n return this;\n }\n\n /**\n * Close the file.\n */\n public close(): void {\n for (let attributeReader of this._attributeReaders) attributeReader.close();\n if (this._container != null) this._container.close(true);\n this._container = null;\n }\n\n /**\n * Get the storage of the file.\n * @return the storage of the file.\n */\n public getFileStorage(): FileStorage {\n return this._fileStorage;\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the container file.\n * @return the container file.\n */\n public getContainer(): ContainerFile {\n return this._container;\n }\n\n /**\n * Get the file record.\n * @return the file record.\n */\n public getFileRecord(): FileRecord {\n return this._fileRecord;\n }\n\n /**\n * Get the number of resolution levels.\n * @return the number of resolution levels.\n */\n public getLevelCount(): int32 {\n return this._fileRecord.getLevelCount();\n }\n\n /**\n * Get a directory reader.\n * @param level the index of the level.\n * @return the directory reader.\n */\n public getDirectoryReader(level: int32): DirectoryReader {\n return this._directoryReaders[level];\n }\n\n /**\n * Get a geometry reader.\n * @param level the index of the level.\n * @return the geometry reader.\n */\n public getGeometryReader(level: int32): GeometryReader {\n return this._geometryReaders[level];\n }\n\n /**\n * Get the static attribute readers.\n * @return the static attribute readers.\n */\n public getStaticAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attribute readers.\n * @return the attribute readers.\n */\n public getAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attributes.\n * @return the attributes.\n */\n public getAttributes(): Array<PointAttribute> {\n let list: Array<PointAttribute> = new Array<PointAttribute>(this._attributeReaders.length);\n for (let i: number = 0; i < this._attributeReaders.length; i++) list[i] = this._attributeReaders[i].getAttribute();\n return list;\n }\n\n /**\n * Find an attribute reader.\n * @param attributeName the name of the attribute.\n * @return the attribute reader (null if not found).\n */\n public findAttributeReader(attributeName: string): AttributeReader {\n /* Check the static attributes */\n for (let attributeReader of this._attributeReaders) {\n if (Strings.equalsIgnoreCase(attributeReader.getAttribute().getName(), attributeName)) return attributeReader;\n }\n /* Not found */\n return null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/FileReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,yEAAsE;AAItE,mDAAgD;AAEhD,uDAAoD;AAEpD,uEAAoE;AACpE,6CAA0C;AAC1C,qDAAkD;AAElD;;;;GAIG;AACH,gBAAgB;AAChB,MAAa,UAAU;IACnB,8BAA8B;aACN,WAAM,GAAW,YAAY,CAAC;IAkBtD;;;;;OAKG;IACH,YAAoB,WAAwB,EAAE,QAAgB,EAAE,SAAwB,EAAE,UAAsB;QAC5G,0BAA0B;QAC1B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC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AiB,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,mBAAmB;QACtB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,aAAa;QAChB,IAAI,IAAI,GAA0B,IAAI,KAAK,CAAiB,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC3F,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QACnH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,aAAqB;QAC5C,iCAAiC;QACjC,KAAK,IAAI,eAAe,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACjD,IAAI,iBAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC;gBAAE,OAAO,eAAe,CAAC;QAClH,CAAC;QACD,eAAe;QACf,OAAO,IAAI,CAAC;IAChB,CAAC;;AArPL,gCAsPC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module OrbitGT\n */\n\n//package orbitgt.pointcloud.format.opc;\n\ntype int8 = number;\ntype int16 = number;\ntype int32 = number;\ntype float32 = number;\ntype float64 = number;\n\nimport { Coordinate } from \"../../../spatial/geom/Coordinate\";\nimport { AList } from \"../../../system/collection/AList\";\nimport { ALong } from \"../../../system/runtime/ALong\";\nimport { Message } from \"../../../system/runtime/Message\";\nimport { Strings } from \"../../../system/runtime/Strings\";\nimport { ContentLoader } from \"../../../system/storage/ContentLoader\";\nimport { FileStorage } from \"../../../system/storage/FileStorage\";\nimport { PointAttribute } from \"../../model/PointAttribute\";\nimport { AttributeReader } from \"./AttributeReader\";\nimport { ContainerFile } from \"./ContainerFile\";\nimport { ContainerFilePart } from \"./ContainerFilePart\";\nimport { DirectoryReader } from \"./DirectoryReader\";\nimport { DirectoryRecord } from \"./DirectoryRecord\";\nimport { EmbeddedAttributeReader } from \"./EmbeddedAttributeReader\";\nimport { FileRecord } from \"./FileRecord\";\nimport { GeometryReader } from \"./GeometryReader\";\n\n/**\n * Class FileReader reads OPC files.\n *\n * @version 1.0 January 2014\n */\n/** @internal */\nexport class FileReader {\n /** The name of this module */\n private static readonly MODULE: string = \"FileReader\";\n\n /** The file storage */\n private _fileStorage: FileStorage;\n /** The name of the file */\n private _fileName: string;\n /** The container */\n private _container: ContainerFile;\n\n /** The file record */\n private _fileRecord: FileRecord;\n /** The directory readers (1 per level) */\n private _directoryReaders: Array<DirectoryReader>;\n /** The geometry readers (1 per level) */\n private _geometryReaders: Array<GeometryReader>;\n /** The attribute readers */\n private _attributeReaders: Array<AttributeReader>;\n\n /**\n * Create a new reader.\n * @param fileName the name of the file.\n * @param container the container file.\n * @param fileRecord the file record.\n */\n private constructor(fileStorage: FileStorage, fileName: string, container: ContainerFile, fileRecord: FileRecord) {\n /* Store the parameters */\n this._fileStorage = fileStorage;\n this._fileName = fileName;\n this._container = container;\n this._fileRecord = fileRecord;\n /* Clear */\n this._directoryReaders = null;\n this._geometryReaders = null;\n this._attributeReaders = null;\n }\n\n /**\n * Open a file.\n * @param fileName the name of the file.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n public static async openFile(fileStorage: FileStorage, fileName: string, lazyLoading: boolean): Promise<FileReader> {\n /* Open the container file */\n let container: ContainerFile = await ContainerFile.read(fileStorage, fileName, \"OPC3\");\n /* Read the file record */\n let filePart: ContainerFilePart = container.getPart(\"file\");\n let fileRecord: FileRecord = await FileRecord.readNew(fileStorage, filePart.getFileAccess().getFileName(), filePart.getOffset(), filePart.getSize());\n /* Create a reader */\n let fileReader: FileReader = new FileReader(fileStorage, fileName, container, fileRecord);\n /* Open the reader */\n fileReader = await fileReader.open(lazyLoading);\n /* Return the reader */\n return fileReader;\n }\n\n /**\n * Open the reader.\n * @param lazyLoading avoid early loading to keep a low memory profile?\n * @return the reader.\n */\n private async open(lazyLoading: boolean): Promise<FileReader> {\n /* Log */\n Message.print(FileReader.MODULE, \"Opening OPC with \" + this._fileRecord.getLevelCount() + \" levels (crs \" + this._fileRecord.getCRS() + \", lazy? \" + lazyLoading + \")\");\n Message.print(FileReader.MODULE, \"Container has \" + this._container.getPartCount() + \" parts\");\n // for(ContainerFilePart part: this._container.getParts()) Message.print(MODULE,\"Part '\"+part.getName()+\"'\");\n /* Define the content we are going to need (dozens of parts) */\n Message.print(FileReader.MODULE, \"Loading \" + this._fileRecord.getLevelCount() + \" levels and \" + this._fileRecord.getAttributeCount() + \" attributes\");\n let fileContents: ContentLoader = new ContentLoader(this._fileStorage, this._fileName);\n /* Only read the block list for the top levels? (to save memory) */\n let prefetchLevelIndex: int32 = (this._fileRecord.getLevelCount() - 6);\n if (prefetchLevelIndex < 0) prefetchLevelIndex = 0;\n if (lazyLoading == false) prefetchLevelIndex = 0;\n Message.print(FileReader.MODULE, \"Prefetching from level \" + prefetchLevelIndex);\n /* Read the directory */\n this._directoryReaders = new Array<DirectoryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let directoryReader: DirectoryReader = new DirectoryReader(this, i);\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n directoryReader.loadData(readBlockList, fileContents);\n this._directoryReaders[i] = directoryReader;\n }\n /* Read the geometry */\n this._geometryReaders = new Array<GeometryReader>(this._fileRecord.getLevelCount());\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n let geometryReader: GeometryReader = new GeometryReader(this, i);\n geometryReader.loadData(fileContents);\n this._geometryReaders[i] = geometryReader;\n }\n /* Read the attributes */\n this._attributeReaders = new Array<AttributeReader>(this._fileRecord.getAttributeCount());\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = new EmbeddedAttributeReader(this._container, i, this._fileRecord.getLevelCount());\n attributeReader.loadData(fileContents);\n this._attributeReaders[i] = attributeReader;\n }\n /* Load all data needed for the structures */\n fileContents = await fileContents.load();\n /* Read the directory */\n for (let i: number = 0; i < this._directoryReaders.length; i++) {\n let readBlockList: boolean = (i >= prefetchLevelIndex);\n this._directoryReaders[i].loadData(readBlockList, fileContents);\n }\n /* Read the geometry */\n for (let i: number = 0; i < this._geometryReaders.length; i++) {\n this._geometryReaders[i].loadData(fileContents);\n }\n /* Read the attributes */\n for (let i: number = 0; i < this._fileRecord.getAttributeCount(); i++) {\n let attributeReader: EmbeddedAttributeReader = <EmbeddedAttributeReader><unknown>(this._attributeReaders[i]);\n attributeReader.loadData(fileContents);\n }\n /* Log file info */\n Message.print(FileReader.MODULE, \"OPC bounds are \" + this._geometryReaders[0].getGeometryRecord().getBounds());\n let tileGridSize0: Coordinate = this._geometryReaders[0].getGeometryRecord().getTileGrid().size;\n Message.print(FileReader.MODULE, \"OPC level0 tile size is (\" + tileGridSize0.x + \",\" + tileGridSize0.y + \",\" + tileGridSize0.z + \")\");\n let totalPointCount: ALong = ALong.ZERO;\n let totalTileCount: int32 = 0;\n let totalBlockCount: int32 = 0;\n for (let i: number = 0; i < this._fileRecord.getLevelCount(); i++) {\n let directoryRecord: DirectoryRecord = this._directoryReaders[i].getDirectoryRecord();\n Message.print(FileReader.MODULE, \"Level \" + i + \" has \" + directoryRecord.getPointCount() + \" points, \" + directoryRecord.getTileCount() + \" tiles, \" + directoryRecord.getBlockCount() + \" blocks\");\n totalPointCount = totalPointCount.add(directoryRecord.getPointCount());\n totalTileCount += directoryRecord.getTileCount();\n totalBlockCount += directoryRecord.getBlockCount();\n }\n Message.print(FileReader.MODULE, \"Pointcloud has \" + totalPointCount + \" points, \" + totalTileCount + \" tiles, \" + totalBlockCount + \" blocks\");\n /* Get the attributes */\n Message.print(FileReader.MODULE, \"Pointcloud has \" + this._attributeReaders.length + \" static attributes:\");\n for (let i: number = 0; i < this._attributeReaders.length; i++) {\n Message.print(FileReader.MODULE, \"Attribute \" + i + \": \" + this._attributeReaders[i].getAttribute());\n Message.print(FileReader.MODULE, \" min: \" + this._attributeReaders[i].getMinimumValue());\n Message.print(FileReader.MODULE, \" max: \" + this._attributeReaders[i].getMaximumValue());\n }\n /* Return the reader */\n return this;\n }\n\n /**\n * Close the file.\n */\n public close(): void {\n for (let attributeReader of this._attributeReaders) attributeReader.close();\n if (this._container != null) this._container.close(true);\n this._container = null;\n }\n\n /**\n * Get the storage of the file.\n * @return the storage of the file.\n */\n public getFileStorage(): FileStorage {\n return this._fileStorage;\n }\n\n /**\n * Get the name of the file.\n * @return the name of the file.\n */\n public getFileName(): string {\n return this._fileName;\n }\n\n /**\n * Get the container file.\n * @return the container file.\n */\n public getContainer(): ContainerFile {\n return this._container;\n }\n\n /**\n * Get the file record.\n * @return the file record.\n */\n public getFileRecord(): FileRecord {\n return this._fileRecord;\n }\n\n /**\n * Get the number of resolution levels.\n * @return the number of resolution levels.\n */\n public getLevelCount(): int32 {\n return this._fileRecord.getLevelCount();\n }\n\n /**\n * Get a directory reader.\n * @param level the index of the level.\n * @return the directory reader.\n */\n public getDirectoryReader(level: int32): DirectoryReader {\n return this._directoryReaders[level];\n }\n\n /**\n * Get a geometry reader.\n * @param level the index of the level.\n * @return the geometry reader.\n */\n public getGeometryReader(level: int32): GeometryReader {\n return this._geometryReaders[level];\n }\n\n /**\n * Get the static attribute readers.\n * @return the static attribute readers.\n */\n public getStaticAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attribute readers.\n * @return the attribute readers.\n */\n public getAttributeReaders(): Array<AttributeReader> {\n return this._attributeReaders;\n }\n\n /**\n * Get the attributes.\n * @return the attributes.\n */\n public getAttributes(): Array<PointAttribute> {\n let list: Array<PointAttribute> = new Array<PointAttribute>(this._attributeReaders.length);\n for (let i: number = 0; i < this._attributeReaders.length; i++) list[i] = this._attributeReaders[i].getAttribute();\n return list;\n }\n\n /**\n * Find an attribute reader.\n * @param attributeName the name of the attribute.\n * @return the attribute reader (null if not found).\n */\n public findAttributeReader(attributeName: string): AttributeReader {\n /* Check the static attributes */\n for (let attributeReader of this._attributeReaders) {\n if (Strings.equalsIgnoreCase(attributeReader.getAttribute().getName(), attributeName)) return attributeReader;\n }\n /* Not found */\n return null;\n }\n}\n"]}
|
|
@@ -20,6 +20,12 @@ const GeometryRecord_1 = require("./GeometryRecord");
|
|
|
20
20
|
*/
|
|
21
21
|
/** @internal */
|
|
22
22
|
class GeometryReader {
|
|
23
|
+
/** The size of the high-resolution record in the file */
|
|
24
|
+
static { this.RECORD_SIZE_HR = 6; }
|
|
25
|
+
/** The size of the low-resolution record in the file */
|
|
26
|
+
static { this.RECORD_SIZE_LR = 3; }
|
|
27
|
+
/** The number of bins (subdivisions) in a multi-resolution tile */
|
|
28
|
+
static { this.MR_BIN_COUNT = 64; }
|
|
23
29
|
/**
|
|
24
30
|
* Create a new reader.
|
|
25
31
|
* @param opcReader the file reader.
|
|
@@ -155,10 +161,4 @@ class GeometryReader {
|
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
exports.GeometryReader = GeometryReader;
|
|
158
|
-
/** The size of the high-resolution record in the file */
|
|
159
|
-
GeometryReader.RECORD_SIZE_HR = 6;
|
|
160
|
-
/** The size of the low-resolution record in the file */
|
|
161
|
-
GeometryReader.RECORD_SIZE_LR = 3;
|
|
162
|
-
/** The number of bins (subdivisions) in a multi-resolution tile */
|
|
163
|
-
GeometryReader.MR_BIN_COUNT = 64;
|
|
164
164
|
//# sourceMappingURL=GeometryReader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryReader.js","sourceRoot":"","sources":["../../../../../src/pointcloud/format/opc/GeometryReader.ts"],"names":[],"mappings":";AA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C,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAClG,CAAC;IACL,CAAC;;AA7JL,wCA8JC;AA7JG,yDAAyD;AAClC,6BAAc,GAAU,CAAC,CAAC;AACjD,wDAAwD;AACjC,6BAAc,GAAU,CAAC,CAAC;AAEjD,mEAAmE;AAC5C,2BAAY,GAAU,EAAE,CAAC","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;aAClC,mBAAc,GAAU,CAAC,CAAC;IACjD,wDAAwD;aACjC,mBAAc,GAAU,CAAC,CAAC;IAEjD,mEAAmE;aAC5C,iBAAY,GAAU,EAAE,CAAC;IAYhD;;;;OAIG;IACH,YAAmB,UAAsB,EAAE,KAAY;QACnD,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,2BAA2B;QAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,K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5C,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":["/*---------------------------------------------------------------------------------------------\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"]}
|
|
@@ -19,6 +19,8 @@ const TileIndex_1 = require("../../model/TileIndex");
|
|
|
19
19
|
*/
|
|
20
20
|
/** @internal */
|
|
21
21
|
class TileRecord {
|
|
22
|
+
/** The size of the record in the file */
|
|
23
|
+
static { this.RECORD_SIZE = 16; }
|
|
22
24
|
/**
|
|
23
25
|
* No instances.
|
|
24
26
|
*/
|
|
@@ -157,6 +159,4 @@ class TileRecord {
|
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
exports.TileRecord = TileRecord;
|
|
160
|
-
/** The size of the record in the file */
|
|
161
|
-
TileRecord.RECORD_SIZE = 16;
|
|
162
162
|
//# sourceMappingURL=TileRecord.js.map
|
|
@@ -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;IAInB;;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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vIG,yCAAyC;AAClB,sBAAW,GAAU,EAAE,CAAC","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;aAClB,gBAAW,GAAU,EAAE,CAAC;IAE/C;;OAEG;IACH;IACA,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,IAAe,EAAE,KAAY,EAAE,KAAY,EAAE,KAAY;QAC1E,O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,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"]}
|
|
@@ -13,6 +13,22 @@ exports.AttributeTypes = void 0;
|
|
|
13
13
|
*/
|
|
14
14
|
/** @internal */
|
|
15
15
|
class AttributeTypes {
|
|
16
|
+
/** The 1-bit boolean type */
|
|
17
|
+
static { this.TYPE_BOOLEAN = 1; }
|
|
18
|
+
/** The 1-byte integer type */
|
|
19
|
+
static { this.TYPE_INT1 = 2; }
|
|
20
|
+
/** The 2-byte integer type */
|
|
21
|
+
static { this.TYPE_INT2 = 3; }
|
|
22
|
+
/** The 4-byte integer type */
|
|
23
|
+
static { this.TYPE_INT4 = 4; }
|
|
24
|
+
/** The 8-byte integer type */
|
|
25
|
+
static { this.TYPE_INT8 = 5; }
|
|
26
|
+
/** The 4-byte float type */
|
|
27
|
+
static { this.TYPE_FLOAT4 = 6; }
|
|
28
|
+
/** The 8-byte float type */
|
|
29
|
+
static { this.TYPE_FLOAT8 = 7; }
|
|
30
|
+
/** The 3-byte color type */
|
|
31
|
+
static { this.TYPE_COLOR = 8; }
|
|
16
32
|
/**
|
|
17
33
|
* No instances.
|
|
18
34
|
*/
|
|
@@ -46,20 +62,4 @@ class AttributeTypes {
|
|
|
46
62
|
}
|
|
47
63
|
}
|
|
48
64
|
exports.AttributeTypes = AttributeTypes;
|
|
49
|
-
/** The 1-bit boolean type */
|
|
50
|
-
AttributeTypes.TYPE_BOOLEAN = 1;
|
|
51
|
-
/** The 1-byte integer type */
|
|
52
|
-
AttributeTypes.TYPE_INT1 = 2;
|
|
53
|
-
/** The 2-byte integer type */
|
|
54
|
-
AttributeTypes.TYPE_INT2 = 3;
|
|
55
|
-
/** The 4-byte integer type */
|
|
56
|
-
AttributeTypes.TYPE_INT4 = 4;
|
|
57
|
-
/** The 8-byte integer type */
|
|
58
|
-
AttributeTypes.TYPE_INT8 = 5;
|
|
59
|
-
/** The 4-byte float type */
|
|
60
|
-
AttributeTypes.TYPE_FLOAT4 = 6;
|
|
61
|
-
/** The 8-byte float type */
|
|
62
|
-
AttributeTypes.TYPE_FLOAT8 = 7;
|
|
63
|
-
/** The 3-byte color type */
|
|
64
|
-
AttributeTypes.TYPE_COLOR = 8;
|
|
65
65
|
//# sourceMappingURL=AttributeTypes.js.map
|
|
@@ -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;
|
|
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;aACN,iBAAY,GAAU,CAAC,CAAC;IAC/C,8BAA8B;aACP,cAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;aACP,cAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;aACP,cAAS,GAAU,CAAC,CAAC;IAC5C,8BAA8B;aACP,cAAS,GAAU,CAAC,CAAC;IAC5C,4BAA4B;aACL,gBAAW,GAAU,CAAC,CAAC;IAC9C,4BAA4B;aACL,gBAAW,GAAU,CAAC,CAAC;IAC9C,4BAA4B;aACL,eAAU,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"]}
|
|
@@ -20,6 +20,10 @@ const AttributeTypes_1 = require("./AttributeTypes");
|
|
|
20
20
|
*/
|
|
21
21
|
/** @internal */
|
|
22
22
|
class AttributeValue {
|
|
23
|
+
/** The 'false' value */
|
|
24
|
+
static { this.FALSE = AttributeValue.createBoolean(false); }
|
|
25
|
+
/** The 'true' value */
|
|
26
|
+
static { this.TRUE = AttributeValue.createBoolean(true); }
|
|
23
27
|
/**
|
|
24
28
|
* Create a new (empty) value.
|
|
25
29
|
*/
|
|
@@ -502,8 +506,4 @@ class AttributeValue {
|
|
|
502
506
|
}
|
|
503
507
|
}
|
|
504
508
|
exports.AttributeValue = AttributeValue;
|
|
505
|
-
/** The 'false' value */
|
|
506
|
-
AttributeValue.FALSE = AttributeValue.createBoolean(false);
|
|
507
|
-
/** The 'true' value */
|
|
508
|
-
AttributeValue.TRUE = AttributeValue.createBoolean(true);
|
|
509
509
|
//# sourceMappingURL=AttributeValue.js.map
|