ImFusion Web SDK

Algorithm

An Algorithm instance as returned by e.g. compatibleAlgorithms

Extends

Methods

MethodDescription
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

MethodDescription
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()

ts
id(): string;

Unique algorithm ID including module name

Returns

string


name()

ts
name(): string;

GUI name of the algorithm including groups

Returns

string


status()

ts
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()

ts
execute(): HandleArray<Data>;

Execute the algorithm.

Call Algorithm.status afterwards to query if the algorithm execution was successful.

Returns

HandleArray<Data>

the array of data this algorithm computed


state()

ts
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()

ts
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()

ts
setState(state: Record<string, unknown>): void;

Configure the algorithm's behavior via the passed state object

Parameters

ParameterType
stateRecord<string, unknown>

Returns

void

On this page