Methods
endInteraction
Ends an interaction event.
getInteractorStyle
Gets the interactor style.
getPanEnabled
Gets flag if pan is enabled.
getPinchEnabled
Gets flag if pinch is enabled.
getRotateEnabled
Gets flag if rotate is enabled.
isPanEnabled
Is pan enabled.
isPinchEnabled
Is pinch enabled.
isRotateEnabled
Is rotate enabled.
onEndPan
Handles an end pan gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
onEndPinch
Handles an end pinch gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
onEndRotate
Handles an end pinch gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
onPan
Handles a pan gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
renderer |
|
Yes |
|
translation |
|
Yes |
|
onPinch
Handles a pinch gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
renderer |
|
Yes |
|
scale |
|
Yes |
|
onRotate
Handles a rotate gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
renderer |
|
Yes |
|
rotation |
|
Yes |
|
onStartPan
Handles a start pan gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
translation |
|
Yes |
|
onStartPinch
Handles a start pinch gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
scale |
|
Yes |
|
onStartRotate
Handles a start rotate gesture.
Argument |
Type |
Required |
Description |
interactor |
|
Yes |
|
rotation |
|
Yes |
|
setInteractorStyle
Sets the interactor style.
Argument |
Type |
Required |
Description |
style |
|
Yes |
vtkInteractorStyle |
setPanEnabled
Sets if pan is enabled.
Argument |
Type |
Required |
Description |
pan |
|
Yes |
|
setPinchEnabled
Sets if pinch is enabled.
Argument |
Type |
Required |
Description |
pinch |
|
Yes |
|
setRotateEnabled
Sets if rotate is enabled.
Argument |
Type |
Required |
Description |
rotate |
|
Yes |
|
startInteraction
Starts an interaction event.
Source
index.d.tsimport vtkInteractorStyle from '../../../Rendering/Core/InteractorStyle'; import vtkRenderer from '../../..//Rendering/Core/Renderer'; import vtkRenderWindowInteractor from '../../../Rendering/Core/RenderWindowInteractor'; import { Nullable } from '../../../types';
export interface vtkCompositeGestureManipulator {
startInteraction(): void;
endInteraction(): void;
onStartPinch(interactor: vtkRenderWindowInteractor, scale: number): void;
onPinch( interactor: vtkRenderWindowInteractor, renderer: vtkRenderer, scale: number ): void;
onEndPinch(interactor: vtkRenderWindowInteractor): void;
onStartRotate(interactor: vtkRenderWindowInteractor, rotation: number): void;
onRotate( interactor: vtkRenderWindowInteractor, renderer: vtkRenderer, rotation: number ): void;
onEndRotate(interactor: vtkRenderWindowInteractor): void;
onStartPan(interactor: vtkRenderWindowInteractor, translation: number): void;
onPan( interactor: vtkRenderWindowInteractor, renderer: vtkRenderer, translation: number ): void;
onEndPan(interactor: vtkRenderWindowInteractor): void;
isPinchEnabled(): boolean;
setPinchEnabled(pinch: boolean): boolean;
getPinchEnabled(): boolean;
isPanEnabled(): boolean;
setPanEnabled(pan: boolean): boolean;
getPanEnabled(): boolean;
isRotateEnabled(): boolean;
setRotateEnabled(rotate: boolean): boolean;
getRotateEnabled(): boolean;
setInteractorStyle(style: Nullable<vtkInteractorStyle>): boolean;
getInteractorStyle(): Nullable<vtkInteractorStyle>; }
export interface ICompositeGestureManipulatorInitialValues { pinchEnabled?: boolean; panEnabled?: boolean; rotateEnabled?: boolean; }
export function extend( publicAPI: object, model: object, initialValues?: ICompositeGestureManipulatorInitialValues ): void;
export const vtkCompositeGestureManipulator: { extend: typeof extend; };
export default vtkCompositeGestureManipulator;
|
index.jsimport macro from 'vtk.js/Sources/macros';
function vtkCompositeGestureManipulator(publicAPI, model) { model.classHierarchy.push('vtkCompositeGestureManipulator');
publicAPI.startInteraction = () => {}; publicAPI.endInteraction = () => {};
publicAPI.onStartPinch = (interactor, scale) => {}; publicAPI.onStartRotate = (interactor, rotation) => {}; publicAPI.onStartPan = (interactor, translation) => {}; publicAPI.onPinch = (interactor, renderer, scale) => {}; publicAPI.onRotate = (interactor, renderer, rotation) => {}; publicAPI.onPan = (interactor, renderer, translation) => {}; publicAPI.onEndPinch = (interactor) => {}; publicAPI.onEndRotate = (interactor) => {}; publicAPI.onEndPan = (interactor) => {};
publicAPI.isPinchEnabled = () => model.pinchEnabled; publicAPI.isPanEnabled = () => model.panEnabled; publicAPI.isRotateEnabled = () => model.rotateEnabled; }
const DEFAULT_VALUES = { pinchEnabled: true, panEnabled: true, rotateEnabled: true, };
export function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues);
macro.set(publicAPI, model, ['pinchEnabled', 'panEnabled', 'rotateEnabled']); macro.setGet(publicAPI, model, ['interactorStyle']);
vtkCompositeGestureManipulator(publicAPI, model); }
export default { extend };
|