Interface WorkingSetInterface

The WorkingSetInterface interface is used to create sets of part instances and their 'geometric part instance ids' counterparts.

It is the expression of the Working Set.

The WorkingSetInterface is the intersection of three sets of data :

  • An algebra of filters.
  • A list of configurations.
  • An algebra of WorkingSetInterface dependencies.

Filters.

The FilterItemInterface serves to elect a list of part instances based on a criterion (or a list of criteria), for example (others can be found in Filters examples):

  • Find all part instances whose size is lower than 3 cms
  • Find all part instances that overlaps a given 3D cube
  • Find all part instances that have a metadata "type" equal to "electrical" (electrical part instances)
  • Find all part instances that have a metadata "mounted" to true (mounted part instances).

A WorkingSetInterface is the expression of a combination of multiple FilterItemInterfaces with a specific operator (union/intersection/exclusion), a GroupOperator.
The order of FilterItemInterface in the WorkingSetInterface is relevant and changing the order of the FilterItemInterfaces may (or not) change the final result.

WorkingSetInterface dependencies.

The WorkingSetInterface may be intersected with a list of WorkingSetInterface dependencies. Such a dependency graph will intersect the WorkingSetInterface with a specific operator of other WorkingSetInterfaces ((union/intersection/exclusion), a GroupOperator. Dependencies are added by insertWorkingSetDependency. Contrary to the FilterItemInterface list, the same WorkingSetInterface can be set as a dependency of multiple WorkingSetInterface (the FilterItemInterface can only have one 'parent'). Pay attention not to create an infinite loop, the api will detect loops and set errors.

Configurations.

The list of available configurations is accessible through the DataSessionInterface.getConfigurationList method.

The user may include any number of ConfigurationInterface inside the WorkingSetInterface (by their id), the resulting set will be the union of all the requested ConfigurationInterface : any part instance included in at least one ConfigurationInterface will be available through the resulting WorkingSetInterface.

The active configurations are set through the setActiveConfs method. Each time the setActiveConfs method is called, the WorkingSetInterfaceSignal.WorkingSetConfChanged signal is sent.

/** 
* Sample to illustrate the change of configuration in the WorkingSetInterface.
*/
import { WorkingSetInterface, DataSessionInterface, ConfigurationInterface, WorkingSetDataRetrieval, WorkingSetBehavior } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// create a WorkingSetInterface
// we want to get geometric instances result
// if nothing is set, this working set should include all parts ('unconfigured')
const lConfContext : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit
);
// retrieve the list of available configurations
const lActiveConfigurations : Array<ConfigurationInterface> = lDataSession.getConfigurationList();
// we will take the first ConfigurationInterface for this context
const lActualConfigurations : Array<string> = new Array<string>(1);
lActualConfigurations[0] = lActiveConfigurations[0].getConfigurationId();
console.log('Using the configuration ' + lActiveConfigurations[0].getName() + ' : ' + lActiveConfigurations[0].getDescription());
// set the active configurations
lConfContext.setActiveConfs(lActualConfigurations);
// and ask to compute all changes requested since the last call to the DataSessionInterface
lDataSession.update();

Or with async calls :
/** 
* Sample to illustrate the asynchronous change of configuration in the WorkingSetInterface.
*/
import {
WorkingSetInterface, DataSessionInterface, ConfigurationInterface,
AsyncResultReason, AsyncUInt32ArrayResult, WorkingSetDataRetrieval, WorkingSetBehavior
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// create a WorkingSetInterface
// we want to get geometric instances result
// if nothing is set, this working set should include all parts ('unconfigured')
const lConfContext : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit
);
// retrieve the list of available configurations
const lActiveConfigurations : Array<ConfigurationInterface> = lDataSession.getConfigurationList();
// we will take the first ConfigurationInterface for this context
const lActualConfigurations : Array<string> = new Array<string>(1);
lActualConfigurations[0] = lActiveConfigurations[0].getConfigurationId();
console.log('Using the configuration ' + lActiveConfigurations[0].getName() + ' : ' + lActiveConfigurations[0].getDescription());

const getResult = async (): Promise<AsyncUInt32ArrayResult> => {
// set the active configurations
lConfContext.setActiveConfs(lActualConfigurations);
const lContent : AsyncUInt32ArrayResult = await lConfContext.asyncGetGeometricInstanceIds();
console.assert(lContent.reason === AsyncResultReason.ARR_Success);
console.assert(lContent.value !== undefined);
return lContent;
};

getResult();

The setActiveConfs does not trigger a computation on the Infinite servers (see below).

WorkingSetInterface results.

The WorkingSetInterface result is gotten asynchronously when triggered by a DataSessionInterface.update call. The WorkingSetInterface sends the event WorkingSetInterfaceSignal.WorkingSetReady when the result is ready to be fetched.

Warning : there may be cases when the getGeometricInstanceIds is not available such as when the WorkingSetInterface is updating, i.e. when isRunning returns true, or when the WorkingSetInterface has been cancelled, i.e. when isCancelled returns true.

A WorkingSetInterface may be interrupted (cancelled) when the WorkingSetInterface is running and DataSessionInterface.cancelUpdate is called. In such cases, the WorkingSetInterfaceSignal.WorkingSetCancelled signal is fired, and shortly after, WorkingSetInterfaceSignal.WorkingSetReady signal is fired, but getGeometricInstanceIds will return undefined. Just call DataSessionInterface.update and the computation of the WorkingSetInterface will resume.

