AccuDraw Class

Accudraw is an aide for entering coordinate data. This class is public to allow applications to provide a user interface for AccuDraw, either by implementing their own, or using the one supplied by the itwin appui package.

@note When writing an InteractiveTool it is not correct to call methods on AccuDraw directly, tools should instead provide hints to AccuDraw using AccuDrawHintBuilder.

Methods

Name Description
constructor(): AccuDraw    
getFieldLock(index: ItemField): boolean Get the current lock state for the supplied input field  
getValueByIndex(index: ItemField): number Get the current value for the supplied input field  
grabInputFocus(): void Implement this method to set focus to the AccuDraw UI.  
onCompassModeChange(): void Called after compass mode is changed between polar and rectangular  
onFieldLockChange(_index: ItemField): void Called after input field locked state is changed  
onFieldValueChange(_index: ItemField): void Called after input field value changes  
onMotion(_ev: BeButtonEvent): void Implemented by sub-classes to update ui fields to show current deltas or coordinates when inactive.  
onRotationModeChange(): void Called after compass rotation is changed  
processFieldInput(index: ItemField, input: string, synchText: boolean): Promise<void> Call from an AccuDraw UI event to sync the supplied input field value  
sendDataPoint(pt: Point3d, viewport: ScreenViewport): Promise<void> Emulate a mouse click at the specified location in the supplied view by sending button down/up events.  
setCompassMode(mode: CompassMode): void Change current compass input mode to either polar or rectangular  
setFieldLock(index: ItemField, locked: boolean): void Change the lock status for the supplied input field  
setFocusItem(_index: ItemField): void Set focus to the specified input field  
setRotationMode(mode: RotationMode): void Change current compass orientation  
setValueByIndex(index: ItemField, value: number): void Set the current value for the supplied input field  

Properties

Name Type Description
alwaysShowCompass boolean    
autoFocusFields boolean    
autoPointPlacement boolean    
axisIndexing boolean    
compassMode CompassMode    
contextSensitive boolean    
currentState CurrentState    
distanceIndexing boolean    
dontMoveFocus boolean Disable automatic focus change when user is entering input.  
floatingOrigin boolean    
hasInputFocus Accessor ReadOnly boolean Whether AccuDraw currently has input focus  
isActive Accessor ReadOnly boolean    
isDeactivated Accessor ReadOnly boolean    
isEnabled Accessor ReadOnly boolean    
isInactive Accessor ReadOnly boolean    
newFocus ItemField Set input field to move focus to (X_Item or Y_Item) for automatic focus change.  
rotationMode RotationMode    
smartKeyin boolean    
stickyZLock boolean    

Defined in

Last Updated: 15 March, 2024