Interface FilterDiagonalInterface

The FilterDiagonalInterface interface is a FilterItemInterface to elect part instances leaves that have an oriented bounding box diagonal SQUARED length contained in one of the range specified in the filter.

This interface allows to create range items FilterRangeItemInterface to allow the creation of an union of ranges, to be tested against the diagonal SQUARED length of the part instances leaves.

Suppose the user wants to get all part instances leaves which have a diagonal SQUARED length contained within 2 and 3 mm.

/** 
* Sample to illustrate how to use a FilterDiagonalInterface and the unit conversion system.
*/
import {
WorkingSetInterface, WorkingSetDataRetrieval,
Unit, FilterRangeItemInterface,
tListenerCallback, FilterDiagonalInterface, DataSessionInterface, GroupOperator, WorkingSetInterfaceSignal, WorkingSetBehavior,
} from 'generated_files/documentation/appinfiniteapi';

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

// what to do when result has been computed ?
let onResultReady : tListenerCallback;

/* Working Sets */
// 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);

/* SOLVER */
// create the solver to retrieve the result
// we want to retrieve `geometric instance ids` and `part instance ids` on the solver
const lGlobalSolver : WorkingSetInterface = lDataSession.createWorkingSet(
WorkingSetDataRetrieval.R_GeometricInstancesAndPartInstances,
WorkingSetBehavior.B_DiscardConfigurationsIfEmptyBit
);

lGlobalSolver.insertWorkingSetDependency(0, lConfVisibilityCtx, GroupOperator.GO_UNION);
// bind the solver to custom implementation when the result is ready
lGlobalSolver.addEventListener(WorkingSetInterfaceSignal.WorkingSetReady, onResultReady);

/* DIAGONAL FILTER */
// get the DMU build unit
const lDMUUnit : Unit = lDataSession.getDmuBuildUnit();
// we want to get values in DMU units
const lConvertFactor : number = lDataSession.convertUnitFactor(Unit.U_Millimeter, lDMUUnit);

// all leaves whose diagonal is contained within 2 and 3 millimeters
let lMinValue : number = 2 * lConvertFactor;
let lMaxValue : number = 3 * lConvertFactor;

// diagonal SQUARED
lMinValue *= lMinValue;
lMaxValue *= lMaxValue;

// create a diagonal filter
const lDiagonalFilter : FilterDiagonalInterface = lDataSession.createFilterDiagonal();
// useless, GroupOperator.GO_UNION is the default operator when creating a new filter
// lDiagonalFilter.setFilterOperator(GroupOperator.GO_UNION);

// and add a range to test ([2mm, 3mm] included)
const lDiagonalFilterContent : FilterRangeItemInterface = lDiagonalFilter.createFilterRangeItem();
// include lower bound
lDiagonalFilterContent.setIncludedLower(true);
// include upper bound
lDiagonalFilterContent.setIncludedUpper(true);
// set the lower bound as 2 mm in DMU units SQUARED
lDiagonalFilterContent.setLowerBound(lMinValue);
// set the upper bound as 3 mm in DMU units SQUARED
lDiagonalFilterContent.setUpperBound(lMaxValue);

// add the filter to the solver
lGlobalSolver.insertFilter(0, lDiagonalFilter);
// and go => make the DataSessionInterface compute the result
lDataSession.update();

This interface MUST be used in a WorkingSetInterface (see Working Sets).
Metadata/Filters

interface FilterDiagonalInterface {
    addEventListener(pType, pListener, pObject): string;
    addEventListener(pType, pListener): string;
    areSignalsBlocked(): boolean;
    blockSignals(pBlock): void;
    createFilterRangeItem(): FilterRangeItemInterface;
    dispose(): void;
    fromJSON(pFilterData): boolean;
    getDepthContribution(): number;
    getFilterId(): string;
    getFilterOperator(): GroupOperator;
    getFilterType(): FilterType;
    getInfiniteObjectType(): InfiniteObjectType;
    getLastError(): InfiniteError;
    getParentFilter(): FilterSetInterface;
    getParentFilterId(): string;
    getRangeItem(pRangeIndex): FilterRangeItemInterface;
    getRangeItems(): FilterRangeItemInterface[];
    hasEventListener(pType, pListener): boolean;
    hasEventListenerById(pId): boolean;
    isDisposed(): boolean;
    isEnabled(): boolean;
    isInverted(): boolean;
    removeAllEventListeners(): boolean;
    removeEventListener(pType, pListener, pObject): boolean;
    removeEventListener(pType, pListener): boolean;
    removeEventListenerById(pId): boolean;
    removeRangeItem(pRangeIndex): boolean;
    setEnabled(pEnabled): void;
    setFilterId(pFilterId): void;
    setFilterOperator(pFilterOperator): void;
    setInverted(pInverted): 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.

  • 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

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

    Use addEventListener on the event FilterItemInterfaceSignal.FilterDataChanged to know when the FilterItemInterface internal data changed.

    {
    "$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"
    }
    ]
    },
    "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"
    }
    },
    "$ref": "#/$defs/filter",
    "$schema": "https://json-schema.org/draft-07/schema#"
    }

    This schema may evolve in the future.

    Parameters

    • pFilterData: string | Object
      in
      Internal FilterItemInterface data to set.

    Returns boolean

    true if the data is set.

    See

    toJSON

  • Gets the depth contribution of the FilterItemInterface.

    This value is usually one.

    Returns number

    The depth contribution of the FilterItemInterface.

  • Gets the identifier of the FilterItemInterface.

    Returns string

    The identifier of the FilterItemInterface.

  • Gets the range item at index pRangeIndex.

    If pRangeIndex is negative or superior or equal to the number of range items, this function does nothing and returns undefined.

    Parameters

    • pRangeIndex: number
      in
      Index of the range item to get.

    Returns FilterRangeItemInterface

    The given FilterRangeItemInterface (this is the actual data held by the FilterDiagonalInterface, and not a copy) if pRangeIndex is valid else return undefined.

  • Gets the list of all range items.

    This function should not be used to add or remove range items, the FilterDiagonalInterface will not see the modifications if the array is modified.

    However, modifying items inside the array is allowed.

    Returns FilterRangeItemInterface[]

    warning
    All range items inside the FilterDiagonalInterface.
  • 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.

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

    true if the FilterItemInterface is enabled.

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

    true if such a FilterItemInterface is "inverted".

  • 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 the range item at the position pRangeIndex.

    If pRangeIndex is negative or superior or equal to the number of range items, this function does nothing and returns false. Returns true if the item is effectively removed.

    Parameters

    • pRangeIndex: number
      in
      Index of the range item to remove.

    Returns boolean

    true if the item was removed else return false.

  • 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 FilterItemInterfaceSignal.FilterEnabledChanged to know when the FilterItemInterface has changed its enabled status. Modifying a disabled FilterItemInterface will not trigger any change in the containing FilterSetInterface / WorkingSetInterface.

    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 across the application.

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

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

    Please refer to JSON.stringify.

    Parameters

    • Optional pKey: any
      in
      Unused.

    Returns Object

    The internal FilterItemInterface data.