import { ConwayGeometry, GeometryObject } from "../../index.js"; import { CanonicalMaterial } from "../../index.js"; import { IfcSceneBuilder } from "../../ifc/ifc_scene_builder.js"; import IfcStepModel from "../../ifc/ifc_step_model.js"; import { FlatMesh, IfcGeometry, LoaderError, Loadersettings, PlacedGeometry, RawLineData, Vector } from "./ifc_api.js"; import { StepExternalByteStore } from "../../step/step_buffer_provider.js"; import { IfcApiModelPassthrough } from "./ifc_api_model_passthrough.js"; import { NodeValueHandle } from "./properties_passthrough.js"; import * as glmatrix from "gl-matrix"; import { IfcProperties } from "./ifc_properties.js"; import { StepHeader } from "../../step/parsing/step_parser.js"; import { IfcGeometryExtraction } from "../../ifc/ifc_geometry_extraction.js"; /** * Everything parse/extraction produces that the proxy constructor's tail * (mesh vectors, statistics) consumes — precomputed by createAsync so the * cooperative path can await mid-parse, or computed synchronously inside * the constructor for the classic OpenModel path. */ interface IfcProxyLoadState { conwaywasm: ConwayGeometry; allTimeStart: number; stepHeader: StepHeader; model: IfcStepModel; scene: IfcSceneBuilder; conwayGeometry: IfcGeometryExtraction; geometryTimeInMs: number; } /** * The proxy for IFC from the shim. */ export declare class IfcApiProxyIfc implements IfcApiModelPassthrough { readonly modelID: number; private readonly wasmModule; private readonly settings?; fs?: any; model: [ IfcStepModel, IfcSceneBuilder, Map, FlatMesh ]>, Map, Vector, glmatrix.mat4 ]; conwaywasm: ConwayGeometry; _isCoordinated: boolean; linearScalingFactor: number; identity: number[]; NormalizeMat: glmatrix.mat4; /** * Contains all the logic and methods regarding properties, psets, qsets, etc. */ properties: IfcProperties; /** * Construct wwih a wasm module. * * @param wasmModule The wasm module. */ constructor(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings | undefined, precomputed?: IfcProxyLoadState); /** * Cooperative construction (conway extension, used by OpenModelAsync): * identical parse/extraction to the constructor path, but periodically * yields to the event loop so progress UI can repaint — issue #301 §2. * * @param modelID The model ID being opened. * @param data The IFC data buffer. * @param wasmModule The wasm module. * @param settings Loader settings (ON_PROGRESS is honored). * @return {Promise} The constructed proxy. */ static createAsync(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings): Promise; /** * Log + record the header parse result on the model statistics. * * @param result0 The header parse result. * @param bufferInput The parsing buffer (for line numbers). * @param modelID The model ID (for statistics lookup). */ private static reportHeaderParseResult; /** * Build the progress tracker for a load, when the settings carry an * ON_PROGRESS callback. * * @param settings Loader settings. * @return {ProgressTracker | undefined} The tracker, if progress is wanted. */ private static makeTracker; /** * Synchronous parse + geometry extraction (the classic OpenModel path). * * @param modelID The model ID being opened. * @param data The IFC data buffer. * @param conwaywasm The conway geometry wasm wrapper. * @param settings Loader settings (ON_PROGRESS is honored). * @return {IfcProxyLoadState} Everything the constructor tail needs. */ private static parseAndExtract; /** * Cooperative twin of parseAndExtract: awaits the *Async parser/extraction * variants so the event loop can run between progress ticks. * * @param modelID The model ID being opened. * @param data The IFC data buffer. * @param conwaywasm The conway geometry wasm wrapper. * @param settings Loader settings (ON_PROGRESS is honored). * @return {Promise} Everything the constructor tail needs. */ private static parseAndExtractAsync; /** * * @param input - FILE_HEADER from step header * @return {string[]} array of fields in FILE_NAME */ parseFileHeader(input: string): string[]; /** * Creates a new model and returns a modelID number (unimplemented) * * @param settings settings for generating data the model * @return {number} model ID */ createModel(settings?: Loadersettings): number; /** * * @param modelID * @return {Uint8Array} unimplemented */ exportFileAsIFC(modelID: number): Uint8Array; /** * Opens a model and returns a modelID number * * @param modelID handle retrieved by OpenModel, model must not be closed * @param geometryExpressID containing IFC data (bytes) * @return {IfcGeometry} */ getGeometry(geometryExpressID: number): IfcGeometry; /** * * @param modelID * @param expressID * @param flatten * @return {any} line data */ getLine(expressID: number, flatten?: boolean): any; /** * Light attribute read: Name / LongName / GlobalId as web-ifc value * handles, WITHOUT materialising the entity's full flattened record. * Reads go through the typed entity's lazy per-field getters — the * first access tokenizes the record's field offsets into the shared * vtable, but only these attributes' values are deserialized. Used by * the spatial structure's `'names'` mode. * * @param expressID * @return {object} `{ Name?, LongName?, GlobalId? }` string handles * (`{type: 1, value}`), each present only when the attribute exists * and is non-null on the entity. */ getLineNameAttributes(expressID: number): { Name?: NodeValueHandle; LongName?: NodeValueHandle; GlobalId?: NodeValueHandle; }; /** * Drop this model's materialised entity/descriptor cache (and lazily * rebuilt vtable data), returning that memory to the JS heap. Entities * and attributes rematerialise transparently on next access, so this is * safe to call between UI interactions to keep the property working set * bounded to what the active UI has touched. */ releaseEntityCache(): void; /** * Are the model's source bytes spilled to an external store (served * through on-demand windows) rather than fully resident? * * @return {boolean} True after spillSourceToExternalStore. */ get sourceIsExternal(): boolean; /** * Release the resident source buffer and serve subsequent record * reads through fixed-size windows paged in from the given external * store (which must hold exactly the model's source bytes — e.g. * the original file already sitting in OPFS). See * StepModelBase.spillSourceToExternalStore. * * @param store The external byte store. * @param chunkBytes Optional window size in bytes. * @param maxResidentChunks Optional residency cap in windows. */ spillSourceToExternalStore(store: StepExternalByteStore, chunkBytes?: number, maxResidentChunks?: number): void; /** * Page in the byte range backing a record so a following synchronous * read (getLine / attribute access) succeeds. Fast no-op while the * source is fully resident. * * Note: covers the record itself (including its inline elements), * NOT entities it merely references — recursive flattening across * references needs each referenced record ensured in turn. * * @param expressID The record's express ID. * @return {Promise} Resolves when resident. */ ensureLineResident(expressID: number): Promise; /** * Lazily iterate the express IDs of all IfcRoot-derived entities * (products, relationships, property sets, quantities — everything * carrying a GlobalId) straight from the type index, without * materialising entity descriptors or touching the source buffer. * * This lets property sweeps skip the ~96% of records in large models * that are geometric resources, and stays safe on a spilled source. * Multi-mapped entities may repeat, so callers should dedupe. * * @return {IterableIterator} Express IDs of IfcRoot subtypes. */ rootExpressIDs(): IterableIterator; /** * * @param modelID * @return {Vector} */ getAndClearErrors(): Vector; /** * * @param modelID * @param lineObject */ writeLine(lineObject: any): void; /** * * @param modelID * @param line */ flattenLine(line: any): void; /** * * @param modelID * @param expressID * @return {RawLineData} */ getRawLineData(expressID: number): RawLineData; /** * * @param modelID * @param data */ writeRawLineData(data: RawLineData): void; /** * * @param modelID * @param type * @return {Vector} */ getLineIDsWithType(type: number): Vector; /** * * @param modelID * @return {Vector} */ getAllLines(): Vector; /** * * @param modelID * @param transformationMatrix */ setGeometryTransformation(transformationMatrix: Array): void; /** * * @param modelID * @return {Array} */ getCoordinationMatrix(): Array; /** * * @param ptr * @param size * @return {Float32Array} */ getVertexArray(ptr: number, size: number): Float32Array; /** * * @param ptr * @param size * @return {Uint32Array} */ getIndexArray(ptr: number, size: number): Uint32Array; /** * * @param heap * @param startPtr * @param sizeBytes * @return {Float32Array | Uint32Array} */ getSubArray(heap: Float32Array | Uint32Array, startPtr: number, sizeBytes: number): Float32Array | Uint32Array; /** * Closes a model and frees all related memory * * @param modelID Model handle retrieved by OpenModel, model must not be closed */ closeModel(): void; /** * * @param modelID * @param meshCallback */ streamAllMeshes(meshCallback: (mesh: FlatMesh) => void): void; /** * * @param modelID * @param types * @param meshCallback */ streamAllMeshesWithTypes(types: Array, meshCallback: (mesh: FlatMesh) => void): void; /** * Load all geometry in a model * * @return {Vector} */ loadAllGeometry(): Vector; /** * Load geometry for a single element * * @param expressID express ID of flat mesh * @return {FlatMesh} */ getFlatMesh(expressID: number): FlatMesh; /** * Creates a map between element ExpressIDs and GlobalIDs. * Each element has two entries, (ExpressID -> GlobalID) and (GlobalID -> ExpressID). * * @param modelID handle retrieved by OpenModel */ createGuidToExpressIdMapping(): void; } export {}; //# sourceMappingURL=ifc_api_proxy_ifc.d.ts.map