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()
id(): string;Unique algorithm ID including module name
Returns
string
name()
name(): string;GUI name of the algorithm including groups
Returns
string
status()
status():
| number
| AlgorithmStatusConstant;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(): HandleArray<Data>;Execute the algorithm.
Call Algorithm.status afterwards to query if the algorithm execution was successful.
Returns
the array of data this algorithm computed
state()
state(): Record<string, unknown>;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()
stateSchema(): Record<string, unknown>;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()
setState(state: Record<string, unknown>): void;Configure the algorithm's behavior via the passed state object
Parameters
| Parameter | Type |
|---|---|
state | Record<string, unknown> |
Returns
void