vim-web 0.3.44-dev.6 → 0.3.44-dev.61
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/README.md +2 -2
- package/dist/style.css +25 -9
- package/dist/types/core-viewers/index.d.ts +3 -0
- package/dist/types/core-viewers/{webgl/viewer/inputs/inputHandler.d.ts → shared/baseInputHandler.d.ts} +6 -6
- package/dist/types/core-viewers/shared/index.d.ts +9 -0
- package/dist/types/core-viewers/shared/inputHandler.d.ts +116 -0
- package/dist/types/core-viewers/shared/keyboardHandler.d.ts +96 -0
- package/dist/types/core-viewers/shared/mouseHandler.d.ts +26 -0
- package/dist/types/core-viewers/shared/raycaster.d.ts +13 -0
- package/dist/types/core-viewers/shared/selection.d.ts +45 -0
- package/dist/types/core-viewers/{webgl/viewer/inputs → shared}/touchHandler.d.ts +15 -18
- package/dist/types/core-viewers/shared/vim.d.ts +35 -0
- package/dist/types/core-viewers/ultra/{viewer/camera.d.ts → camera.d.ts} +14 -4
- package/dist/types/core-viewers/ultra/{viewer/colorManager.d.ts → colorManager.d.ts} +6 -6
- package/dist/types/core-viewers/ultra/{viewer/decoder.d.ts → decoder.d.ts} +0 -8
- package/dist/types/core-viewers/ultra/element3d.d.ts +15 -0
- package/dist/types/core-viewers/ultra/index.d.ts +28 -8
- package/dist/types/core-viewers/ultra/inputAdapter.d.ts +5 -0
- package/dist/types/core-viewers/ultra/nodeState.d.ts +113 -0
- package/dist/types/core-viewers/ultra/raycaster.d.ts +52 -0
- package/dist/types/core-viewers/ultra/{viewer/color.d.ts → remoteColor.d.ts} +3 -3
- package/dist/types/core-viewers/ultra/{viewer/renderer.d.ts → renderer.d.ts} +9 -3
- package/dist/types/core-viewers/ultra/{viewer/rpcClient.d.ts → rpcClient.d.ts} +27 -28
- package/dist/types/core-viewers/ultra/rpcMarshal.d.ts +62 -0
- package/dist/types/core-viewers/ultra/{viewer/rpcSafeClient.d.ts → rpcSafeClient.d.ts} +22 -23
- package/dist/types/core-viewers/ultra/{utils/math3d.d.ts → rpcTypes.d.ts} +22 -22
- package/dist/types/core-viewers/ultra/{viewer/sectionBox.d.ts → sectionBox.d.ts} +7 -2
- package/dist/types/core-viewers/ultra/selection.d.ts +4 -0
- package/dist/types/core-viewers/ultra/{viewer/socketClient.d.ts → socketClient.d.ts} +4 -11
- package/dist/types/core-viewers/ultra/{viewer/viewer.d.ts → viewer.d.ts} +16 -13
- package/dist/types/core-viewers/ultra/vim.d.ts +48 -0
- package/dist/types/core-viewers/webgl/index.d.ts +2 -21
- package/dist/types/core-viewers/webgl/loader/{colorAttributes.d.ts → colorAttribute.d.ts} +4 -4
- package/dist/types/core-viewers/webgl/loader/{object3D.d.ts → element3d.d.ts} +12 -9
- package/dist/types/core-viewers/webgl/loader/geometry.d.ts +76 -78
- package/dist/types/core-viewers/webgl/loader/index.d.ts +24 -0
- package/dist/types/core-viewers/webgl/loader/materials/index.d.ts +9 -0
- package/dist/types/core-viewers/webgl/loader/materials/{viewerMaterials.d.ts → materials.d.ts} +5 -5
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +7 -7
- package/dist/types/core-viewers/webgl/loader/progressive/insertableGeometry.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableSubmesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedSubmesh.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/progressive/legacyMeshFactory.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/subsetBuilder.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/subsetRequest.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/vimRequest.d.ts +3 -3
- package/dist/types/core-viewers/webgl/loader/scene.d.ts +11 -14
- package/dist/types/core-viewers/webgl/loader/vim.d.ts +15 -19
- package/dist/types/core-viewers/webgl/loader/vimSettings.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/{objectAttributes.d.ts → webglAttribute.d.ts} +4 -4
- package/dist/types/core-viewers/webgl/viewer/camera/camera.d.ts +8 -113
- package/dist/types/core-viewers/webgl/viewer/camera/{ICamera.d.ts → cameraInterface.d.ts} +0 -4
- package/dist/types/core-viewers/webgl/viewer/camera/cameraMovement.d.ts +5 -5
- package/dist/types/core-viewers/webgl/viewer/camera/cameraMovementLerp.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/camera/cameraMovementSnap.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/camera/{orthographic.d.ts → cameraOrthographic.d.ts} +1 -1
- package/dist/types/core-viewers/webgl/viewer/camera/{perspective.d.ts → cameraPerspective.d.ts} +1 -1
- package/dist/types/core-viewers/webgl/viewer/camera/index.d.ts +7 -0
- package/dist/types/core-viewers/webgl/viewer/environment/environment.d.ts +5 -5
- package/dist/types/core-viewers/webgl/viewer/environment/index.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/environment/{cameraLight.d.ts → light.d.ts} +2 -2
- package/dist/types/core-viewers/webgl/viewer/environment/skybox.d.ts +3 -3
- package/dist/types/core-viewers/webgl/viewer/gizmos/axes/axesSettings.d.ts +3 -2
- package/dist/types/core-viewers/webgl/viewer/gizmos/axes/gizmoAxes.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/axes/index.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmoOrbit.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmos.d.ts +0 -5
- package/dist/types/core-viewers/webgl/viewer/gizmos/index.d.ts +7 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/markers/gizmoMarker.d.ts +63 -15
- package/dist/types/core-viewers/webgl/viewer/gizmos/markers/gizmoMarkers.d.ts +30 -7
- package/dist/types/core-viewers/webgl/viewer/gizmos/markers/index.d.ts +2 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/measure/index.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/measure/measure.d.ts +10 -16
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/index.d.ts +7 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +4 -5
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxGizmo.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +6 -4
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandles.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxInputs.d.ts +3 -40
- package/dist/types/core-viewers/webgl/viewer/index.d.ts +10 -0
- package/dist/types/core-viewers/webgl/viewer/inputsAdapter.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/raycaster.d.ts +37 -57
- package/dist/types/core-viewers/webgl/viewer/rendering/index.d.ts +4 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/mergePass.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +8 -8
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +9 -6
- package/dist/types/core-viewers/webgl/viewer/rendering/renderingComposer.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/rendering/renderingSection.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/selection.d.ts +6 -89
- package/dist/types/core-viewers/webgl/viewer/settings/index.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/settings/{defaultViewerSettings.d.ts → viewerDefaultSettings.d.ts} +1 -1
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettings.d.ts +2 -9
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettingsParsing.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +13 -13
- package/dist/types/index.d.ts +2 -3
- package/dist/types/react-viewers/bim/bimInfoData.d.ts +2 -2
- package/dist/types/react-viewers/bim/bimInfoObject.d.ts +4 -4
- package/dist/types/react-viewers/bim/bimInfoPanel.d.ts +3 -3
- package/dist/types/react-viewers/bim/bimInfoVim.d.ts +4 -4
- package/dist/types/react-viewers/bim/bimPanel.d.ts +13 -13
- package/dist/types/react-viewers/bim/bimSearch.d.ts +2 -2
- package/dist/types/react-viewers/bim/bimTree.d.ts +10 -8
- package/dist/types/react-viewers/bim/bimTreeData.d.ts +5 -4
- package/dist/types/react-viewers/bim/index.d.ts +8 -0
- package/dist/types/react-viewers/container.d.ts +3 -3
- package/dist/types/react-viewers/controlbar/controlBar.d.ts +10 -4
- package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +1 -4
- package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +36 -27
- package/dist/types/react-viewers/controlbar/controlBarSection.d.ts +1 -4
- package/dist/types/react-viewers/controlbar/index.d.ts +6 -0
- package/dist/types/react-viewers/controlbar/style.d.ts +10 -0
- package/dist/types/react-viewers/errors/index.d.ts +2 -0
- package/dist/types/react-viewers/helpers/cameraObserver.d.ts +2 -2
- package/dist/types/react-viewers/helpers/cursor.d.ts +5 -3
- package/dist/types/react-viewers/helpers/element.d.ts +3 -2
- package/dist/types/react-viewers/helpers/index.d.ts +10 -0
- package/dist/types/react-viewers/helpers/loadRequest.d.ts +6 -6
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +270 -0
- package/dist/types/react-viewers/helpers/utils.d.ts +1 -1
- package/dist/types/react-viewers/{panels/icons.d.ts → icons.d.ts} +9 -0
- package/dist/types/react-viewers/index.d.ts +10 -6
- package/dist/types/react-viewers/panels/axesPanel.d.ts +4 -4
- package/dist/types/react-viewers/panels/contextMenu.d.ts +20 -10
- package/dist/types/react-viewers/panels/genericPanel.d.ts +22 -0
- package/dist/types/react-viewers/panels/index.d.ts +14 -0
- package/dist/types/react-viewers/panels/loadingBox.d.ts +2 -2
- package/dist/types/react-viewers/panels/messageBox.d.ts +1 -1
- package/dist/types/react-viewers/panels/modal.d.ts +6 -6
- package/dist/types/react-viewers/panels/renderSettingsPanel.d.ts +4 -0
- package/dist/types/react-viewers/panels/restOfScreen.d.ts +1 -1
- package/dist/types/react-viewers/{sidePanel → panels}/sidePanel.d.ts +3 -3
- package/dist/types/react-viewers/panels/toast.d.ts +3 -3
- package/dist/types/react-viewers/settings/index.d.ts +5 -0
- package/dist/types/react-viewers/settings/menuSettings.d.ts +2 -2
- package/dist/types/react-viewers/settings/settings.d.ts +13 -50
- package/dist/types/react-viewers/settings/settingsState.d.ts +8 -8
- package/dist/types/react-viewers/settings/settingsStorage.d.ts +6 -6
- package/dist/types/react-viewers/settings/userBoolean.d.ts +17 -0
- package/dist/types/react-viewers/state/cameraState.d.ts +24 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +35 -20
- package/dist/types/react-viewers/state/index.d.ts +9 -0
- package/dist/types/react-viewers/state/measureState.d.ts +2 -2
- package/dist/types/react-viewers/state/pointerState.d.ts +5 -5
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +18 -17
- package/dist/types/react-viewers/state/sharedIsolation.d.ts +38 -0
- package/dist/types/react-viewers/state/viewerInputs.d.ts +3 -0
- package/dist/types/react-viewers/ultra/camera.d.ts +3 -0
- package/dist/types/react-viewers/ultra/controlBar.d.ts +6 -0
- package/dist/types/react-viewers/ultra/errors/ultraErrors.d.ts +3 -3
- package/dist/types/react-viewers/ultra/index.d.ts +2 -1
- package/dist/types/react-viewers/ultra/isolation.d.ts +3 -0
- package/dist/types/react-viewers/ultra/modal.d.ts +5 -0
- package/dist/types/react-viewers/ultra/sectionBox.d.ts +3 -0
- package/dist/types/react-viewers/ultra/viewer.d.ts +21 -0
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +38 -0
- package/dist/types/react-viewers/urls.d.ts +1 -0
- package/dist/types/react-viewers/webgl/camera.d.ts +3 -0
- package/dist/types/react-viewers/webgl/index.d.ts +3 -8
- package/dist/types/react-viewers/webgl/inputsBindings.d.ts +8 -0
- package/dist/types/react-viewers/webgl/isolation.d.ts +2 -0
- package/dist/types/react-viewers/webgl/{webglLoading.d.ts → loading.d.ts} +8 -8
- package/dist/types/react-viewers/webgl/sectionBox.d.ts +3 -0
- package/dist/types/react-viewers/webgl/viewer.d.ts +28 -0
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +98 -0
- package/dist/types/react-viewers/webgl/viewerState.d.ts +7 -5
- package/dist/types/utils/index.d.ts +11 -0
- package/dist/types/utils/interfaces.d.ts +3 -0
- package/dist/types/utils/math3d.d.ts +19 -0
- package/dist/types/utils/partial.d.ts +7 -0
- package/dist/types/{core-viewers/webgl/utils/requestResult.d.ts → utils/result.d.ts} +1 -1
- package/dist/types/utils/strings.d.ts +7 -0
- package/dist/types/{core-viewers/webgl/utils → utils}/threeUtils.d.ts +1 -0
- package/dist/types/{core-viewers/ultra/utils → utils}/url.d.ts +2 -0
- package/dist/types/{core-viewers/ultra/utils → utils}/validation.d.ts +11 -10
- package/dist/vim-web.iife.js +16910 -17039
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +16873 -17002
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/core-viewers/ultra/utils/deferredPromise.d.ts +0 -8
- package/dist/types/core-viewers/ultra/utils/result.d.ts +0 -11
- package/dist/types/core-viewers/ultra/viewer/inputs/InputTouch.d.ts +0 -25
- package/dist/types/core-viewers/ultra/viewer/inputs/inputHandler.d.ts +0 -7
- package/dist/types/core-viewers/ultra/viewer/inputs/inputKeyboard.d.ts +0 -20
- package/dist/types/core-viewers/ultra/viewer/inputs/inputMouse.d.ts +0 -21
- package/dist/types/core-viewers/ultra/viewer/inputs/inputs.d.ts +0 -27
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +0 -86
- package/dist/types/core-viewers/ultra/viewer/selection.d.ts +0 -96
- package/dist/types/core-viewers/ultra/viewer/vim.d.ts +0 -111
- package/dist/types/core-viewers/webgl/utils/deferredPromise.d.ts +0 -8
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmoRectangle.d.ts +0 -51
- package/dist/types/core-viewers/webgl/viewer/gizmos/measure/measureFlow.d.ts +0 -36
- package/dist/types/core-viewers/webgl/viewer/inputs/input.d.ts +0 -128
- package/dist/types/core-viewers/webgl/viewer/inputs/keyboardHandler.d.ts +0 -113
- package/dist/types/core-viewers/webgl/viewer/inputs/mouseHandler.d.ts +0 -66
- package/dist/types/react-viewers/errors/errorUtils.d.ts +0 -2
- package/dist/types/react-viewers/helpers/camera.d.ts +0 -37
- package/dist/types/react-viewers/helpers/inputs.d.ts +0 -22
- package/dist/types/react-viewers/helpers/isolation.d.ts +0 -128
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +0 -29
- package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +0 -6
- package/dist/types/react-viewers/ultra/ultraModal.d.ts +0 -4
- package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +0 -3
- package/dist/types/react-viewers/webgl/webglComponent.d.ts +0 -28
- package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +0 -113
- package/dist/types/react-viewers/webgl/webglSectionBoxState.d.ts +0 -3
- /package/dist/types/core-viewers/ultra/{viewer/decoderWithWorker.d.ts → decoderWithWorker.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/loadRequest.d.ts → loadRequest.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/logger.d.ts → logger.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/protocol.d.ts → protocol.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/streamLogger.d.ts → streamLogger.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/streamRenderer.d.ts → streamRenderer.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/viewport.d.ts → viewport.d.ts} +0 -0
- /package/dist/types/core-viewers/ultra/{viewer/vimCollection.d.ts → vimCollection.d.ts} +0 -0
- /package/dist/types/react-viewers/{sidePanel → state}/sideState.d.ts +0 -0
- /package/dist/types/{core-viewers/ultra/utils → utils}/array.d.ts +0 -0
- /package/dist/types/{core-viewers/ultra/utils → utils}/debounce.d.ts +0 -0
- /package/dist/types/{core-viewers/ultra/utils → utils}/promise.d.ts +0 -0
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
export * from './viewer
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export
|
|
2
|
+
export * from './viewer';
|
|
3
|
+
export { RGB, RGBA, RGBA32, Segment, type SectionBoxState, type HitCheckResult, type VimStatus } from './rpcTypes';
|
|
4
|
+
export { materialHandles, MaterialHandles, type MaterialHandle, } from './rpcClient';
|
|
5
|
+
export type * from './camera';
|
|
6
|
+
export type * from './colorManager';
|
|
7
|
+
export type * from './decoder';
|
|
8
|
+
export type * from './nodeState';
|
|
9
|
+
export { NodeState } from './nodeState';
|
|
10
|
+
export type * from './element3d';
|
|
11
|
+
export type * from './inputAdapter';
|
|
12
|
+
export type * from './loadRequest';
|
|
13
|
+
export type * from './logger';
|
|
14
|
+
export type * from './protocol';
|
|
15
|
+
export type * from './raycaster';
|
|
16
|
+
export type * from './remoteColor';
|
|
17
|
+
export type * from './renderer';
|
|
18
|
+
export type * from './rpcClient';
|
|
19
|
+
export type * from './rpcMarshal';
|
|
20
|
+
export type * from './rpcSafeClient';
|
|
21
|
+
export { InputMode, VimLoadingStatus } from './rpcSafeClient';
|
|
22
|
+
export type * from './sectionBox';
|
|
23
|
+
export type * from './selection';
|
|
24
|
+
export type * from './socketClient';
|
|
25
|
+
export type * from './streamLogger';
|
|
26
|
+
export type * from './streamRenderer';
|
|
27
|
+
export type * from './viewport';
|
|
28
|
+
export type * from './vim';
|
|
29
|
+
export type * from './vimCollection';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { RpcSafeClient } from './rpcSafeClient';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the possible states a node can have in the UltraVim system.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum NodeState {
|
|
6
|
+
VISIBLE = "visible",
|
|
7
|
+
HIDDEN = "hidden",
|
|
8
|
+
GHOSTED = "ghosted",
|
|
9
|
+
HIGHLIGHTED = "highlighted"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A class that wraps a StateTracker and is responsible for synchronizing its state updates with the remote RPCs.
|
|
13
|
+
* It batches updates to optimize performance and handles the communication with the remote system.
|
|
14
|
+
*/
|
|
15
|
+
export declare class StateSynchronizer {
|
|
16
|
+
private _tracker;
|
|
17
|
+
private _rpc;
|
|
18
|
+
private _getHandle;
|
|
19
|
+
private _onUpdate;
|
|
20
|
+
private _isConnected;
|
|
21
|
+
private _animationFrame;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new StateSynchronizer instance.
|
|
24
|
+
*
|
|
25
|
+
* @param rpc - The RPC client used to communicate with the remote system
|
|
26
|
+
* @param getHandle - Function that returns the current handle identifier
|
|
27
|
+
* @param isConnected - Function that returns whether the connection to the remote system is active
|
|
28
|
+
* @param onUpdate - Callback function invoked when updates are sent to the remote system
|
|
29
|
+
* @param defaultState - The default state for nodes when not explicitly set (defaults to VISIBLE)
|
|
30
|
+
*/
|
|
31
|
+
constructor(rpc: RpcSafeClient, getHandle: () => number, isConnected: () => boolean, onUpdate: () => void, defaultState?: NodeState);
|
|
32
|
+
/**
|
|
33
|
+
* Checks if all nodes are in the specified state(s).
|
|
34
|
+
*
|
|
35
|
+
* @param state - A single state or array of states to check against
|
|
36
|
+
* @returns True if all nodes are in the specified state(s), false otherwise
|
|
37
|
+
*/
|
|
38
|
+
areAllInState(state: NodeState | NodeState[]): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the current state of a specific node.
|
|
41
|
+
*
|
|
42
|
+
* @param node - The node identifier
|
|
43
|
+
* @returns The current state of the node
|
|
44
|
+
*/
|
|
45
|
+
getNodeState(node: number): NodeState;
|
|
46
|
+
/**
|
|
47
|
+
* Gets all nodes that are currently in the specified state.
|
|
48
|
+
*
|
|
49
|
+
* @param state - The state to query
|
|
50
|
+
* @returns Either 'all' if all nodes are in this state, or an array of node IDs
|
|
51
|
+
*/
|
|
52
|
+
getNodesInState(state: NodeState): number[] | 'all';
|
|
53
|
+
/**
|
|
54
|
+
* Gets the default state used for nodes without explicit state settings.
|
|
55
|
+
*
|
|
56
|
+
* @returns The current default state
|
|
57
|
+
*/
|
|
58
|
+
getDefaultState(): NodeState;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the state of a specific node.
|
|
61
|
+
*
|
|
62
|
+
* @param nodeId - The identifier of the node
|
|
63
|
+
* @param state - The new state to apply
|
|
64
|
+
*/
|
|
65
|
+
setNodeState(nodeId: number, state: NodeState): void;
|
|
66
|
+
/**
|
|
67
|
+
* Sets the state of all nodes to the specified value.
|
|
68
|
+
*
|
|
69
|
+
* @param state - The state to apply to all nodes
|
|
70
|
+
* @param clear - If true, clears all node-specific overrides
|
|
71
|
+
*/
|
|
72
|
+
setAllNodesState(state: NodeState, clear: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* Replaces all nodes in one state (or states) with another state.
|
|
75
|
+
*
|
|
76
|
+
* @param fromState - The state(s) to replace
|
|
77
|
+
* @param toState - The new state to apply
|
|
78
|
+
*/
|
|
79
|
+
replaceState(fromState: NodeState | NodeState[], toState: NodeState): void;
|
|
80
|
+
/**
|
|
81
|
+
* Reapplies all current state settings, useful after changes to the node structure.
|
|
82
|
+
* This will remove redundant overrides and ensure consistency.
|
|
83
|
+
*/
|
|
84
|
+
reapplyStates(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Schedules a synchronization on the next animation frame.
|
|
87
|
+
* This batches multiple rapid state changes to avoid excessive RPC calls.
|
|
88
|
+
*
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
private scheduleUpdate;
|
|
92
|
+
/**
|
|
93
|
+
* Processes all pending updates and sends them to the remote system.
|
|
94
|
+
*
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
private remoteUpdate;
|
|
98
|
+
/**
|
|
99
|
+
* Calls the appropriate RPC method to update the state of all nodes.
|
|
100
|
+
*
|
|
101
|
+
* @param state - The state to apply to all nodes
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
private callRPCForStateAll;
|
|
105
|
+
/**
|
|
106
|
+
* Calls the appropriate RPC method to update the state of specific nodes.
|
|
107
|
+
*
|
|
108
|
+
* @param state - The state to apply
|
|
109
|
+
* @param nodes - Array of node IDs to update
|
|
110
|
+
* @private
|
|
111
|
+
*/
|
|
112
|
+
private callRPCForStateNodes;
|
|
113
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { IRaycastResult, IRaycaster } from "../shared/raycaster";
|
|
3
|
+
import { Element3D } from "./element3d";
|
|
4
|
+
import { RpcSafeClient } from "./rpcSafeClient";
|
|
5
|
+
import { IReadonlyVimCollection } from "./vimCollection";
|
|
6
|
+
export type IUltraRaycastResult = IRaycastResult<Element3D>;
|
|
7
|
+
export type IUltraRaycaster = IRaycaster<Element3D>;
|
|
8
|
+
/**
|
|
9
|
+
* Represents the result of a hit test operation.
|
|
10
|
+
*/
|
|
11
|
+
export declare class UltraRaycastResult implements IRaycastResult<Element3D> {
|
|
12
|
+
/** The model Object hit */
|
|
13
|
+
object: Element3D;
|
|
14
|
+
/** The 3D world position of the hit point */
|
|
15
|
+
worldPosition: THREE.Vector3;
|
|
16
|
+
/** The surface normal at the hit point */
|
|
17
|
+
worldNormal: THREE.Vector3;
|
|
18
|
+
constructor(object: Element3D, worldPosition: THREE.Vector3, worldNormal: THREE.Vector3);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @module ultra-webgl-viewer
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Handles raycasting operations in the Ultra system, enabling picking and
|
|
25
|
+
* interaction with 3D objects in the scene.
|
|
26
|
+
*/
|
|
27
|
+
export declare class Raycaster implements IRaycaster<Element3D> {
|
|
28
|
+
private _rpc;
|
|
29
|
+
private _vims;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new UltraCoreRaycaster instance.
|
|
32
|
+
*
|
|
33
|
+
* @param {RpcSafeClient} rpc - RPC client for communication with the viewer.
|
|
34
|
+
* @param {IReadonlyVimCollection} vims - Collection of VIM instances to manage.
|
|
35
|
+
*/
|
|
36
|
+
constructor(rpc: RpcSafeClient, vims: IReadonlyVimCollection);
|
|
37
|
+
/**
|
|
38
|
+
* Performs a raycast from the camera using normalized screen coordinates.
|
|
39
|
+
* Coordinates must be within [0, 1] for both x and y.
|
|
40
|
+
*
|
|
41
|
+
* @param {Vector2} position - The normalized screen position for raycasting.
|
|
42
|
+
* @returns {Promise<UltraRaycastResult | undefined>} Promise resolving to hit test result or undefined if no hit.
|
|
43
|
+
*/
|
|
44
|
+
raycastFromScreen(position: THREE.Vector2): Promise<UltraRaycastResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Performs a raycast from a specific world position towards a target.
|
|
47
|
+
*
|
|
48
|
+
* @param {Vector3} position - The target world position for raycasting.
|
|
49
|
+
* @returns {Promise<UltraRaycastResult | undefined>} Promise resolving to hit test result or undefined if no hit.
|
|
50
|
+
*/
|
|
51
|
+
raycastFromWorld(position: THREE.Vector3): Promise<UltraRaycastResult | undefined>;
|
|
52
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { RGBA32 } from
|
|
2
|
-
import { ColorManager } from
|
|
1
|
+
import { RGBA32 } from './rpcTypes';
|
|
2
|
+
import { ColorManager } from './colorManager';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a handle to a color in the color management system.
|
|
5
5
|
* This class provides access to color components and manages the lifecycle of color instances.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class RemoteColor {
|
|
8
8
|
private _manager;
|
|
9
9
|
/** Unique identifier for the color instance */
|
|
10
10
|
readonly id: number;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISignal } from "ste-signals";
|
|
2
|
+
import * as THREE from "three";
|
|
2
3
|
import { ILogger } from "./logger";
|
|
3
4
|
import { RpcSafeClient, SceneSettings } from "./rpcSafeClient";
|
|
5
|
+
import { RGBA } from "./rpcTypes";
|
|
4
6
|
import { ClientStreamError } from "./socketClient";
|
|
5
7
|
/**
|
|
6
8
|
* Render settings that extend SceneSettings with additional rendering-specific properties
|
|
@@ -19,6 +21,7 @@ export declare const defaultRenderSettings: RenderSettings;
|
|
|
19
21
|
* Interface defining the basic renderer capabilities
|
|
20
22
|
*/
|
|
21
23
|
export interface IRenderer {
|
|
24
|
+
onSceneUpdated: ISignal;
|
|
22
25
|
ghostColor: RGBA;
|
|
23
26
|
lockIblRotation: boolean;
|
|
24
27
|
hdrScale: number;
|
|
@@ -27,7 +30,7 @@ export interface IRenderer {
|
|
|
27
30
|
hdrBackgroundSaturation: number;
|
|
28
31
|
backgroundBlur: number;
|
|
29
32
|
backgroundColor: RGBA;
|
|
30
|
-
getBoundingBox(): Promise<Box3 | undefined>;
|
|
33
|
+
getBoundingBox(): Promise<THREE.Box3 | undefined>;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Renderer class that handles 3D scene rendering and settings management
|
|
@@ -40,6 +43,8 @@ export declare class Renderer implements IRenderer {
|
|
|
40
43
|
private _updateLighting;
|
|
41
44
|
private _updateGhostColor;
|
|
42
45
|
private _updateIblRotation;
|
|
46
|
+
private readonly _onSceneUpdated;
|
|
47
|
+
get onSceneUpdated(): ISignal;
|
|
43
48
|
/**
|
|
44
49
|
* Creates a new Renderer instance
|
|
45
50
|
* @param rpc - RPC client for communication with the rendering backend
|
|
@@ -56,6 +61,7 @@ export declare class Renderer implements IRenderer {
|
|
|
56
61
|
* Sets up initial scene settings, ghost color, and IBL rotation
|
|
57
62
|
*/
|
|
58
63
|
onConnect(): void;
|
|
64
|
+
notifySceneUpdated(): void;
|
|
59
65
|
/**
|
|
60
66
|
* Gets the ghost color used for transparent rendering
|
|
61
67
|
* @returns Current ghost color as RGBA
|
|
@@ -136,7 +142,7 @@ export declare class Renderer implements IRenderer {
|
|
|
136
142
|
* @param value - New background color as RGBA
|
|
137
143
|
*/
|
|
138
144
|
set backgroundColor(value: RGBA);
|
|
139
|
-
getBoundingBox(): Promise<Box3 | undefined>;
|
|
145
|
+
getBoundingBox(): Promise<THREE.Box3 | undefined>;
|
|
140
146
|
/**
|
|
141
147
|
* Requests an update to be performed on the next animation frame.
|
|
142
148
|
* Multiple setting changes will be batched into a single update.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SocketClient } from './socketClient';
|
|
2
|
-
import
|
|
3
|
-
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from '../utils/math3d';
|
|
2
|
+
import * as RpcTypes from './rpcTypes';
|
|
4
3
|
export type MaterialHandle = 4294967295 | 6 | 2 | 0 | 1 | 3 | 4 | 5 | 7 | 8;
|
|
5
4
|
export declare class MaterialHandles {
|
|
6
5
|
static readonly Invalid: MaterialHandle;
|
|
@@ -24,24 +23,24 @@ export declare class RpcClient {
|
|
|
24
23
|
RPCAddNodeFlags(componentHandle: number, nodes: number[], flags: number): void;
|
|
25
24
|
RPCClearMaterialOverrides(componentHandle: number): void;
|
|
26
25
|
RPCClearScene(): void;
|
|
27
|
-
RPCCreateMaterialInstances(materialHandle: number, smoothness: number, colors: RGBA32[]): Promise<number>;
|
|
28
|
-
RPCCreateText(position: Vector3, color: RGBA32, text: string): Promise<number>;
|
|
26
|
+
RPCCreateMaterialInstances(materialHandle: number, smoothness: number, colors: RpcTypes.RGBA32[]): Promise<number>;
|
|
27
|
+
RPCCreateText(position: RpcTypes.Vector3, color: RpcTypes.RGBA32, text: string): Promise<number>;
|
|
29
28
|
RPCDestroyMaterialInstances(materialInstanceHandle: number[]): void;
|
|
30
29
|
RPCDestroyText(componentHandle: number): void;
|
|
31
30
|
RPCEnableSectionBox(value: boolean): void;
|
|
32
|
-
RPCFrameAll(blendTime: number): Promise<Segment>;
|
|
33
|
-
RPCFrameBox(box: Box3, blendTime: number): Promise<Segment>;
|
|
34
|
-
RPCFrameInstances(componentHandle: number, nodes: number[], blendTime: number): Promise<Segment>;
|
|
35
|
-
RPCFrameVim(componentHandle: number, blendTime: number): Promise<Segment>;
|
|
31
|
+
RPCFrameAll(blendTime: number): Promise<RpcTypes.Segment>;
|
|
32
|
+
RPCFrameBox(box: RpcTypes.Box3, blendTime: number): Promise<RpcTypes.Segment>;
|
|
33
|
+
RPCFrameInstances(componentHandle: number, nodes: number[], blendTime: number): Promise<RpcTypes.Segment>;
|
|
34
|
+
RPCFrameVim(componentHandle: number, blendTime: number): Promise<RpcTypes.Segment>;
|
|
36
35
|
RPCGetAPIVersion(): Promise<string>;
|
|
37
|
-
RPCGetBoundingBox(componentHandle: number, nodes: number[]): Promise<Box3>;
|
|
38
|
-
RPCGetBoundingBoxAll(componentHandle: number): Promise<Box3>;
|
|
39
|
-
RPCGetCameraPosition(): Promise<Segment>;
|
|
40
|
-
RPCGetIblRotation(): Promise<Matrix44>;
|
|
36
|
+
RPCGetBoundingBox(componentHandle: number, nodes: number[]): Promise<RpcTypes.Box3>;
|
|
37
|
+
RPCGetBoundingBoxAll(componentHandle: number): Promise<RpcTypes.Box3>;
|
|
38
|
+
RPCGetCameraPosition(): Promise<RpcTypes.Segment>;
|
|
39
|
+
RPCGetIblRotation(): Promise<RpcTypes.Matrix44>;
|
|
41
40
|
RPCGetLastError(): Promise<string>;
|
|
42
|
-
RPCGetSceneAABB(): Promise<Box3>;
|
|
43
|
-
RPCGetSectionBox(): Promise<SectionBoxState>;
|
|
44
|
-
RPCGetVimLoadingState(componentHandle: number): Promise<VimStatus>;
|
|
41
|
+
RPCGetSceneAABB(): Promise<RpcTypes.Box3>;
|
|
42
|
+
RPCGetSectionBox(): Promise<RpcTypes.SectionBoxState>;
|
|
43
|
+
RPCGetVimLoadingState(componentHandle: number): Promise<RpcTypes.VimStatus>;
|
|
45
44
|
RPCGhost(componentHandle: number, nodes: number[]): void;
|
|
46
45
|
RPCGhostAll(componentHandle: number): void;
|
|
47
46
|
RPCHide(componentHandle: number, nodes: number[]): void;
|
|
@@ -54,28 +53,28 @@ export declare class RpcClient {
|
|
|
54
53
|
RPCLoadVim(fileName: string): Promise<number>;
|
|
55
54
|
RPCLoadVimURL(url: string, authToken: string): Promise<number>;
|
|
56
55
|
RPCLockIblRotation(lock: boolean): void;
|
|
57
|
-
RPCMouseButtonEvent(mousePos: Vector2, mouseButton: number, down: boolean): void;
|
|
58
|
-
RPCMouseDoubleClickEvent(mousePos: Vector2, mouseButton: number): void;
|
|
59
|
-
RPCMouseMoveEvent(mousePos: Vector2): void;
|
|
56
|
+
RPCMouseButtonEvent(mousePos: RpcTypes.Vector2, mouseButton: number, down: boolean): void;
|
|
57
|
+
RPCMouseDoubleClickEvent(mousePos: RpcTypes.Vector2, mouseButton: number): void;
|
|
58
|
+
RPCMouseMoveEvent(mousePos: RpcTypes.Vector2): void;
|
|
60
59
|
RPCMouseScrollEvent(scrollValue: number): void;
|
|
61
|
-
RPCMouseSelectEvent(mousePos: Vector2, mouseButton: number): void;
|
|
62
|
-
RPCMoveCameraTo(usePosition: boolean, useTarget: boolean, position: Vector3, target: Vector3, blendTime: number): void;
|
|
60
|
+
RPCMouseSelectEvent(mousePos: RpcTypes.Vector2, mouseButton: number): void;
|
|
61
|
+
RPCMoveCameraTo(usePosition: boolean, useTarget: boolean, position: RpcTypes.Vector3, target: RpcTypes.Vector3, blendTime: number): void;
|
|
63
62
|
RPCPauseRendering(pause: boolean): void;
|
|
64
|
-
RPCPerformHitTest(pos: Vector2): Promise<HitCheckResult>;
|
|
63
|
+
RPCPerformHitTest(pos: RpcTypes.Vector2): Promise<RpcTypes.HitCheckResult>;
|
|
65
64
|
RPCRemoveNodeFlags(componentHandle: number, nodes: number[], flags: number): void;
|
|
66
65
|
RPCSetAspectRatio(width: number, height: number): void;
|
|
67
66
|
RPCSetCameraMode(orbit: boolean): void;
|
|
68
|
-
RPCSetCameraPosition(state: Segment, blendTime: number): void;
|
|
69
|
-
RPCSetGhostColor(ghostColor: RGBA): void;
|
|
70
|
-
RPCSetIblRotation(transform: Matrix44): void;
|
|
71
|
-
RPCSetLighting(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RGBA): void;
|
|
67
|
+
RPCSetCameraPosition(state: RpcTypes.Segment, blendTime: number): void;
|
|
68
|
+
RPCSetGhostColor(ghostColor: RpcTypes.RGBA): void;
|
|
69
|
+
RPCSetIblRotation(transform: RpcTypes.Matrix44): void;
|
|
70
|
+
RPCSetLighting(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RpcTypes.RGBA): void;
|
|
72
71
|
RPCSetMaterialOverrides(componentHandle: number, nodes: number[], materialInstanceHandles: number[]): void;
|
|
73
72
|
RPCSetMoveSpeed(speed: number): void;
|
|
74
|
-
RPCSetSectionBox(state: SectionBoxState): void;
|
|
73
|
+
RPCSetSectionBox(state: RpcTypes.SectionBoxState): void;
|
|
75
74
|
RPCShow(componentHandle: number, nodes: number[]): void;
|
|
76
|
-
RPCShowAABBs(componentHandle: number, nodes: number[], colors: RGBA32[]): void;
|
|
75
|
+
RPCShowAABBs(componentHandle: number, nodes: number[], colors: RpcTypes.RGBA32[]): void;
|
|
77
76
|
RPCShowAll(componentHandle: number): void;
|
|
78
|
-
RPCStartScene(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RGBA): Promise<boolean>;
|
|
77
|
+
RPCStartScene(toneMappingWhitePoint: number, hdrScale: number, hdrBackgroundScale: number, hdrBackgroundSaturation: number, backgroundBlur: number, backgroundColor: RpcTypes.RGBA): Promise<boolean>;
|
|
79
78
|
RPCTriggerRenderDocCapture(): void;
|
|
80
79
|
RPCUnloadVim(componentHandle: number): void;
|
|
81
80
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Don't modify this file, the RPC generated code depends on its interface.
|
|
3
|
+
*/
|
|
4
|
+
import * as RpcTypes from "./rpcTypes";
|
|
5
|
+
export declare class Marshal {
|
|
6
|
+
private buffer;
|
|
7
|
+
private _dataView;
|
|
8
|
+
private _offset;
|
|
9
|
+
constructor(initialSize?: number);
|
|
10
|
+
getBuffer(): ArrayBuffer;
|
|
11
|
+
private ensureCapacity;
|
|
12
|
+
writeData(data: ArrayBuffer): void;
|
|
13
|
+
writeMatrix44(data: RpcTypes.Matrix44): void;
|
|
14
|
+
writeBoolean(value: boolean): void;
|
|
15
|
+
writeInt(value: number): void;
|
|
16
|
+
writeUInt(value: number): void;
|
|
17
|
+
writeFloat(value: number): void;
|
|
18
|
+
writeString(value: string): void;
|
|
19
|
+
writeHitCheckResult(data: RpcTypes.HitCheckResult): void;
|
|
20
|
+
writeVimStatus(data: RpcTypes.VimStatus): void;
|
|
21
|
+
writeVector2(data: RpcTypes.Vector2): void;
|
|
22
|
+
writeVector3(data: RpcTypes.Vector3): void;
|
|
23
|
+
writeRGBA(color: RpcTypes.RGBA): void;
|
|
24
|
+
writeRGB(color: RpcTypes.RGB): void;
|
|
25
|
+
writeRGBA32(color: RpcTypes.RGBA32): void;
|
|
26
|
+
writeSegment(segment: RpcTypes.Segment): void;
|
|
27
|
+
writeBox3(data: RpcTypes.Box3): void;
|
|
28
|
+
writeSectionBoxState(data: RpcTypes.SectionBoxState): void;
|
|
29
|
+
writeArrayOfInt(values: number[]): void;
|
|
30
|
+
writeArrayOfUInt(values: number[]): void;
|
|
31
|
+
writeArrayOfFloat(values: number[]): void;
|
|
32
|
+
writeArrayOfBool(values: boolean[]): void;
|
|
33
|
+
writeArrayOfRGBA32(values: RpcTypes.RGBA32[]): void;
|
|
34
|
+
writeArray<T>(data: T[], sizeT: number, write: (data: T) => void): void;
|
|
35
|
+
}
|
|
36
|
+
export declare class ReadMarshal {
|
|
37
|
+
private _dataView;
|
|
38
|
+
private _offset;
|
|
39
|
+
constructor(buffer: ArrayBuffer);
|
|
40
|
+
readMatrix44(): RpcTypes.Matrix44;
|
|
41
|
+
readInt(): number;
|
|
42
|
+
readUInt(): number;
|
|
43
|
+
readFloat(): number;
|
|
44
|
+
readBoolean(): boolean;
|
|
45
|
+
readString(): string;
|
|
46
|
+
readHitCheckResult(): RpcTypes.HitCheckResult;
|
|
47
|
+
readVimStatus(): RpcTypes.VimStatus;
|
|
48
|
+
readVector2(): RpcTypes.Vector2;
|
|
49
|
+
readVector3(): RpcTypes.Vector3;
|
|
50
|
+
readRGBA(): RpcTypes.RGBA;
|
|
51
|
+
readRGB(): RpcTypes.RGB;
|
|
52
|
+
readRGBA32(): RpcTypes.RGBA32;
|
|
53
|
+
readBox3(): RpcTypes.Box3;
|
|
54
|
+
readSegment(): RpcTypes.Segment;
|
|
55
|
+
readSectionBoxState(): RpcTypes.SectionBoxState;
|
|
56
|
+
readArrayOfInt(): number[];
|
|
57
|
+
readArrayOfUInt(): number[];
|
|
58
|
+
readArrayOfFloat(): number[];
|
|
59
|
+
readArrayOfBool(): boolean[];
|
|
60
|
+
readArrayOfRGBA32(): RpcTypes.RGBA32[];
|
|
61
|
+
readArray<T>(read: () => T): T[];
|
|
62
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HitCheckResult, SectionBoxState } from "./marshal";
|
|
1
|
+
import * as RpcTypes from "./rpcTypes";
|
|
3
2
|
import { MaterialHandle, RpcClient } from "./rpcClient";
|
|
4
3
|
export type VimSource = {
|
|
5
4
|
url: string;
|
|
@@ -19,7 +18,7 @@ export type SceneSettings = {
|
|
|
19
18
|
hdrBackgroundScale: number;
|
|
20
19
|
hdrBackgroundSaturation: number;
|
|
21
20
|
backGroundBlur: number;
|
|
22
|
-
backgroundColor: RGBA;
|
|
21
|
+
backgroundColor: RpcTypes.RGBA;
|
|
23
22
|
};
|
|
24
23
|
export declare const defaultSceneSettings: SceneSettings;
|
|
25
24
|
export declare enum VimLoadingStatus {
|
|
@@ -57,7 +56,7 @@ export declare class RpcSafeClient {
|
|
|
57
56
|
*/
|
|
58
57
|
RPCSetLighting(settings: SceneSettings): void;
|
|
59
58
|
RPCLockIblRotation(lock: boolean): void;
|
|
60
|
-
RPCGetSceneAABB(): Promise<Box3 | undefined>;
|
|
59
|
+
RPCGetSceneAABB(): Promise<RpcTypes.Box3 | undefined>;
|
|
61
60
|
/*******************************************************************************
|
|
62
61
|
* NODE VISIBILITY METHODS
|
|
63
62
|
* Methods for controlling node visibility, including show/hide, ghosting,
|
|
@@ -131,7 +130,7 @@ export declare class RpcSafeClient {
|
|
|
131
130
|
* @returns Promise resolving to the handle of the created text component
|
|
132
131
|
* @throws {Error} If the text is empty
|
|
133
132
|
*/
|
|
134
|
-
RPCCreateText(position: Vector3, color: RGBA32, text: string): Promise<number>;
|
|
133
|
+
RPCCreateText(position: RpcTypes.Vector3, color: RpcTypes.RGBA32, text: string): Promise<number>;
|
|
135
134
|
/**
|
|
136
135
|
* Destroys a text component, removing it from the scene.
|
|
137
136
|
* @param componentHandle - The handle of the text component to destroy
|
|
@@ -143,8 +142,8 @@ export declare class RpcSafeClient {
|
|
|
143
142
|
* Methods for controlling section box visibility and position.
|
|
144
143
|
******************************************************************************/
|
|
145
144
|
RPCEnableSectionBox(enable: boolean): void;
|
|
146
|
-
RPCSetSectionBox(state: SectionBoxState): void;
|
|
147
|
-
RPCGetSectionBox(): Promise<SectionBoxState | undefined>;
|
|
145
|
+
RPCSetSectionBox(state: RpcTypes.SectionBoxState): void;
|
|
146
|
+
RPCGetSectionBox(): Promise<RpcTypes.SectionBoxState | undefined>;
|
|
148
147
|
/*******************************************************************************
|
|
149
148
|
* CAMERA AND VIEW METHODS
|
|
150
149
|
* Methods for controlling camera position, movement, framing, and view settings.
|
|
@@ -153,15 +152,15 @@ export declare class RpcSafeClient {
|
|
|
153
152
|
* Retrieves the current camera position and orientation.
|
|
154
153
|
* @returns Promise resolving to a segment representing the camera's current position and target
|
|
155
154
|
*/
|
|
156
|
-
RPCGetCameraPosition(): Promise<Segment | undefined>;
|
|
155
|
+
RPCGetCameraPosition(): Promise<RpcTypes.Segment | undefined>;
|
|
157
156
|
/**
|
|
158
157
|
* Sets the camera position and orientation.
|
|
159
158
|
* @param segment - The desired camera position and target
|
|
160
159
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
161
160
|
* @throws {Error} If segment is invalid or blendTime is negative
|
|
162
161
|
*/
|
|
163
|
-
RPCSetCameraPosition(segment: Segment, blendTime: number): void;
|
|
164
|
-
RPCGetBoundingBoxAll(componentHandle: number): Promise<
|
|
162
|
+
RPCSetCameraPosition(segment: RpcTypes.Segment, blendTime: number): void;
|
|
163
|
+
RPCGetBoundingBoxAll(componentHandle: number): Promise<RpcTypes.Box3 | undefined>;
|
|
165
164
|
/**
|
|
166
165
|
* Calculates the bounding box for specified nodes in a component.
|
|
167
166
|
* Large node arrays are automatically processed in batches for better performance.
|
|
@@ -170,14 +169,14 @@ export declare class RpcSafeClient {
|
|
|
170
169
|
* @returns Promise resolving to the combined bounding box
|
|
171
170
|
* @throws {Error} If the component handle is invalid or nodes array is invalid
|
|
172
171
|
*/
|
|
173
|
-
RPCGetBoundingBox(componentHandle: number, nodes: number[]): Promise<Box3 | undefined>;
|
|
172
|
+
RPCGetBoundingBox(componentHandle: number, nodes: number[]): Promise<RpcTypes.Box3 | undefined>;
|
|
174
173
|
private getBoundingBoxBatched;
|
|
175
174
|
/**
|
|
176
175
|
* Frames the camera to show all components in the scene.
|
|
177
176
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
178
177
|
* @returns Promise resolving to camera segment representing the final position
|
|
179
178
|
*/
|
|
180
|
-
RPCFrameAll(blendTime: number): Promise<Segment | undefined>;
|
|
179
|
+
RPCFrameAll(blendTime: number): Promise<RpcTypes.Segment | undefined>;
|
|
181
180
|
/**
|
|
182
181
|
* Frames a specific VIM component in the scene.
|
|
183
182
|
* @param componentHandle - The handle of the VIM component to frame
|
|
@@ -185,7 +184,7 @@ export declare class RpcSafeClient {
|
|
|
185
184
|
* @returns Promise resolving to camera segment representing the final position
|
|
186
185
|
* @throws {Error} If the component handle is invalid
|
|
187
186
|
*/
|
|
188
|
-
RPCFrameVim(componentHandle: number, blendTime: number): Promise<Segment | undefined>;
|
|
187
|
+
RPCFrameVim(componentHandle: number, blendTime: number): Promise<RpcTypes.Segment | undefined>;
|
|
189
188
|
/**
|
|
190
189
|
* Frames specific instances within a component. For large numbers of instances,
|
|
191
190
|
* automatically switches to bounding box framing for better performance.
|
|
@@ -195,14 +194,14 @@ export declare class RpcSafeClient {
|
|
|
195
194
|
* @returns Promise resolving to camera segment representing the final position
|
|
196
195
|
* @throws {Error} If the component handle is invalid or nodes array is empty
|
|
197
196
|
*/
|
|
198
|
-
RPCFrameInstances(componentHandle: number, nodes: number[], blendTime: number): Promise<Segment | undefined>;
|
|
197
|
+
RPCFrameInstances(componentHandle: number, nodes: number[], blendTime: number): Promise<RpcTypes.Segment | undefined>;
|
|
199
198
|
/**
|
|
200
199
|
* Frames the camera to show a specific bounding box.
|
|
201
200
|
* @param box - The bounding box to frame
|
|
202
201
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
203
202
|
* @throws {Error} If the box is invalid (min values must be less than max values)
|
|
204
203
|
*/
|
|
205
|
-
RPCFrameBox(box: Box3, blendTime: number): Promise<Segment | undefined>;
|
|
204
|
+
RPCFrameBox(box: RpcTypes.Box3, blendTime: number): Promise<RpcTypes.Segment | undefined>;
|
|
206
205
|
/*******************************************************************************
|
|
207
206
|
* INPUT HANDLING METHODS
|
|
208
207
|
* Methods for handling user input including mouse, keyboard, and camera controls.
|
|
@@ -260,13 +259,13 @@ export declare class RpcSafeClient {
|
|
|
260
259
|
* Sets the color used for ghosted geometry.
|
|
261
260
|
* @param ghostColor - The RGBA color to use for ghosted elements
|
|
262
261
|
*/
|
|
263
|
-
RPCSetGhostColor(ghostColor: RGBA): void;
|
|
262
|
+
RPCSetGhostColor(ghostColor: RpcTypes.RGBA): void;
|
|
264
263
|
/**
|
|
265
264
|
* Performs hit testing at a specified screen position.
|
|
266
265
|
* @param pos - Normalized screen coordinates (0-1, 0-1)
|
|
267
266
|
* @returns Promise resolving to hit test result if something was hit, undefined otherwise
|
|
268
267
|
*/
|
|
269
|
-
RPCPerformHitTest(pos: Vector2): Promise<HitCheckResult | undefined>;
|
|
268
|
+
RPCPerformHitTest(pos: RpcTypes.Vector2): Promise<RpcTypes.HitCheckResult | undefined>;
|
|
270
269
|
/**
|
|
271
270
|
* Sends a mouse button event to the viewer.
|
|
272
271
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
@@ -274,19 +273,19 @@ export declare class RpcSafeClient {
|
|
|
274
273
|
* @param down - True if button is pressed down, false if released
|
|
275
274
|
* @throws {Error} If mouseButton is not a valid positive integer
|
|
276
275
|
*/
|
|
277
|
-
RPCMouseButtonEvent(position: Vector2, mouseButton: number, down: boolean): void;
|
|
276
|
+
RPCMouseButtonEvent(position: RpcTypes.Vector2, mouseButton: number, down: boolean): void;
|
|
278
277
|
/**
|
|
279
278
|
* Sends a mouse double-click event to the viewer.
|
|
280
279
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
281
280
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
282
281
|
* @throws {Error} If mouseButton is not a valid positive integer
|
|
283
282
|
*/
|
|
284
|
-
RPCMouseDoubleClickEvent(position: Vector2, mouseButton: number): void;
|
|
283
|
+
RPCMouseDoubleClickEvent(position: RpcTypes.Vector2, mouseButton: number): void;
|
|
285
284
|
/**
|
|
286
285
|
* Sends a mouse movement event to the viewer.
|
|
287
286
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
288
287
|
*/
|
|
289
|
-
RPCMouseMoveEvent(position: Vector2): void;
|
|
288
|
+
RPCMouseMoveEvent(position: RpcTypes.Vector2): void;
|
|
290
289
|
/**
|
|
291
290
|
* Sends a mouse scroll wheel event to the viewer.
|
|
292
291
|
* @param scrollValue - The scroll amount (-1 to 1)
|
|
@@ -298,7 +297,7 @@ export declare class RpcSafeClient {
|
|
|
298
297
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
299
298
|
* @throws {Error} If mouseButton is not a valid positive integer
|
|
300
299
|
*/
|
|
301
|
-
RPCMouseSelectEvent(position: Vector2, mouseButton: number): void;
|
|
300
|
+
RPCMouseSelectEvent(position: RpcTypes.Vector2, mouseButton: number): void;
|
|
302
301
|
/**
|
|
303
302
|
* Sends a keyboard event to the viewer.
|
|
304
303
|
* @param keyCode - The key code of the event
|
|
@@ -318,7 +317,7 @@ export declare class RpcSafeClient {
|
|
|
318
317
|
* @returns Array of handles for the created material instances
|
|
319
318
|
* @throws {Error} If the material handle is invalid or smoothness is out of range
|
|
320
319
|
*/
|
|
321
|
-
RPCCreateMaterialInstances(materialHandle: MaterialHandle, smoothness: number, colors: RGBA32[]): Promise<number[] | undefined>;
|
|
320
|
+
RPCCreateMaterialInstances(materialHandle: MaterialHandle, smoothness: number, colors: RpcTypes.RGBA32[]): Promise<number[] | undefined>;
|
|
322
321
|
private createMaterialInstancesBatched;
|
|
323
322
|
/**
|
|
324
323
|
* Destroys multiple material instances, freeing associated resources.
|
|
@@ -378,7 +377,7 @@ export declare class RpcSafeClient {
|
|
|
378
377
|
* @param colors - Array of colors for each AABB (must match nodes length)
|
|
379
378
|
* @throws {Error} If arrays have different lengths or component handle is invalid
|
|
380
379
|
*/
|
|
381
|
-
RPCShowAABBs(componentHandle: number, nodes: number[], colors: RGBA32[]): void;
|
|
380
|
+
RPCShowAABBs(componentHandle: number, nodes: number[], colors: RpcTypes.RGBA32[]): void;
|
|
382
381
|
/**
|
|
383
382
|
* Hides the axis-aligned bounding boxes (AABBs) for specified nodes.
|
|
384
383
|
* Large node arrays are automatically processed in batches.
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export { Vector2, Vector3, Box3 } from 'three';
|
|
3
|
-
import { Vector2, Vector3 } from 'three';
|
|
4
|
-
/**
|
|
5
|
-
* Checks if two Vector2 objects are approximately equal.
|
|
6
|
-
* @param v1 - First Vector2.
|
|
7
|
-
* @param v2 - Second Vector2.
|
|
8
|
-
* @param epsilon - Tolerance for floating-point comparisons.
|
|
9
|
-
* @returns True if vectors are almost equal, false otherwise.
|
|
10
|
-
*/
|
|
11
|
-
export declare function almostEqual(v1: Vector2, v2: Vector2, epsilon?: number): boolean;
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export { Vector2, Vector3, Box3, Matrix4 as Matrix44 } from 'three';
|
|
12
3
|
export declare class Segment {
|
|
13
|
-
origin: Vector3;
|
|
14
|
-
target: Vector3;
|
|
15
|
-
constructor(origin?: Vector3, target?: Vector3);
|
|
4
|
+
origin: THREE.Vector3;
|
|
5
|
+
target: THREE.Vector3;
|
|
6
|
+
constructor(origin?: THREE.Vector3, target?: THREE.Vector3);
|
|
16
7
|
static fromArray(array: number[]): Segment;
|
|
17
8
|
toArray(): number[];
|
|
18
9
|
isValid(): boolean;
|
|
@@ -24,6 +15,7 @@ export declare class RGBA {
|
|
|
24
15
|
b: number;
|
|
25
16
|
a: number;
|
|
26
17
|
constructor(r: number, g: number, b: number, a?: number);
|
|
18
|
+
clone(): RGBA;
|
|
27
19
|
isValid(): boolean;
|
|
28
20
|
equals(color: RGBA): boolean;
|
|
29
21
|
static fromString(str: string): RGBA;
|
|
@@ -57,11 +49,19 @@ export declare class RGBA32 {
|
|
|
57
49
|
*/
|
|
58
50
|
get a(): number;
|
|
59
51
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
export type HitCheckResult = {
|
|
53
|
+
vimHandle: number;
|
|
54
|
+
nodeIndex: number;
|
|
55
|
+
worldPosition: THREE.Vector3;
|
|
56
|
+
worldNormal: THREE.Vector3;
|
|
57
|
+
};
|
|
58
|
+
export type VimStatus = {
|
|
59
|
+
status: number;
|
|
60
|
+
progress: number;
|
|
61
|
+
};
|
|
62
|
+
export type SectionBoxState = {
|
|
63
|
+
visible: boolean;
|
|
64
|
+
interactive: boolean;
|
|
65
|
+
clip: boolean;
|
|
66
|
+
box: THREE.Box3;
|
|
67
|
+
};
|