import { CanonicalMaterial } from "../core/canonical_material.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 AP214MaterialCache implements ModelMaterials { private readonly deduplicationMap_; private readonly cache_; private readonly assignments_; readonly relMaterialsMap: Map; readonly materialDefinitionsMap: Map; readonly styledItemMap: Map; /** * 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<[number, CanonicalMaterial]>} 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 a material by its local ID. * * @param geometryLocalID The local ID of the geometry to fetch * @return {[CanonicalMaterial, 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 material for a geometry scene node from the scene with these materials. * * @param node The scene geometry node. * @return {CanonicalMaterial | undefined} The canonical material associated with the geometry or * undefined if none is available. */ getMaterialFromGeometryNode(node: SceneNodeGeometry): CanonicalMaterial | undefined; } //# sourceMappingURL=ap214_material_cache.d.ts.map