import type { ParserAPI, ParserProgress } from './IFCParser'; import { TypeManager } from './TypeManager'; import type { IfcState } from '../BaseDefinitions'; import { IFCModel } from './IFCModel'; import type { LoaderSettings } from 'web-ifc'; import type { PropertyManagerAPI } from './properties/BaseDefinitions'; import { IFCUtils } from './IFCUtils'; import type { AssetContainer, Mesh, Nullable, Scene } from '@babylonjs/core'; /** * Contains all the logic to work with the loaded IFC files (select, edit, etc). */ export declare class IFCManager { state: IfcState; parser: ParserAPI; utils: IFCUtils; properties: PropertyManagerAPI; types: TypeManager; useFragments: boolean; private cleaner; /** * Returns the underlying web-ifc API. */ get ifcAPI(): Nullable; parse(buffer: ArrayBuffer, _scene: Scene, _assetContainer: Nullable): Promise; /** * Sets the relative path of web-ifc.wasm file in the project. * Beware: you **must** serve this file in your page; this means * that you have to copy this files from *node_modules/web-ifc* * to your deployment directory. * * If you don't use this methods, * IFC.js assumes that you are serving it in the root directory. * * Example if web-ifc.wasm is in dist/wasmDir: * `ifcLoader.setWasmPath("dist/wasmDir/");` * * @path Relative path to web-ifc.wasm. */ setWasmPath(path: string): Promise; /** * Sets a callback function that is called every 10% of IFC loaded. * @onProgress callback function */ setOnProgress(onProgress: (event: ParserProgress) => void): void; /** * Sets a coordination matrix to be applied when loading geometry. * @matrix THREE.Matrix4 */ setupCoordinationMatrix(matrix: number[]): void; /** * Clears the coordination matrix that is applied when loading geometry. */ clearCoordinationMatrix(): void; /** * Applies a configuration for [web-ifc](https://ifcjs.github.io/info/docs/Guide/web-ifc/Introduction). */ applyWebIfcConfig(settings: LoaderSettings): Promise; /** * Closes the specified model and deletes it from the [scene](https://threejs.org/docs/#api/en/scenes/Scene). * @modelID ID of the IFC model. * @scene Scene where the model is (if it's located in a scene). */ close(modelID: number): void; /** * Gets the **Express ID** to which the given face belongs. * This ID uniquely identifies this entity within this IFC file. * @geometry The geometry IFC model. * @faceIndex The index of the face of a geometry.You can easily get this index using the [Raycaster](https://threejs.org/docs/#api/en/core/Raycaster). */ getExpressId(geometry: Mesh, faceIndex: number): number; /** * Returns all items of the specified type. You can import * the types from *web-ifc*. * * Example to get all the standard walls of a project: * ```js * import { IFCWALLSTANDARDCASE } from 'web-ifc'; * const walls = ifcLoader.getAllItemsOfType(IFCWALLSTANDARDCASE); * ``` * @modelID ID of the IFC model. * @type type of IFC items to get. * @verbose If false (default), this only gets IDs. If true, this also gets the native properties of all the fetched items. */ getAllItemsOfType(modelID: number, type: number, verbose: boolean): Promise; /** * Gets the native properties of the given element. * @modelID ID of the IFC model. * @id Express ID of the element. * @recursive Wether you want to get the information of the referenced elements recursively. */ getItemProperties(modelID: number, id: number, recursive?: boolean): Promise; /** * Gets the [property sets](https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifckernel/lexical/ifcpropertyset.htm) * assigned to the given element. * @modelID ID of the IFC model. * @id Express ID of the element. * @recursive If true, this gets the native properties of the referenced elements recursively. */ getPropertySets(modelID: number, id: number, recursive?: boolean): Promise; /** * Gets the properties of the type assigned to the element. * For example, if applied to a wall (IfcWall), this would get back the information * contained in the IfcWallType assigned to it, if any. * @modelID ID of the IFC model. * @id Express ID of the element. * @recursive If true, this gets the native properties of the referenced elements recursively. */ getTypeProperties(modelID: number, id: number, recursive?: boolean): Promise; /** * Gets the materials assigned to the given element. * @modelID ID of the IFC model. * @id Express ID of the element. * @recursive If true, this gets the native properties of the referenced elements recursively. */ getMaterialsProperties(modelID: number, id: number, recursive?: boolean): Promise; /** * Gets the ifc type of the specified item. * @modelID ID of the IFC model. * @id Express ID of the element. */ getIfcType(modelID: number, id: number): string | Promise | undefined; /** * Gets the spatial structure of the project. The * [spatial structure](https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifcproductextension/lexical/ifcspatialstructureelement.htm) * is the hierarchical structure that organizes every IFC project (all physical items * are referenced to an element of the spatial structure). It is formed by * one IfcProject that contains one or more IfcSites, that contain one or more * IfcBuildings, that contain one or more IfcBuildingStoreys, that contain * one or more IfcSpaces. * @modelID ID of the IFC model. */ getSpatialStructure(modelID: number, includeProperties?: boolean): Promise; /** * Returns the IFC class name of an instance if the optional parameter is not provided. * If an entit class is provided, it will check if an instance belongs to the class. * @modelID ID of the IFC model. * @entityClass IFC Class name. */ isA(entity: any, entity_class: string): Promise; /** * Returns the IFC objects filtered by IFC Type and wrapped with the entity_instance class. * If an IFC type class has subclasses, all entities of those subclasses are also returned. * @modelID ID of the IFC model. * @entityClass IFC Class name. */ byType(modelID: number, entityClass: string): Promise; /** * Returns the IFC objects filtered by IFC ID. * @modelID ID of the IFC model. * @id Express ID of the element. */ byId(modelID: number, id: number): Promise; /** * Returns the IFC objects filtered by IFC Type and wrapped with the entity_instance class. * If an IFC type class has subclasses, all entities of those subclasses are also returned. * @modelID ID of the IFC model. * @entityClass IFC Class name. */ idsByType(modelID: number, entityClass: string): Promise>; /** * Disposes all memory used by the IFCLoader, including WASM memory and the web worker. * Use this if you want to destroy the object completely. * If you want to load an IFC later, you'll need to create a new instance. */ dispose(): Promise; /** * For internal use of IFC.js dev team and testers */ getAndClearErrors(modelID: number): void; }