vim-web 0.5.1 → 0.6.0-dev.1
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/dist/types/core-viewers/shared/index.d.ts +2 -0
- package/dist/types/core-viewers/shared/inputAdapter.d.ts +1 -1
- package/dist/types/core-viewers/shared/loadResult.d.ts +55 -0
- package/dist/types/core-viewers/shared/mouseHandler.d.ts +1 -1
- package/dist/types/core-viewers/shared/raycaster.d.ts +5 -5
- package/dist/types/core-viewers/shared/vimCollection.d.ts +25 -0
- package/dist/types/core-viewers/ultra/loadRequest.d.ts +6 -28
- package/dist/types/core-viewers/ultra/viewer.d.ts +1 -1
- package/dist/types/core-viewers/ultra/vimCollection.d.ts +15 -11
- package/dist/types/core-viewers/webgl/index.d.ts +0 -1
- package/dist/types/core-viewers/webgl/loader/index.d.ts +3 -3
- package/dist/types/core-viewers/webgl/loader/materials/index.d.ts +1 -0
- package/dist/types/core-viewers/webgl/loader/materials/pickingMaterial.d.ts +42 -0
- package/dist/types/core-viewers/webgl/loader/progressive/insertableGeometry.d.ts +6 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMeshFactory.d.ts +8 -1
- package/dist/types/core-viewers/webgl/loader/progressive/legacyMeshFactory.d.ts +4 -1
- package/dist/types/core-viewers/webgl/loader/progressive/loadRequest.d.ts +21 -0
- package/dist/types/core-viewers/webgl/loader/progressive/subsetBuilder.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/subsetRequest.d.ts +3 -2
- package/dist/types/core-viewers/webgl/loader/vim.d.ts +7 -2
- package/dist/types/core-viewers/webgl/loader/vimCollection.d.ts +78 -0
- package/dist/types/core-viewers/webgl/loader/vimSettings.d.ts +11 -4
- package/dist/types/core-viewers/webgl/viewer/camera/cameraMovement.d.ts +8 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmoOrbit.d.ts +22 -17
- package/dist/types/core-viewers/webgl/viewer/raycaster.d.ts +3 -1
- package/dist/types/core-viewers/webgl/viewer/rendering/gpuPicker.d.ts +127 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/rendering/renderingSection.d.ts +4 -0
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettings.d.ts +11 -6
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +11 -1
- package/dist/types/react-viewers/helpers/loadRequest.d.ts +15 -16
- package/dist/types/react-viewers/panels/loadingBox.d.ts +1 -1
- package/dist/types/react-viewers/webgl/loading.d.ts +17 -22
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +20 -3
- package/dist/types/utils/asyncQueue.d.ts +15 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/vim-web.iife.js +48666 -48532
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +48427 -48293
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/open.d.ts +0 -12
- package/dist/types/core-viewers/webgl/loader/progressive/vimRequest.d.ts +0 -44
- package/dist/types/utils/result.d.ts +0 -13
|
@@ -7,26 +7,33 @@ import { Camera } from '../camera/camera';
|
|
|
7
7
|
import { ViewerSettings } from '../settings/viewerSettings';
|
|
8
8
|
import { type InputHandler } from '../../../shared';
|
|
9
9
|
/**
|
|
10
|
-
* Manages the camera target gizmo
|
|
10
|
+
* Manages the camera target gizmo - displays orbital rings at the camera target
|
|
11
|
+
* 2 vertical rings (great circles) + 3 horizontal rings (latitude circles)
|
|
12
|
+
* Each rendered twice: once with depth test, once always visible (for see-through effect)
|
|
11
13
|
*/
|
|
12
14
|
export declare class GizmoOrbit {
|
|
13
15
|
private _renderer;
|
|
14
16
|
private _camera;
|
|
15
17
|
private _inputs;
|
|
16
18
|
private _size;
|
|
17
|
-
private _color;
|
|
18
|
-
private _opacity;
|
|
19
|
-
private _opacityAlways;
|
|
20
19
|
private _showDurationMs;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
20
|
+
private _torusGeometry;
|
|
21
|
+
private _verticalMaterialDepth;
|
|
22
|
+
private _verticalMaterialAlways;
|
|
23
|
+
private _horizontalMaterialDepth;
|
|
24
|
+
private _horizontalMaterialAlways;
|
|
25
|
+
private _verticalMeshDepth;
|
|
26
|
+
private _verticalMeshAlways;
|
|
27
|
+
private _horizontalMeshDepth;
|
|
28
|
+
private _horizontalMeshAlways;
|
|
25
29
|
private _gizmos;
|
|
26
30
|
private _disconnectCamera;
|
|
27
31
|
private _timeout;
|
|
28
32
|
private _active;
|
|
29
|
-
private
|
|
33
|
+
private _color;
|
|
34
|
+
private _colorHorizontal;
|
|
35
|
+
private _opacity;
|
|
36
|
+
private _opacityAlways;
|
|
30
37
|
constructor(renderer: Renderer, camera: Camera, input: InputHandler, settings: ViewerSettings);
|
|
31
38
|
private connect;
|
|
32
39
|
private onUpdate;
|
|
@@ -47,23 +54,21 @@ export declare class GizmoOrbit {
|
|
|
47
54
|
setPosition(position: THREE.Vector3): void;
|
|
48
55
|
/**
|
|
49
56
|
* Updates the size of the orbit gizmo.
|
|
50
|
-
* @param {number} size - The new size of
|
|
57
|
+
* @param {number} size - The new size as fraction of screen (0-1).
|
|
51
58
|
*/
|
|
52
59
|
setSize(size: number): void;
|
|
53
60
|
/**
|
|
54
|
-
* Updates the
|
|
55
|
-
* @param {number} opacity - The opacity of the non-occluded part.
|
|
56
|
-
* @param {number} opacityAlways - The opacity of the occluded part.
|
|
61
|
+
* Updates the colors of the orbit gizmo.
|
|
57
62
|
*/
|
|
58
|
-
|
|
63
|
+
setColors(color: THREE.Color, colorHorizontal: THREE.Color): void;
|
|
59
64
|
/**
|
|
60
|
-
* Updates the
|
|
61
|
-
* @param {THREE.Color} color - The new color for the orbit gizmo.
|
|
65
|
+
* Updates the opacities of the orbit gizmo.
|
|
62
66
|
*/
|
|
63
|
-
|
|
67
|
+
setOpacity(opacity: number, opacityAlways: number): void;
|
|
64
68
|
private applySettings;
|
|
65
69
|
private updateScale;
|
|
66
70
|
private createGizmo;
|
|
71
|
+
private createInstancedMesh;
|
|
67
72
|
/**
|
|
68
73
|
* Disposes of all resources.
|
|
69
74
|
*/
|
|
@@ -31,7 +31,9 @@ export declare class RaycastResult implements IRaycastResult {
|
|
|
31
31
|
constructor(intersections: ThreeIntersectionList, firstHit?: THREE.Intersection, object?: Element3D | Marker);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Performs raycasting operations.
|
|
34
|
+
* Performs CPU-based raycasting operations using Three.js.
|
|
35
|
+
* This is kept as a reference/fallback implementation.
|
|
36
|
+
* The primary raycaster is GpuPicker which implements IRaycaster.
|
|
35
37
|
*/
|
|
36
38
|
export declare class Raycaster implements IRaycaster {
|
|
37
39
|
private _camera;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module viw-webgl-viewer/rendering
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { Camera } from '../camera/camera';
|
|
6
|
+
import { RenderScene } from './renderScene';
|
|
7
|
+
import { RenderingSection } from './renderingSection';
|
|
8
|
+
import { Element3D } from '../../loader/element3d';
|
|
9
|
+
import { Vim } from '../../loader/vim';
|
|
10
|
+
import { VimCollection } from '../../loader/vimCollection';
|
|
11
|
+
import type { IRaycaster, IRaycastResult } from '../../../shared';
|
|
12
|
+
import { Marker } from '../gizmos/markers/gizmoMarker';
|
|
13
|
+
/** Raycastable objects for the GpuPicker */
|
|
14
|
+
export type GpuRaycastableObject = Element3D | Marker;
|
|
15
|
+
/**
|
|
16
|
+
* Packs vimIndex (8 bits) and elementIndex (24 bits) into a single uint32.
|
|
17
|
+
* Used for GPU picking attribute.
|
|
18
|
+
*/
|
|
19
|
+
export declare function packPickingId(vimIndex: number, elementIndex: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Unpacks vimIndex and elementIndex from a packed uint32.
|
|
22
|
+
*/
|
|
23
|
+
export declare function unpackPickingId(packedId: number): {
|
|
24
|
+
vimIndex: number;
|
|
25
|
+
elementIndex: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Result of a GPU pick operation containing element index, world position, and surface normal.
|
|
29
|
+
* Implements IRaycastResult for compatibility with the raycaster interface.
|
|
30
|
+
*/
|
|
31
|
+
export declare class GpuPickResult implements IRaycastResult<GpuRaycastableObject> {
|
|
32
|
+
/** The element index in the vim */
|
|
33
|
+
readonly elementIndex: number;
|
|
34
|
+
/** The vim index identifying which vim the element belongs to */
|
|
35
|
+
readonly vimIndex: number;
|
|
36
|
+
/** The world position of the hit */
|
|
37
|
+
readonly worldPosition: THREE.Vector3;
|
|
38
|
+
/** The world normal at the hit point */
|
|
39
|
+
readonly worldNormal: THREE.Vector3;
|
|
40
|
+
/** Reference to the vim containing the element */
|
|
41
|
+
private _vim;
|
|
42
|
+
constructor(elementIndex: number, vimIndex: number, worldPosition: THREE.Vector3, worldNormal: THREE.Vector3, vim: Vim | undefined);
|
|
43
|
+
/**
|
|
44
|
+
* The object property for IRaycastResult interface.
|
|
45
|
+
* Returns the Element3D for the picked element.
|
|
46
|
+
*/
|
|
47
|
+
get object(): Element3D | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the Element3D object for the picked element.
|
|
50
|
+
* @returns The Element3D object, or undefined if not found
|
|
51
|
+
*/
|
|
52
|
+
getElement(): Element3D | undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Unified GPU picker that outputs element index, depth, vim index, and surface normal in a single render pass.
|
|
56
|
+
* Implements IRaycaster for compatibility with the viewer's raycaster interface.
|
|
57
|
+
*
|
|
58
|
+
* Uses a Float32 render target with:
|
|
59
|
+
* - R = packed(vimIndex * 16777216 + elementIndex) - supports 256 vims × 16M elements
|
|
60
|
+
* - G = depth (distance along camera direction, 0 = miss)
|
|
61
|
+
* - B = normal.x (surface normal X component)
|
|
62
|
+
* - A = normal.y (surface normal Y component)
|
|
63
|
+
*
|
|
64
|
+
* Normal.z is reconstructed as: sqrt(1 - x² - y²), always positive since normal faces camera.
|
|
65
|
+
*/
|
|
66
|
+
export declare class GpuPicker implements IRaycaster<GpuRaycastableObject> {
|
|
67
|
+
private _renderer;
|
|
68
|
+
private _camera;
|
|
69
|
+
private _scene;
|
|
70
|
+
private _vims;
|
|
71
|
+
private _section;
|
|
72
|
+
private _renderTarget;
|
|
73
|
+
private _pickingMaterial;
|
|
74
|
+
private _readBuffer;
|
|
75
|
+
debug: boolean;
|
|
76
|
+
private _debugSphere;
|
|
77
|
+
private _debugLine;
|
|
78
|
+
constructor(renderer: THREE.WebGLRenderer, camera: Camera, scene: RenderScene, vims: VimCollection, section: RenderingSection, width: number, height: number);
|
|
79
|
+
/**
|
|
80
|
+
* Updates the render target size to match viewport.
|
|
81
|
+
*/
|
|
82
|
+
setSize(width: number, height: number): void;
|
|
83
|
+
/**
|
|
84
|
+
* Performs GPU picking at the given screen coordinates.
|
|
85
|
+
* Returns a result object with element index, world position, and getElement() method.
|
|
86
|
+
*
|
|
87
|
+
* @param screenPos Screen position in 0-1 range (0,0 is top-left)
|
|
88
|
+
* @returns Pick result with element index, world position, and getElement(), or undefined if no hit
|
|
89
|
+
*/
|
|
90
|
+
pick(screenPos: THREE.Vector2): GpuPickResult | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Shows debug visuals (sphere at hit point, line showing normal direction).
|
|
93
|
+
*/
|
|
94
|
+
private showDebugVisuals;
|
|
95
|
+
/**
|
|
96
|
+
* Reconstructs world position from screen coordinates and depth value.
|
|
97
|
+
*/
|
|
98
|
+
private reconstructWorldPosition;
|
|
99
|
+
/**
|
|
100
|
+
* Removes debug visuals (sphere and normal line) from the scene.
|
|
101
|
+
*/
|
|
102
|
+
clearDebugVisuals(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Raycasts from camera to the screen position to find the first object hit.
|
|
105
|
+
* Implements IRaycaster interface.
|
|
106
|
+
* @param position - Screen position in 0-1 range (0,0 is top-left)
|
|
107
|
+
* @returns A promise that resolves to the raycast result, or undefined if no hit
|
|
108
|
+
*/
|
|
109
|
+
raycastFromScreen(position: THREE.Vector2): Promise<GpuPickResult | undefined>;
|
|
110
|
+
/**
|
|
111
|
+
* Raycasts from camera towards a world position to find the first object hit.
|
|
112
|
+
* Implements IRaycaster interface.
|
|
113
|
+
* @param position - The world position to raycast towards
|
|
114
|
+
* @returns A promise that resolves to the raycast result, or undefined if no hit
|
|
115
|
+
*/
|
|
116
|
+
raycastFromWorld(position: THREE.Vector3): Promise<GpuPickResult | undefined>;
|
|
117
|
+
/**
|
|
118
|
+
* Converts a world position to screen coordinates (0-1 range).
|
|
119
|
+
* @param worldPos - The world position to convert
|
|
120
|
+
* @returns Screen position in 0-1 range, or undefined if behind camera
|
|
121
|
+
*/
|
|
122
|
+
private worldToScreen;
|
|
123
|
+
/**
|
|
124
|
+
* Disposes of all resources.
|
|
125
|
+
*/
|
|
126
|
+
dispose(): void;
|
|
127
|
+
}
|
|
@@ -12,13 +12,13 @@ export declare class RenderScene {
|
|
|
12
12
|
threeScene: THREE.Scene;
|
|
13
13
|
boxUpdated: boolean;
|
|
14
14
|
smallGhostThreshold: number | undefined;
|
|
15
|
-
private
|
|
15
|
+
private _vimScenesById;
|
|
16
16
|
private _boundingBox;
|
|
17
17
|
private _memory;
|
|
18
18
|
private _2dCount;
|
|
19
19
|
private _outlineCount;
|
|
20
20
|
private _modelMaterial;
|
|
21
|
-
get meshes(): (import("../..").
|
|
21
|
+
get meshes(): (InstancedMesh | import("../..").Mesh | import("../..").InsertableMesh)[];
|
|
22
22
|
constructor();
|
|
23
23
|
get estimatedMemory(): number;
|
|
24
24
|
has2dObjects(): boolean;
|
|
@@ -106,23 +106,28 @@ export type ViewerSettings = {
|
|
|
106
106
|
*/
|
|
107
107
|
enable: boolean;
|
|
108
108
|
/**
|
|
109
|
-
* Size of camera gizmo.
|
|
110
|
-
* Default: 0.
|
|
109
|
+
* Size of camera gizmo as fraction of screen (0-1).
|
|
110
|
+
* Default: 0.1
|
|
111
111
|
*/
|
|
112
112
|
size: number;
|
|
113
113
|
/**
|
|
114
|
-
* Color of
|
|
115
|
-
* Default: THREE.Color(
|
|
114
|
+
* Color of vertical rings (great circles).
|
|
115
|
+
* Default: THREE.Color(0x0590cc) - VIM blue
|
|
116
116
|
*/
|
|
117
117
|
color: THREE.Color;
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Color of horizontal rings (latitude circles).
|
|
120
|
+
* Default: THREE.Color(0x58b5dd) - Primary_300
|
|
121
|
+
*/
|
|
122
|
+
colorHorizontal: THREE.Color;
|
|
123
|
+
/**
|
|
124
|
+
* Opacity of the camera gizmo when in front of objects.
|
|
120
125
|
* Default: 0.5
|
|
121
126
|
*/
|
|
122
127
|
opacity: number;
|
|
123
128
|
/**
|
|
124
129
|
* Opacity of the camera gizmo when behind objects.
|
|
125
|
-
* Default: 0.
|
|
130
|
+
* Default: 0.1
|
|
126
131
|
*/
|
|
127
132
|
opacityAlways: number;
|
|
128
133
|
};
|
|
@@ -68,7 +68,7 @@ export declare class Viewer {
|
|
|
68
68
|
get onVimLoaded(): ISignal;
|
|
69
69
|
private _camera;
|
|
70
70
|
private _clock;
|
|
71
|
-
private
|
|
71
|
+
private _vimCollection;
|
|
72
72
|
private _onVimLoaded;
|
|
73
73
|
private _updateId;
|
|
74
74
|
constructor(settings?: PartialViewerSettings);
|
|
@@ -82,6 +82,16 @@ export declare class Viewer {
|
|
|
82
82
|
* The number of Vim objects currently loaded in the viewer.
|
|
83
83
|
*/
|
|
84
84
|
get vimCount(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Allocates a stable ID for a new vim to be loaded.
|
|
87
|
+
* The ID persists for the vim's lifetime and is used for GPU picking.
|
|
88
|
+
* @returns The allocated ID (0-255), or undefined if all 256 slots are in use
|
|
89
|
+
*/
|
|
90
|
+
allocateVimId(): number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the viewer has reached maximum capacity (256 vims).
|
|
93
|
+
*/
|
|
94
|
+
get isVimsFull(): boolean;
|
|
85
95
|
/**
|
|
86
96
|
* Adds a Vim object to the renderer, triggering the appropriate actions and dispatching events upon successful addition.
|
|
87
97
|
* @param {Vim} vim - The Vim object to add to the renderer.
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import * as Core from '../../core-viewers';
|
|
2
|
+
import { ILoadRequest as CoreILoadRequest } from '../../core-viewers/webgl/loader/progressive/loadRequest';
|
|
3
|
+
import { IProgress } from '../../core-viewers/shared/loadResult';
|
|
2
4
|
import { LoadingError } from '../webgl/loading';
|
|
3
5
|
type RequestCallbacks = {
|
|
4
|
-
onProgress: (p:
|
|
6
|
+
onProgress: (p: IProgress) => void;
|
|
5
7
|
onError: (e: LoadingError) => void;
|
|
6
8
|
onDone: () => void;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* Class to handle loading a request.
|
|
12
|
+
* Implements ILoadRequest for compatibility with Ultra viewer's load request interface.
|
|
10
13
|
*/
|
|
11
|
-
export declare class LoadRequest {
|
|
12
|
-
|
|
13
|
-
private _callbacks;
|
|
14
|
+
export declare class LoadRequest implements CoreILoadRequest {
|
|
15
|
+
private _source;
|
|
14
16
|
private _request;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
constructor(callbacks: RequestCallbacks, source: Core.Webgl.RequestSource, settings?: Core.Webgl.
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
private end;
|
|
25
|
-
getProgress(): AsyncGenerator<Core.Webgl.IProgressLogs, void, void>;
|
|
26
|
-
getResult(): Promise<import("../../utils").Result<Core.Webgl.Vim>>;
|
|
17
|
+
private _callbacks;
|
|
18
|
+
private _onLoaded?;
|
|
19
|
+
private _progressQueue;
|
|
20
|
+
private _resultPromise;
|
|
21
|
+
constructor(callbacks: RequestCallbacks, source: Core.Webgl.RequestSource, settings: Core.Webgl.VimPartialSettings, vimIndex: number, onLoaded?: (vim: Core.Webgl.Vim) => Promise<void> | void);
|
|
22
|
+
private trackAndGetResult;
|
|
23
|
+
get isCompleted(): boolean;
|
|
24
|
+
getProgress(): AsyncGenerator<IProgress>;
|
|
25
|
+
getResult(): Promise<Core.LoadResult<Core.Webgl.Vim>>;
|
|
27
26
|
abort(): void;
|
|
28
27
|
}
|
|
29
28
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module viw-webgl-react
|
|
3
3
|
*/
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
export type ProgressMode = '
|
|
5
|
+
export type ProgressMode = 'percent' | 'bytes';
|
|
6
6
|
/**
|
|
7
7
|
* Interface for message information displayed in the LoadingBox.
|
|
8
8
|
* @property message - Optional main message text.
|
|
@@ -5,17 +5,13 @@ import * as Core from '../../core-viewers';
|
|
|
5
5
|
import { LoadRequest } from '../helpers/loadRequest';
|
|
6
6
|
import { ModalHandle } from '../panels/modal';
|
|
7
7
|
import { WebglSettings } from './settings';
|
|
8
|
+
import { IProgress } from '../../core-viewers/shared/loadResult';
|
|
8
9
|
type AddSettings = {
|
|
9
10
|
/**
|
|
10
11
|
* Controls whether to frame the camera on a vim everytime it is updated.
|
|
11
12
|
* Default: true
|
|
12
13
|
*/
|
|
13
14
|
autoFrame?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Controls whether to initially load the vim content or not.
|
|
16
|
-
* Default: false
|
|
17
|
-
*/
|
|
18
|
-
loadEmpty?: boolean;
|
|
19
15
|
};
|
|
20
16
|
export type OpenSettings = Core.Webgl.VimPartialSettings & AddSettings;
|
|
21
17
|
export type LoadingError = {
|
|
@@ -34,9 +30,9 @@ export declare class ComponentLoader {
|
|
|
34
30
|
/**
|
|
35
31
|
* Event emitter for progress updates.
|
|
36
32
|
*/
|
|
37
|
-
onProgress(p:
|
|
33
|
+
onProgress(p: IProgress): void;
|
|
38
34
|
/**
|
|
39
|
-
|
|
35
|
+
* Event emitter for completion notifications.
|
|
40
36
|
*/
|
|
41
37
|
onDone(): void;
|
|
42
38
|
/**
|
|
@@ -44,26 +40,25 @@ export declare class ComponentLoader {
|
|
|
44
40
|
*/
|
|
45
41
|
onError(e: LoadingError): void;
|
|
46
42
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param onProgress Optional callback function to track progress during opening.
|
|
51
|
-
* Receives progress logs as input.
|
|
52
|
-
*/
|
|
53
|
-
open(source: Core.Webgl.RequestSource, settings: OpenSettings, onProgress?: (p: Core.Webgl.IProgressLogs) => void): Promise<Core.Webgl.Vim>;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new load request for the provided source and settings.
|
|
43
|
+
* Opens a vim file without loading geometry.
|
|
44
|
+
* Use this for querying BIM data or selective loading.
|
|
45
|
+
* Call vim.loadAll() or vim.loadSubset() to load geometry later.
|
|
56
46
|
* @param source The url to the vim file or a buffer of the file.
|
|
57
47
|
* @param settings Settings to apply to vim file.
|
|
58
|
-
* @returns A
|
|
48
|
+
* @returns A LoadRequest to track progress and get result. The vim is auto-added on success.
|
|
49
|
+
* @throws Error if the viewer has reached maximum capacity (256 vims)
|
|
59
50
|
*/
|
|
60
|
-
|
|
61
|
-
add(vim: Core.Webgl.Vim, settings?: AddSettings): void;
|
|
51
|
+
open(source: Core.Webgl.RequestSource, settings?: OpenSettings): LoadRequest;
|
|
62
52
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
53
|
+
* Loads a vim file with all geometry.
|
|
54
|
+
* Use this for immediate viewing.
|
|
55
|
+
* @param source The url to the vim file or a buffer of the file.
|
|
56
|
+
* @param settings Settings to apply to vim file.
|
|
57
|
+
* @returns A LoadRequest to track progress and get result. The vim is auto-added on success.
|
|
58
|
+
* @throws Error if the viewer has reached maximum capacity (256 vims)
|
|
65
59
|
*/
|
|
66
|
-
|
|
60
|
+
load(source: Core.Webgl.RequestSource, settings?: OpenSettings): LoadRequest;
|
|
61
|
+
private loadInternal;
|
|
67
62
|
private initVim;
|
|
68
63
|
}
|
|
69
64
|
export {};
|
|
@@ -8,13 +8,14 @@ import { CameraRef } from '../state/cameraState';
|
|
|
8
8
|
import { Container } from '../container';
|
|
9
9
|
import { BimInfoPanelRef } from '../bim/bimInfoData';
|
|
10
10
|
import { ControlBarRef } from '../controlbar';
|
|
11
|
-
import {
|
|
11
|
+
import { OpenSettings } from './loading';
|
|
12
12
|
import { ModalHandle } from '../panels/modal';
|
|
13
13
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
14
14
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
15
15
|
import { GenericPanelHandle } from '../generic';
|
|
16
16
|
import { SettingsItem } from '../settings/settingsItem';
|
|
17
17
|
import { WebglSettings } from './settings';
|
|
18
|
+
export type { OpenSettings } from './loading';
|
|
18
19
|
/**
|
|
19
20
|
* Settings API managing settings applied to the viewer.
|
|
20
21
|
*/
|
|
@@ -64,9 +65,25 @@ export type ViewerRef = {
|
|
|
64
65
|
*/
|
|
65
66
|
core: Core.Webgl.Viewer;
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
+
* Loads a vim file with all geometry for immediate viewing.
|
|
69
|
+
* @param source The url or buffer of the vim file
|
|
70
|
+
* @param settings Optional settings
|
|
71
|
+
* @returns LoadRequest to track progress and get result
|
|
68
72
|
*/
|
|
69
|
-
|
|
73
|
+
load: (source: Core.Webgl.RequestSource, settings?: OpenSettings) => Core.Webgl.ILoadRequest;
|
|
74
|
+
/**
|
|
75
|
+
* Opens a vim file without loading geometry.
|
|
76
|
+
* Use for BIM queries or selective loading via vim.loadAll()/loadSubset().
|
|
77
|
+
* @param source The url or buffer of the vim file
|
|
78
|
+
* @param settings Optional settings
|
|
79
|
+
* @returns LoadRequest to track progress and get result
|
|
80
|
+
*/
|
|
81
|
+
open: (source: Core.Webgl.RequestSource, settings?: OpenSettings) => Core.Webgl.ILoadRequest;
|
|
82
|
+
/**
|
|
83
|
+
* Removes a vim from the viewer and disposes it.
|
|
84
|
+
* @param vim The vim to remove
|
|
85
|
+
*/
|
|
86
|
+
remove: (vim: Core.Webgl.Vim) => void;
|
|
70
87
|
/**
|
|
71
88
|
* Isolation API managing isolation state in the viewer.
|
|
72
89
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A queue that converts push-based callbacks into an async iterator.
|
|
3
|
+
* Use this to bridge callback-based APIs with async/await consumers.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AsyncQueue<T> {
|
|
6
|
+
private _queue;
|
|
7
|
+
private _waiters;
|
|
8
|
+
private _closed;
|
|
9
|
+
/** Push a value to the queue. Wakes up one waiting consumer. */
|
|
10
|
+
push(value: T): void;
|
|
11
|
+
/** Close the queue. No more values can be pushed. */
|
|
12
|
+
close(): void;
|
|
13
|
+
/** Async iterator that yields queued values until closed. */
|
|
14
|
+
[Symbol.asyncIterator](): AsyncGenerator<T, void, void>;
|
|
15
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './array';
|
|
2
|
+
export * from './asyncQueue';
|
|
2
3
|
export * from './debounce';
|
|
3
4
|
export * from './interfaces';
|
|
4
5
|
export * from './math3d';
|
|
5
6
|
export * from './partial';
|
|
6
7
|
export * from './promise';
|
|
7
|
-
export * from './result';
|
|
8
8
|
export * from './threeUtils';
|
|
9
9
|
export * from './url';
|
|
10
10
|
export * from './validation';
|