Interface FilterSetInterface

The FilterSetInterface interface is a FilterItemInterface that groups FilterItemInterface together.

The FilterSetInterface allows to create an operator precedence with FilterOperator. It is a sort of "parenthesis" filter.

There is a maximum depth of imbricated FilterSetInterfaces (a FilterSetInterface inside a FilterSetInterface inside a FilterSetInterface ...), the cumulated depth (getDepthContribution) cannot be more than

Max Depth Contribution

Any empty FilterSetInterface is valid and is represented by 0 part instance and 0 geometric instance.

The FilterSetInterface interface is created through the createFilterSet.

The FilterSetInterface has the type FT_SET (getFilterType).

The FilterSetInterface has a depth contribution of 1 + Maximum depth contribution of each included FilterItemInterface.

/** 
* Sample to illustrate the operator precedence.
*/
import { FilterItemInterface, FilterSolverInterface, FilterOperator, FilterSetInterface, DataSessionInterface } from 'generated/documentation/appinfiniteapi';

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

let lFilterSolver: FilterSolverInterface;
// A, B and C have been created previously
let A : FilterItemInterface;
let B : FilterItemInterface;
let C : FilterItemInterface;

// compute C U (A - B)
// we create the parenthesis with a FilterSetInterface
const lParenthesis : FilterSetInterface = lDataSession.createFilterSet();

// it is better to modify the filters first and insert them after if possible (less signals sent)

// filter operator of C will be discarded, but a warning is outputted in the console if not FilterOperator.FO_UNION.
C.setFilterOperator(FilterOperator.FO_UNION);
// filter operator of A will be discarded, but a warning is outputted in the console if not FilterOperator.FO_UNION.
A.setFilterOperator(FilterOperator.FO_UNION);

// compute union and exclusion
lParenthesis.setFilterOperator(FilterOperator.FO_UNION);
B.setFilterOperator(FilterOperator.FO_UNION);

// add filters in parenthesis
lParenthesis.insertFilter(-1, A);
lParenthesis.insertFilter(-1, B);

// and insert filters
lFilterSolver.insertFilter(-1, C);
lFilterSolver.insertFilter(-1, lParenthesis);

// and tell the DataSessionInterface to update the modified FilterSolverInterface
lDataSession.update();

Please refer to Available Filters for a list of other [FilterItemInterfaces](FilterItemInterface.html).
Metadata/Filters

See

Hierarchy

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.

    Returns

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

    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: undefined | Object
      in
      The optional object the callback will be called with when the given event fires.

    Returns string

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

    Returns

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

    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

  • Gets the depth contribution of the FilterItemInterface.

    This value is usually one.

    Returns

    The depth contribution of the FilterItemInterface.

    Returns number

  • Gets the identifier of the FilterItemInterface.

    Returns

    The identifier of the FilterItemInterface.

    Returns string

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

    Returns

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

    Parameters

    • pFilterId: string
      in
      The identifier of the [FilterItemInterface](FilterItemInterface.html) to query.

    Returns number

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

    Returns

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

    Parameters

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

    Returns boolean

  • Tells if this object has been gotten rid off.

    Returns

    true if dispose has been called on this object.

    Returns boolean

  • Tells if the FilterItemInterface is enabled.

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

    A FilterItemInterface is enabled by default.

    Returns

    true if the FilterItemInterface is enabled.

    Returns boolean

  • Tells if the FilterItemInterface is "inverted".

    When "inverted", a FilterItemInterface elects all the part instances that were not selected if it was not inverted.

    A FilterItemInterface is not "inverted" by default.

    Returns

    true if such a FilterItemInterface is "inverted".

    Returns boolean

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

    Returns

    true if the FilterItemInterface was found and changed.

    Parameters

    • pFilterId: string
      in
      The identifier of the [FilterItemInterface](FilterItemInterface.html) to move.
    • pOrder: number
      in
      The new order of the [FilterItemInterface](FilterItemInterface.html).

    Returns boolean

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

    Returns

    true if the callback was removed else false.

    Parameters

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

      The listener function that gets removed.

    • pObject: undefined | Object

      The listener object that was used when addEventListener was called.

    Returns boolean

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

    Returns

    true if the callback was removed else false.

    Parameters

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

      The listener function that gets removed.

    Returns boolean

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

    Returns

    true if the callback was removed else false.

    Parameters

    • pId: string
      in
      The id returned by the call to [addEventListener](FilterSetInterface.html#addEventListener) that you want to remove.

    Returns boolean

  • Sets the FilterItemInterface enabled/disabled status.

    If disabled, this FilterItemInterface is completely ignored during all the computations (the behavior is the same as if it had not been created). Use addEventListener on the event FilterEnabledChanged to know when the FilterItemInterface has changed its enabled status.

    A FilterItemInterface is enabled by default.

    Parameters

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

    Returns void

  • Sets the identifier of the FilterItemInterface. Make sure the id is unique. A unique FilterItemInterface identifier is created if the identifier is not overridden.

    Parameters

    • pFilterId: string
      in
      The new identifier of the FilterItemInterface.

    Returns void

  • Sets the "inverted" status of the FilterItemInterface.

    When "inverted", a FilterItemInterface elects all the part instances that were not selected if it was not inverted. Use addEventListener on the event FilterInvertedChanged to know when the FilterItemInterface has changed its "inverted" status.

    A FilterItemInterface is not "inverted" by default.

    Parameters

    • pInverted: boolean
      in
      If true, such a FilterItemInterface will be "inverted".

    Returns void