The result of a WorkingSetInterface may be represented as :

  • a set of {geometric instance ids}
  • a set of {part instance ids}.
  • nothing.
/** 
* Sample to illustrate the retrieval of the `geometric instance ids` in the WorkingSetInterface, applying
* a "visibility" to the InfiniteEngineInterface.
*/
import {
WorkingSetInterface, InfiniteEngineInterface, VisualStates,
tListenerCallback, InfiniteEvent, WorkingSetInterfaceSignal,
} from 'generated_files/documentation/appinfiniteapi';

// the WorkingSetInterface should have been created previously
let lConfContext : WorkingSetInterface;
// the InfiniteEngineInterface should have been created previously
let lInfiniteEngine : InfiniteEngineInterface;
// the callback called when the WorkingSetInterface is ready
let lConfContextReady : tListenerCallback;

// getting notified when the WorkingSetInterface is ready
lConfContext.addEventListener(WorkingSetInterfaceSignal.WorkingSetReady, lConfContextReady);

lConfContextReady = (_pEvent: InfiniteEvent, _pCallbackData: Object | undefined) : void =>
{
// get the geometries of this WorkingSetInterface
const lGeometries: Uint32Array | undefined = lConfContext.getGeometricInstanceIds();
// make sure we are not updating the content (isRunning() is true)
if (lGeometries)
{
// hide all geometries and set them as invisible and not ghosted
lInfiniteEngine.updateGeometricStateForAll(VisualStates.S_Hidden | VisualStates.S_Ghost, (VisualStates.S_Hidden | ~VisualStates.S_Ghost));
// set all the geometries of the WorkingSetInterface as visible.
lInfiniteEngine.updateGeometricState(lGeometries, VisualStates.S_Hidden, ~VisualStates.S_Hidden);
}
};

The setRetrieveDataMode and getRetrieveDataMode (WorkingSetDataRetrieval enumeration) allows to set the way data is retrieved. If you never get the result of a specific WorkingSetInterface, then it is recommended to set WorkingSetDataRetrieval.R_Nothing.

WorkingSetInterface behavior.

As the WorkingSetInterface is the intersection of configurations, filters and other WorkingSetInterface, this implies that when any of filters, configurations, or dependencies are empty, then the geometric instance ids of such a WorkingSetInterface are empty.

In order to ease the use of WorkingSetInterface, the behavior of the WorkingSetInterface may be customized when any of these properties are empty with getWorkingSetBehavior, setWorkingSetBehavior that uses the enumeration WorkingSetBehavior.

The default behavior is WorkingSetBehavior.B_DefaultBehavior meaning that if any the filter, configuration, or dependencies is empty, then the WorkingSetInterface is empty. On the contrary, with the WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit behavior, then if no filters, no dependencies and no configurations are set, then the WorkingSetInterface is represented by ALL the geometric instance ids. Please refer to WorkingSetBehavior for more information about the way data is computed inside a WorkingSetInterface.

When a FilterItemInterface is modified, there is no automatic update of the content of a WorkingSetInterface : indeed, you may want to modify a lot of FilterItemInterface, WorkingSets before getting the expected result. Moreover, any WorkingSet may depend on WorkingSetInterfaces that could lead to massive dependency graphs. For this reason, WorkingSetInterfaces and FilterItemInterfaces are not updated through a dedicated function on each interface but with the DataSessionInterface.update function.
The dependency graph of WorkingSets 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, and WorkingSetInterfaces without taking into account any dependency that may have between them, and when you want the server to compute the result, remember to call DataSessionInterface.update.

Using WorkingSetInterfaces.

The WorkingSetInterface interface is created through the DataSessionInterface.createWorkingSet and is bound to this given DataSessionInterface.

The list of signals the WorkingSetInterface may trigger is available in the WorkingSetInterfaceSignal enumeration.

Discard (with dispose) existing WorkingSetInterface before loading a new DataSessionInterface.

Recommended usage: It is highly advised to create specialized WorkingSetInterface to lower the bandwidth usage and correctly understand the way data is handled. It is advised to have at least one WorkingSetInterface that takes in charge the configurations (and ONLY configurations), using the behavior WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit. Such a WorkingSetInterface will then act as a kind of 'Configuration context'. When you want to change the configurations of your visible items, you just change one WorkingSetInterface. This behavior will also help with configured metadata. Indeed, the metadata of the DMU may be configured, meaning that the content of a specific attribute may depend on a 'chosen' configuration. When an id-card request is made, or a filter on a 'configured' attribute is computed, the given algorithm is used to get the 'current' configuration:

  • The 'starting' WorkingSetInterface is the one that contains the given filter or is the target of the id-card request
  • If the 'starting' WorkingSetInterface has some configurations set, then this list of configurations is used to compute the filter/id card request.
  • If not, then all WorkingSetInterface dependencies that have not the operator GroupOperator.GO_EXCLUSION are crawled (with the exception of the first enabled dependency that is always crawled), incrementing the given WorkingSetInterface dependency depth by one. And this crawling is done recursively, leading to a list of WorkingSetInterface with a given depth (relative to the 'starting' WorkingSetInterface).
  • This list is filtered with only WorkingSetInterfaces that have configurations.
  • The WorkingSetInterface with the lowest depth is chosen, and in case of equality, the WorkingSetInterface that is included first in the dependency list is chosen.
  • The list of configurations of this WorkingSetInterface is used to compute the id-card request, or filter.
