@procore/bim-webviewer-sdk 17.3.0-rc.16 → 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.
@@ -5,6 +5,7 @@ import type { StreamedMeshnode } from './StreamedMeshnode';
5
5
  import { MeshObject } from '../objects/MeshObject';
6
6
  import { MeshData } from './MeshData';
7
7
  import { Mesh } from '../standard/Mesh';
8
+ import { OPFSFile } from '../../../utils/OPFSFile';
8
9
  import type { ValidatedFeatureFlags } from '../../../types/WebviewerOptions';
9
10
  import type { ResourceDiscriminator } from '../../../Webviewer';
10
11
  export declare class StreamedMeshServices extends MeshServices {
@@ -20,6 +21,7 @@ export declare class StreamedMeshServices extends MeshServices {
20
21
  });
21
22
  initOPFS(): Promise<void>;
22
23
  private deleteOPFSFile;
24
+ getOPFSFile(): OPFSFile | undefined;
23
25
  closeOPFS(): Promise<void>;
24
26
  writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
25
27
  getMeshObject(meshIndex: number): MeshObject;
@@ -22,9 +22,12 @@ import { GeometryFactory } from '../../procoregl/GeometryFactory';
22
22
  import type { BootstrapperResult } from '../../controllers/Bootstrapper';
23
23
  import { Manifest } from './Manifest';
24
24
  import { Vector3 } from '../../types/Math';
25
+ import type { ValidatedFeatureFlags } from '../../types/WebviewerOptions';
26
+ import type { ResourceDiscriminator } from '../../Webviewer';
25
27
  export declare class PWFV2 implements PWF {
26
28
  private readonly downloadMetaData;
27
29
  resourceId: number;
30
+ resource: ResourceDiscriminator;
28
31
  streaming: boolean;
29
32
  nodeAB?: ArrayBuffer;
30
33
  meshnodeAB?: ArrayBuffer;
@@ -47,14 +50,18 @@ export declare class PWFV2 implements PWF {
47
50
  meshnodeOffPointer: number;
48
51
  bvhTree?: BVHTree;
49
52
  _virtualMeshnodeIndexOffset: number;
53
+ private readonly featureFlags;
50
54
  loadPartitionPromises: Promise<void>[];
51
55
  currentIndex: number;
52
56
  partitionProxies: PartitionProxy[];
53
57
  partitionsCache: LRUCache<string, Partition>;
58
+ private meshServicesOPFSInitialized;
54
59
  constructor(params: {
55
60
  downloadMetaData: DownloadMetaData;
56
61
  resourceId: number;
62
+ resource: ResourceDiscriminator;
57
63
  manifest: Manifest;
64
+ featureFlags: ValidatedFeatureFlags;
58
65
  });
59
66
  setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
60
67
  setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionProxiesAB: ArrayBuffer): void;
@@ -14,5 +14,6 @@ export declare class MeshData {
14
14
  faces(): Uint16Array;
15
15
  uploadToGPU(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
16
16
  uploadToGPUPreFetching(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
17
+ getCompressedMeshData(): ArrayBuffer;
17
18
  getUncompressedMeshData(): ArrayBuffer;
18
19
  }
@@ -2,8 +2,10 @@ import { Partition } from './Partition';
2
2
  import type { StreamedMeshnode } from './StreamedMeshnode';
3
3
  import { PWFPartitionProxy } from '../interface/PWFPartitionProxy';
4
4
  import { StreamedGeometryFactory } from '../../../procoregl/StreamedGeometryFactory';
5
+ import { StreamedMeshServices } from './StreamedMeshServices';
5
6
  export declare class PartitionProxy {
6
7
  private pwfPartitionProxy;
8
+ private meshServices;
7
9
  static numberOfPartitions: number;
8
10
  static numberOfPartitionsLoaded: number;
9
11
  static currentNumberOfDownloading: number;
@@ -14,7 +16,10 @@ export declare class PartitionProxy {
14
16
  private _byteLength?;
15
17
  private _compressedByteLength?;
16
18
  private stats;
17
- constructor(pwfPartitionProxy: PWFPartitionProxy);
19
+ constructor(params: {
20
+ pwfPartitionProxy: PWFPartitionProxy;
21
+ meshServices: StreamedMeshServices;
22
+ });
18
23
  meshCount(): number;
19
24
  incrementMeshCount(numMeshes: number): void;
20
25
  vertexCount(): number;
@@ -32,7 +37,7 @@ export declare class PartitionProxy {
32
37
  compressed: number;
33
38
  size: number;
34
39
  };
35
- static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, callback: (partitionProxy: PartitionProxy) => void): void;
40
+ static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, meshServices: StreamedMeshServices, callback: (partitionProxy: PartitionProxy) => void): void;
36
41
  static getPartitionProxies(partitionProxiesAB: ArrayBuffer): PWFPartitionProxy[];
37
42
  getContentOfPartitionUrl(): string;
38
43
  }
@@ -3,10 +3,31 @@ import type { PWFV2 } from '../PWFV2';
3
3
  import { MeshServices } from '../standard';
4
4
  import type { StreamedMeshnode } from './StreamedMeshnode';
5
5
  import { MeshObject } from '../objects/MeshObject';
6
+ import { MeshData } from './MeshData';
7
+ import { Mesh } from '../standard/Mesh';
8
+ import { OPFSFile } from '../../../utils/OPFSFile';
9
+ import type { ValidatedFeatureFlags } from '../../../types/WebviewerOptions';
10
+ import type { ResourceDiscriminator } from '../../../Webviewer';
6
11
  export declare class StreamedMeshServices extends MeshServices {
7
- constructor(pwf: PWFV2);
8
- getMeshObject(meshOffset: number): MeshObject;
12
+ private readonly featureFlags;
13
+ private meshIndexToOPFSRecord;
14
+ private opfsFile?;
15
+ private opfsOffset;
16
+ private resource;
17
+ constructor(params: {
18
+ pwf: PWFV2;
19
+ featureFlags: ValidatedFeatureFlags;
20
+ resource: ResourceDiscriminator;
21
+ });
22
+ initOPFS(): Promise<void>;
23
+ private deleteOPFSFile;
24
+ getOPFSFile(): OPFSFile | undefined;
25
+ closeOPFS(): Promise<void>;
26
+ writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
27
+ getMeshObject(meshIndex: number): MeshObject;
9
28
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
10
29
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
11
- dispose(): void;
30
+ meshFromOffset(meshIndex: number): Mesh;
31
+ private getCompressedMeshDataFromOPFS;
32
+ dispose(): Promise<void>;
12
33
  }
@@ -3,6 +3,7 @@ export declare class MainThreadSyncAccessHandleFallback implements FileSystemSyn
3
3
  private buffer;
4
4
  private path;
5
5
  constructor(path: string);
6
+ static clearOpenHandles(): void;
6
7
  close(): void;
7
8
  read(buffer: ArrayBuffer, options: {
8
9
  at: number;
@@ -0,0 +1 @@
1
+ export { OPFSFile, nextIndexAvailable, clearOPFS, getFileHandleFromPath, } from './OPFSFile';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "17.3.0-rc.16",
3
+ "version": "17.3.0-rc.18",
4
4
  "description": "Procore BIM Webviewer SDK",
5
5
  "main": "dist/Procore.Bim.Webviewer.js",
6
6
  "types": "dist/Procore.Bim.Webviewer.d.ts",
@@ -1 +0,0 @@
1
- export { OPFSFile } from './OPFSFile';