Tool Class

A Tool that performs an action. It has a toolId that uniquely identifies it, so it can be found via a lookup in the ToolRegistry. Every time a tools run, a new instance of (a subclass of) this class is created and its Tool.run method is invoked.

see InteractiveTool for a base Tool class to handle user input events from a Viewport.

see Tools

extensions

Extended by

Methods

Name Description
constructor(..._args: any[]): Tool    
parseAndRun(..._args: string[]): Promise<boolean> Run this instance of a tool using a series of string arguments.  
run(..._args: any[]): Promise<boolean> Run this instance of a Tool.  
register(namespace?: string): void Static Register this Tool class with the ToolRegistry.  

Properties

Name Type Description
description Accessor StaticReadOnly string Get the localized description for this Tool class.  
description Accessor ReadOnly string Get the localized description string from this Tool's class  
englishKeyin Accessor StaticReadOnly string Get the English keyin string for this Tool class.  
flyover Accessor StaticReadOnly string Get the localized flyover for this Tool class.  
flyover Accessor ReadOnly string Get the localized flyover string from this Tool's class  
hidden Static boolean If true, this Tool will not appear in the list from ToolRegistry.getToolList.  
iconSpec Static string The icon for this Tool.  
iconSpec Accessor ReadOnly string Get the iconSpec from this Tool's class.  
keyin Accessor StaticReadOnly string Get the localized keyin string for this Tool class.  
keyin Accessor ReadOnly string Get the localized keyin string from this Tool's class  
maxArgs Accessor StaticReadOnly undefined | number The maximum number of arguments allowed by Tool.parseAndRun, or undefined if there is no maximum.  
minArgs Accessor StaticReadOnly number The minimum number of arguments allowed by Tool.parseAndRun.  
namespace Static string The namespace that provides localized strings for this Tool.  
toolId Accessor ReadOnly string Get the toolId string for this Tool class.  
toolId Static string The unique string that identifies this tool.  

Defined in

Last Updated: 20 May, 2022