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.
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).
Gets the list of all the geometric Instance ids of the part instances represented by the union of these ConfigurationInterface.
The list of geometric Instance ids is returned once the ConfContextInterface has finished computing.
If it's been cancelled, or disposed, the returned promise contains this information.
If pRunUpdate is true (by default), a update is automatically called.
DO NOT modify this array in place, this results in undefined behavior.
A promise. The promise is resolved with the reason (success, cancelled, disposed, bad input), or rejected in case of an
unexpected error. In case of success, the promise is resolved with the list of geometric instances ids represented by this ConfContextInterface.
Optional pRunUpdate: booleanIf set to true, a update is called (defaults to true).
Gets rid of this object.
After this call, this object can no longer be used.
If the object is an InfiniteObjectDispatcherInterface, then the ObjectDisposed signal is emitted.
Further uses of the object (with the exception of isDisposed and getInfiniteObjectType) will log a message with LL_UsingDisposedObject.
Gets the list of active ConfigurationInterface ids, as set previously by setActiveConfs.
Modifying this array in place results in undefined behavior.
DO NOT modify this array.
Gets the list of all the geometric Instance ids of the part instances represented by the union of these ConfigurationInterface.
The list of geometric Instance ids is returned if the ConfContextInterface has finished computing.
Use addEventListener on the event ConfContextReady to
know when the ConfContextInterface is ready.
DO NOT modify this array in place, this results in undefined behavior.
geometric instances ids represented by this ConfContextInterface, or
undefined if the ConfContextInterface is computing or if the ConfContextInterface is in error or cancelled.
Tells the type of the given interface.
The type of the given interface.
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 ConfContextInterface has been cancelled.
This is generally the case after calling cancelUpdate when the ConfContextInterface is updating (ie .isRunning() is true).
true If the ConfContextInterface is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if the ConfContextInterface is updating (running).
This is generally the case after calling setActiveConfs, or right after the ConfContextInterface creation with createConfContext.
true if the ConfContextInterface is updating.
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.
true if the callback was removed else false.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
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.
true if the callback was removed else false.
The listener function that gets removed.
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.
Sets the ids of the active configurations that are included in this ConfContextInterface.
An event ConfContextChanged signal is sent.
The consecutive call to update will trigger the
calculation of the part instances inside this union of getConfigurationId.
If pActiveConfigurationIds is an empty array (the default case), the given ConfContextInterface is "unconfigured", i.e. it contains
all the part instances of the DMU.
Only unique and valid configuration ids from pActiveConfigurationIds will be activated. If pActiveConfigurationIds contains duplicates or invalid configuration ids they will be skipped which might results as activating an empty array (the default case).
true if the ConfContextInterface is changed and update must be called.
Sets the identifier of the ConfContextInterface. Make sure the id is unique. A unique ConfContextInterface identifier is created if the identifier is not overridden.
The ConfContextInterface interface is used to get the available
part instancesinside the "Configurations" of a DMU. It may be used to filter out a group ofpart instancesdepending on their presence in these "Configurations", or to display or hide them.The ConfContextInterface interfaces are created through the createConfContext method, and there may be any number of different configurations inside the ConfContextInterface.
The list of available configurations is accessible through the getConfigurationList method.
The user may include any number of [ConfigurationInterface](ConfigurationInterface.html) inside the ConfContextInterface (by their id), the resulting set will be the union of all the requested [ConfigurationInterface](ConfigurationInterface.html) : any `part instance` included in at least one [ConfigurationInterface](ConfigurationInterface.html) will be available through the resulting ConfContextInterface.
The ConfContextInterface has two major uses :
part instancenot inside the chosen ConfigurationInterface will be filtered out.For example, the following code hides all the
part instancesexcept the ones in the ConfContextInterface :The list of signals the ConfContextInterface may trigger is available in the [ConfContextInterfaceSignal](../enums/ConfContextInterfaceSignal.html) enumeration.
The active configurations are set through the setActiveConfs method. Each time the setActiveConfs method is called, the ConfContextChanged signal is sent. The setActiveConfs does not trigger a computation on the infinite servers, the user has to call the update method to trigger a computation (after the ConfContextInterface has been changed). The result is not available right away, but the event ConfContextReady is triggered when the result of the ConfContextInterface is available.
Warning : Creating a ConfContextInterface by createConfContext will fire a ConfContextReady with all the
part instancesof the DMU, this is equivalent to calling :Or with async calls :
Warning : there may be cases when the [getGeometricInstanceIds](ConfContextInterface.html#getGeometricInstanceIds) is not available such as when the ConfContextInterface is updating, i.e. when [isRunning](ConfContextInterface.html#isRunning) returns true, or when the ConfContextInterface has been cancelled, i.e. when [isCancelled](ConfContextInterface.html#isCancelled) returns true.
A ConfContextInterface may be interrupted (cancelled) when the ConfContextInterface is running and cancelUpdate is called. In such cases, the ConfContextCancelled signal is fired, and shortly after, ConfContextReady signal is fired, but getGeometricInstanceIds will return undefined. Just call update and the computation of the ConfContextInterface will resume.
If you call multiple times setActiveConfs before receiving the ConfContextReady, only one ConfContextReady will be sent with the content of the last call to setActiveConfs.
See