ToolAdmin Class

Controls the operation of Tools, administering the current ViewTool, PrimitiveTool, and IdleTool and forwarding events to the appropriate tool.

@see toolAdmin to access the session's ToolAdmin.

Methods

Name Description
constructor(): ToolAdmin    
adjustPoint(pointActive: Point3d, vp: ScreenViewport, projectToACS: booleantrue, applyLocks: booleantrue): void    
adjustPointToACS(pointActive: Point3d, vp: Viewport, perpendicular: boolean): void    
adjustPointToGrid(pointActive: Point3d, vp: Viewport): void    
adjustSnapPoint(perpendicular: booleantrue): void    
bumpToolSetting(settingIndex?: number): Promise<boolean> Method used to "bump" the value of a tool setting for the current tool.  
convertTouchEndToButtonUp(ev: BeTouchEvent, button: BeButtonBeButton.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: BeButtonBeButton.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: BeButtonBeButton.Data): Promise<void> Can be called by tools that wish to emulate pressing the mouse button for onTouchStart or onTouchMoveStart.  
convertTouchTapToButtonDownAndUp(ev: BeTouchEvent, button: BeButtonBeButton.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.  
dispatchUiSyncEvent(specificSyncEventId?: string, toolId?: string): void Method used by interactive tools to inform one or more UI components to refresh.  
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.  
fillEventFromCursorLocation(ev: BeButtonEvent, useSnap: booleantrue): void Fill the supplied button event from the current cursor location.  
fillEventFromLastDataButton(ev: BeButtonEvent): void Fill the supplied button event from the last data button location.  
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.  
restartPrimitiveTool(): Promise<void> Call from external events or immediate tools that may have invalidated the current primitive tool's state.  
sendEndDragEvent(ev: BeButtonEvent): Promise<any>    
setCursor(cursor: string): void    
setLocateCircleOn(locateOn: boolean): void    
setLocateCursor(enableLocate: boolean): void    
simulateMotionEvent(): void Can be called by tools to invoke their onDynamicFrame method without requiring a motion event.  
startDefaultTool(): Promise<void> Starts the default PrimitiveTool, if any.  
syncToolSettingsProperties(toolId: string, syncProperties: DialogPropertySyncItem[]): void Method used by interactive tools to send updated values to UI components, typically showing tool settings.  
wantToolTip(_hit: HitDetail): boolean Allow applications to inhibit specific tooltips, such as for maps.  
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.  
coordinateLockOverrides Accessor CoordinateLockOverrides Controls how the button event location is adjusted for the active tool  
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 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 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 ScreenViewport | undefined    
primitiveTool Accessor ReadOnly undefined | PrimitiveTool    
reloadToolSettingsHandler Accessor undefined | () => void Returns the handler registered by the UI layer that allows it to display property changes made by the active Tool.  
toolSettingsChangeHandler Accessor undefined | (toolId: string, syncProperties: DialogPropertySyncItem[]) => void Returns the handler registered by the UI layer that allows it to display property changes made by the active Tool.  
toolSettingsState Readonly ToolSettingsState Maintains the state of tool settings properties for the current session.  
toolSyncUiEventDispatcher Accessor undefined | (syncEventId: string, useImmediateDispatch?: boolean) => void Returns the handler registered by the UI layer that will trigger UiSyncEvent processing that informs UI component to refresh their state.  
viewTool Accessor ReadOnly undefined | ViewTool    

Defined in

Last Updated: 23 November, 2024