@shopware-ag/dive
Version:
Shopware Spatial Framework
39 lines (38 loc) • 1.21 kB
TypeScript
import { Object3D } from 'three/webgpu';
import { DIVESelectable } from '../../../../index.ts';
import { Tool } from '../Tool.ts';
import { PointerContext } from '../PointerContext.ts';
import { SelectionState } from '../SelectionState.ts';
/**
* Type guard to check if a tool is a SelectTool.
*/
export declare const isSelectTool: (tool: Tool) => tool is SelectTool;
/**
* Tool for selecting objects via click.
*
* Only processes objects on PRODUCT_LAYER (models), ignoring UI elements like gizmos.
* Uses SelectionState to manage selection and notify other tools (like TransformTool).
*
* @module
*/
export declare class SelectTool implements Tool {
readonly name = "select";
readonly priority = 30;
private _selectionState;
constructor(selectionState: SelectionState);
/**
* Get the currently selected object.
*/
get selected(): (Object3D & DIVESelectable) | null;
onActivate(): void;
onDeactivate(): void;
onClick(ctx: PointerContext): void;
/**
* Programmatically select an object.
*/
select(obj: Object3D & DIVESelectable): void;
/**
* Programmatically deselect the current selection.
*/
deselect(): void;
}