/** 
* Sample to illustrate the use of multiple WorkingSetInterfaces to define a set of visible pieces, and
* colorize a subset.
* The visibility is composed of all the part instances included in a Box, that have the "CompletionStatus" attribute
* set to "done".
* The colorization set is based on the visibility, the part instances that have the attribute "ToBeRedesigned"
* true should be colored in yellow.
* This colors all part instance in yellow in the given box, that ave the attribute "ToBeRedesigned"
* true and "CompletionStatus" attribute set to "done".
* This sample uses multiple WorkingSetInterface.
* It uses some FilterAABBInterface, FilterAttributeInterface, FilterBooleanInterface.
*/
import {
AttributesDictionaryInterface, AttributeInfoInterface, AttributeType, DataSessionInterface,
InfiniteEngineInterface, Vector3, AABB, FilterAABBInterface, FilterAttributeInterface,
GroupOperator, VisualStates, FilterBooleanInterface, WorkingSetInterface, WorkingSetInterfaceSignal,
WorkingSetDataRetrieval,
WorkingSetBehavior
} from 'generated_files/documentation/appinfiniteapi';

// lEngineInterface has been created previously
let lEngineInterface : InfiniteEngineInterface;
// the DataSessionInterface has been created previously, is connected and is bound to the Infinite engine
let lDataSession : DataSessionInterface;

// MAKE SURE the attributes "CompletionStatus", "ToBeRedesigned" are relevant
const lAttributeDictionary : AttributesDictionaryInterface = lDataSession.getAttributesDictionary();
let lAttributeInfo : AttributeInfoInterface | undefined = lAttributeDictionary.getAttributeInfo('CompletionStatus');
// make sure the attribute is a string one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_STRING));

lAttributeInfo = lAttributeDictionary.getAttributeInfo('ToBeRedesigned');
// make sure the attribute is a date one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_BOOLEAN));

// create a custom material yellow
const lMaterialId : number = lEngineInterface.getMaterialManager().createNewMaterial(new Vector3(1, 1, 0));
// create a a working set that contain the configurations
// we want to get geometric instances result
// if nothing is set, this working set should include all parts ('unconfigured')
const lConfContext : WorkingSetInterface = lDataSession.createWorkingSet(
// we may retrieve the geometric instances
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
// This working set should discard empty sets if no
// configurations, no filters, and no dependencies
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit
);

// no configuration for the moment (all `part instances`)
// lConfContext holds all geometric instance ids
lConfContext.setActiveConfs([]);

// the AABB to use
const lABB : AABB = new AABB();
lABB.mCenter.x = 3;
lABB.mCenter.y = 3;
lABB.mCenter.z = 3;

lABB.mHalfExtent.x = 10;
lABB.mHalfExtent.y = 10;
lABB.mHalfExtent.z = 10;

// create the visibility Working set
// we want to get geometric instances result
const lVisibilityFilterSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);

// create the inner Working set
const lInnerWorkingSet : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_Nothing,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit
);
lInnerWorkingSet.insertWorkingSetDependency(0, lConfContext, GroupOperator.GO_INTERSECTION);
lVisibilityFilterSolver.insertWorkingSetDependency(0, lInnerWorkingSet, GroupOperator.GO_UNION);

// create a box filter
const lFilterAABB : FilterAABBInterface = lDataSession.createFilterAABB();
// useless, GroupOperator.GO_UNION is the default operator when creating a new filter
// lFilterAABB.setFilterOperator(GroupOperator.GO_UNION);
lFilterAABB.setAABB(lABB);

// create a FilterAttributeInterface
const lFilterAttributes : FilterAttributeInterface = lDataSession.createFilterAttribute();
// completion status to done
lFilterAttributes.setAttributeName('CompletionStatus');
lFilterAttributes.setExactValues(['done']);
// no n/a
lFilterAttributes.setNaValueChecked(false);

// intersection is the way to go since intersection of box and instances that have the field "CompletionStatus"
// to "done"
// only change the operator of the filters except the first
lFilterAttributes.setFilterOperator(GroupOperator.GO_INTERSECTION);

// and add the filters
// push back (-1) the AABB filter
lVisibilityFilterSolver.insertFilter(-1, lFilterAABB);
// push back (-1) the FilterAttributeInterface, as it is the second one, its operator is used and therefore
// intersection is used
lVisibilityFilterSolver.insertFilter(-1, lFilterAttributes);

lVisibilityFilterSolver.addEventListener(WorkingSetInterfaceSignal.WorkingSetReady, () =>
{
const lGeometries : Uint32Array | undefined = lVisibilityFilterSolver.getGeometricInstanceIds();
if (lGeometries)
{
// set hidden and not ghosted for everyone
lEngineInterface.updateGeometricStateForAll(VisualStates.S_Ghost | VisualStates.S_Hidden, (~VisualStates.S_Ghost) | VisualStates.S_Hidden);
// and set not hidden for the given geometries
lEngineInterface.updateGeometricState(lGeometries, VisualStates.S_Hidden, ~VisualStates.S_Hidden);
}
});

// create the colorize Working Set
// we want to get geometric instances result
const lColorizeFilterSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);
// create an attribute filter
const lColorizeFilterAttributes : FilterBooleanInterface = lDataSession.createFilterBoolean();
// search ToBeRedesigned attribute
lColorizeFilterAttributes.setAttributeName('ToBeRedesigned');
// value should be true
lColorizeFilterAttributes.setBooleanValue(true);

// when the WorkingSetInterface is ready, colorize the given `geometric instances`
lColorizeFilterSolver.addEventListener(WorkingSetInterfaceSignal.WorkingSetReady, () =>
{
const lGeomIds : Uint32Array | undefined = lColorizeFilterSolver.getGeometricInstanceIds();
if (lGeomIds)
{
// change material for these elements
lEngineInterface.getMaterialManager().changeMaterialOfInstances(lGeomIds, lMaterialId);
}
});

