import { CanonicalMaterial } from "../core/canonical_material.js"; import IfcStepModel from "./ifc_step_model.js"; import StepEntityBase from "../step/step_entity_base.js"; import EntityTypesIfc from "./ifc4_gen/entity_types_ifc.gen.js"; import { ModelMaterials } from "../core/model_materials.js"; import { SceneNodeGeometry } from "../core/scene_node.js"; /** * Cache of materials via their local ID */ export declare class IfcMaterialCache implements ModelMaterials { readonly model: IfcStepModel; readonly isVoid: boolean; private readonly cache_; private readonly assignments_; readonly relMaterialsMap: Map; readonly materialDefinitionsMap: Map; readonly styledItemMap: Map; /** * Construct this with an IFC step model. * * @param model The model this is from * @param isVoid */ constructor(model: IfcStepModel, isVoid?: boolean); /** * If there is a material for a whole element, this is used to * add a default material to that item. */ defaultMaterialLocalID: number | undefined; /** * Get the number of materials in this. * * @return {number} The number of materials in this. */ get size(): number; /** * Get the materials in the cache. * * @return {IterableIterator} The iterator for the * local IDs and their respective materials. */ [Symbol.iterator](): IterableIterator<[ number, CanonicalMaterial ]>; /** * Get the materials in the cache (values only). * * @return {IterableIterator} The iterator for the respective * materials. */ materials(): IterableIterator; /** * Add a material to the cache * * @param localID The local ID of the source material object * @param material The canonical material version of the material to add */ add(localID: number, material: CanonicalMaterial): void; /** * Get a material by its local ID. * * @param localID The local ID to fetch a material for. * @return {CanonicalMaterial | undefined} The material for the matching local ID */ get(localID: number): CanonicalMaterial | undefined; /** * Get the material matching a geometry node. * * @param node The geometry node to match a material for. * @return {CanonicalMaterial | undefined} A material, or undefined if it is not found. */ getMaterialFromGeometryNode(node: SceneNodeGeometry): CanonicalMaterial | undefined; /** * Get a material by its local ID. * * @param geometryLocalID The local ID of the geometry to fetch * @return {number | undefined} A tuple containing the * material and its id, or undefined if it is not found. */ getMaterialIDByGeometryID(geometryLocalID: number): number | undefined; /** * Assign a particular geometry to a particular material * * @param geometryLocalID The geometry * @param materialLocalID The material */ addGeometryMapping(geometryLocalID: number, materialLocalID: number): void; /** * Map the current geometry to the current default material, if one is set. * * @param geometryLocalID The geometry ID to add. */ addDefaultGeometryMapping(geometryLocalID: number): void; /** * Get a material by its local geometry ID. * * @param geometryLocalID The local ID of the geometry to get the associated * material for. * @return {[CanonicalMaterial, number] | undefined} A tuple containing the * material and its id, or undefined if it is not found. */ getMaterialByGeometryID(geometryLocalID: number): [ CanonicalMaterial, number ] | undefined; /** * Get the OBJs for all the curves in the cache (lazily) * * @yields {[StepEntityBase, string]} Curves with their matching OBJ as a string */ mtls(): IterableIterator<[ StepEntityBase, string ]>; } //# sourceMappingURL=ifc_material_cache.d.ts.map