ToolAdmin Class
Controls the operation of Tools, administering the current ViewTool, PrimitiveTool, and IdleTool and forwarding events to the appropriate tool.
extensions
Methods
Name | Description | |
---|---|---|
constructor(): ToolAdmin | ||
adjustPoint(pointActive: Point3d, vp: ScreenViewport, projectToACS: boolean = true, applyLocks: boolean = true): void | ||
adjustPointToACS(pointActive: Point3d, vp: Viewport, perpendicular: boolean): void | ||
adjustPointToGrid(pointActive: Point3d, vp: Viewport): void | ||
adjustSnapPoint(perpendicular: boolean = true): void | ||
bumpToolSetting(settingIndex?: number): Promise<boolean> | Method used to "bump" the value of a tool setting for the current tool. | Beta |
convertTouchEndToButtonUp(ev: BeTouchEvent, button: BeButton = BeButton.Data): Promise<void> | Can be called by tools that wish to emulate releasing the mouse button for onTouchEnd or onTouchComplete. | |
convertTouchMoveStartToButtonDownAndMotion(startEv: BeTouchEvent, ev: BeTouchEvent, button: BeButton = BeButton.Data): Promise<void> | Can be called by tools that wish to emulate moving the mouse with a button depressed for onTouchMoveStart. | |
convertTouchMoveToMotion(ev: BeTouchEvent): Promise<void> | Can be called by tools that wish to emulate a mouse motion event for onTouchMove. | |
convertTouchStartToButtonDown(ev: BeTouchEvent, button: BeButton = BeButton.Data): Promise<void> | Can be called by tools that wish to emulate pressing the mouse button for onTouchStart or onTouchMoveStart. | |
convertTouchTapToButtonDownAndUp(ev: BeTouchEvent, button: BeButton = BeButton.Data): Promise<void> | Can be called by tools that wish to emulate mouse button down/up events for onTouchTap. | |
dispatchImmediateUiSyncEvent(specificSyncEventId?: string, toolId?: string): void | Method used by interactive tools to inform one or more UI components to refresh. | Beta |
dispatchUiSyncEvent(specificSyncEventId?: string, toolId?: string): void | Method used by interactive tools to inform one or more UI components to refresh. | Beta |
doRedoOperation(): Promise<boolean> | Called to redo previous data button for primitive tools or undo last write operation. | |
doUndoOperation(): Promise<boolean> | Called to undo previous data button for primitive tools or undo last write operation. | |
filterViewport(vp: ScreenViewport): boolean Protected | Return true to filter (ignore) events to the given viewport | |
getToolTip(hit: HitDetail): Promise<string | HTMLElement> | Ask the current tool to provide tooltip contents for the supplied HitDetail. | |
onCtrlKeyPressed(keyEvent: KeyboardEvent): Promise<{ handled: boolean, result: boolean }> | Process key down events while the Ctrl key is pressed | |
processShortcutKey(_keyEvent: KeyboardEvent, _wentDown: boolean): Promise<boolean> | Process shortcut key events | |
processWheelEvent(ev: BeWheelEvent, doUpdate: boolean): Promise<EventHandled> | Performs default handling of mouse wheel event (zoom in/out) | |
reloadToolSettingsProperties(): void | Method used by interactive tools to send request to reload UI from properties returned via method supplyToolSettingsProperties. | Beta |
sendEndDragEvent(ev: BeButtonEvent): Promise<any> | ||
setCursor(cursor: undefined | string): void | ||
setLocateCircleOn(locateOn: boolean): void | ||
setLocateCursor(enableLocate: boolean): void | ||
startDefaultTool(): Promise<void> | Starts the default Tool, if any. | |
syncToolSettingsProperties(toolId: string, syncProperties: DialogPropertySyncItem[]): void | Method used by interactive tools to send updated values to UI components, typically showing tool settings. | Beta |
exceptionHandler(exception: any): Promise<any> Static | A function that catches otherwise-uncaught exceptions occurring inside ToolAdmin.eventLoop. |
Properties
Name | Type | Description | |
---|---|---|---|
acsContextLock | boolean | If ACS Plane Lock is on, standard view rotations are relative to the ACS instead of global. | |
acsPlaneSnapLock | boolean | If ACS Snap Lock is on, project snap points to the ACS plane. | |
activeTool Accessor ReadOnly | undefined | InteractiveTool | The currently active InteractiveTool. | |
activeToolChanged Readonly | BeEvent<(tool: Tool, start: StartOrResume) => void> | Event raised whenever the active tool changes. | |
assemblyLock | boolean | Apply operations such as transform, copy or delete to all members of an assembly. | |
currentTool Accessor ReadOnly | InteractiveTool | The current tool. | |
cursorView Accessor ReadOnly | undefined | ScreenViewport | Get the ScreenViewport where the cursor is currently, if any. | |
defaultToolArgs Accessor | undefined | any[] | The arguments supplied to the default Tool's Tool.run method from ToolAdmin.startDefaultTool. | |
defaultToolId Accessor | string | The name of the PrimitiveTool to use as the default tool. | |
exceptionOptions Static | { alertBox: boolean, details: boolean, launchDebugger: boolean, log: boolean } | Options for how uncaught exceptions should be handled by ToolAdmin.exceptionHandler. | |
gridLock | boolean | If Grid Lock is on, project data points to grid. | |
idleTool Accessor | InteractiveTool | The idleTool handles events that are not otherwise processed. | |
isLocateCircleOn Accessor ReadOnly | boolean | ||
manipulatorToolEvent Readonly | BeEvent<(tool: Tool, event: ManipulatorToolEvent) => void> | Event raised by tools that support edit manipulators like the SelectTool. | |
markupView | undefined | ScreenViewport | ||
primitiveTool Accessor ReadOnly | undefined | PrimitiveTool | ||
viewTool Accessor ReadOnly | undefined | ViewTool |
Defined in
- core/frontend/src/tools/ToolAdmin.ts Line 325
Last Updated: 30 November, 2023