// set the Working set of the given `part instances` list
lColorizeFilterSolver.insertWorkingSetDependency(0, lVisibilityFilterSolver, GroupOperator.GO_UNION);
// add the colorize filter
lColorizeFilterSolver.insertFilter(-1, lColorizeFilterAttributes);
// and tell the DataSessionInterface to update the modified WorkingSetInterfaces
lDataSession.update();
// theWorking set may then be used to restrict a search, or a metadata retrieval to the given Working set.

or asynchronously :
/** 
* Sample to illustrate the asynchronous use of multiple WorkingSetInterfaces to define a set of visible pieces, and
* colorize a subset.
* The visibility is composed of all the part instances included in a Box, that have the "CompletionStatus" attribute
* set to "done".
* The colorization set is based on the visibility, the part instances that have the attribute "ToBeRedesigned"
* true should be colored in yellow.
* This colors all part instance in yellow in the given box, that ave the attribute "ToBeRedesigned"
* true and "CompletionStatus" attribute set to "done".
* This sample uses multiple WorkingSetInterface.
* It uses some FilterAABBInterface, FilterAttributeInterface, FilterBooleanInterface.
*/
import {
AttributesDictionaryInterface, AttributeInfoInterface, AttributeType, DataSessionInterface,
InfiniteEngineInterface, WorkingSetInterface, Vector3, AABB,
FilterAABBInterface, FilterAttributeInterface, GroupOperator, VisualStates, FilterBooleanInterface,
AsyncUInt32ArrayResult, WorkingSetDataRetrieval, WorkingSetBehavior
} from 'generated_files/documentation/appinfiniteapi';

// lEngineInterface has been created previously
let lEngineInterface : InfiniteEngineInterface;
// the DataSessionInterface has been created previously, is connected and is bound to the Infinite engine
let lDataSession : DataSessionInterface;

// MAKE SURE the attributes "CompletionStatus", "ToBeRedesigned" are relevant
const lAttributeDictionary : AttributesDictionaryInterface = lDataSession.getAttributesDictionary();
let lAttributeInfo : AttributeInfoInterface | undefined = lAttributeDictionary.getAttributeInfo('CompletionStatus');
// make sure the attribute is a string one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_STRING));

lAttributeInfo = lAttributeDictionary.getAttributeInfo('ToBeRedesigned');
// make sure the attribute is a date one
console.assert((lAttributeInfo !== undefined) && (lAttributeInfo.getAttributeType() === AttributeType.ATTR_BOOLEAN));

// create a custom material yellow
const lMaterialId : number = lEngineInterface.getMaterialManager().createNewMaterial(new Vector3(1, 1, 0));
// create a a working set that contain the configurations
// we want to get geometric instances result
// if nothing is set, this working set should include all parts ('unconfigured')
const lConfContext : WorkingSetInterface = lDataSession.createWorkingSet(
// we may retrieve the geometric instances
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
// This working set should discard empty sets if no
// configurations, no filters, and no dependencies
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit
);

// no configuration for the moment (all `part instances`)
// lConfContext holds all geometric instance ids
lConfContext.setActiveConfs([]);

// the AABB to use
const lABB : AABB = new AABB();
lABB.mCenter.x = 3;
lABB.mCenter.y = 3;
lABB.mCenter.z = 3;

lABB.mHalfExtent.x = 10;
lABB.mHalfExtent.y = 10;
lABB.mHalfExtent.z = 10;

// create the visibility Working set
// we want to get geometric instances result
const lVisibilityFilterSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);

// create the inner Working Set
const lInnerWorkingSet : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_Nothing,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit
);
lInnerWorkingSet.insertWorkingSetDependency(0, lConfContext, GroupOperator.GO_INTERSECTION);
lVisibilityFilterSolver.insertWorkingSetDependency(0, lInnerWorkingSet, GroupOperator.GO_UNION);

// create a box filter
const lFilterAABB : FilterAABBInterface = lDataSession.createFilterAABB();
// useless, GroupOperator.GO_UNION is the default operator when creating a new filter
// lFilterAABB.setFilterOperator(GroupOperator.GO_UNION);
lFilterAABB.setAABB(lABB);

// create a FilterAttributeInterface
const lFilterAttributes : FilterAttributeInterface = lDataSession.createFilterAttribute();
// completion status to done
lFilterAttributes.setAttributeName('CompletionStatus');
lFilterAttributes.setExactValues(['done']);
// no n/a
lFilterAttributes.setNaValueChecked(false);

// intersection is the way to go since intersection of box and instances that have the field "CompletionStatus"
// to "done"
// only change the operator of the filters except the first
lFilterAttributes.setFilterOperator(GroupOperator.GO_INTERSECTION);

// and add the filters
// push back (-1) the AABB filter
lVisibilityFilterSolver.insertFilter(-1, lFilterAABB);
// push back (-1) the FilterAttributeInterface, as it is the second one, its operator is used and therefore
// intersection is used
lVisibilityFilterSolver.insertFilter(-1, lFilterAttributes);

// create the colorize Working Set
// we want to get geometric instances result
const lColorizeFilterSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);
// create an attribute filter
const lColorizeFilterAttributes : FilterBooleanInterface = lDataSession.createFilterBoolean();
// search ToBeRedesigned attribute
lColorizeFilterAttributes.setAttributeName('ToBeRedesigned');
// value should be true
lColorizeFilterAttributes.setBooleanValue(true);

