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 represented by this FilterSolverInterface.
These geometric instance ids are the resulting set from the list of FilterItemInterface(s)
with their operators intersected with the geometric instance ids represented by the VisibilityContextInterface set by
setVisibilityContext.
if pRunUpdate is true (by default), a update is automatically called.
A promise. The promise is resolved with the reason (success, cancelled, reset, 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 FilterSolverInterface.
Optional pRunUpdate: booleanGets 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 a FilterItemInterface previously included by insertFilter given its identifier.
Each FilterItemInterface, upon creation, is given a unique identifier.
The FilterItemInterface with the given id, or undefined if not found.
Gets a FilterItemInterface previously included by insertFilter given its order in the container list.
The FilterItemInterface at the given order, or undefined if pOrder is out of range [0,getFilterCount()-1].
Gets the number of FilterItemInterface in the FilterSolverInterface.
The FilterItemInterfaces count.
Gets the identifier of the FilterSolverInterface.
The identifier of the FilterSolverInterface.
Please use getFilterSolverId.
Gets the order of the FilterItemInterface represented by the given identifier.
The order of the FilterItemInterface in the FilterSolverInterface, or -1 if not found.
Gets the list of all the geometric instance ids represented by this FilterSolverInterface.
These geometric instance ids are the resulting set from the list of FilterItemInterface(s)
with their operators intersected with the geometric instance ids represented by the VisibilityContextInterface set by
setVisibilityContext.
The value is returned if the FilterSolverInterface has finished computing.
Use addEventListener on the event SolverReady to
know when the FilterSolverInterface is ready (isRunning() is false).
DO NOT modify this array in place, this results in undefined behavior.
geometric instances ids represented by this FilterSolverInterface, or undefined if the FilterSolverInterface is computing
(([isRunning()](FilterSolverInterface.html#isRunning) is `false`)) or cancelled ([isCancelled()](FilterSolverInterface.html#isCancelled) is true) .Tells the type of the given interface.
The type of the given interface.
Gets the last error returned by the update of the FilterSolverInterface.
The error message is updated :
If the FilterSolverInterface is running, returns an empty string.
A string containing the last error message (if any, or an empty string if no error occurred).
Gets the list of all the part instance ids of the part instances represented by this FilterSolverInterface.
These part instance ids are the resulting set from the list of FilterItemInterface(s)
with their operators intersected with the part instance ids represented by the VisibilityContextInterface set by
setVisibilityContext.
The value is returned if the FilterSolverInterface has finished computing and if
setRetrievePartInstanceIds(true) has been called.
Use addEventListener on the event SolverReady to know when the FilterSolverInterface is ready.
part instances ids represented by this FilterSolverInterface,
or undefined if it is computing ([isRunning()](FilterSolverInterface.html#isRunning) is false) or cancelled ([isCancelled()](FilterSolverInterface.html#isCancelled) is true)
or if it should not retrieve part instance ids ([setRetrievePartInstanceIds(false)](FilterSolverInterface.html#setRetrievePartInstanceIds)).Gets the number of triangles of all the geometric instances represented by this FilterSolverInterface.
This should be called after the FilterSolverInterface has finished its computation.
Use addEventListener on the event SolverReady to know when the
FilterSolverInterface is ready.
getTrianglesCount should return -1 if the FilterSolverInterface is running or has never been computed.
The number of triangles of the geometric instances of this FilterSolverInterface.
Gets the filtering context to be intersected with.
A valid VisibilityContextInterface is required for the FilterSolverInterface to be considered valid. The VisibilityContextInterface MUST contain a valid ConfContextInterface (be it unconfigured).
The current VisibilityContextInterface to be intersected with (may be undefined).
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.
Inserts a FilterItemInterface at the given position.
Any invalid position will result in the FilterItemInterface being pushed at the end of the list of FilterItemInterfaces. Use addEventListener on the event SolverFilterAdded to know when a FilterItemInterface is added to the FilterSolverInterface.
Returns true if the FilterItemInterface is added, false if the FilterItemInterface has been cleaned up, pOrder is not a number, or if the FilterItemInterface is already inside a container.
true if the FilterItemInterface is added.
0 and [getFilterCount()](FilterSolverInterface.html#getFilterCount) included).Tells if the FilterSolverInterface has been cancelled.
This is the case after calling cancelUpdate when the FilterSolverInterface is updating (ie isRunning() is true). The SolverReady signal will be sent shortly after cancelUpdate has been called.
true if the FilterSolverInterface is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if the FilterSolverInterface should retrieve the part instance ids.
The isRetrievePartInstanceIds() is false by default.
true if the FilterSolverInterface should also retrieve part instance ids.
Changes the order of the given FilterItemInterface in the container list by its filter id.
Orders number must be in the range of existing orders i.e. [0,getFilterCount()-1].
true if the FilterItemInterface was found and changed.
Removes all the FilterItemInterface contained in this FilterSolverInterface.
Use addEventListener on the event SolverChanged to know when a FilterItemInterface is changed.
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.
Removes a FilterItemInterface previously included by insertFilter given its identifier from the container list.
Use addEventListener on the event SolverFilterRemoved to know when a FilterItemInterface is removed.
true if the FilterItemInterface was found and removed.
Sets the identifier of the FilterSolverInterface. Make sure the id is unique. A unique FilterSolverInterface identifier is created if the identifier is not overridden.
Tells the FilterSolverInterface to compute the result as a list of part instance ids.
You may choose not to get the part instance ids to save memory and network bandwidth.
isRetrievePartInstanceIds() is false by default.
part instance ids will also be retrieved
and available when [SolverReady](../enums/FilterSolverInterfaceSignal.html#SolverReady) is triggered.Sets/Clears the filtering context (VisibilityContextInterface) to be intersected with.
A valid VisibilityContextInterface is required for the FilterSolverInterface to be considered valid. The VisibilityContextInterface MUST contain a valid ConfContextInterface (be it unconfigured).
If the pFilteringContext is the same as getVisibilityContext, nothing is changed.
Use addEventListener on the event SolverVisibilityContextChanged to know when a VisibilityContextInterface is changed.
true if the filtering context has been set (i.e. the FilterSolverInterface has not been destroyed by
dispose, or the dispose has been called on pFilteringContext).
The FilterSolverInterface interface is used to create sets of
part instances.The FilterItemInterface serves to elect a list of
part instancesbased on a criterion (or a list of criteria), for example (others can be found in Filters examples):part instanceswhose size is lower than 3 cmspart instancesthat overlaps a given 3D cubepart instancesthat have a metadata "type" equal to "electrical" (electricalpart instances)part instancesthat have a metadata "mounted" to true (mountedpart instances).A FilterSolverInterface is the expression of a combination of multiple FilterItemInterfaces with a specific operator (union/intersection/exclusion), a FilterOperator.
The order of FilterItemInterface in the FilterSolverInterface is relevant and changing the order of the FilterItemInterfaces may (or not) change the final result.
The FilterSolverInterface MUST be intersected with a filtering context : VisibilityContextInterface (see Filtering Context). Such a filtering context will intersect the FilterSolverInterface with a specific configuration and optionally a union of other FilterSolverInterfaces (setVisibilityContext).
The FilterSolverInterface result is gotten asynchronously when triggered by a update call. The FilterSolverInterface sends the event SolverReady when it the result is ready to be fetched. The result of a FilterSolverInterface is represented as a set of
{geometric instance ids}and optionally{part instance ids}.When a FilterItemInterface is modified, there is no automatic update of the content of a FilterSolverInterface : indeed, you may want to modify a lot of FilterItemInterface, ConfContextInterfaces, VisibilityContextInterfaces before getting the expected result. Moreover, VisibilityContextInterfaces may depend on FilterSolverInterfaces that could lead to massive dependency graphs. For this reason, VisibilityContextInterfaces, FilterSolverInterfaces and FilterItemInterfaces are not updated through a dedicated function on each interface but with the update function.
The dependency graph of ConfContextInterfaces, VisibilityContextInterfaces and FilterItemInterfaces is handled by the DataSessionInterface, this also prevent too many requests to be sent to the server for nothing.
To sum up : modify your FilterItemInterfaces, ConfContextInterfaces, VisibilityContextInterfaces and FilterSolverInterfaces without taking into account any dependency that may have between them, and when you want the server to compute the result, remember to call update.
The FilterSolverInterface interface is created through the createFilterSolver and is bound to this given DataSessionInterface.
or asynchronously :
Please make sure the destination browser supports promises before using async calls.
See