Enumeration GroupOperator

The GroupOperator enumeration tells how theFilterItemInterfaces inside a WorkingSetInterface or FilterSetInterface are combined.

Usual set operators are available there, union, intersection and minus operator (exclusion).

Operators between filters are set inside the second filter. The operator on the first filter is always ignored but a warning os outputted if the filter operator is different that GroupOperator.GO_UNION. There are no operator precedence with the given operators, they are computed from the left to the right. The only way to add parenthesis is to use a FilterSetInterface to group filters together.

Example : creating a working set that computes the intersection of the part instances that have the field "CompletionStatus" to "done" inside a specific box :

/** 
* Sample to illustrate the use of an intersection of
* FilterAABBInterface and FilterAttributeInterface.
*/
import {
AABB, AttributesDictionaryInterface, AttributeInfoInterface, AttributeType, DataSessionInterface,
WorkingSetInterface,
FilterAABBInterface, FilterAttributeInterface, GroupOperator, WorkingSetDataRetrieval, WorkingSetBehavior,
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;

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

// create the resolution chain :
// create a Working set "unconfigured"
// first create WorkingSetInterface "unconfigured"
// we want to get geometric instances result
// if nothing is set, this working set should include all parts ('unconfigured')
const lConfCtx : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit | WorkingSetBehavior.B_DiscardDependenciesIfEmptyBit
);

// and create the Working set and bind it to the unconfigured WorkingSetInterface
const lConfVisibilityCtx: WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_Nothing,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit | WorkingSetBehavior.B_DiscardFiltersIfEmptyBit
);
lConfVisibilityCtx.insertWorkingSetDependency(0, lConfCtx, GroupOperator.GO_INTERSECTION);

// 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 a Filter Solver
const lFilterSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_OnlyGeometricInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);
// we want to get geometric instances result
lFilterSolver.setRetrieveDataMode(WorkingSetDataRetrieval.R_OnlyGeometricInstances);
// 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 an 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
lFilterSolver.insertFilter(-1, lFilterAABB);
// push back (-1) the FilterAttributeInterface, as it is the second one, its operator is used and therefore
// intersection is used
lFilterSolver.insertFilter(-1, lFilterAttributes);

// set the conf context to use => unconfigured for this example
lFilterSolver.insertWorkingSetDependency(0, lConfVisibilityCtx, GroupOperator.GO_UNION);
// and tell the DataSessionInterface to update the modified WorkingSetInterfaces
lDataSession.update();

Please refer to the FilterItemInterface and WorkingSetInterface for more information.
Metadata/Filters

Enumeration Members

GO_EXCLUSION: 2

The FilterItemInterfaces / WorkingSetInterfaces are combined in exclusion.

GO_INTERSECTION: 1

The FilterItemInterfaces / WorkingSetInterfaces are combined in intersection.

GO_INVALID: -1

The FilterItemInterfaces / WorkingSetInterfaces operator is invalid.

GO_UNION: 0

The FilterItemInterfaces / WorkingSetInterfaces are combined in unions.