// set the Working Set of the given `part instances` list
lColorizeFilterSolver.insertWorkingSetDependency(0, lVisibilityFilterSolver, GroupOperator.GO_UNION);
// add the colorize filter
lColorizeFilterSolver.insertFilter(-1, lColorizeFilterAttributes);

// the Working Set may then be used to restrict a search, or a metadata retrieval to the given Working Set.

const waitForResult = async () : Promise<void> =>
{
// and tell the DataSessionInterface to update the modified WorkingSetInterfaces (true)
const lVisibleResult : AsyncUInt32ArrayResult = await lVisibilityFilterSolver.asyncGetGeometricInstanceIds(true);
// no need to call DataSessionInterface update again (false)
const lColorizeResult : AsyncUInt32ArrayResult = await lColorizeFilterSolver.asyncGetGeometricInstanceIds(false);

if (lVisibleResult.value)
{
// set hidden and not ghosted for everyone
lEngineInterface.updateGeometricStateForAll(VisualStates.S_Ghost | VisualStates.S_Hidden, (~VisualStates.S_Ghost) | VisualStates.S_Hidden);
// and set not hidden for the given geometries
lEngineInterface.updateGeometricState(lVisibleResult.value, VisualStates.S_Hidden, ~VisualStates.S_Hidden);
}
if (lColorizeResult.value)
{
// change material for these elements
lEngineInterface.getMaterialManager().changeMaterialOfInstances(lColorizeResult.value, lMaterialId);
}
};
waitForResult();

Please make sure the destination browser supports promises before using async calls.
Metadata

interface WorkingSetInterface {
    addEventListener(pType, pListener, pObject): string;
    addEventListener(pType, pListener): string;
    areSignalsBlocked(): boolean;
    asyncGetGeometricInstanceIds(pRunUpdate?): Promise<AsyncUInt32ArrayResult>;
    blockSignals(pBlock): void;
    copy(pOther): WorkingSetInterface;
    dispose(): void;
    fromJSON(pWorkingSetData): boolean;
    getActiveConfs(): readonly string[];
    getFilterById(pFilterId): FilterItemInterface;
    getFilterByOrder(pOrder): FilterItemInterface;
    getFilterCount(): number;
    getFilterOrder(pFilterId): number;
    getGeometricInstanceIds(): Uint32Array;
    getInfiniteObjectType(): InfiniteObjectType;
    getLastError(): InfiniteError;
    getPartInstanceIds(): Uint32Array;
    getPartInstanceIdsCount(): number;
    getRetrieveDataMode(): WorkingSetDataRetrieval;
    getTrianglesCount(): number;
    getWorkingSetBehavior(): WorkingSetBehavior;
    getWorkingSetDependencyByOrder(pWorkingSetOffset): WorkingSetInterface;
    getWorkingSetDependencyCount(): number;
    getWorkingSetDependencyOperator(pWorkingSetDependency): GroupOperator;
    getWorkingSetDependencyOperatorByOrder(pWorkingSetOffset): GroupOperator;
    getWorkingSetDependencyOrder(pWorkingSetDependency): number;
    getWorkingSetId(): string;
    getWorkingSetParentCount(): number;
    getWorkingSetParents(pParents): boolean;
    hasEventListener(pType, pListener): boolean;
    hasEventListenerById(pId): boolean;
    insertFilter(pOrder, pFilter): boolean;
    insertWorkingSetDependency(pOffset, pWorkingSet, pOperator): boolean;
    isCancelled(): boolean;
    isDisposed(): boolean;
    isEnabled(): boolean;
    isExcludedFromJSONStreaming(): boolean;
    isModified(): boolean;
    isRunning(): boolean;
    moveFilter(pFilterId, pOrder): boolean;
    moveWorkingSetDependency(pWorkingSet, pOrder): boolean;
    removeAllEventListeners(): boolean;
    removeAllFilters(): void;
    removeAllWorkingSetDependencies(): void;
    removeEventListener(pType, pListener, pObject): boolean;
    removeEventListener(pType, pListener): boolean;
    removeEventListenerById(pId): boolean;
    removeFilter(pFilterId): boolean;
    removeWorkingSetDependency(pWorkingSet): boolean;
    removeWorkingSetDependencyByOrder(pWorkingSetOrder): boolean;
    replaceWorkingSetDependency(pNewContext, pOldCtx, pOperator): boolean;
    setActiveConfs(pActiveConfigurationIds): boolean;
    setEnabled(pEnabled): void;
    setExcludedFromJSONStreaming(pExcluded): void;
    setRetrieveDataMode(pRetrievePartInstanceIds): void;
    setWorkingSetBehavior(pWorkingSetBehavior): void;
    setWorkingSetDependencyOperator(pWorkingSet, pOperator): boolean;
    setWorkingSetDependencyOperatorByOrder(pWorkingSetOffset, pOperator): boolean;
    setWorkingSetId(pWorkingSetId): void;
    toJSON(pKey?): Object;
}

Hierarchy (view full)

