vim-web 0.3.44-dev.39 → 0.3.44-dev.40
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/{webgl/viewer/inputs/input.d.ts → shared/coreInputHandler.d.ts} +46 -64
- package/dist/types/core-viewers/{webgl/viewer/inputs → shared}/inputHandler.d.ts +4 -5
- 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/{webgl/viewer/inputs → shared}/touchHandler.d.ts +13 -16
- package/dist/types/core-viewers/ultra/index.d.ts +3 -3
- package/dist/types/core-viewers/ultra/viewer/camera.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/color.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/colorManager.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/renderer.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/selection.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/socketClient.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/{viewer.d.ts → ultraCoreViewer.d.ts} +4 -4
- package/dist/types/core-viewers/ultra/viewer/ultraInputsAdapter.d.ts +5 -0
- package/dist/types/core-viewers/ultra/{utils → viewer}/validation.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/vim.d.ts +1 -1
- package/dist/types/core-viewers/webgl/index.d.ts +2 -3
- package/dist/types/core-viewers/webgl/loader/progressive/vimRequest.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/camera/ICamera.d.ts +0 -4
- package/dist/types/core-viewers/webgl/viewer/camera/camera.d.ts +0 -11
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmoOrbit.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/gizmos/measure/measure.d.ts +9 -16
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +2 -2
- package/dist/types/core-viewers/webgl/viewer/webglInputsAdapter.d.ts +3 -0
- package/dist/types/react-viewers/helpers/loadRequest.d.ts +1 -1
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +1 -0
- package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +1 -1
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -1
- package/dist/types/react-viewers/ultra/ultraComponentRef.d.ts +1 -1
- package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +1 -1
- package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +1 -1
- package/dist/types/react-viewers/webgl/webgInputsBindings.d.ts +8 -0
- package/dist/vim-web.iife.js +7089 -7605
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +7072 -7588
- 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/viewer/inputs/inputHandler.d.ts +0 -7
- package/dist/types/core-viewers/ultra/viewer/inputs/inputs.d.ts +0 -27
- package/dist/types/core-viewers/ultra/viewer/inputs/keyboardHandler.d.ts +0 -20
- package/dist/types/core-viewers/ultra/viewer/inputs/mouseHandler.d.ts +0 -22
- package/dist/types/core-viewers/ultra/viewer/inputs/touchHandler.d.ts +0 -25
- package/dist/types/core-viewers/webgl/utils/deferredPromise.d.ts +0 -8
- package/dist/types/core-viewers/webgl/viewer/gizmos/measure/measureFlow.d.ts +0 -36
- 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/ultra/ultraInputs.d.ts +0 -22
- package/dist/types/react-viewers/webgl/webgInputs.d.ts +0 -22
- /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}/math3d.d.ts +0 -0
- /package/dist/types/core-viewers/{ultra/utils → utils}/promise.d.ts +0 -0
- /package/dist/types/core-viewers/{webgl/utils → utils}/requestResult.d.ts +0 -0
- /package/dist/types/core-viewers/{ultra/utils → utils}/result.d.ts +0 -0
- /package/dist/types/core-viewers/{webgl/utils → utils}/threeUtils.d.ts +0 -0
- /package/dist/types/core-viewers/{ultra/utils → utils}/url.d.ts +0 -0
package/dist/types/core-viewers/{webgl/viewer/inputs/input.d.ts → shared/coreInputHandler.d.ts}
RENAMED
|
@@ -1,48 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module viw-webgl-viewer/inputs
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { Viewer } from '../viewer';
|
|
6
|
-
import { KeyboardHandler } from './keyboardHandler';
|
|
7
1
|
import { TouchHandler } from './touchHandler';
|
|
8
2
|
import { MouseHandler } from './mouseHandler';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { KeyboardHandler } from './keyboardHandler';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { InputHandler } from './inputHandler';
|
|
12
6
|
export type PointerMode = 'orbit' | 'look' | 'pan' | 'zoom' | 'rect';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
export interface InputAdapter {
|
|
8
|
+
init: () => void;
|
|
9
|
+
toggleOrthographic: () => void;
|
|
10
|
+
resetCamera: () => void;
|
|
11
|
+
clearSelection: () => void;
|
|
12
|
+
frameCamera: () => void;
|
|
13
|
+
moveCamera: (value: THREE.Vector3) => void;
|
|
14
|
+
orbitCamera: (value: THREE.Vector2) => void;
|
|
15
|
+
rotateCamera: (value: THREE.Vector2) => void;
|
|
16
|
+
panCamera: (value: THREE.Vector2) => void;
|
|
17
|
+
keyDown: (keyCode: string) => boolean;
|
|
18
|
+
keyUp: (keyCode: string) => boolean;
|
|
19
|
+
mouseDown: (pos: THREE.Vector2, button: number) => void;
|
|
20
|
+
mouseUp: (pos: THREE.Vector2, button: number) => void;
|
|
21
|
+
mouseMove: (pos: THREE.Vector2) => void;
|
|
22
|
+
selectAtPointer: (pos: THREE.Vector2, add: boolean) => void;
|
|
23
|
+
frameAtPointer: (pos: THREE.Vector2) => void;
|
|
24
|
+
zoom: (value: number) => void;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
onMainAction(action: InputAction): void;
|
|
38
|
-
onIdleAction(hit: InputAction): void;
|
|
39
|
-
onKeyAction(key: number): boolean;
|
|
26
|
+
interface InputSettings {
|
|
27
|
+
orbit: boolean;
|
|
28
|
+
scrollSpeed: number;
|
|
29
|
+
moveSpeed: number;
|
|
30
|
+
rotateSpeed: number;
|
|
31
|
+
orbitSpeed: number;
|
|
40
32
|
}
|
|
41
|
-
|
|
42
|
-
* Manages and registers all viewer user inputs for mouse, keyboard and touch
|
|
43
|
-
*/
|
|
44
|
-
export declare class Input {
|
|
45
|
-
private _viewer;
|
|
33
|
+
export declare class CoreInputHandler extends InputHandler {
|
|
46
34
|
/**
|
|
47
35
|
* Touch input handler
|
|
48
36
|
*/
|
|
@@ -55,10 +43,22 @@ export declare class Input {
|
|
|
55
43
|
* Keyboard input handler
|
|
56
44
|
*/
|
|
57
45
|
keyboard: KeyboardHandler;
|
|
46
|
+
scrollSpeed: number;
|
|
47
|
+
private _moveSpeed;
|
|
48
|
+
rotateSpeed: number;
|
|
49
|
+
orbitSpeed: number;
|
|
58
50
|
private _pointerActive;
|
|
59
51
|
private _pointerFallback;
|
|
60
52
|
private _pointerOverride;
|
|
61
|
-
|
|
53
|
+
private _onPointerOverrideChanged;
|
|
54
|
+
private _onPointerModeChanged;
|
|
55
|
+
private _onSettingsChanged;
|
|
56
|
+
private _adapter;
|
|
57
|
+
constructor(canvas: HTMLCanvasElement, adapter: InputAdapter, settings?: Partial<InputSettings>);
|
|
58
|
+
init(): void;
|
|
59
|
+
get moveSpeed(): number;
|
|
60
|
+
set moveSpeed(value: number);
|
|
61
|
+
get onSettingsChanged(): import("ste-signals").ISignal;
|
|
62
62
|
/**
|
|
63
63
|
* Returns the last main mode (orbit, look) that was active.
|
|
64
64
|
*/
|
|
@@ -70,18 +70,16 @@ export declare class Input {
|
|
|
70
70
|
/**
|
|
71
71
|
* A temporary pointer mode used for temporary icons.
|
|
72
72
|
*/
|
|
73
|
-
get pointerOverride(): PointerMode
|
|
73
|
+
get pointerOverride(): PointerMode;
|
|
74
74
|
set pointerOverride(value: PointerMode | undefined);
|
|
75
75
|
/**
|
|
76
76
|
* Changes pointer interaction mode. Look mode will set camera orbitMode to false.
|
|
77
77
|
*/
|
|
78
78
|
set pointerActive(value: PointerMode);
|
|
79
|
-
private _onPointerModeChanged;
|
|
80
79
|
/**
|
|
81
80
|
* Event called when pointer interaction mode changes.
|
|
82
81
|
*/
|
|
83
82
|
get onPointerModeChanged(): import("ste-signals").ISignal;
|
|
84
|
-
private _onPointerOverrideChanged;
|
|
85
83
|
/**
|
|
86
84
|
* Event called when the pointer is temporarily overriden.
|
|
87
85
|
*/
|
|
@@ -91,31 +89,13 @@ export declare class Input {
|
|
|
91
89
|
* Event called when when context menu could be displayed
|
|
92
90
|
*/
|
|
93
91
|
get onContextMenu(): import("ste-simple-events").ISimpleEvent<THREE.Vector2>;
|
|
94
|
-
private _scheme;
|
|
95
|
-
/**
|
|
96
|
-
* Get or set the current viewer input scheme, set undefined to revert to default.
|
|
97
|
-
*/
|
|
98
|
-
get scheme(): InputScheme | undefined;
|
|
99
|
-
set scheme(value: InputScheme | undefined);
|
|
100
|
-
/**
|
|
101
|
-
* Calls main action on the current input scheme
|
|
102
|
-
*/
|
|
103
|
-
MainAction(action: InputAction): void;
|
|
104
|
-
/**
|
|
105
|
-
* Calls idle action on the current input scheme
|
|
106
|
-
*/
|
|
107
|
-
IdleAction(action: InputAction | undefined): void;
|
|
108
|
-
/**
|
|
109
|
-
* Calls key action on the current input scheme
|
|
110
|
-
*/
|
|
111
|
-
KeyAction(key: number): boolean;
|
|
112
92
|
/**
|
|
113
93
|
* Calls context menu action
|
|
114
94
|
*/
|
|
115
95
|
ContextMenu(position: THREE.Vector2 | undefined): void;
|
|
116
96
|
/**
|
|
117
|
-
|
|
118
|
-
|
|
97
|
+
* Register inputs handlers for default viewer behavior
|
|
98
|
+
*/
|
|
119
99
|
registerAll(): void;
|
|
120
100
|
/**
|
|
121
101
|
* Unregisters all input handlers
|
|
@@ -125,4 +105,6 @@ export declare class Input {
|
|
|
125
105
|
* Resets all input state
|
|
126
106
|
*/
|
|
127
107
|
resetAll(): void;
|
|
108
|
+
dispose(): void;
|
|
128
109
|
}
|
|
110
|
+
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-viewer/inputs
|
|
3
3
|
*/
|
|
4
|
-
import { Viewer } from '../viewer';
|
|
5
4
|
/**
|
|
6
5
|
* TODO: Use the same code for ULTRA and webgl.
|
|
7
6
|
* Base class for various input handlers.
|
|
8
7
|
* It provides convenience to register to and unregister from events.
|
|
9
8
|
*/
|
|
10
9
|
export declare class InputHandler {
|
|
11
|
-
protected
|
|
12
|
-
protected
|
|
13
|
-
constructor(
|
|
14
|
-
protected reg
|
|
10
|
+
protected _canvas: HTMLCanvasElement;
|
|
11
|
+
protected _disconnect: Function[];
|
|
12
|
+
constructor(canvas: HTMLCanvasElement);
|
|
13
|
+
protected reg<T extends Event>(element: Document | HTMLElement | Window, eventType: string, callback: (event: T) => void): void;
|
|
15
14
|
/**
|
|
16
15
|
* Register handler to related browser events
|
|
17
16
|
* Prevents double registrations
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module viw-webgl-viewer/inputs
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { InputHandler } from './inputHandler';
|
|
6
|
+
type CallbackMode = 'replace' | 'append' | 'prepend';
|
|
7
|
+
/**
|
|
8
|
+
* KeyboardHandler
|
|
9
|
+
*
|
|
10
|
+
* A modern keyboard handler that manages keyboard events using a stateful pattern.
|
|
11
|
+
* It supports separate handlers for key down, key up, and continuous key pressed events.
|
|
12
|
+
* The handler calculates a movement vector based on currently pressed keys.
|
|
13
|
+
*/
|
|
14
|
+
export declare class KeyboardHandler extends InputHandler {
|
|
15
|
+
/**
|
|
16
|
+
* Callback invoked whenever the calculated movement vector is updated.
|
|
17
|
+
*/
|
|
18
|
+
onMove: (value: THREE.Vector3) => void;
|
|
19
|
+
onKeyUp: (code: string) => boolean;
|
|
20
|
+
onKeyDown: (code: string) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Speed multiplier applied when the Shift key is held.
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
private readonly SHIFT_MULTIPLIER;
|
|
26
|
+
/**
|
|
27
|
+
* Set of currently pressed key codes.
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
private pressedKeys;
|
|
31
|
+
/**
|
|
32
|
+
* Map of key down event handlers (invoked once on key down).
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
private keyDownHandlers;
|
|
36
|
+
/**
|
|
37
|
+
* Map of key up event handlers (invoked once on key up).
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
private keyUpHandlers;
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of KeyboardHandler.
|
|
43
|
+
* @param canvas The HTMLCanvasElement to attach keyboard events to.
|
|
44
|
+
*/
|
|
45
|
+
constructor(canvas: HTMLCanvasElement);
|
|
46
|
+
/**
|
|
47
|
+
* Registers the necessary keyboard event listeners.
|
|
48
|
+
* @protected
|
|
49
|
+
*/
|
|
50
|
+
protected addListeners(): void;
|
|
51
|
+
private registerMovementHandlers;
|
|
52
|
+
/**
|
|
53
|
+
* Checks if a key is currently pressed.
|
|
54
|
+
* @param key The event.code of the key.
|
|
55
|
+
* @returns {boolean} True if the key is pressed, false otherwise.
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
isKeyPressed(key: string): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Resets the handler state by clearing all pressed keys and recalculating movement.
|
|
61
|
+
* @override
|
|
62
|
+
*/
|
|
63
|
+
reset(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Registers a handler for a key down event.
|
|
66
|
+
* @param code The event.code of the key.
|
|
67
|
+
* @param handler Callback invoked on key down.
|
|
68
|
+
*/
|
|
69
|
+
registerKeyDown(code: string, mode: CallbackMode, handler: () => void): void;
|
|
70
|
+
/**
|
|
71
|
+
* Registers a handler for a key up event.
|
|
72
|
+
* @param code The event.code of the key.
|
|
73
|
+
* @param handler Callback invoked on key up.
|
|
74
|
+
*/
|
|
75
|
+
registerKeyUp(code: string, mode: CallbackMode, handler: () => void): void;
|
|
76
|
+
private registerKey;
|
|
77
|
+
/**
|
|
78
|
+
* Internal key down event handler.
|
|
79
|
+
* @param event The KeyboardEvent object.
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
private _onKeyDown;
|
|
83
|
+
/**
|
|
84
|
+
* Internal key up event handler.
|
|
85
|
+
* @param event The KeyboardEvent object.
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
private _onKeyUp;
|
|
89
|
+
/**
|
|
90
|
+
* Calculates and applies the movement vector based on currently pressed keys.
|
|
91
|
+
* Also calls any continuous key pressed handlers for keys that are held down.
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
private applyMove;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InputHandler } from "./inputHandler";
|
|
2
|
+
import { Vector2 } from "../utils/math3d";
|
|
3
|
+
type DragCallback = (delta: Vector2, button: number) => void;
|
|
4
|
+
export declare class MouseHandler extends InputHandler {
|
|
5
|
+
private _lastMouseDownPosition;
|
|
6
|
+
private _capture;
|
|
7
|
+
private _dragHandler;
|
|
8
|
+
onButtonDown: (pos: Vector2, button: number) => void;
|
|
9
|
+
onButtonUp: (pos: Vector2, button: number) => void;
|
|
10
|
+
onMouseMove: (event: Vector2) => void;
|
|
11
|
+
onDrag: DragCallback;
|
|
12
|
+
onClick: (position: Vector2, ctrl: boolean) => void;
|
|
13
|
+
onDoubleClick: (position: Vector2) => void;
|
|
14
|
+
onWheel: (value: number, ctrl: boolean) => void;
|
|
15
|
+
constructor(canvas: HTMLCanvasElement);
|
|
16
|
+
register(): void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
private onPointerDown;
|
|
19
|
+
private onPointerUp;
|
|
20
|
+
private handleMouseClick;
|
|
21
|
+
private onPointerMove;
|
|
22
|
+
private _onDoubleClick;
|
|
23
|
+
private onMouseScroll;
|
|
24
|
+
private relativePosition;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-viewer/inputs
|
|
3
3
|
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
4
5
|
import { InputHandler } from './inputHandler';
|
|
5
|
-
import { Viewer } from '../viewer';
|
|
6
6
|
/**
|
|
7
7
|
* Manages user touch inputs.
|
|
8
8
|
*/
|
|
@@ -12,17 +12,12 @@ export declare class TouchHandler extends InputHandler {
|
|
|
12
12
|
private readonly TAP_MAX_MOVE_PIXEL;
|
|
13
13
|
private readonly ZOOM_SPEED;
|
|
14
14
|
private readonly MOVE_SPEED;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
orbitSpeed: number;
|
|
23
|
-
constructor(viewer: Viewer);
|
|
24
|
-
private get camera();
|
|
25
|
-
private get viewport();
|
|
15
|
+
onTap: (position: THREE.Vector2) => void;
|
|
16
|
+
onDoubleTap: (position: THREE.Vector2) => void;
|
|
17
|
+
onDrag: (delta: THREE.Vector2) => void;
|
|
18
|
+
onDoubleDrag: (delta: THREE.Vector2) => void;
|
|
19
|
+
onPinchOrSpread: (delta: number) => void;
|
|
20
|
+
constructor(canvas: HTMLCanvasElement);
|
|
26
21
|
private _touch;
|
|
27
22
|
private _touch1;
|
|
28
23
|
private _touch2;
|
|
@@ -31,15 +26,17 @@ export declare class TouchHandler extends InputHandler {
|
|
|
31
26
|
private _touchStart;
|
|
32
27
|
protected addListeners(): void;
|
|
33
28
|
reset: () => void;
|
|
34
|
-
private
|
|
29
|
+
private _onTap;
|
|
35
30
|
private onTouchStart;
|
|
36
31
|
private toRotation;
|
|
37
|
-
private onDrag;
|
|
38
|
-
private onDoubleDrag;
|
|
39
|
-
private onPinchOrSpread;
|
|
40
32
|
private onTouchMove;
|
|
41
33
|
private onTouchEnd;
|
|
42
34
|
private isSingleTouch;
|
|
43
35
|
private touchToVector;
|
|
44
36
|
private average;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the pixel size of the canvas.
|
|
39
|
+
* @returns {THREE.Vector2} The pixel size of the canvas.
|
|
40
|
+
*/
|
|
41
|
+
getCanvasSize(): THREE.Vector2;
|
|
45
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
export * from './viewer/
|
|
3
|
-
export * as utils from '
|
|
2
|
+
export * from './viewer/ultraCoreViewer';
|
|
3
|
+
export * as utils from '../utils/promise';
|
|
4
|
+
export * from '../utils/math3d';
|
|
4
5
|
export * from './viewer/vim';
|
|
5
|
-
export * from './utils/math3d';
|
|
6
6
|
export * from './viewer/color';
|
|
7
7
|
export type { ILoadRequest, VimRequestErrorType } from './viewer/loadRequest';
|
|
8
8
|
export type { ClientState, ConnectionSettings } from './viewer/socketClient';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcSafeClient } from './rpcSafeClient';
|
|
2
2
|
import { ColorHandle } from './color';
|
|
3
|
-
import { RGBA32 } from '
|
|
3
|
+
import { RGBA32 } from '../../utils/math3d';
|
|
4
4
|
/**
|
|
5
5
|
* Manages the creation, caching, and deletion of color instances.
|
|
6
6
|
* Handles batched deletion of colors to optimize RPC calls.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Don't modify this file, the RPC generated code depends on its interface.
|
|
3
3
|
*/
|
|
4
|
-
import { Box3, RGB, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from "
|
|
4
|
+
import { Box3, RGB, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from "../../utils/math3d";
|
|
5
5
|
export type HitCheckResult = {
|
|
6
6
|
vimHandle: number;
|
|
7
7
|
nodeIndex: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SocketClient } from './socketClient';
|
|
2
2
|
import { HitCheckResult, VimStatus, SectionBoxState } from './marshal';
|
|
3
|
-
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from '
|
|
3
|
+
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3, Matrix44 } from '../../utils/math3d';
|
|
4
4
|
export type MaterialHandle = 4294967295 | 6 | 2 | 0 | 1 | 3 | 4 | 5 | 7 | 8;
|
|
5
5
|
export declare class MaterialHandles {
|
|
6
6
|
static readonly Invalid: MaterialHandle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3 } from "
|
|
1
|
+
import { Box3, RGBA, RGBA32, Segment, Vector2, Vector3 } from "../../utils/math3d";
|
|
2
2
|
import { HitCheckResult, SectionBoxState } from "./marshal";
|
|
3
3
|
import { MaterialHandle, RpcClient } from "./rpcClient";
|
|
4
4
|
export type VimSource = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Protocol from './protocol';
|
|
2
2
|
import { Marshal, ReadMarshal } from './marshal';
|
|
3
3
|
import { ILogger } from './logger';
|
|
4
|
-
import { Segment } from '
|
|
4
|
+
import { Segment } from '../../utils/math3d';
|
|
5
5
|
export declare const DEFAULT_LOCAL_ULTRA_SERVER_URL = "ws://localhost:8123";
|
|
6
6
|
export type ConnectionSettings = {
|
|
7
7
|
url?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IInputs } from './inputs/inputs';
|
|
2
1
|
import { ClientState, ConnectionSettings } from './socketClient';
|
|
3
2
|
import { IDecoder } from './decoder';
|
|
4
3
|
import { Vim } from './vim';
|
|
@@ -13,12 +12,13 @@ import { ViewerSelection } from './selection';
|
|
|
13
12
|
import { IReadonlyVimCollection } from './vimCollection';
|
|
14
13
|
import { IRenderer } from './renderer';
|
|
15
14
|
import { SectionBox } from './sectionBox';
|
|
15
|
+
import { CoreInputHandler } from '../../shared/coreInputHandler';
|
|
16
16
|
export declare const INVALID_HANDLE = 4294967295;
|
|
17
17
|
/**
|
|
18
18
|
* The main Viewer class responsible for managing VIM files,
|
|
19
19
|
* handling connections, and coordinating various components like the camera, decoder, and inputs.
|
|
20
20
|
*/
|
|
21
|
-
export declare class
|
|
21
|
+
export declare class UltraCoreViewer {
|
|
22
22
|
private readonly _decoder;
|
|
23
23
|
private readonly _socketClient;
|
|
24
24
|
private readonly _input;
|
|
@@ -41,7 +41,7 @@ export declare class Viewer {
|
|
|
41
41
|
/**
|
|
42
42
|
* The input API for handling user input events.
|
|
43
43
|
*/
|
|
44
|
-
get inputs():
|
|
44
|
+
get inputs(): CoreInputHandler;
|
|
45
45
|
get vims(): IReadonlyVimCollection;
|
|
46
46
|
/**
|
|
47
47
|
* The viewport API for managing the rendering viewport.
|
|
@@ -79,7 +79,7 @@ export declare class Viewer {
|
|
|
79
79
|
* @param logger - Optional logger for logging messages.
|
|
80
80
|
* @returns A new instance of the Viewer class.
|
|
81
81
|
*/
|
|
82
|
-
static createWithCanvas(parent: HTMLElement, logger?: ILogger):
|
|
82
|
+
static createWithCanvas(parent: HTMLElement, logger?: ILogger): UltraCoreViewer;
|
|
83
83
|
/**
|
|
84
84
|
* Constructs a new Viewer instance.
|
|
85
85
|
* @param canvas - The HTML canvas element for rendering.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoreInputHandler } from "../../shared/coreInputHandler";
|
|
2
|
+
import { UltraCoreViewer } from "./ultraCoreViewer";
|
|
3
|
+
declare const CODE_TO_KEYCODE: Record<string, number>;
|
|
4
|
+
export default CODE_TO_KEYCODE;
|
|
5
|
+
export declare function ultraInputAdapter(viewer: UltraCoreViewer): CoreInputHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, RGB, RGBA, Segment, Vector2, Vector3 } from '
|
|
1
|
+
import { Box3, RGB, RGBA, Segment, Vector2, Vector3 } from '../../utils/math3d';
|
|
2
2
|
export declare class Validation {
|
|
3
3
|
static isNumber(value: number): boolean;
|
|
4
4
|
static isPositiveNumber(value: number): boolean;
|
|
@@ -3,7 +3,7 @@ import { ColorManager } from './colorManager';
|
|
|
3
3
|
import { LoadRequest } from './loadRequest';
|
|
4
4
|
import { RpcSafeClient, VimSource } from './rpcSafeClient';
|
|
5
5
|
import { ILogger } from './logger';
|
|
6
|
-
import { Box3 } from '
|
|
6
|
+
import { Box3 } from '../../utils/math3d';
|
|
7
7
|
type NodeState = 'visible' | 'hidden' | 'ghosted' | 'highlighted';
|
|
8
8
|
export declare class Vim {
|
|
9
9
|
readonly source: VimSource;
|
|
@@ -7,13 +7,12 @@ export * from './loader/progressive/vimRequest';
|
|
|
7
7
|
export * from './loader/progressive/vimx';
|
|
8
8
|
export * from './viewer/viewer';
|
|
9
9
|
export * from './loader/geometry';
|
|
10
|
-
export
|
|
11
|
-
export { DefaultInputScheme, KEYS } from './viewer/inputs/input';
|
|
10
|
+
export * from '../shared/coreInputHandler';
|
|
12
11
|
export * from './viewer/settings/viewerSettings';
|
|
13
12
|
export * from './viewer/settings/viewerSettingsParsing';
|
|
14
13
|
export * from './viewer/settings/defaultViewerSettings';
|
|
15
14
|
export { RaycastResult as HitTestResult, InputAction } from './viewer/raycaster';
|
|
16
|
-
export { type SelectableObject } from './viewer/selection';
|
|
15
|
+
export { type SelectableObject, Selection } from './viewer/selection';
|
|
17
16
|
export * from './loader/progressive/insertableMesh';
|
|
18
17
|
export * from './loader/progressive/g3dSubset';
|
|
19
18
|
export * from './loader/geometry';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VimPartialSettings } from '../vimSettings';
|
|
2
2
|
import { Vim } from '../vim';
|
|
3
|
-
import { RequestResult } from '
|
|
3
|
+
import { RequestResult } from '../../../utils/requestResult';
|
|
4
4
|
import { VimSource } from '../..';
|
|
5
5
|
import { IProgressLogs } from 'vim-format';
|
|
6
6
|
export type RequestSource = {
|
|
@@ -79,10 +79,6 @@ export interface ICamera {
|
|
|
79
79
|
*/
|
|
80
80
|
get forward(): THREE.Vector3;
|
|
81
81
|
get isLerping(): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* The camera speed factor.
|
|
84
|
-
*/
|
|
85
|
-
speed: number;
|
|
86
82
|
/**
|
|
87
83
|
* The current or target velocity of the camera.
|
|
88
84
|
*/
|
|
@@ -120,7 +116,6 @@ export declare class Camera implements ICamera {
|
|
|
120
116
|
private _movement;
|
|
121
117
|
private _inputVelocity;
|
|
122
118
|
private _velocity;
|
|
123
|
-
private _speed;
|
|
124
119
|
private _orthographic;
|
|
125
120
|
private _target;
|
|
126
121
|
private _lastPosition;
|
|
@@ -169,7 +164,6 @@ export declare class Camera implements ICamera {
|
|
|
169
164
|
get defaultForward(): THREE.Vector3;
|
|
170
165
|
set defaultForward(value: THREE.Vector3);
|
|
171
166
|
private _velocityBlendFactor;
|
|
172
|
-
private _moveSpeed;
|
|
173
167
|
constructor(scene: RenderScene, viewport: Viewport, settings: ViewerSettings);
|
|
174
168
|
/**
|
|
175
169
|
* Interface for instantaneously moving the camera.
|
|
@@ -210,11 +204,6 @@ export declare class Camera implements ICamera {
|
|
|
210
204
|
* The forward direction of the camera.
|
|
211
205
|
*/
|
|
212
206
|
get forward(): THREE.Vector3;
|
|
213
|
-
/**
|
|
214
|
-
* The camera speed factor.
|
|
215
|
-
*/
|
|
216
|
-
get speed(): number;
|
|
217
|
-
set speed(value: number);
|
|
218
207
|
/**
|
|
219
208
|
* The current or target velocity of the camera.
|
|
220
209
|
*/
|
|
@@ -5,7 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { Renderer } from '../rendering/renderer';
|
|
6
6
|
import { Camera } from '../camera/camera';
|
|
7
7
|
import { ViewerSettings } from '../settings/viewerSettings';
|
|
8
|
-
import {
|
|
8
|
+
import { CoreInputHandler } from '../../../shared/coreInputHandler';
|
|
9
9
|
/**
|
|
10
10
|
* Manages the camera target gizmo
|
|
11
11
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class GizmoOrbit {
|
|
|
27
27
|
private _timeout;
|
|
28
28
|
private _active;
|
|
29
29
|
private _animation;
|
|
30
|
-
constructor(renderer: Renderer, camera: Camera, input:
|
|
30
|
+
constructor(renderer: Renderer, camera: Camera, input: CoreInputHandler, settings: ViewerSettings);
|
|
31
31
|
private connect;
|
|
32
32
|
private onUpdate;
|
|
33
33
|
/**
|