Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Asynchronously triggers a request to "translate" the given geometric instance ids to the corresponding part instance ids.
The server will try to find all part instances that are linked to the given geometric instance ids in the given WorkingSetInterface.
If pComputeGeometricInstanceIdMapping is set to true, then getGeometricInstanceIdsMapping will return an Uint32Array of
the same size as getPartInstanceIds and
getGeometricInstanceIdsMapping()[offset] will return the geometric instance id of getPartInstanceIds()[offset].
pComputeGeometricInstanceIdMapping defaults to false.
Returns a promise.
Please note that in case of multiple promises running at the same time on the same GeometricInstanceConverterInterface, the first promises will be signalled as cancelled, the last as ok, but all calls to getPartInstanceIds after awaiting will return the same value.
If pWorkingSetContext is modified during the execution, then the call is cancelled (see cancel).
geometric instance ids to perform the conversion with.Optional pComputeGeometricInstanceIdMapping: booleanA promise. The promise is resolved with the reason (success, cancelled, disposed, bad input). In case of success, the promise contains the requested Uint32Array.
Cancels the computation of the conversion process (if any).
A GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterCancelled signal is emitted if the GeometricInstanceConverterInterface is retrieving data.
true if the GeometricInstanceConverterInterface was running, else false.
Triggers a request to "translate" the given geometric instance ids to their corresponding part instance ids.
The server will try to find all part instances that are linked to the given geometric instance ids in the given WorkingSetInterface.
An event GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady is fired when the translation is finished,
use getLastError() to check if it was correctly performed.
If pComputeGeometricInstanceIdMapping is set to true, then getGeometricInstanceIdsMapping will return an Uint32Array of
the same size as getPartInstanceIds and
getGeometricInstanceIdsMapping()[offset] will return the geometric instance id of getPartInstanceIds()[offset].
pComputeGeometricInstanceIdMapping defaults to false.
Returns true if the "conversion" is started. If not, just call getLastError to get the reason why the procedure failed.
If pWorkingSetContext is modified during the execution, then the call is cancelled (see cancel).
geometric instance ids to perform the conversion with.Optional pComputeGeometricInstanceIdMapping: booleantrue if the conversion process has started, just wait for GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady.
Gets rid of this object.
After this call, this object can no longer be used.
If the object is an InfiniteObjectDispatcherInterface, then the InfiniteObjectDispatcherInterfaceSignal.ObjectDisposed signal is emitted.
Further uses of the object (with the exception of isDisposed, getInfiniteObjectType and application id retrieval) will log a message with LogLevel.LL_UsingDisposedObject.
Gets the mapping result of the last convert call of the geometric instance ids conversion, with
pComputeGeometricInstanceIdMapping set to true.
getGeometricInstanceIdsMapping will be of the same size as getPartInstanceIds, and getGeometricInstanceIdsMapping(offset) corresponds
to the geometric instance id of the part instance leaf getPartInstanceIds(offset).
An Uint32Array representing the geometric instance ids is returned if the GeometricInstanceConverterInterface
has finished computing.
Use addEventListener on the event GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady to
know when the GeometricInstanceConverterInterface is ready.
DO NOT modify this data in place, this results in undefined behavior.
geometric instance ids correspondence
result of the conversion, or undefined if the converter had an error, is still computing,
or called with pComputeGeometricInstanceIdMapping set to false.Tells the type of the given interface.
The type of the given interface.
Gets the last error returned by the convert call of the GeometricInstanceConverterInterface.
The last error (if any, or undefined if no error occurred).
The id of the last call to convert.
Gets the result of the last convert call of the geometric instance ids conversion.
An Uint32Array representing the part instance ids is returned if the GeometricInstanceConverterInterface
has finished computing.
Use addEventListener on the event GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady to
know when the GeometricInstanceConverterInterface is ready.
DO NOT modify this data in place, this results in undefined behavior.
part instance ids,
result of the conversion, or undefined if the converter had an error, or is still computing.Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Tells if the GeometricInstanceConverterInterface has been cancelled.
This is generally the case after calling cancel when the GeometricInstanceConverterInterface is retrieving data.
true if the GeometricInstanceConverterInterface is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if the GeometricInstanceConverterInterface is converting data.
This is the case after calling convert.
true if the GeometricInstanceConverterInterface is converting.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
true if the callback was removed else false.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
The GeometricInstanceConverterInterface interface is used to get, from a list of
geometric instance ids, the correspondingpart instance ids.Such a conversion is dependant on a WorkingSetInterface. Indeed, the list of current
part instancesis dependant on the chosen configuration (at least) and may be dependant on the list of visiblepart instancesfor example. For this reason, convertinggeometric instance ids(from a picking request for example) needs a WorkingSetInterface (see WorkingSetInterface).This conversion is particularly useful to make id-card requests, since metadata documents are retrieved from
part instancesand notgeometric instances.The GeometricInstanceConverterInterface interfaces are created through the DataSessionInterface.createGeometricInstanceConverter method.
The list of signals the GeometricInstanceConverterInterface may trigger is available in the GeometricInstanceConverterInterfaceSignal enumeration.
The conversion mechanism is triggered through the convert method. The result is not available right away, but the event GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady is triggered when the result of the GeometricInstanceConverterInterfaceSignal is available. The result is available through the getPartInstanceIds function.
Warning : there may be cases when the getPartInstanceIds is not available such as when the GeometricInstanceConverterInterface is fetching data, i.e. when isRunning returns true, or when the GeometricInstanceConverterInterface has been cancelled, i.e. when isCancelled returns true.
A GeometricInstanceConverterInterface may be interrupted (cancelled) when the GeometricInstanceConverterInterface is fetching data and cancel is called. In such cases, the GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterCancelled signal is fired, and shortly after, GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady signal is fired, but getPartInstanceIds will return undefined. Just call convert with another (or the same)
geometric instance idsto trigger a new retrieval.If you call multiple times convert before receiving the GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady, only one GeometricInstanceConverterInterfaceSignal.GeometricInstanceConverterReady will be sent with the content of the last call to convert.
This interface performs the opposite operation of the PartInstanceConverterInterface interface.
Or with async calls :
An example with an id-card request :
Please refer to IdCardGetterInterface for more information about id-card requests.
See
GeometricInstanceConverterInterfaceSignal