@procore/bim-webviewer-sdk 16.6.0-rc.10 → 16.6.0-rc.11
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 +3 -0
- package/dist/Procore.Bim.Webviewer.d.ts +49 -11
- package/dist/Procore.Bim.Webviewer.js +1 -1
- package/dist/types/src/controllers/CacheController.d.ts +1 -0
- package/dist/types/src/controllers/DatabaseController.d.ts +1 -0
- package/dist/types/src/controllers/PubSubController.d.ts +1 -0
- package/dist/types/src/controllers/RenderController.d.ts +1 -1
- package/dist/types/src/controllers/RenderControllerProxy.d.ts +1 -0
- package/dist/types/src/controllers/__tests__/fixtures.d.ts +4 -1
- package/dist/types/src/procoregl/Models/Models.d.ts +3 -1
- package/dist/types/src/pwfreader/PWF.d.ts +1 -0
- package/dist/types/src/pwfreader/PWFProxy.d.ts +4 -1
- package/dist/types/src/pwfreader/v1/PWFV1.d.ts +6 -1
- package/dist/types/src/pwfreader/v1/standard/MeshServices.d.ts +1 -0
- package/dist/types/src/pwfreader/v1/streaming/MeshData.d.ts +1 -0
- package/dist/types/src/pwfreader/v1/streaming/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts +14 -0
- package/dist/types/src/pwfreader/v1/streaming/OPFSFile/OPFSFile.d.ts +12 -0
- package/dist/types/src/pwfreader/v1/streaming/OPFSFile/index.d.ts +1 -0
- package/dist/types/src/pwfreader/v1/streaming/PartitionProxy.d.ts +7 -2
- package/dist/types/src/pwfreader/v1/streaming/StreamedMeshServices.d.ts +18 -2
- package/dist/types/src/pwfreader/v2/PWFV2.d.ts +1 -0
- package/dist/types/src/pwfreader/v2/standard/MeshServices.d.ts +1 -0
- package/dist/types/src/pwfreader/v2/streaming/StreamedMeshServices.d.ts +1 -0
- package/dist/types/src/types/WebviewerOptions.d.ts +8 -3
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export type ModelRevisionStoreItem = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare const LocalStoreItemDNE = "Local store item does not exist.";
|
|
16
16
|
export declare namespace Cache {
|
|
17
|
+
const clear: () => Promise<boolean>;
|
|
17
18
|
const updateAndPurgeFileVersion: (fileVersion: FileVersion, propertyFileId: PropertiesFile["id"], geometryBundle: GeometryBundle) => Promise<void>;
|
|
18
19
|
const updateAndPurgeModelRevision: (modelId: Model["id"], modelRevisionId: ModelRevision["id"], geometryBundle: GeometryBundle) => Promise<void>;
|
|
19
20
|
const removeModel: (options: any) => Promise<boolean>;
|
|
@@ -9,6 +9,7 @@ export class DatabaseController {
|
|
|
9
9
|
getValue(objectStoreName: any, key: any): Promise<any>;
|
|
10
10
|
updateValue(objectStoreName: any, key: any, value: any): Promise<any>;
|
|
11
11
|
deleteValue(objectStoreName: any, key: any): Promise<any>;
|
|
12
|
+
clearObjectStore(objectStoreName: any): Promise<any>;
|
|
12
13
|
}
|
|
13
14
|
export namespace DatabaseController {
|
|
14
15
|
let OBJECT_STORES: Readonly<{
|
|
@@ -71,6 +71,7 @@ export namespace PubSubController {
|
|
|
71
71
|
objectTreeUpdated: "objectTreeUpdated";
|
|
72
72
|
objectUnhide: "objectUnhide";
|
|
73
73
|
optionsChanged: "optionsChanged";
|
|
74
|
+
allPartitionsDownloadComplete: "allPartitionsDownloadComplete";
|
|
74
75
|
projectSettingsLoaded: "projectSettingsLoaded";
|
|
75
76
|
projectSettingsUpdated: "projectSettingsUpdated";
|
|
76
77
|
propertiesReady: "propertiesReady";
|
|
@@ -56,7 +56,7 @@ export class RenderController {
|
|
|
56
56
|
parsePwfNodes(): import("./Bootstrapper").BootstrapperResult;
|
|
57
57
|
parsePwfMeshnodes(): import("./Bootstrapper").BootstrapperResult;
|
|
58
58
|
parsePwfMeshes(): void;
|
|
59
|
-
initMeshServices():
|
|
59
|
+
initMeshServices(): import("./Bootstrapper").BootstrapperResult;
|
|
60
60
|
initNodeServices(): void;
|
|
61
61
|
initMeshnodeServices(): void;
|
|
62
62
|
initNodeTree(): import("./Bootstrapper").BootstrapperResult;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MeshnodeObject } from '../../pwfreader/PWFTypes';
|
|
2
|
+
import type { PublicNode } from '../../types/PublicNode';
|
|
2
3
|
export declare const rootNode: PublicNode;
|
|
4
|
+
export declare const MESHNODE_WITH_INDEX_1: MeshnodeObject;
|
|
5
|
+
export declare const MESHNODE_WITH_NODE_ID_13: MeshnodeObject;
|
|
@@ -9,6 +9,7 @@ import { MeshObject } from '../../pwfreader/v1/objects/MeshObject';
|
|
|
9
9
|
import type { ViewerRenderer } from '../ViewerRenderer';
|
|
10
10
|
import type { BootstrapperResult } from '../../controllers/Bootstrapper';
|
|
11
11
|
import { Vector3 } from '../../types/Math';
|
|
12
|
+
import type { ValidatedFeatureFlags } from '../../types/WebviewerOptions';
|
|
12
13
|
export declare function computeDetailsParam(totalFaces: number): {
|
|
13
14
|
detailsInMotion: number;
|
|
14
15
|
detailsAtRest: number;
|
|
@@ -47,6 +48,7 @@ export declare class Models {
|
|
|
47
48
|
modelDescriptors: ModelDescriptor[];
|
|
48
49
|
selectionOption: SelectMethod;
|
|
49
50
|
prefetchingPartitions?: boolean;
|
|
51
|
+
featureFlags: ValidatedFeatureFlags;
|
|
50
52
|
});
|
|
51
53
|
private sceneGraphFactory;
|
|
52
54
|
getResourceId: (resource: ResourceDiscriminator) => number;
|
|
@@ -57,7 +59,7 @@ export declare class Models {
|
|
|
57
59
|
parsePwfNodes(): BootstrapperResult;
|
|
58
60
|
parsePwfMeshnodes(): BootstrapperResult;
|
|
59
61
|
parsePwfMeshes(): void;
|
|
60
|
-
initMeshServices():
|
|
62
|
+
initMeshServices(): BootstrapperResult;
|
|
61
63
|
initNodeServices(): void;
|
|
62
64
|
initMeshnodeServices(): void;
|
|
63
65
|
initNodeTree(): BootstrapperResult;
|
|
@@ -4,12 +4,14 @@ import { GeometryFactory } from '../procoregl/GeometryFactory';
|
|
|
4
4
|
import type { BootstrapperResult } from '../controllers/Bootstrapper';
|
|
5
5
|
import type { DownloadMetaData } from '../procoregl/Models/Models';
|
|
6
6
|
import { PWF } from './PWF';
|
|
7
|
+
import type { ValidatedFeatureFlags } from '../types/WebviewerOptions';
|
|
7
8
|
export declare class PWFProxy implements PWF {
|
|
8
9
|
pwf: PWFVersion;
|
|
9
10
|
constructor(params: {
|
|
10
11
|
manifest: Manifest | undefined;
|
|
11
12
|
downloadMetaData: DownloadMetaData;
|
|
12
13
|
resourceId: number;
|
|
14
|
+
featureFlags: ValidatedFeatureFlags;
|
|
13
15
|
});
|
|
14
16
|
setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
|
|
15
17
|
setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionAB: ArrayBuffer): void;
|
|
@@ -18,7 +20,7 @@ export declare class PWFProxy implements PWF {
|
|
|
18
20
|
parsePwfNodes(): BootstrapperResult;
|
|
19
21
|
parsePwfMeshnodes(): BootstrapperResult;
|
|
20
22
|
parsePwfMeshes(): void;
|
|
21
|
-
initMeshServices():
|
|
23
|
+
initMeshServices(): BootstrapperResult;
|
|
22
24
|
initNodeServices(): void;
|
|
23
25
|
initMeshnodeServices(): void;
|
|
24
26
|
initNodeTree(): BootstrapperResult;
|
|
@@ -55,4 +57,5 @@ export declare class PWFProxy implements PWF {
|
|
|
55
57
|
get virtualMeshnodeIndexOffset(): number;
|
|
56
58
|
set virtualMeshnodeIndexOffset(offset: number);
|
|
57
59
|
isPartitionedModel(): boolean;
|
|
60
|
+
dispose(): void;
|
|
58
61
|
}
|
|
@@ -22,6 +22,7 @@ import { Partition } from './streaming/Partition';
|
|
|
22
22
|
import { GeometryFactory } from '../../procoregl/GeometryFactory';
|
|
23
23
|
import type { BootstrapperResult } from '../../controllers/Bootstrapper';
|
|
24
24
|
import { Vector3 } from '../../types/Math';
|
|
25
|
+
import type { ValidatedFeatureFlags } from '../../types/WebviewerOptions';
|
|
25
26
|
export declare class PWFV1 implements PWF {
|
|
26
27
|
private readonly downloadMetaData;
|
|
27
28
|
resourceId: number;
|
|
@@ -45,13 +46,16 @@ export declare class PWFV1 implements PWF {
|
|
|
45
46
|
meshnodeServices?: MeshnodeServices | StreamedMeshnodeServices;
|
|
46
47
|
bvhTree?: BVHTree;
|
|
47
48
|
_virtualMeshnodeIndexOffset: number;
|
|
49
|
+
private readonly featureFlags;
|
|
48
50
|
loadPartitionPromises: Promise<void>[];
|
|
49
51
|
currentIndex: number;
|
|
50
52
|
partitionProxies: PartitionProxy[];
|
|
51
53
|
partitionsCache: LRUCache<string, Partition>;
|
|
54
|
+
private meshServicesOPFSInitialized;
|
|
52
55
|
constructor(params: {
|
|
53
56
|
downloadMetaData: DownloadMetaData;
|
|
54
57
|
resourceId: number;
|
|
58
|
+
featureFlags: ValidatedFeatureFlags;
|
|
55
59
|
});
|
|
56
60
|
setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
|
|
57
61
|
setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionProxiesAB: ArrayBuffer): void;
|
|
@@ -60,7 +64,7 @@ export declare class PWFV1 implements PWF {
|
|
|
60
64
|
parsePwfNodes(): BootstrapperResult;
|
|
61
65
|
parsePwfMeshnodes(): BootstrapperResult;
|
|
62
66
|
parsePwfMeshes(): void;
|
|
63
|
-
initMeshServices():
|
|
67
|
+
initMeshServices(): BootstrapperResult;
|
|
64
68
|
initNodeServices(): void;
|
|
65
69
|
initMeshnodeServices(): void;
|
|
66
70
|
initNodeTree(): BootstrapperResult;
|
|
@@ -101,4 +105,5 @@ export declare class PWFV1 implements PWF {
|
|
|
101
105
|
getModelAnalyticsData(): ModelAnalyticsData;
|
|
102
106
|
get virtualMeshnodeIndexOffset(): number;
|
|
103
107
|
set virtualMeshnodeIndexOffset(value: number);
|
|
108
|
+
dispose(): void;
|
|
104
109
|
}
|
|
@@ -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
|
}
|
package/dist/types/src/pwfreader/v1/streaming/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class MainThreadSyncAccessHandleFallback implements FileSystemSyncAccessHandle {
|
|
2
|
+
private buffer;
|
|
3
|
+
constructor();
|
|
4
|
+
close(): void;
|
|
5
|
+
read(buffer: ArrayBuffer, options: {
|
|
6
|
+
at: number;
|
|
7
|
+
}): number;
|
|
8
|
+
write(buffer: ArrayBuffer, options: {
|
|
9
|
+
at: number;
|
|
10
|
+
}): number;
|
|
11
|
+
truncate(size: number): void;
|
|
12
|
+
flush(): void;
|
|
13
|
+
getSize(): number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class OPFSFile {
|
|
2
|
+
private path;
|
|
3
|
+
private syncAccessHandle?;
|
|
4
|
+
private static stats;
|
|
5
|
+
constructor(path: string);
|
|
6
|
+
open(): Promise<void>;
|
|
7
|
+
close(): void;
|
|
8
|
+
truncate(offset: number): void;
|
|
9
|
+
write(buffer: ArrayBuffer, offset: number): number | undefined;
|
|
10
|
+
read(offset: number, byteLength: number): ArrayBuffer;
|
|
11
|
+
private updateReadStats;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OPFSFile } from './OPFSFile';
|
|
@@ -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(
|
|
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,9 +3,25 @@ import type { PWFV1 } from '../PWFV1';
|
|
|
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 type { ValidatedFeatureFlags } from '../../../types/WebviewerOptions';
|
|
6
9
|
export declare class StreamedMeshServices extends MeshServices {
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
private readonly featureFlags;
|
|
11
|
+
private meshIndexToOPFSRecord;
|
|
12
|
+
private opfsFile?;
|
|
13
|
+
private opfsOffset;
|
|
14
|
+
constructor(params: {
|
|
15
|
+
pwf: PWFV1;
|
|
16
|
+
featureFlags: ValidatedFeatureFlags;
|
|
17
|
+
});
|
|
18
|
+
initOPFS(): Promise<void>;
|
|
19
|
+
closeOPFS(): Promise<void>;
|
|
20
|
+
writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
|
|
21
|
+
getMeshObject(meshIndex: number): MeshObject;
|
|
9
22
|
loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
|
|
10
23
|
getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
|
|
24
|
+
meshFromOffset(meshIndex: number): Mesh;
|
|
25
|
+
private getCompressedMeshDataFromOPFS;
|
|
26
|
+
dispose(): void;
|
|
11
27
|
}
|
|
@@ -8,4 +8,5 @@ export declare class StreamedMeshServices extends MeshServices {
|
|
|
8
8
|
getMeshObject(meshOffset: number): MeshObject;
|
|
9
9
|
loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
|
|
10
10
|
getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
|
|
11
|
+
dispose(): void;
|
|
11
12
|
}
|
|
@@ -3,12 +3,17 @@ import { FileExtraction, GeometryFile } from '../api/types/FileExtraction';
|
|
|
3
3
|
import { Model } from '../api/types/Model';
|
|
4
4
|
import { ModelRevision } from '../api/types/ModelRevision';
|
|
5
5
|
import type { Tool } from '../components/Tool';
|
|
6
|
-
export type FeatureFlags =
|
|
6
|
+
export type FeatureFlags = {
|
|
7
7
|
/**
|
|
8
8
|
* @beta Enables the new measurement mode Point to Point, which allows users to measure the distance between two points in the model.
|
|
9
9
|
*/
|
|
10
10
|
enablePointToPoint: boolean;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @beta Enables writing mesh data to OPFS for partitioned models, which allows users to use features that use mesh data, notably Point to Point.
|
|
13
|
+
*/
|
|
14
|
+
enableMeshDataOnOPFS: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type ValidatedFeatureFlags = Readonly<FeatureFlags>;
|
|
12
17
|
export type CommonOptions = {
|
|
13
18
|
/**
|
|
14
19
|
* Always required
|
|
@@ -48,7 +53,7 @@ export type CommonOptions = {
|
|
|
48
53
|
multiselect?: boolean;
|
|
49
54
|
selection?: string;
|
|
50
55
|
enableWebWorker?: boolean;
|
|
51
|
-
featureFlags?: FeatureFlags
|
|
56
|
+
featureFlags?: Partial<FeatureFlags>;
|
|
52
57
|
logInitializationTimes?: boolean;
|
|
53
58
|
sceneGraph?: string;
|
|
54
59
|
bimFileId?: number;
|