Algorithm
An Algorithm instance as returned by e.g. compatibleAlgorithms
Extends
Methods
| Method | Description |
|---|---|
| id() | Unique algorithm ID including module name |
| name() | GUI name of the algorithm including groups |
| status() | Indicates the status of the last call to execute. |
| execute() | Execute the algorithm. |
| state() | Returns the algorithm's state. |
| stateSchema() | Returns the algorithm's stateSchema. |
| setState() | Configure the algorithm's behavior via the passed state object |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
id()
Unique algorithm ID including module name
Returns
string
name()
GUI name of the algorithm including groups
Returns
string
status()
Indicates the status of the last call to execute. Returns a predefined AlgorithmStatusConstant or custom algorithm-specific integer error codes.
Returns
| number
| AlgorithmStatusConstant
execute()
Execute the algorithm.
Call Algorithm.status afterwards to query if the algorithm execution was successful.
Returns
the array of data this algorithm computed
state()
Returns the algorithm's state. This is useful to figure out what properties are supported by an algorithm. Change the state object and call Algorithm.setState to change/configure the algorithm's behavior.
Returns
Record<string, unknown>
stateSchema()
Returns the algorithm's stateSchema. This is useful to figure out what properties are supported by an algorithm. Additionally provides metadata about the properties, which can be used e.g. to create a GUI controller for this algorithm.
Returns
Record<string, unknown>
setState()
Configure the algorithm's behavior via the passed state object
Parameters
| Parameter | Type |
|---|---|
state | Record<string, unknown> |
Returns
void