import ToolBaseClass from '../../browser/tool/Tool'; import ViewerEvent from '../../browser/viewer/ViewerEvent'; /** * DragInfo holds convenient data while dragging. */ export interface DragInfo { /** * The mouse travel distance since the previous drag event. */ dx: number; /** * The mouse travel distance since the previous drag event. */ dy: number; /** * The total mouse travel distance since the mouse was pressed. */ totalDx: number; /** * The total mouse travel distance since the mouse was pressed. */ totalDy: number; } /** * DraggableTool is a base class for tools that handles mouse dragging * over the Viewer. * This class manages a protected member "dragInfo", which holds handy values * such as the total mouse move distance from the drag start point. */ export default abstract class DraggableTool extends ToolBaseClass { protected usePointerLockAPI: boolean; /** * Holds some useful drag-related variables. */ protected dragInfo: DragInfo; private prevX; private prevY; private startX; private startY; private prevTotalX; private prevTotalY; dragStartHandler(ev: ViewerEvent): void; dragHandler(ev: ViewerEvent): void; dragEndHandler(ev: ViewerEvent): void; private updateInfo; }