import { type IGeometryData, type IMaterialAbstractData, type IViewportApi } from "@shapediver/viewer"; import { type RestrictionProperties } from "@shapediver/viewer.rendering-engine.intersection-restriction-engine"; import { type ITreeNode } from "@shapediver/viewer.shared.node-tree"; import { type IIntersectionDefinition, type IRay } from "@shapediver/viewer.shared.types"; import { vec3 } from "gl-matrix"; import { INTERACTION_STATE } from "../../interfaces/IInteractionEngine"; import { type IInteractionFilterOptions } from "../../interfaces/IInteractionManager"; import { type IDragConstraint } from "../../interfaces/utils/IDragConstraint"; import { type IInteractionEffect } from "../../interfaces/utils/IInteractionEffectUtils"; import { AbstractInteractionManager } from "../AbstractInteractionManager"; export declare class DragManager extends AbstractInteractionManager { #private; constructor(id?: string, interactionEffect?: IInteractionEffect | IMaterialAbstractData); get filter(): IInteractionFilterOptions; add(viewport: IViewportApi): void; /** * Add a new drag constraint. * Returns a token that is used for removing the drag constraint via {@link removeRestriction}. * * @deprecated This method is deprecated. Please use {@link addRestriction} instead. * @param constraint * @returns */ addDragConstraint(constraint: IDragConstraint): string | undefined; /** * Add a new restriction. * Returns a token that is used for removing the restriction via {@link removeRestriction}. * * @param properties * @returns */ addRestriction(properties: RestrictionProperties): string | undefined; onDown(event: PointerEvent, ray: IRay, intersection: IIntersectionDefinition[]): void; onEnd(event: PointerEvent, ray: IRay, intersection: IIntersectionDefinition[], endState: INTERACTION_STATE): void; onKeyDown(event: KeyboardEvent, pointerInCanvas: boolean): void; onKeyUp(event: KeyboardEvent, pointerInCanvas: boolean): void; onMove(event: PointerEvent, ray: IRay, intersection: IIntersectionDefinition[]): void; remove(): void; /** * Remove the drag constraint that was added via {@link removeRestriction}. * * @deprecated This method is deprecated. Please use {@link removeRestriction} instead. * @param token * @returns */ removeDragConstraint(token: string): boolean; /** * Remove the node as the currently used drag node. * * @returns */ removeNode(event?: PointerEvent, ray?: IRay): void; /** * Removes the restriction with the given token. * * @param token * @returns */ removeRestriction(token: string): boolean; /** * Removes all restrictions. */ removeRestrictions(): false | undefined; /** * Set the current dragged node. * This will serve as the start of the drag event. * This function is also called internally at onDown events. * * @param node * @param distance * @param intersectionPoint * @param ray */ setNode(node: ITreeNode, geometryData?: IGeometryData, distance?: number, intersectionPoint?: vec3, event?: PointerEvent, ray?: IRay): void; /** * Utility function to make the node the current active node. * Set the according values, apply the effect and emit the event. * * @param intersection */ private activateNode; /** * Utility function to apply the transformation to the current node. * * @param node * @param matrix */ private applyTransformation; /** * Utility function to make the node inactive. * Set the according values, remove the effect and emit the event. * * @param intersection */ private deactivateNode; private removeTransformation; } //# sourceMappingURL=DragManager.d.ts.map