@kitware/vtk.js 33.0.0-beta.1 → 33.0.0-beta.2

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.
@@ -0,0 +1,113 @@
1
+ import { Vector3 } from './../../types';
2
+ import { vtkObject } from './../../interfaces';
3
+ import vtkCompositeKeyboardManipulator from './CompositeKeyboardManipulator';
4
+ import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
5
+ import vtkCamera from './../../Rendering/Core/Camera';
6
+ import vtkRenderer from './../../Rendering/Core/Renderer';
7
+
8
+ export interface vtkKeyboardCameraManipulator
9
+ extends vtkObject,
10
+ vtkCompositeKeyboardManipulator {
11
+ /**
12
+ * Returns whether a movement is ongoing.
13
+ */
14
+ inMotion(): boolean;
15
+
16
+ /**
17
+ * Reset the movement speed to be proportional to the longest length of the renderer's bounds.
18
+ */
19
+ resetMovementSpeed(): void;
20
+
21
+ /**
22
+ * Initialize a movement of the current camera.
23
+ */
24
+ startMovement(): void;
25
+
26
+ /**
27
+ * Cancel any ongoing camera movement.
28
+ */
29
+ endMovement(): void;
30
+
31
+ /**
32
+ * Update active camera direction, depending on currently pressed keys.
33
+ */
34
+ calculateCurrentDirection(): void;
35
+
36
+ /**
37
+ * Returns the direction vector of the given camera for the given key.
38
+ * @param key the movedkey
39
+ * @param camera the camera
40
+ */
41
+ getDirectionFromKey(key: KeyboardEvent['key'], camera: vtkCamera): Vector3;
42
+
43
+ /**
44
+ * Moves the given camera, in the given direction, at the given speed.
45
+ * @param camera the moved camera
46
+ * @param direction the direction of the movemnt
47
+ * @param speed the speed
48
+ */
49
+ moveCamera(camera: vtkCamera, direction: Vector3, speed: number): void;
50
+
51
+ /**
52
+ * Handles a keypress event.
53
+ * @param interactor the interactor
54
+ * @param renderer the renderer
55
+ * @param key the key
56
+ */
57
+ onKeyPress(
58
+ interactor: vtkRenderWindowInteractor,
59
+ renderer: vtkRenderer,
60
+ key: KeyboardEvent['key']
61
+ ): void;
62
+
63
+ /**
64
+ * Handles a keydown event.
65
+ * @param interactor the interactor
66
+ * @param renderer the renderer
67
+ * @param key the key
68
+ */
69
+ onKeyDown(
70
+ interactor: vtkRenderWindowInteractor,
71
+ renderer: vtkRenderer,
72
+ key: KeyboardEvent['key']
73
+ ): void;
74
+
75
+ /**
76
+ * Handles a keyup event.
77
+ * @param interactor the interactor
78
+ * @param renderer the renderer
79
+ * @param key the key
80
+ */
81
+ onKeyUp(
82
+ interactor: vtkRenderWindowInteractor,
83
+ renderer: vtkRenderer,
84
+ key: KeyboardEvent['key']
85
+ ): void;
86
+ }
87
+
88
+ export interface IKeyboardCameraManipulatorInitialValues {
89
+ movementSpeed?: number;
90
+ moveForwardKeys?: KeyboardEvent['key'][];
91
+ moveLeftKeys?: KeyboardEvent['key'][];
92
+ moveBackwardKeys?: KeyboardEvent['key'][];
93
+ moveRightKeys?: KeyboardEvent['key'][];
94
+ moveUpKeys?: KeyboardEvent['key'][];
95
+ moveDownKeys?: KeyboardEvent['key'][];
96
+ }
97
+
98
+ export function newInstance(
99
+ initialValues?: IKeyboardCameraManipulatorInitialValues
100
+ ): vtkKeyboardCameraManipulator;
101
+
102
+ export function extend(
103
+ publicAPI: object,
104
+ model: object,
105
+ initialValues?: IKeyboardCameraManipulatorInitialValues
106
+ ): void;
107
+
108
+ export const vtkKeyboardCameraManipulator: {
109
+ newInstance: typeof newInstance;
110
+ extend: typeof extend;
111
+ };
112
+
113
+ export default vtkKeyboardCameraManipulator;
package/index.d.ts CHANGED
@@ -118,6 +118,7 @@
118
118
  /// <reference path="./Interaction/Manipulators/CompositeMouseManipulator.d.ts" />
119
119
  /// <reference path="./Interaction/Manipulators/CompositeVRManipulator.d.ts" />
120
120
  /// <reference path="./Interaction/Manipulators/GestureCameraManipulator.d.ts" />
121
+ /// <reference path="./Interaction/Manipulators/KeyboardCameraManipulator.d.ts" />
121
122
  /// <reference path="./Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts" />
122
123
  /// <reference path="./Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts" />
123
124
  /// <reference path="./Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "33.0.0-beta.1",
3
+ "version": "33.0.0-beta.2",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",