@kitware/vtk.js 26.3.2 → 26.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/DataModel/Collection.d.ts +118 -0
- package/Common/DataModel/Collection.js +113 -0
- package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +68 -0
- package/Interaction/Manipulators/CompositeGestureManipulator.d.ts +168 -0
- package/Interaction/Manipulators/CompositeKeyboardManipulator.d.ts +48 -0
- package/Interaction/Manipulators/CompositeMouseManipulator.d.ts +149 -0
- package/Interaction/Manipulators/CompositeVRManipulator.d.ts +44 -0
- package/Interaction/Manipulators/GestureCameraManipulator.d.ts +34 -0
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts +88 -0
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
- package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
- package/Interaction/Style/InteractorStyleManipulator.d.ts +333 -0
- package/Proxy/Core/AbstractRepresentationProxy.d.ts +24 -0
- package/Proxy/Core/LookupTableProxy.d.ts +45 -0
- package/Proxy/Core/PiecewiseFunctionProxy.d.ts +62 -0
- package/Proxy/Core/ProxyManager.d.ts +81 -0
- package/Proxy/Core/SourceProxy.d.ts +22 -0
- package/Proxy/Core/View2DProxy.d.ts +7 -0
- package/Proxy/Core/ViewProxy.d.ts +86 -0
- package/Proxy/Representations/SliceRepresentationProxy.d.ts +27 -0
- package/Proxy/Representations/VolumeRepresentationProxy.d.ts +44 -0
- package/Rendering/Core/AbstractImageMapper/helper.js +127 -0
- package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
- package/Rendering/Core/AbstractImageMapper.js +42 -0
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/ImageArrayMapper.d.ts +252 -0
- package/Rendering/Core/ImageArrayMapper.js +242 -0
- package/Rendering/Core/ImageMapper.d.ts +5 -35
- package/Rendering/Core/ImageMapper.js +16 -108
- package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
- package/Rendering/Core/InteractorStyle.d.ts +229 -0
- package/Rendering/Core/PointPicker.js +1 -1
- package/Rendering/OpenGL/ImageMapper.js +13 -7
- package/Rendering/OpenGL/RenderWindow.d.ts +8 -1
- package/Rendering/OpenGL/RenderWindow.js +3 -2
- package/Rendering/OpenGL/Texture.js +13 -12
- package/Widgets/Core/StateBuilder.d.ts +29 -0
- package/index.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { vtkObject } from './../../interfaces';
|
|
2
|
+
import { Nullable } from './../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export interface ICollectionInitialValues {
|
|
8
|
+
collection?: vtkObject[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface vtkCollection extends vtkObject {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Add item (vtkObject) to the collection
|
|
16
|
+
* @param {vtkObject} item item to be added to the collection
|
|
17
|
+
*/
|
|
18
|
+
addItem(item: vtkObject): void;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Add item (vtkObject) to the collection _at_ the given index.
|
|
22
|
+
* This differs from VTK-C++ where insertItem inserts at position
|
|
23
|
+
* after the provided index value.
|
|
24
|
+
* @param {number} idx index where the new item should be inserted.
|
|
25
|
+
* @param {vtkObject} item item to be inserted
|
|
26
|
+
*/
|
|
27
|
+
insertItem(idx: number, item: vtkObject): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Replace an existing item (vtkObject) with a new one
|
|
31
|
+
* @param {number} idx index of item to be replaced
|
|
32
|
+
* @param {vtkObject} item
|
|
33
|
+
*/
|
|
34
|
+
replaceItem(idx: number, item: vtkObject): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Remove an existing item from the collection
|
|
38
|
+
* @param {number|vtkObject} inValue index or reference of an item to be removed
|
|
39
|
+
*/
|
|
40
|
+
removeItem(inValue: number|vtkObject): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Remove all items from the collection
|
|
44
|
+
*/
|
|
45
|
+
removeAllItems(): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if a provided item is already present in the collection
|
|
49
|
+
*/
|
|
50
|
+
isItemPresent(item: vtkObject): boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get the total number of items in the collection
|
|
54
|
+
*/
|
|
55
|
+
getNumberOfItems(): number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if the collection is empty
|
|
59
|
+
*/
|
|
60
|
+
empty(): boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* get the current item and provided index, returns null if index is out of bounds
|
|
64
|
+
*/
|
|
65
|
+
getItem(idx: number): Nullable<vtkObject>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Execute a passed function on every item in the collection
|
|
69
|
+
* @param callbackfn callback function to be executed on every item in the collection
|
|
70
|
+
*/
|
|
71
|
+
forEach<T>(callbackfn: (value: T, index: number, array: readonly T[]) => void): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Execute a passed function on every item in the collection, in order to calculate an aggregated return value.
|
|
75
|
+
* @param callbackfn callback function to be used for aggregating a single value from each item in the collection
|
|
76
|
+
* @param initialValue starting value to calculate aggregation
|
|
77
|
+
*/
|
|
78
|
+
reduce<T>(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Similar to forEach, but returns an array of resulting values.
|
|
82
|
+
* @param callbackfn callback function to execute on each item in the collection, that returns a value.
|
|
83
|
+
*/
|
|
84
|
+
map<T>(callbackfn: (value: T, index: number, array: readonly T[]) => void): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Check each element for modified time and update the collection's
|
|
88
|
+
* MTime to the latest timestamp from individual items in the collection.
|
|
89
|
+
*/
|
|
90
|
+
updateMTimeWithElements(): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Method used to decorate a given object (publicAPI+model) with vtkCollection characteristics.
|
|
95
|
+
*
|
|
96
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
97
|
+
* @param model object on which data structure will be bounds (protected)
|
|
98
|
+
* @param {ICollectionInitialValues} [initialValues] (default: {})
|
|
99
|
+
*/
|
|
100
|
+
export function extend(publicAPI: object, model: object, initialValues? : ICollectionInitialValues): void;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Method used to create a new instance of vtkCollection.
|
|
104
|
+
* @param {ICollectionInitialValues} [initialValues] for pre-setting some of its content
|
|
105
|
+
*/
|
|
106
|
+
export function newInstance(initialValues? : ICollectionInitialValues): vtkCollection;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* vtkCollection is a container of multiple vtkObject items.
|
|
110
|
+
* This can be useful for encapsulating multiple vtkObjects such as images
|
|
111
|
+
* into a single vtkObject (vtkCollection instance) to be passed as input
|
|
112
|
+
* to other filters and mappers as a single unit.
|
|
113
|
+
*/
|
|
114
|
+
export declare const vtkCollection: {
|
|
115
|
+
newInstance: typeof newInstance;
|
|
116
|
+
extend: typeof extend;
|
|
117
|
+
};
|
|
118
|
+
export default vtkCollection;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import macro from '../../macros.js';
|
|
2
|
+
|
|
3
|
+
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
4
|
+
// vtkCollection methods
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
function vtkCollection(publicAPI, model) {
|
|
8
|
+
// Set our className
|
|
9
|
+
model.classHierarchy.push('vtkCollection');
|
|
10
|
+
|
|
11
|
+
publicAPI.addItem = function (item) {
|
|
12
|
+
model.collection.push(item);
|
|
13
|
+
publicAPI.modified();
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
publicAPI.insertItem = function (idx, item) {
|
|
17
|
+
if (idx < 0 || model.collection.length < idx) {
|
|
18
|
+
vtkErrorMacro('idx out of bounds for insertion.');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
model.collection.splice(idx, 0, item);
|
|
22
|
+
publicAPI.modified();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
publicAPI.replaceItem = function (idx, item) {
|
|
26
|
+
model.collection.splice(idx, 1, item);
|
|
27
|
+
publicAPI.modified();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
publicAPI.removeItem = function (inValue) {
|
|
31
|
+
var idx = typeof inValue === 'number' ? inValue : model.collection.indexOf(inValue);
|
|
32
|
+
|
|
33
|
+
if (idx >= 0 && idx < model.collection.length) {
|
|
34
|
+
model.collection.splice(idx, 1);
|
|
35
|
+
publicAPI.modified();
|
|
36
|
+
} else {
|
|
37
|
+
vtkErrorMacro('idx out of bounds for removeItem.');
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
publicAPI.removeAllItems = function () {
|
|
42
|
+
model.collection = [];
|
|
43
|
+
publicAPI.modified();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
publicAPI.isItemPresent = function (item) {
|
|
47
|
+
return model.collection.includes(item);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
publicAPI.getNumberOfItems = function () {
|
|
51
|
+
return model.collection.length;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
publicAPI.empty = function () {
|
|
55
|
+
return model.collection.length === 0;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
publicAPI.getItem = function (idx) {
|
|
59
|
+
return model.collection[idx];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
publicAPI.forEach = function (ftor) {
|
|
63
|
+
model.collection.forEach(ftor); // Call modified() for the collection, since ftor could have modified the elements.
|
|
64
|
+
|
|
65
|
+
publicAPI.updateMTimeWithElements();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
publicAPI.reduce = function (ftor, initialValue) {
|
|
69
|
+
return model.collection.reduce(ftor, initialValue);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
publicAPI.map = function (ftor) {
|
|
73
|
+
return model.collection.map(ftor);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
publicAPI.updateMTimeWithElements = function () {
|
|
77
|
+
var maxMTimeOfItems = 0; // we expect time values to be positive numbers
|
|
78
|
+
|
|
79
|
+
for (var i = 0; i < model.collection.length; ++i) {
|
|
80
|
+
var elem = model.collection[i];
|
|
81
|
+
maxMTimeOfItems = Math.max(maxMTimeOfItems, elem.getMTime());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (maxMTimeOfItems > publicAPI.getMTime()) {
|
|
85
|
+
publicAPI.modified();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
} // ----------------------------------------------------------------------------
|
|
89
|
+
// Object factory
|
|
90
|
+
// ----------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
var DEFAULT_VALUES = {
|
|
94
|
+
collection: []
|
|
95
|
+
}; // ----------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
function extend(publicAPI, model) {
|
|
98
|
+
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
99
|
+
Object.assign(model, DEFAULT_VALUES, initialValues); // Object methods
|
|
100
|
+
|
|
101
|
+
macro.obj(publicAPI, model); // Object specific methods
|
|
102
|
+
|
|
103
|
+
vtkCollection(publicAPI, model);
|
|
104
|
+
} // ----------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
var newInstance = macro.newInstance(extend, 'vtkCollection'); // ----------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
var index = {
|
|
109
|
+
newInstance: newInstance,
|
|
110
|
+
extend: extend
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { index as default, extend, newInstance };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import vtkInteractorObserver from './../../Rendering/Core/InteractorObserver';
|
|
2
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
3
|
+
import { Vector2, Vector3 } from './../../types';
|
|
4
|
+
|
|
5
|
+
export interface vtkCompositeCameraManipulator {
|
|
6
|
+
/**
|
|
7
|
+
* Computes the display center.
|
|
8
|
+
* @param observer
|
|
9
|
+
* @param renderer
|
|
10
|
+
*/
|
|
11
|
+
computeDisplayCenter(
|
|
12
|
+
observer: vtkInteractorObserver,
|
|
13
|
+
renderer: vtkRenderer
|
|
14
|
+
): void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Sets the rotation factor.
|
|
18
|
+
* @param factor
|
|
19
|
+
*/
|
|
20
|
+
setRotationFactor(factor: number): boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Gets the rotation factor.
|
|
24
|
+
*/
|
|
25
|
+
getRotationFactor(): number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sets the display center.
|
|
29
|
+
* @param center
|
|
30
|
+
*/
|
|
31
|
+
setDisplayCenter(center: Vector2): boolean;
|
|
32
|
+
setDisplayCenter(x: number, y: number): boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Gets the display center.
|
|
36
|
+
*/
|
|
37
|
+
getDisplayCenter(): Vector2;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Sets the center.
|
|
41
|
+
* @param center
|
|
42
|
+
*/
|
|
43
|
+
setCenter(center: Vector3): boolean;
|
|
44
|
+
setCenter(x: number, y: number, z: number): boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Gets the center.
|
|
48
|
+
*/
|
|
49
|
+
getCenter(): Vector3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ICompositeCameraManipulatorInitialValues {
|
|
53
|
+
center?: Vector3;
|
|
54
|
+
rotationFactor?: number;
|
|
55
|
+
displayCenter?: Vector2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function extend(
|
|
59
|
+
publicAPI: object,
|
|
60
|
+
model: object,
|
|
61
|
+
initialValues?: ICompositeCameraManipulatorInitialValues
|
|
62
|
+
): void;
|
|
63
|
+
|
|
64
|
+
export const vtkCompositeCameraManipulator: {
|
|
65
|
+
extend: typeof extend;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default vtkCompositeCameraManipulator;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import vtkInteractorStyle from './../../Rendering/Core/InteractorStyle';
|
|
2
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
3
|
+
import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
|
|
4
|
+
import { Nullable } from './../../types';
|
|
5
|
+
|
|
6
|
+
export interface vtkCompositeGestureManipulator {
|
|
7
|
+
/**
|
|
8
|
+
* Starts an interaction event.
|
|
9
|
+
*/
|
|
10
|
+
startInteraction(): void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Ends an interaction event.
|
|
14
|
+
*/
|
|
15
|
+
endInteraction(): void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Handles a start pinch gesture.
|
|
19
|
+
* @param interactor
|
|
20
|
+
* @param scale
|
|
21
|
+
*/
|
|
22
|
+
onStartPinch(interactor: vtkRenderWindowInteractor, scale: number): void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Handles a pinch gesture.
|
|
26
|
+
* @param interactor
|
|
27
|
+
* @param renderer
|
|
28
|
+
* @param scale
|
|
29
|
+
*/
|
|
30
|
+
onPinch(
|
|
31
|
+
interactor: vtkRenderWindowInteractor,
|
|
32
|
+
renderer: vtkRenderer,
|
|
33
|
+
scale: number
|
|
34
|
+
): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Handles an end pinch gesture.
|
|
38
|
+
* @param interactor
|
|
39
|
+
*/
|
|
40
|
+
onEndPinch(interactor: vtkRenderWindowInteractor): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Handles a start rotate gesture.
|
|
44
|
+
* @param interactor
|
|
45
|
+
* @param rotation
|
|
46
|
+
*/
|
|
47
|
+
onStartRotate(interactor: vtkRenderWindowInteractor, rotation: number): void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Handles a rotate gesture.
|
|
51
|
+
* @param interactor
|
|
52
|
+
* @param renderer
|
|
53
|
+
* @param rotation
|
|
54
|
+
*/
|
|
55
|
+
onRotate(
|
|
56
|
+
interactor: vtkRenderWindowInteractor,
|
|
57
|
+
renderer: vtkRenderer,
|
|
58
|
+
rotation: number
|
|
59
|
+
): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Handles an end pinch gesture.
|
|
63
|
+
* @param interactor
|
|
64
|
+
*/
|
|
65
|
+
onEndRotate(interactor: vtkRenderWindowInteractor): void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Handles a start pan gesture.
|
|
69
|
+
* @param interactor
|
|
70
|
+
* @param translation
|
|
71
|
+
*/
|
|
72
|
+
onStartPan(interactor: vtkRenderWindowInteractor, translation: number): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Handles a pan gesture.
|
|
76
|
+
* @param interactor
|
|
77
|
+
* @param renderer
|
|
78
|
+
* @param translation
|
|
79
|
+
*/
|
|
80
|
+
onPan(
|
|
81
|
+
interactor: vtkRenderWindowInteractor,
|
|
82
|
+
renderer: vtkRenderer,
|
|
83
|
+
translation: number
|
|
84
|
+
): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Handles an end pan gesture.
|
|
88
|
+
* @param interactor
|
|
89
|
+
*/
|
|
90
|
+
onEndPan(interactor: vtkRenderWindowInteractor): void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Is pinch enabled.
|
|
94
|
+
*/
|
|
95
|
+
isPinchEnabled(): boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Sets if pinch is enabled.
|
|
99
|
+
* @param pinch
|
|
100
|
+
*/
|
|
101
|
+
setPinchEnabled(pinch: boolean): boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Gets flag if pinch is enabled.
|
|
105
|
+
*/
|
|
106
|
+
getPinchEnabled(): boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Is pan enabled.
|
|
110
|
+
*/
|
|
111
|
+
isPanEnabled(): boolean;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Sets if pan is enabled.
|
|
115
|
+
* @param pan
|
|
116
|
+
*/
|
|
117
|
+
setPanEnabled(pan: boolean): boolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Gets flag if pan is enabled.
|
|
121
|
+
*/
|
|
122
|
+
getPanEnabled(): boolean;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Is rotate enabled.
|
|
126
|
+
*/
|
|
127
|
+
isRotateEnabled(): boolean;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Sets if rotate is enabled.
|
|
131
|
+
* @param rotate
|
|
132
|
+
*/
|
|
133
|
+
setRotateEnabled(rotate: boolean): boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Gets flag if rotate is enabled.
|
|
137
|
+
*/
|
|
138
|
+
getRotateEnabled(): boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Sets the interactor style.
|
|
142
|
+
* @param style vtkInteractorStyle
|
|
143
|
+
*/
|
|
144
|
+
setInteractorStyle(style: Nullable<vtkInteractorStyle>): boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Gets the interactor style.
|
|
148
|
+
*/
|
|
149
|
+
getInteractorStyle(): Nullable<vtkInteractorStyle>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface ICompositeGestureManipulatorInitialValues {
|
|
153
|
+
pinchEnabled?: boolean;
|
|
154
|
+
panEnabled?: boolean;
|
|
155
|
+
rotateEnabled?: boolean;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function extend(
|
|
159
|
+
publicAPI: object,
|
|
160
|
+
model: object,
|
|
161
|
+
initialValues?: ICompositeGestureManipulatorInitialValues
|
|
162
|
+
): void;
|
|
163
|
+
|
|
164
|
+
export const vtkCompositeGestureManipulator: {
|
|
165
|
+
extend: typeof extend;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default vtkCompositeGestureManipulator;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
2
|
+
import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
|
|
3
|
+
|
|
4
|
+
export interface vtkCompositeKeyboardManipulator {
|
|
5
|
+
/**
|
|
6
|
+
* Handles a keypress event.
|
|
7
|
+
* @param interactor the interactor
|
|
8
|
+
* @param renderer the renderer
|
|
9
|
+
* @param key the key
|
|
10
|
+
*/
|
|
11
|
+
onKeyPress(
|
|
12
|
+
interactor: vtkRenderWindowInteractor,
|
|
13
|
+
renderer: vtkRenderer,
|
|
14
|
+
key: KeyboardEvent['key']
|
|
15
|
+
): void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Handles a keydown event.
|
|
19
|
+
* @param interactor the interactor
|
|
20
|
+
* @param renderer the renderer
|
|
21
|
+
* @param key the key
|
|
22
|
+
*/
|
|
23
|
+
onKeyDown(
|
|
24
|
+
interactor: vtkRenderWindowInteractor,
|
|
25
|
+
renderer: vtkRenderer,
|
|
26
|
+
key: KeyboardEvent['key']
|
|
27
|
+
): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Handles a keyup event.
|
|
31
|
+
* @param interactor the interactor
|
|
32
|
+
* @param renderer the renderer
|
|
33
|
+
* @param key the key
|
|
34
|
+
*/
|
|
35
|
+
onKeyUp(
|
|
36
|
+
interactor: vtkRenderWindowInteractor,
|
|
37
|
+
renderer: vtkRenderer,
|
|
38
|
+
key: KeyboardEvent['key']
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function extend(publicAPI: object, model: object): void;
|
|
43
|
+
|
|
44
|
+
export const vtkCompositeKeyboardManipulator: {
|
|
45
|
+
extend: typeof extend;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default vtkCompositeKeyboardManipulator;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
2
|
+
import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
|
|
3
|
+
|
|
4
|
+
export interface vtkCompositeMouseManipulator {
|
|
5
|
+
/**
|
|
6
|
+
* Starts an interaction event.
|
|
7
|
+
*/
|
|
8
|
+
startInteraction(): void;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Ends an interaction event.
|
|
12
|
+
*/
|
|
13
|
+
endInteraction(): void;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Handles a button down event.
|
|
17
|
+
* @param interactor the interactor
|
|
18
|
+
* @param renderer the renderer
|
|
19
|
+
* @param position the display position
|
|
20
|
+
*/
|
|
21
|
+
onButtonDown(
|
|
22
|
+
interactor: vtkRenderWindowInteractor,
|
|
23
|
+
renderer: vtkRenderer,
|
|
24
|
+
position: { x: number; y: number }
|
|
25
|
+
): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Handles a button up event.
|
|
29
|
+
* @param interactor the interactor
|
|
30
|
+
*/
|
|
31
|
+
onButtonUp(interactor: vtkRenderWindowInteractor): void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Handles a mouse move event.
|
|
35
|
+
* @param interactor the interactor
|
|
36
|
+
* @param renderer the renderer
|
|
37
|
+
* @param position the display position
|
|
38
|
+
*/
|
|
39
|
+
onMouseMove(
|
|
40
|
+
interactor: vtkRenderWindowInteractor,
|
|
41
|
+
renderer: vtkRenderer,
|
|
42
|
+
position: { x: number; y: number }
|
|
43
|
+
): void;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Handles a start scroll event.
|
|
47
|
+
* @param interactor the interactor
|
|
48
|
+
* @param renderer the renderer
|
|
49
|
+
* @param delta the scroll delta
|
|
50
|
+
*/
|
|
51
|
+
onStartScroll(
|
|
52
|
+
interactor: vtkRenderWindowInteractor,
|
|
53
|
+
renderer: vtkRenderer,
|
|
54
|
+
delta: number
|
|
55
|
+
): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Handles a scroll event.
|
|
59
|
+
* @param interactor the interactor
|
|
60
|
+
*/
|
|
61
|
+
onEndScroll(interactor: vtkRenderWindowInteractor): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Is drag enabled.
|
|
65
|
+
*/
|
|
66
|
+
isDragEnabled(): boolean;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Sets if drag is enabled.
|
|
70
|
+
* @param enabled
|
|
71
|
+
*/
|
|
72
|
+
setDragEnabled(enabled: boolean): boolean;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Is scroll enabled.
|
|
76
|
+
*/
|
|
77
|
+
isScrollEnabled(): boolean;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Sets if scroll is enabled.
|
|
81
|
+
* @param enabled
|
|
82
|
+
*/
|
|
83
|
+
setScrollEnabled(enabled: boolean): boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Sets the associated button.
|
|
87
|
+
* @param btn
|
|
88
|
+
*/
|
|
89
|
+
setButton(btn: number): boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Gets the associated button.
|
|
93
|
+
*/
|
|
94
|
+
getButton(): number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Sets if the shift key is required.
|
|
98
|
+
* @param shift
|
|
99
|
+
*/
|
|
100
|
+
setShift(shift: boolean): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Gets flag if shift key is required.
|
|
104
|
+
*/
|
|
105
|
+
getShift(): boolean;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Sets if the control key is required.
|
|
109
|
+
* @param ctrl
|
|
110
|
+
*/
|
|
111
|
+
setControl(ctrl: boolean): boolean;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Gets flag if control key is required.
|
|
115
|
+
*/
|
|
116
|
+
getControl(): boolean;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Sets if the alt key is required.
|
|
120
|
+
* @param alt
|
|
121
|
+
*/
|
|
122
|
+
setAlt(alt: boolean): boolean;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Gets flag if alt key is required.
|
|
126
|
+
*/
|
|
127
|
+
getAlt(): boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ICompositeMouseManipulatorInitialValues {
|
|
131
|
+
button?: number;
|
|
132
|
+
shift?: boolean;
|
|
133
|
+
control?: boolean;
|
|
134
|
+
alt?: boolean;
|
|
135
|
+
dragEnabled?: boolean;
|
|
136
|
+
scrollEnabled?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function extend(
|
|
140
|
+
publicAPI: object,
|
|
141
|
+
model: object,
|
|
142
|
+
initialValues?: ICompositeMouseManipulatorInitialValues
|
|
143
|
+
): void;
|
|
144
|
+
|
|
145
|
+
export const vtkCompositeMouseManipulator: {
|
|
146
|
+
extend: typeof extend;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default vtkCompositeMouseManipulator;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { States } from './../../Rendering/Core/InteractorStyle/Constants';
|
|
2
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
3
|
+
import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
|
|
4
|
+
import {
|
|
5
|
+
Device,
|
|
6
|
+
Input,
|
|
7
|
+
} from './../../Rendering/Core/RenderWindowInteractor/Constants';
|
|
8
|
+
|
|
9
|
+
export interface vtkCompositeVRManipulator {
|
|
10
|
+
onButton3D(
|
|
11
|
+
interactor: vtkRenderWindowInteractor,
|
|
12
|
+
renderer: vtkRenderer,
|
|
13
|
+
state: States,
|
|
14
|
+
device: Device,
|
|
15
|
+
input: Input,
|
|
16
|
+
pressed: boolean
|
|
17
|
+
): void;
|
|
18
|
+
|
|
19
|
+
onMove3D(
|
|
20
|
+
interactor: vtkRenderWindowInteractor,
|
|
21
|
+
renderer: vtkRenderer,
|
|
22
|
+
state: States,
|
|
23
|
+
device: Device,
|
|
24
|
+
input: Input,
|
|
25
|
+
pressed: boolean
|
|
26
|
+
): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ICompositeVRManipulatorInitialValues {
|
|
30
|
+
device?: Device;
|
|
31
|
+
input?: Input;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function extend(
|
|
35
|
+
publicAPI: object,
|
|
36
|
+
model: object,
|
|
37
|
+
initialValues?: ICompositeVRManipulatorInitialValues
|
|
38
|
+
): void;
|
|
39
|
+
|
|
40
|
+
export const vtkCompositeVRManipulator: {
|
|
41
|
+
extend: typeof extend;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default vtkCompositeVRManipulator;
|