|
| 1 | +import vtkInteractorStyle from '../../../Rendering/Core/InteractorStyle'; |
| 2 | +import vtkCellPicker from '../../../Rendering/Core/CellPicker'; |
| 3 | +import vtkProp3D from '../../../Rendering/Core/Prop3D'; |
| 4 | +import vtkRenderer from '../../../Rendering/Core/Renderer'; |
| 5 | +import { Nullable } from '../../../types'; |
| 6 | +import { IRenderWindowInteractorEvent } from '../../../Rendering/Core/RenderWindowInteractor'; |
| 7 | + |
| 8 | +export interface IInteractorStyleTrackballActorInitialValues { |
| 9 | + motionFactor?: number; |
| 10 | + interactionProp?: Nullable<vtkProp3D>; |
| 11 | + interactionPicker?: Nullable<vtkCellPicker>; |
| 12 | +} |
| 13 | + |
| 14 | +export interface vtkInteractorStyleTrackballActor extends vtkInteractorStyle { |
| 15 | + /** |
| 16 | + * Find the picked actor and pick position. |
| 17 | + * @param {vtkRenderer} renderer |
| 18 | + * @param {{x: number, y: number}} position |
| 19 | + */ |
| 20 | + findPickedActor( |
| 21 | + renderer: vtkRenderer, |
| 22 | + position: { x: number; y: number } |
| 23 | + ): void; |
| 24 | + |
| 25 | + /** |
| 26 | + * Handle mouse move event. |
| 27 | + * @param {IRenderWindowInteractorEvent} callData |
| 28 | + */ |
| 29 | + handleMouseMove(callData: IRenderWindowInteractorEvent): void; |
| 30 | + |
| 31 | + /** |
| 32 | + * Handle left mouse button press event. |
| 33 | + * @param {IRenderWindowInteractorEvent} callData |
| 34 | + */ |
| 35 | + handleLeftButtonPress(callData: IRenderWindowInteractorEvent): void; |
| 36 | + |
| 37 | + /** |
| 38 | + * Handle left mouse button release event. |
| 39 | + * @param {IRenderWindowInteractorEvent} callData |
| 40 | + */ |
| 41 | + handleLeftButtonRelease(callData: IRenderWindowInteractorEvent): void; |
| 42 | + |
| 43 | + /** |
| 44 | + * Handle middle mouse button press event. |
| 45 | + * @param {IRenderWindowInteractorEvent} callData |
| 46 | + */ |
| 47 | + handleMiddleButtonPress(callData: IRenderWindowInteractorEvent): void; |
| 48 | + |
| 49 | + /** |
| 50 | + * Handle middle mouse button release event. |
| 51 | + * @param {IRenderWindowInteractorEvent} callData |
| 52 | + */ |
| 53 | + handleMiddleButtonRelease(callData: IRenderWindowInteractorEvent): void; |
| 54 | + |
| 55 | + /** |
| 56 | + * Handle right mouse button press event. |
| 57 | + * @param {IRenderWindowInteractorEvent} callData |
| 58 | + */ |
| 59 | + handleRightButtonPress(callData: IRenderWindowInteractorEvent): void; |
| 60 | + |
| 61 | + /** |
| 62 | + * Handle right mouse button release event. |
| 63 | + * @param {IRenderWindowInteractorEvent} callData |
| 64 | + */ |
| 65 | + handleRightButtonRelease(callData: IRenderWindowInteractorEvent): void; |
| 66 | + |
| 67 | + /** |
| 68 | + * Handle mouse rotate event. |
| 69 | + * @param {vtkRenderer} renderer |
| 70 | + * @param {{x: number, y: number}} position |
| 71 | + */ |
| 72 | + handleMouseRotate( |
| 73 | + renderer: vtkRenderer, |
| 74 | + position: { x: number; y: number } |
| 75 | + ): void; |
| 76 | + |
| 77 | + /** |
| 78 | + * Handle mouse spin event. |
| 79 | + * @param {vtkRenderer} renderer |
| 80 | + * @param {{x: number, y: number}} position |
| 81 | + */ |
| 82 | + handleMouseSpin( |
| 83 | + renderer: vtkRenderer, |
| 84 | + position: { x: number; y: number } |
| 85 | + ): void; |
| 86 | + |
| 87 | + /** |
| 88 | + * Handle mouse pan event. |
| 89 | + * @param {vtkRenderer} renderer |
| 90 | + * @param {{x: number, y: number}} position |
| 91 | + */ |
| 92 | + handleMousePan( |
| 93 | + renderer: vtkRenderer, |
| 94 | + position: { x: number; y: number } |
| 95 | + ): void; |
| 96 | + |
| 97 | + /** |
| 98 | + * Handle mouse dolly event. |
| 99 | + * @param {vtkRenderer} renderer |
| 100 | + * @param {{x: number, y: number}} position |
| 101 | + */ |
| 102 | + handleMouseDolly( |
| 103 | + renderer: vtkRenderer, |
| 104 | + position: { x: number; y: number } |
| 105 | + ): void; |
| 106 | + |
| 107 | + /** |
| 108 | + * Handle mouse uniform scale event. |
| 109 | + * @param {vtkRenderer} renderer |
| 110 | + * @param {{x: number, y: number}} position |
| 111 | + */ |
| 112 | + handleMouseUniformScale( |
| 113 | + renderer: vtkRenderer, |
| 114 | + position: { x: number; y: number } |
| 115 | + ): void; |
| 116 | + |
| 117 | + /** |
| 118 | + * Start uniform scale interaction. |
| 119 | + */ |
| 120 | + startUniformScale(): void; |
| 121 | + |
| 122 | + /** |
| 123 | + * End uniform scale interaction. |
| 124 | + */ |
| 125 | + endUniformScale(): void; |
| 126 | + |
| 127 | + /** |
| 128 | + * Get the interaction picker. |
| 129 | + */ |
| 130 | + getInteractionPicker(): Nullable<vtkCellPicker>; |
| 131 | + |
| 132 | + /** |
| 133 | + * Get the interaction prop. |
| 134 | + */ |
| 135 | + getInteractionProp(): Nullable<vtkProp3D>; |
| 136 | + |
| 137 | + /** |
| 138 | + * Set the interaction prop. |
| 139 | + * @param {vtkProp3D | null} prop |
| 140 | + */ |
| 141 | + setInteractionProp(prop: Nullable<vtkProp3D>): boolean; |
| 142 | + |
| 143 | + /** |
| 144 | + * Get the motion factor. |
| 145 | + */ |
| 146 | + getMotionFactor(): number; |
| 147 | + |
| 148 | + /** |
| 149 | + * Set the motion factor. |
| 150 | + * @param {Number} factor |
| 151 | + */ |
| 152 | + setMotionFactor(factor: number): boolean; |
| 153 | +} |
| 154 | + |
| 155 | +export function newInstance( |
| 156 | + initialValues?: IInteractorStyleTrackballActorInitialValues |
| 157 | +): vtkInteractorStyleTrackballActor; |
| 158 | + |
| 159 | +export function extend( |
| 160 | + publicAPI: object, |
| 161 | + model: object, |
| 162 | + initialValues?: IInteractorStyleTrackballActorInitialValues |
| 163 | +): void; |
| 164 | + |
| 165 | +/** |
| 166 | + * vtkInteractorStyleTrackballActor allows the user to interact with (rotate, pan, etc.) objects in the scene independent of each other. |
| 167 | + * In trackball interaction, the magnitude of the mouse motion is proportional to the actor motion associated with a particular mouse binding. |
| 168 | + * For example, small left-button motions cause small changes in the rotation of the actor around its center point. |
| 169 | + */ |
| 170 | +export const vtkInteractorStyleTrackballActor: { |
| 171 | + newInstance: typeof newInstance; |
| 172 | + extend: typeof extend; |
| 173 | +}; |
| 174 | + |
| 175 | +export default vtkInteractorStyleTrackballActor; |
0 commit comments