Cache of materials via their local ID

Constructors

Properties

defaultMaterialLocalID: undefined | number

If there is a material for a whole element, this is used to add a default material to that item.

isVoid: boolean = false
materialDefinitionsMap: Map<number, number> = ...
model: default

The model this is from

relMaterialsMap: Map<number, number> = ...
styledItemMap: Map<number, number> = ...

Accessors

  • get size(): number
  • Get the number of materials in this.

    Returns number

    The number of materials in this.

Methods

  • Map the current geometry to the current default material, if one is set.

    Parameters

    • geometryLocalID: number

      The geometry ID to add.

    Returns void

  • Assign a particular geometry to a particular material

    Parameters

    • geometryLocalID: number

      The geometry

    • materialLocalID: number

      The material

    Returns void

  • Get a material by its local geometry ID.

    Parameters

    • geometryLocalID: number

      The local ID of the geometry to get the associated material for.

    Returns undefined | [CanonicalMaterial, number]

    A tuple containing the material and its id, or undefined if it is not found.

  • Get a material by its local ID.

    Parameters

    • geometryLocalID: number

      The local ID of the geometry to fetch

    Returns undefined | number

    A tuple containing the material and its id, or undefined if it is not found.

  • Get the OBJs for all the curves in the cache (lazily)

    Returns IterableIterator<[default<EntityTypesIfc>, string]>

    Curves with their matching OBJ as a string