@procore/bim-webviewer-sdk 17.3.0-rc.17 → 17.3.0-rc.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
  - ([#1416](https://github.com/procore/bim-webviewer/pull/1416)) When the Measurement Tool is enabled, the context menu for mouse right click button will no longer display.
18
18
  - ([#1442](https://github.com/procore/bim-webviewer/pull/1442)) [Internal] Refactor Shortest Distance Measurement to get mesh data in the same code path for both standard and partitioned models. For partitioned models this means it no longer fetches the partition from cache for the mesh data and instead reads it from OPFS
19
19
  - ([#1446](https://github.com/procore/bim-webviewer/pull/1446)) Hotkey refactoring. Additionally, the SDK method `setMeasurement` can now be used even if the Measurement Tool is not added to the `options.tools` array when initializing the Web Viewer. This allows third party developers to enable the Measurement Tool after the Web Viewer has been initialized.
20
+ - ([#1452])(https://github.com/procore/bim-webviewer/pull/1452) [Internal][QA Ignore] Add support for writing mesh data to OPFS for PWFv2 partitioned models. Effectively just copying over the implementation from v1.
20
21
 
21
22
  ### Fixed
22
23
 
@@ -367,6 +367,7 @@ declare class MeshData {
367
367
  faces(): Uint16Array;
368
368
  uploadToGPU(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
369
369
  uploadToGPUPreFetching(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
370
+ getCompressedMeshData(): ArrayBuffer;
370
371
  getUncompressedMeshData(): ArrayBuffer;
371
372
  }
372
373
 
@@ -833,6 +834,22 @@ export declare type ObjectFilter = {
833
834
  filterValue: string;
834
835
  };
835
836
 
837
+ declare class OPFSFile {
838
+ private path;
839
+ private syncAccessHandle?;
840
+ private directoryHandle?;
841
+ private fileName?;
842
+ private static stats;
843
+ constructor(path: string);
844
+ open(): Promise<void>;
845
+ delete(): Promise<void>;
846
+ close(): void;
847
+ truncate(offset: number): void;
848
+ write(buffer: ArrayBuffer, byteOffset?: number): number | undefined;
849
+ read(byteOffset?: number, byteLength?: number): ArrayBuffer;
850
+ private updateReadStats;
851
+ }
852
+
836
853
  export declare type Options = FileExtractionModePwfV2OverrideOptions | FileExtractionModePwfV1OverrideOptions | FileExtractionModeOptions | ModelRevisionModePwfV2OverrideOptions | ModelRevisionModePwfV1OverrideOptions | ModelRevisionModeOptions | ResourceOptions;
837
854
 
838
855
  declare type Palette = {
@@ -862,6 +879,7 @@ declare class Partition_2 {
862
879
 
863
880
  declare class PartitionProxy {
864
881
  private pwfPartitionProxy;
882
+ private meshServices;
865
883
  static numberOfPartitions: number;
866
884
  static numberOfPartitionsLoaded: number;
867
885
  static currentNumberOfDownloading: number;
@@ -872,7 +890,10 @@ declare class PartitionProxy {
872
890
  private _byteLength?;
873
891
  private _compressedByteLength?;
874
892
  private stats;
875
- constructor(pwfPartitionProxy: PWFPartitionProxy);
893
+ constructor(params: {
894
+ pwfPartitionProxy: PWFPartitionProxy;
895
+ meshServices: StreamedMeshServices;
896
+ });
876
897
  meshCount(): number;
877
898
  incrementMeshCount(numMeshes: number): void;
878
899
  vertexCount(): number;
@@ -890,7 +911,7 @@ declare class PartitionProxy {
890
911
  compressed: number;
891
912
  size: number;
892
913
  };
893
- static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, callback: (partitionProxy: PartitionProxy) => void): void;
914
+ static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, meshServices: StreamedMeshServices, callback: (partitionProxy: PartitionProxy) => void): void;
894
915
  static getPartitionProxies(partitionProxiesAB: ArrayBuffer): PWFPartitionProxy[];
895
916
  getContentOfPartitionUrl(): string;
896
917
  }
@@ -1264,6 +1285,7 @@ export declare type PwfV1Bundle = {
1264
1285
  declare class PWFV2 implements PWF {
1265
1286
  private readonly downloadMetaData;
1266
1287
  resourceId: number;
1288
+ resource: ResourceDiscriminator;
1267
1289
  streaming: boolean;
1268
1290
  nodeAB?: ArrayBuffer;
1269
1291
  meshnodeAB?: ArrayBuffer;
@@ -1286,14 +1308,18 @@ declare class PWFV2 implements PWF {
1286
1308
  meshnodeOffPointer: number;
1287
1309
  bvhTree?: BVHTree;
1288
1310
  _virtualMeshnodeIndexOffset: number;
1311
+ private readonly featureFlags;
1289
1312
  loadPartitionPromises: Promise<void>[];
1290
1313
  currentIndex: number;
1291
1314
  partitionProxies: PartitionProxy[];
1292
1315
  partitionsCache: LRUCache<string, Partition>;
1316
+ private meshServicesOPFSInitialized;
1293
1317
  constructor(params: {
1294
1318
  downloadMetaData: DownloadMetaData;
1295
1319
  resourceId: number;
1320
+ resource: ResourceDiscriminator;
1296
1321
  manifest: Manifest;
1322
+ featureFlags: ValidatedFeatureFlags;
1297
1323
  });
1298
1324
  setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
1299
1325
  setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionProxiesAB: ArrayBuffer): void;
@@ -1442,11 +1468,27 @@ declare class StreamedMeshnodeServices_2 extends MeshnodeServices_2 {
1442
1468
  }
1443
1469
 
1444
1470
  declare class StreamedMeshServices extends MeshServices {
1445
- constructor(pwf: PWFV2);
1446
- getMeshObject(meshOffset: number): MeshObject_2;
1471
+ private readonly featureFlags;
1472
+ private meshIndexToOPFSRecord;
1473
+ private opfsFile?;
1474
+ private opfsOffset;
1475
+ private resource;
1476
+ constructor(params: {
1477
+ pwf: PWFV2;
1478
+ featureFlags: ValidatedFeatureFlags;
1479
+ resource: ResourceDiscriminator;
1480
+ });
1481
+ initOPFS(): Promise<void>;
1482
+ private deleteOPFSFile;
1483
+ getOPFSFile(): OPFSFile | undefined;
1484
+ closeOPFS(): Promise<void>;
1485
+ writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
1486
+ getMeshObject(meshIndex: number): MeshObject_2;
1447
1487
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
1448
1488
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
1449
- dispose(): void;
1489
+ meshFromOffset(meshIndex: number): Mesh;
1490
+ private getCompressedMeshDataFromOPFS;
1491
+ dispose(): Promise<void>;
1450
1492
  }
1451
1493
 
1452
1494
  declare class StreamedMeshServices_2 extends MeshServices_2 {
@@ -1462,6 +1504,7 @@ declare class StreamedMeshServices_2 extends MeshServices_2 {
1462
1504
  });
1463
1505
  initOPFS(): Promise<void>;
1464
1506
  private deleteOPFSFile;
1507
+ getOPFSFile(): OPFSFile | undefined;
1465
1508
  closeOPFS(): Promise<void>;
1466
1509
  writeMeshDataToOPFS(meshData: MeshData_2): Promise<void>;
1467
1510
  getMeshObject(meshIndex: number): MeshObject;