Methods

  • 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.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.
    • pObject: Object
      in
      The optional object the callback will be called with when the given event fires.

    Returns string

    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.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Tells if signals sent by the object are blocked or not.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Returns boolean

    true if signals are blocked.

  • Gets the list of all the geometric Instance ids represented by this WorkingSetInterface.

    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 WorkingSet set by


    if pRunUpdate is true (by default), a DataSessionInterface.update is automatically called.

    Parameters

    Returns Promise<AsyncUInt32ArrayResult>

    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 WorkingSetInterface.

  • Blocks / Unblocks all signals sent by the object.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Parameters

    • pBlock: boolean
      in
      If set to true, all further signals will be silently discarded.

    Returns void

  • Copies this onto pOther WorkingSetInterface.

    New filters are created (their ids are set randomly), and dependencies are set (same objects are used).

    Parameters

    Returns WorkingSetInterface

    The copied WorkingSetInterface or undefined if an error occurred.

  • Sets the content of the WorkingSetInterface from a former call to toJSON.

    Warning, this call removes all working set dependencies. If you want a full copy of the WorkingSetInterface, prefer using DataSessionInterface.fromJSON or copy.

    {
    "$defs": {
    "all": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "all",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "id"
    ],
    "title": "Filter all definition",
    "type": "object"
    },
    "attribute": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "containsValues": {
    "description": "Elects all the `part instances` having the attribute whose name set with attribute in their `joined attribute set` that have a value that contains at least one of the values in the given string array",
    "items": {
    "type": "string"
    },
    "type": "array"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "exactValues": {
    "description": "Elects all the `part instances` having the attribute whose name set with `attribute` in their `joined attribute set` that have a value exactly included in the given string array.",
    "items": {
    "type": "string"
    },
    "type": "array"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "na": {
    "description": "Include `part instances` with the `N/A` value",
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "attribute",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "enabled",
    "operator",
    "inverted",
    "exactValues",
    "containsValues",
    "na",
    "attribute",
    "id"
    ],
    "title": "Filter attribute definition",
    "type": "object"
    },
    "boolean": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "boolean",
    "description": "Type of the filter",
    "type": "string"
    },
    "value": {
    "default": false,
    "description": "Boolean value of the filter",
    "example": false,
    "type": "boolean"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "value",
    "id"
    ],
    "title": "Filter boolean definition",
    "type": "object"
    },
    "box": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "max": {
    "description": "Define the coordinates [x,y,z] of the max point of the AABB",
    "items": {
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "type": "array"
    },
    "min": {
    "description": "Define the coordinates [x,y,z] of the min point of the AABB",
    "items": {
    "type": "number"
    },
    "maxItems": 3,
    "minItems": 3,
    "type": "array"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "overlap": {
    "description": "Specify if AABB test is included or overlap",
    "example": true,
    "type": "boolean"
    },
    "precision": {
    "description": "Numeric precision will be subtracted/added to min/max point of AABB",
    "type": "number"
    },
    "type": {
    "const": "box",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "inverted",
    "enabled",
    "min",
    "max",
    "overlap",
    "precision",
    "id"
    ],
    "title": "Filter box definition",
    "type": "object"
    },
    "compound": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "subfilters": {
    "description": "list of metadata sub filters",
    "items": {
    "$ref": "#/$defs/compoundfilters"
    },
    "type": "array"
    },
    "type": {
    "const": "compound",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "subfilters",
    "id"
    ],
    "title": "Filter compound definition",
    "type": "object"
    },
    "compoundfilters": {
    "oneOf": [
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/range"
    }
    ]
    },
    "dependencyItem": {
    "additionalProperties": false,
    "properties": {
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "op": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    }
    },
    "required": [
    "op",
    "id"
    ],
    "type": "object"
    },
    "diagonal": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "rangeitems": {
    "description": "List of range item",
    "items": {
    "$ref": "#/$defs/rangeitem"
    },
    "type": "array"
    },
    "type": {
    "const": "diagonal",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "rangeitems",
    "id"
    ],
    "title": "Filter diagonal definition",
    "type": "object"
    },
    "filter": {
    "oneOf": [
    {
    "$ref": "#/$defs/box"
    },
    {
    "$ref": "#/$defs/all"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/literal"
    },
    {
    "$ref": "#/$defs/compound"
    },
    {
    "$ref": "#/$defs/diagonal"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/partinstanceidlist"
    },
    {
    "$ref": "#/$defs/range"
    },
    {
    "$ref": "#/$defs/filterset"
    }
    ]
    },
    "filterset": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "subfilters": {
    "description": "List of sub filters",
    "items": {
    "oneOf": [
    {
    "$ref": "#/$defs/box"
    },
    {
    "$ref": "#/$defs/all"
    },
    {
    "$ref": "#/$defs/attribute"
    },
    {
    "$ref": "#/$defs/boolean"
    },
    {
    "$ref": "#/$defs/literal"
    },
    {
    "$ref": "#/$defs/compound"
    },
    {
    "$ref": "#/$defs/diagonal"
    },
    {
    "$ref": "#/$defs/hasfield"
    },
    {
    "$ref": "#/$defs/partinstanceidlist"
    },
    {
    "$ref": "#/$defs/range"
    },
    {
    "$ref": "#/$defs/filterset"
    }
    ]
    },
    "type": "array"
    },
    "type": {
    "const": "set",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "enabled",
    "operator",
    "inverted",
    "subfilters",
    "id"
    ],
    "title": "Filter set definition",
    "type": "object"
    },
    "hasfield": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "hasfield",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "id"
    ],
    "title": "Filter Has field definition",
    "type": "object"
    },
    "literal": {
    "additionalProperties": false,
    "properties": {
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "query": {
    "description": "Sets the query string in the 3djuump infinite literal and search query language",
    "example": ":PartNumber=='bolt'",
    "type": "string"
    },
    "type": {
    "const": "literal",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "query",
    "id"
    ],
    "title": "Filter literal definition",
    "type": "object"
    },
    "partinstanceidlist": {
    "additionalProperties": false,
    "properties": {
    "buildid": {
    "description": "Id of the build use to create the part list instance",
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "list": {
    "description": "List of part instance ids",
    "items": {
    "type": "number"
    },
    "type": "array"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "type": {
    "const": "partinstanceidlist",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "buildid",
    "list",
    "id"
    ],
    "title": "Filter Part instance list definition",
    "type": "object"
    },
    "range": {
    "additionalProperties": false,
    "properties": {
    "attribute": {
    "description": "Name of the attribute to filter with",
    "example": "PartNumber",
    "minLength": 0,
    "type": "string"
    },
    "enabled": {
    "default": true,
    "description": "If disabled, this filter is completely ignored during all the computations",
    "example": true,
    "type": "boolean"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "inverted": {
    "description": "When 'inverted', a filter elects all the `part instances` that would not be selected if it was not inverted.",
    "example": true,
    "type": "boolean"
    },
    "operator": {
    "default": "and",
    "description": "Operator to apply with this filter and its closest enabled predecessor in its parent container.",
    "enum": [
    "or",
    "and",
    "minus"
    ],
    "example": "or",
    "type": "string"
    },
    "rangeitems": {
    "description": "List of range item",
    "items": {
    "$ref": "#/$defs/rangeitem"
    },
    "type": "array"
    },
    "type": {
    "const": "range",
    "description": "Type of the filter",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "type",
    "operator",
    "enabled",
    "inverted",
    "attribute",
    "rangeitems",
    "id"
    ],
    "title": "Filter range definition",
    "type": "object"
    },
    "rangeitem": {
    "additionalProperties": false,
    "properties": {
    "includedLower": {
    "description": "Sets if the lower bound value should be included or excluded",
    "type": "boolean"
    },
    "includedUpper": {
    "description": "Sets if the upper bound value should be included or excluded",
    "type": "boolean"
    },
    "lower": {
    "description": "Lower bound of the range item",
    "type": "number"
    },
    "upper": {
    "description": "Upper bound of the range item",
    "type": "number"
    }
    },
    "required": [
    "includedLower",
    "includedUpper"
    ],
    "title": "Range item definition",
    "type": "object"
    },
    "retrievalType": {
    "enum": [
    "none",
    "geometric_instance_ids",
    "geometric_and_part_instance_ids"
    ],
    "type": "string"
    },
    "workingset": {
    "additionalProperties": false,
    "properties": {
    "behavior": {
    "description": "The way data is computed inside the working set",
    "type": "integer"
    },
    "configurationids": {
    "items": {
    "description": "ID of a JSON document",
    "maxLength": 255,
    "minLength": 1,
    "pattern": "^[^_].{0,255}$",
    "type": "string"
    },
    "type": "array"
    },
    "dependencies": {
    "items": {
    "$ref": "#/$defs/dependencyItem"
    },
    "type": "array"
    },
    "enabled": {
    "type": "boolean"
    },
    "filters": {
    "description": "List of sub filters",
    "items": {
    "$ref": "#/$defs/filter"
    },
    "type": "array"
    },
    "id": {
    "description": "an object id : only ascii non control and non blank characters",
    "example": "123e4567e89b12d3a456426614174000",
    "maxLength": 64,
    "pattern": "^[\\x21-\\x7E]{1,64}$",
    "type": "string"
    },
    "retrieval": {
    "$ref": "#/$defs/retrievalType"
    },
    "type": {
    "const": "workingset",
    "type": "string"
    },
    "version": {
    "description": "Define the version of the object",
    "example": 1,
    "type": "integer"
    }
    },
    "required": [
    "id",
    "type",
    "filters",
    "dependencies",
    "enabled",
    "retrieval",
    "configurationids",
    "behavior"
    ],
    "title": "WorkingSet definition",
    "type": "object"
    }
    },
    "$ref": "#/$defs/workingset",
    "$schema": "https://json-schema.org/draft-07/schema#"
    }

    This schema may evolve in the future.

    Parameters

    • pWorkingSetData: string | Object
      in
      Internal WorkingSetInterface data to set.

    Returns boolean

    true if the data is set.

  • Gets the order of the FilterItemInterface represented by the given identifier.

    Parameters

    Returns number

    The order of the FilterItemInterface in the WorkingSetInterface, or -1 if not found.

  • Gets the number of triangles of all the geometric instances represented by this WorkingSetInterface.

    This should be called after the WorkingSetInterface has finished its computation.
    Use addEventListener on the event WorkingSetInterfaceSignal.WorkingSetReady to know when the WorkingSetInterface is ready.

    getTrianglesCount should return -1 if the WorkingSetInterface is running or has never been computed. getTrianglesCount should return 0 if the WorkingSetInterface has finished its computation and getRetrieveDataMode is WorkingSetDataRetrieval.R_Nothing.

    Returns number

    The number of triangles of the geometric instances of this WorkingSetInterface.

  • Gets the given dependency working set by its offset.

    Parameters

    • pWorkingSetOffset: number
      in
      The working set offset.

    Returns WorkingSetInterface

    The given working set interface.

  • Gets the number of working set dependencies.

    Returns number

    The number of working set dependencies.

  • Gets the given dependency operator applied to this working set dependency.

    Parameters

    Returns GroupOperator

    The given filter operator. If the working set is invalid or not in the dependency list, GroupOperator.GO_INVALID is returned.

  • Gets the given dependency operator by its offset.

    Parameters

    • pWorkingSetOffset: number
      in
      The working set offset.

    Returns GroupOperator

    The given filter operator. If the offset is invalid, GroupOperator.GO_INVALID is returned.

  • Gets the given dependency order in this working set dependency list.

    Parameters

    Returns number

    The given working set order in the dependency list. If the working set is invalid or not in the dependency list, -1 is returned.

  • Gets the identifier of the WorkingSetInterface.

    The identifier can be set by the application with DataSessionInterface.createWorkingSet or customized later with setWorkingSetId.

    Returns string

    The identifier of the WorkingSetInterface.

  • Gets the number of "parents" of this WorkingSetInterface.

    A parent is a WorkingSetInterface that has this WorkingSetInterface in its list of dependencies.

    Returns number

    The number of "parents" of this WorkingSetInterface.

  • Gets all the "parents" of this WorkingSetInterface.

    A parent is a WorkingSetInterface that has this WorkingSetInterface in its list of dependencies.

    Parameters

    • pParents: WorkingSetInterface[]
      out
      The list of WorkingSetInterface that will contain the "parents".

    Returns boolean

    true if the call was successful.

  • Tells if the EventDispatcher has such a callback registered for the given event type.

    Parameters

    • pType: string
      in
      The type of the event to test.
    • pListener: tListenerCallback
      in
      The listener function that gets tested.

    Returns boolean

    true if such a listener is installed for the given type of event.

  • Tells if the EventDispatcher has such a callback registered for the given callback id.

    Parameters

    • pId: string
      in
      The id of the callback to test.

    Returns boolean

    true if such a listener is installed for the given callback id.

  • Inserts a new WorkingSetInterface dependency with the given operator, at the desired position.

    If pOffset is negative or too big, then the working set dependency is appended to the list of dependencies.

    Use addEventListener on the event WorkingSetInterfaceSignal.WorkingSetDependencyAdded to know when a dependency is added.

    Returns true if the WorkingSetInterface dependency was added (this is not the case if the WorkingSetInterface is already in the dependency list).

    Parameters

    • pOffset: number
      in
      The position to insert the working set to.
    • pWorkingSet: WorkingSetInterface
      in
      The WorkingSetInterface to add.
    • pOperator: GroupOperator
      in
      The operator to use.

    Returns boolean

    true if the working set was inserted.

  • Tells if the WorkingSetInterface is enabled.

    If disabled, this WorkingSetInterface is completely ignored during all the computations (the behavior is the same as if it had not been created).

    A WorkingSetInterface is enabled by default.

    Returns boolean

    true if the WorkingSetInterface is enabled.

  • Tells if the WorkingSetInterface is modified.

    This is the case after calling any filter modification, any WorkingSetInterface dependency change or configurations change.

    Returns boolean

    true if the WorkingSetInterface 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.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    • pObject: Object

      The listener object that was used when addEventListener was called.

    Returns boolean

    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.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    Returns boolean

    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.

    Parameters

    • pId: string
      in
      The id returned by the call to addEventListener that you want to remove.

    Returns boolean

    true if the callback was removed else false.

  • Removes a working set dependency by its position.

    Use addEventListener on the event WorkingSetInterfaceSignal.WorkingSetDependencyRemoved to know when a dependency is removed.

    Parameters

    • pWorkingSetOrder: number
      in
      The working set order to remove.

    Returns boolean

    true if the working set was removed.

  • Sets the ids of the active configurations that are included in this WorkingSetInterface.

    An event WorkingSetInterfaceSignal.WorkingSetConfChanged signal is sent.

    The consecutive call to DataSessionInterface.update will trigger the calculation of the part instances inside this union of ConfigurationInterface.getConfigurationId.

    If pActiveConfigurationIds is an empty array (the default case), the given WorkingSetInterface 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).

    Parameters

    Returns boolean

    true if the WorkingSetInterface is changed and DataSessionInterface.update must be called.

  • Sets the WorkingSetInterface enabled/disabled status.

    If disabled, this WorkingSetInterface is completely ignored during all the computations (the behavior is the same as if it had not been created).

    A WorkingSetInterface is enabled by default.

    Parameters

    • pEnabled: boolean
      in
      If true, the given WorkingSetInterface is enabled.

    Returns void

  • Sets the behavior of the WorkingSetInterface when it contains no filter, no configurations, or no dependencies.

    Please refer to WorkingSetBehavior to find the differences between behaviors.

    Parameters

    • pWorkingSetBehavior: WorkingSetBehavior
      in
      The ored value of the WorkingSetInterface behavior when it contains no filter, no configurations, or no dependencies.

    Returns void

  • Sets the working set operator of the dependency by its offset.

    Use addEventListener on the event WorkingSetInterfaceSignal.WorkingSetDependencyOperatorChanged to know when a dependency operator is changed.

    Parameters

    • pWorkingSetOffset: number
      in
      The offset in the dependency list.
    • pOperator: GroupOperator
      in
      The new operator to set.

    Returns boolean

    false if pWorkingSetOffset is invalid.

  • Sets the identifier of the WorkingSetInterface.

    Make sure the id is unique. A unique WorkingSetInterface identifier is automatically created if the identifier is not overridden.

    Parameters

    • pWorkingSetId: string
      in
      The new identifier of the WorkingSetInterface.

    Returns void

  • Gets a deep copy of the internal data of the WorkingSetInterface.

    Please refer to JSON.stringify.

    Parameters

    • Optional pKey: any
      in
      Unused.

    Returns Object

    The internal WorkingSetInterface data.