IFClite TypeScript API
    Preparing search index...

    Interface LensDataProvider

    Abstract interface for accessing IFC entity data during lens evaluation.

    Consumers implement this to bridge their data source (IfcDataStore, server API, IndexedDB, etc.) to the lens engine.

    interface LensDataProvider {
        forEachEntity(
            callback: (globalId: number, modelId: string) => void,
        ): void;
        getClassifications?(globalId: number): ClassificationInfo[];
        getEntityAttribute?(globalId: number, attrName: string): string | undefined;
        getEntityCount(): number;
        getEntityGroups?(
            globalId: number,
        ): readonly {
            id: number;
            name?: string;
            objectType?: string;
            type: string;
        }[];
        getEntityType(globalId: number): string | undefined;
        getMaterialName?(globalId: number): string | undefined;
        getMaterialNames?(globalId: number): string[];
        getModelId?(globalId: number): string | undefined;
        getModelName?(modelId: string): string | undefined;
        getPropertySets(globalId: number): PropertySetInfo[];
        getPropertyValue(
            globalId: number,
            propertySetName: string,
            propertyName: string,
        ): unknown;
        getQuantitySets?(
            globalId: number,
        ): readonly { name: string; quantities: readonly { name: string }[] }[];
        getQuantityValue?(
            globalId: number,
            qsetName: string,
            quantName: string,
        ): string | number | undefined;
        resolveCapturedScope?(scope: CapturedEntityScope): ReadonlySet<number>;
    }
    Index
    • Iterate all entities. The callback receives the global ID and the model identifier for each entity.

      Parameters

      • callback: (globalId: number, modelId: string) => void

      Returns void

    • Get classification references for an entity. Returns an empty array when the entity has no classifications.

      Parameters

      • globalId: number

      Returns ClassificationInfo[]

    • Get a single entity attribute by name (e.g. "Name", "Description", "ObjectType", "Tag"). Optional — engine skips attribute criteria when not implemented.

      Parameters

      • globalId: number
      • attrName: string

      Returns string | undefined

    • Total entity count (used for pre-allocation hints)

      Returns number

    • Get the groups/zones an entity is assigned to via IfcRelAssignsToGroup (IfcZone, IfcGroup, IfcSystem). Used by the "group" criterion / auto-color source to colour or isolate by zone membership. Optional — the engine skips group criteria when not implemented (#1075).

      Parameters

      • globalId: number

      Returns readonly { id: number; name?: string; objectType?: string; type: string }[]

    • Get the IFC class name for an entity (e.g. "IfcWall")

      Parameters

      • globalId: number

      Returns string | undefined

    • Get the material name for an entity. Returns the top-level material name, or the first layer/constituent name.

      Parameters

      • globalId: number

      Returns string | undefined

    • Get every distinct individual material name for an entity — each layer / constituent / profile material of a multi-material element, or the single material for a simple one. Unlike getMaterialName this does NOT return the layer-set / usage name, so "color/select by material" groups by the real materials and a multi-layer element belongs to each of them. (#1366)

      Parameters

      • globalId: number

      Returns string[]

    • Get the federated model identifier for an entity. Optional — engine skips model criteria when not implemented.

      Parameters

      • globalId: number

      Returns string | undefined

    • Get the display name for a model identifier (for legends and UI). Optional — falls back to the raw modelId when not implemented.

      Parameters

      • modelId: string

      Returns string | undefined

    • Get all property sets for an entity. Used for material matching (scans psets whose name contains "material").

      Parameters

      • globalId: number

      Returns PropertySetInfo[]

    • Get a single property value by property-set name and property name. Returns undefined when the property does not exist.

      Parameters

      • globalId: number
      • propertySetName: string
      • propertyName: string

      Returns unknown

    • Get quantity sets for an entity (used for discovery). Returns quantity set names and their quantity names.

      Parameters

      • globalId: number

      Returns readonly { name: string; quantities: readonly { name: string }[] }[]

    • Get a quantity value by quantity-set name and quantity name. Returns the numeric or string value, or undefined if not found.

      Parameters

      • globalId: number
      • qsetName: string
      • quantName: string

      Returns string | number | undefined

    • Resolve pinned membership to native global ids; required for a scoped lens.

      Parameters

      Returns ReadonlySet<number>