@procore/bim-webviewer-sdk 16.6.0-rc.9 → 17.0.0-rc.0
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 +14 -5
- package/dist/Procore.Bim.Webviewer.d.ts +156 -2317
- package/dist/Procore.Bim.Webviewer.js +1 -1
- package/dist/types/src/Webviewer.d.ts +4 -3
- package/dist/types/src/api/analytic_events/analyticKeys.d.ts +1 -0
- package/dist/types/src/api/analytic_events/index.d.ts +1 -1
- package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +1 -0
- package/dist/types/src/components/ToolBarComponent/ToolbarButton/SplitButton.d.ts +7 -5
- 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 +2 -0
- package/dist/types/src/controllers/RenderController.d.ts +2 -1
- package/dist/types/src/controllers/RenderControllerProxy.d.ts +2 -0
- package/dist/types/src/controllers/RenderControllerWorker.d.ts +1 -0
- package/dist/types/src/controllers/__tests__/fixtures.d.ts +4 -1
- package/dist/types/src/measuring/MeasurementManager.d.ts +5 -4
- package/dist/types/src/measuring/PointToPointController.d.ts +6 -0
- package/dist/types/src/measuring/PointToPointManager.d.ts +13 -0
- package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +5 -4
- package/dist/types/src/measuring/createPointToPointLineDrawingDebugGui.d.ts +0 -5
- package/dist/types/src/navigation/DefaultControl.d.ts +0 -11
- package/dist/types/src/navigation/__tests__/FixedOrbitControl.test.d.ts +1 -0
- package/dist/types/src/navigation/__tests__/ZoomControl.test.d.ts +1 -0
- 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/sdk.d.ts +1 -0
- package/dist/types/src/types/WebviewerOptions.d.ts +8 -3
- package/package.json +1 -1
|
@@ -10,8 +10,8 @@ import { SectionDataAutodeskFormat, SectionDataProcoreFormat } from './sectionin
|
|
|
10
10
|
import type { Viewpoint, Visibility } from './api/types/Viewpoint';
|
|
11
11
|
import type { CssColor } from './components/Markup/SvgRenderer';
|
|
12
12
|
import { RenderMode } from './utils/constants';
|
|
13
|
-
import { PointToPointManager } from './measuring';
|
|
14
13
|
import { Uom, DisplayUnit } from './unit_util';
|
|
14
|
+
import { MeasureMode } from './measuring/MeasurementManager';
|
|
15
15
|
export type ResourceDiscriminator = {
|
|
16
16
|
fileExtractionId: number;
|
|
17
17
|
} | {
|
|
@@ -19,7 +19,6 @@ export type ResourceDiscriminator = {
|
|
|
19
19
|
};
|
|
20
20
|
export declare class Webviewer {
|
|
21
21
|
options: Options;
|
|
22
|
-
pointToPointManager: PointToPointManager;
|
|
23
22
|
private readonly measurementRenderer;
|
|
24
23
|
private readonly measurementManager;
|
|
25
24
|
static readonly tools: {
|
|
@@ -216,7 +215,9 @@ export declare class Webviewer {
|
|
|
216
215
|
deselectObjects: (objectIds: number[], objectTreeName?: string) => Promise<boolean>;
|
|
217
216
|
selectAllObjects: (objectTreeName?: string) => Promise<boolean>;
|
|
218
217
|
getSelectedObjects: () => Promise<number[]>;
|
|
219
|
-
setMeasurement: (enable: boolean
|
|
218
|
+
setMeasurement: (enable: boolean, options?: {
|
|
219
|
+
measurementMode?: MeasureMode;
|
|
220
|
+
}) => void;
|
|
220
221
|
setObjectColor: (palettes: PaletteParams[], options?: {
|
|
221
222
|
resourceId?: number;
|
|
222
223
|
}) => void;
|
|
@@ -148,6 +148,7 @@ export declare const MEASUREMENT_ORIGIN: {
|
|
|
148
148
|
readonly ESC: "esc";
|
|
149
149
|
readonly HOTKEY: "hotkey";
|
|
150
150
|
};
|
|
151
|
+
export type MeasurementOrigin = (typeof MEASUREMENT_ORIGIN)[keyof typeof MEASUREMENT_ORIGIN];
|
|
151
152
|
export declare const measurements: {
|
|
152
153
|
readonly enabled: "project.3d_models.measure.enabled";
|
|
153
154
|
readonly disabled: "project.3d_models.measure.disabled";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { model, clientLoadings, webviewers, bimToolbars, sectionBoxes, SECTION_BOX_ORIGIN, SectionBoxOrigin, SectionBoxDisplayPlanesPayload, bimObjects, BIM_OBJECT_ORIGIN, renderings, RENDER_MODE_ORIGIN, measurements, MEASUREMENT_ORIGIN, } from './analyticKeys';
|
|
1
|
+
export { model, clientLoadings, webviewers, bimToolbars, sectionBoxes, SECTION_BOX_ORIGIN, SectionBoxOrigin, SectionBoxDisplayPlanesPayload, bimObjects, BIM_OBJECT_ORIGIN, renderings, RENDER_MODE_ORIGIN, measurements, MEASUREMENT_ORIGIN, MeasurementOrigin, } from './analyticKeys';
|
|
2
2
|
export { trackEvent } from './analyticEvents';
|
|
3
3
|
export { AnalyticEventPayload } from './types/AnalyticEventPayload';
|
|
@@ -61,6 +61,7 @@ export class ToolBarComponent {
|
|
|
61
61
|
createToolBarButton(tool: any, clickFunction?: null): HTMLDivElement;
|
|
62
62
|
createDividerLine(id: any): HTMLDivElement;
|
|
63
63
|
createOptionalTools(toolbar: any): void;
|
|
64
|
+
measureButton: any;
|
|
64
65
|
onResize(): void;
|
|
65
66
|
createNavTools(toolbar: any): void;
|
|
66
67
|
onMeasurementToggled(data: any): void;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import './styles.css';
|
|
2
2
|
type FlyOutMenuItem = {
|
|
3
|
+
key: string;
|
|
3
4
|
content: string;
|
|
4
5
|
onMenuItemClick: () => void;
|
|
5
6
|
cssIconClass: string;
|
|
6
7
|
};
|
|
7
8
|
export declare class SplitButton {
|
|
8
9
|
element: HTMLElement;
|
|
9
|
-
flyOutMenu
|
|
10
|
-
button
|
|
11
|
-
buttonIcon
|
|
12
|
-
flyOutClickAreaButton
|
|
13
|
-
|
|
10
|
+
private readonly flyOutMenu;
|
|
11
|
+
private readonly button;
|
|
12
|
+
private readonly buttonIcon;
|
|
13
|
+
private readonly flyOutClickAreaButton;
|
|
14
|
+
private readonly flyOutMenuItems;
|
|
14
15
|
onFlyOutMenuOpen: () => void;
|
|
15
16
|
onFlyOutMenuClose: () => void;
|
|
16
17
|
constructor(params: {
|
|
@@ -25,6 +26,7 @@ export declare class SplitButton {
|
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
private createFlyOutMenuItem;
|
|
29
|
+
setSelectedItem: (key: string) => void;
|
|
28
30
|
private setMenuItemSelected;
|
|
29
31
|
private flyOutClickZoneOnClick;
|
|
30
32
|
private setFlyOutMenuVisibility;
|
|
@@ -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";
|
|
@@ -99,6 +100,7 @@ export namespace PubSubController {
|
|
|
99
100
|
undo: "undo";
|
|
100
101
|
updatePivot: "updatePivot";
|
|
101
102
|
windowClose: "windowClose";
|
|
103
|
+
wheel: "wheel";
|
|
102
104
|
windowComponentChanged: "windowComponentChanged";
|
|
103
105
|
windowComponentShouldClose: "windowComponentShouldClose";
|
|
104
106
|
windowComponentShouldOpen: "windowComponentShouldOpen";
|
|
@@ -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;
|
|
@@ -185,6 +185,7 @@ export class RenderController {
|
|
|
185
185
|
handleEmptySpaceClick(): void;
|
|
186
186
|
onSingleClick(evt: any, rightClick?: boolean): void;
|
|
187
187
|
onMouseMove(evt: any): void;
|
|
188
|
+
onWheel(evt: any): void;
|
|
188
189
|
setCanvasSelectionEnabled(enabled: any): void;
|
|
189
190
|
getSelectedSubtree(meshnodeIndex: any): {
|
|
190
191
|
objectId: number;
|
|
@@ -28,6 +28,7 @@ export class RenderControllerProxy {
|
|
|
28
28
|
logInitializationTimes: any;
|
|
29
29
|
projectId: any;
|
|
30
30
|
baseUrl: any;
|
|
31
|
+
featureFlags: any;
|
|
31
32
|
nodeUrl: any;
|
|
32
33
|
meshnodeUrl: any;
|
|
33
34
|
meshUrl: any;
|
|
@@ -127,6 +128,7 @@ export class RenderControllerProxy {
|
|
|
127
128
|
};
|
|
128
129
|
onSingleClick(...params: any[]): void | Promise<any>;
|
|
129
130
|
onMouseMove(...params: any[]): void | Promise<any>;
|
|
131
|
+
onWheel(...params: any[]): void | Promise<any>;
|
|
130
132
|
resizeScene(...params: any[]): void;
|
|
131
133
|
onDoubleClick(...params: any[]): void | Promise<any>;
|
|
132
134
|
onRightClick(...params: any[]): void | Promise<any>;
|
|
@@ -40,6 +40,7 @@ export class RenderControllerWorker {
|
|
|
40
40
|
getContextMenuData(evt: any): Promise<any>;
|
|
41
41
|
onSingleClick(evt: any): Promise<any>;
|
|
42
42
|
onMouseMove(evt: any): Promise<any>;
|
|
43
|
+
onWheel(evt: any): Promise<any>;
|
|
43
44
|
resizeScene(...params: any[]): Promise<any>;
|
|
44
45
|
onDoubleClick(evt: any): Promise<any>;
|
|
45
46
|
onRightClick(evt: any): Promise<any>;
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MeasurementInterface } from './MeasurementInterface';
|
|
2
2
|
import { Vector3 } from '../types/Math';
|
|
3
3
|
import type { ApiController } from '../controllers/ApiController';
|
|
4
|
+
import { MeasurementOrigin } from '../api/analytic_events';
|
|
4
5
|
export declare const MEASURE_MODES: {
|
|
5
6
|
POINT_TO_POINT: string;
|
|
6
7
|
SHORTEST_DISTANCE: string;
|
|
@@ -20,16 +21,16 @@ export declare class MeasurementManager {
|
|
|
20
21
|
});
|
|
21
22
|
setGlobalOffset(params: Vector3): void;
|
|
22
23
|
setMeasurementEnabled(params: {
|
|
23
|
-
measurementMode
|
|
24
|
+
measurementMode?: MeasureMode;
|
|
24
25
|
enable: boolean;
|
|
25
|
-
origin:
|
|
26
|
+
origin: MeasurementOrigin;
|
|
26
27
|
}): void;
|
|
27
28
|
toggleMeasurement(params: {
|
|
28
29
|
measurementMode: MeasureMode;
|
|
29
|
-
origin:
|
|
30
|
+
origin: MeasurementOrigin;
|
|
30
31
|
}): void;
|
|
31
32
|
toggleCurrentMeasurement(params: {
|
|
32
|
-
origin:
|
|
33
|
+
origin: MeasurementOrigin;
|
|
33
34
|
}): void;
|
|
34
35
|
handleKeydown(curKey: number): void;
|
|
35
36
|
private handleESC;
|
|
@@ -2,6 +2,7 @@ import type { PickingController } from '../picking/PickingController';
|
|
|
2
2
|
import type { Models } from '../procoregl/Models';
|
|
3
3
|
import type { SnapType } from './MeasureToolUtils';
|
|
4
4
|
import type { ViewerRenderer } from '../procoregl/ViewerRenderer';
|
|
5
|
+
import type { RenderController } from '../controllers/RenderController';
|
|
5
6
|
import { Vector3 } from '../types/Math';
|
|
6
7
|
export type WorldIntersectionSnapResult = {
|
|
7
8
|
intersection: Vector3;
|
|
@@ -18,6 +19,7 @@ export type WorldIntersectionSnapResult = {
|
|
|
18
19
|
meshnodeIndex: number;
|
|
19
20
|
cursorRotation: Vector3;
|
|
20
21
|
snapScreenPosition: Vector3;
|
|
22
|
+
relatedMeshnodeIndex?: number | null;
|
|
21
23
|
};
|
|
22
24
|
export declare class PointToPointController {
|
|
23
25
|
private readonly pickingController;
|
|
@@ -31,8 +33,10 @@ export declare class PointToPointController {
|
|
|
31
33
|
private lastWorldIntersectionSnapResult;
|
|
32
34
|
private readonly debugGui;
|
|
33
35
|
private readonly viewerRenderer;
|
|
36
|
+
private renderController;
|
|
34
37
|
constructor(params: {
|
|
35
38
|
pickingController: PickingController;
|
|
39
|
+
renderController: RenderController;
|
|
36
40
|
models: Models;
|
|
37
41
|
camera: THREE.PerspectiveCamera;
|
|
38
42
|
globalOffset: THREE.Vector3;
|
|
@@ -42,6 +46,8 @@ export declare class PointToPointController {
|
|
|
42
46
|
set enabled(value: boolean);
|
|
43
47
|
handleMouseClick(): void;
|
|
44
48
|
handleMouseMove(event: MouseEvent): void;
|
|
49
|
+
handleWheel(event: WheelEvent): Promise<void>;
|
|
50
|
+
private computeIntersectionSnapResult;
|
|
45
51
|
private getWorldIntersectionSnapResult;
|
|
46
52
|
private publishIntersectionSnapResult;
|
|
47
53
|
private getMeshTopology;
|
|
@@ -24,6 +24,11 @@ export declare class PointToPointManager implements MeasurementInterface {
|
|
|
24
24
|
private readonly locale;
|
|
25
25
|
private cursorTooltip;
|
|
26
26
|
private featureTooltip;
|
|
27
|
+
private surfaceCursor;
|
|
28
|
+
private edgeCursor;
|
|
29
|
+
private midPointCursor;
|
|
30
|
+
private endPointCursor;
|
|
31
|
+
private dom;
|
|
27
32
|
constructor(params: {
|
|
28
33
|
apiController: ApiController;
|
|
29
34
|
renderControllerProxy: RenderControllerProxy;
|
|
@@ -34,6 +39,8 @@ export declare class PointToPointManager implements MeasurementInterface {
|
|
|
34
39
|
});
|
|
35
40
|
setGlobalOffset(params: Vector3): void;
|
|
36
41
|
getGlobalOffset(): THREE.Vector3;
|
|
42
|
+
private onMouseMove;
|
|
43
|
+
private onWheel;
|
|
37
44
|
getMeasurementProgress(): MeasurementState;
|
|
38
45
|
private onCameraUpdated;
|
|
39
46
|
private onNavigationChanged;
|
|
@@ -50,4 +57,10 @@ export declare class PointToPointManager implements MeasurementInterface {
|
|
|
50
57
|
private removeCursors;
|
|
51
58
|
private setCameraAndNavigationControls;
|
|
52
59
|
private updateSvg;
|
|
60
|
+
private updateCursorPosition;
|
|
61
|
+
private updatePointToPointCursorSize;
|
|
62
|
+
private managePointToPointCursorElements;
|
|
63
|
+
private onMeasurementObjectEnter;
|
|
64
|
+
private updatePointToPointCursor;
|
|
65
|
+
private resetCursor;
|
|
53
66
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { WorldIntersectionSnapResult } from '../PointToPointController';
|
|
2
2
|
export declare const matrixWorld: import("three").Matrix4;
|
|
3
|
-
export declare const measurementObjectEnterObject1Payload: WorldIntersectionSnapResult;
|
|
4
|
-
export declare const measurementObjectEnterTooComplexPayload: WorldIntersectionSnapResult;
|
|
5
|
-
export declare const measurementObjectEnterObject2Payload: WorldIntersectionSnapResult;
|
|
6
|
-
export declare const measurementObjectMoveMidpointPayload: WorldIntersectionSnapResult;
|
|
7
3
|
export declare const measurementObjectLeaveMoveIntoObject2: {
|
|
8
4
|
meshnodeIndex: number;
|
|
9
5
|
relatedMeshnodeIndex: number;
|
|
@@ -26,7 +22,12 @@ export declare const measurementObjectClickPayloadSecondAnchor: {
|
|
|
26
22
|
z: number;
|
|
27
23
|
};
|
|
28
24
|
};
|
|
25
|
+
export declare const measurementObjectEnterObject1Payload: WorldIntersectionSnapResult;
|
|
26
|
+
export declare const measurementObjectEnterTooComplexPayload: WorldIntersectionSnapResult;
|
|
27
|
+
export declare const measurementObjectEnterObject2Payload: WorldIntersectionSnapResult;
|
|
28
|
+
export declare const measurementObjectMoveMidpointPayload: WorldIntersectionSnapResult;
|
|
29
29
|
export declare const measurementObjectMovePayload: WorldIntersectionSnapResult;
|
|
30
|
+
export declare const measurementObjectMoveComplexMeshPayload: WorldIntersectionSnapResult;
|
|
30
31
|
export declare const svgDataObjectOutline: {
|
|
31
32
|
lines: {
|
|
32
33
|
stroke: string;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import { DebugGui } from '../utils/DebugGui';
|
|
2
|
-
export declare const pointToPointCursorSize: {
|
|
3
|
-
surfaceCursorSize: number;
|
|
4
|
-
edgeCursorSize: number;
|
|
5
|
-
endpointCursorSize: number;
|
|
6
|
-
};
|
|
7
2
|
export declare const createPointToPointLineDrawingDebugGui: () => ReturnType<typeof DebugGui.add>;
|
|
@@ -7,10 +7,6 @@ export declare class DefaultControl implements MouseControl {
|
|
|
7
7
|
private isRotating;
|
|
8
8
|
private startMouseDown?;
|
|
9
9
|
private lockRotation;
|
|
10
|
-
private surfaceCursor;
|
|
11
|
-
private edgeCursor;
|
|
12
|
-
private midPointCursor;
|
|
13
|
-
private endPointCursor;
|
|
14
10
|
private static COUNTS_AS_CLICK_THRESHOLD;
|
|
15
11
|
constructor(params: {
|
|
16
12
|
dom: HTMLElement;
|
|
@@ -23,12 +19,5 @@ export declare class DefaultControl implements MouseControl {
|
|
|
23
19
|
dispose(): void;
|
|
24
20
|
private updateSectionHover;
|
|
25
21
|
private onSectionBoxDisplayHoverUpdated;
|
|
26
|
-
private onMeasurementObjectMove;
|
|
27
|
-
private onMeasurementObjectLeave;
|
|
28
|
-
private onMeasurementObjectEnter;
|
|
29
|
-
private updatePointToPointCursor;
|
|
30
22
|
private resetCursor;
|
|
31
|
-
private updateCursorPosition;
|
|
32
|
-
private updatePointToPointCursorSize;
|
|
33
|
-
private addPointToPointCursorToDom;
|
|
34
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
}
|
package/dist/types/src/sdk.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export type { PaletteParams } from './types/Palette';
|
|
|
34
34
|
export type { Uom, DisplayUnit } from './unit_util';
|
|
35
35
|
export { UOM, DISPLAY_UNIT_ABBREVIATIONS as DISPLAY_UNIT } from './unit_util';
|
|
36
36
|
export type { ProjectSettings } from './controllers/SettingsController';
|
|
37
|
+
export { MEASURE_MODES, type MeasureMode, } from './measuring/MeasurementManager';
|
|
37
38
|
declare const version: string;
|
|
38
39
|
export { version };
|
|
39
40
|
export { ErrorLogger } from './utils/Error';
|
|
@@ -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;
|