import { ConwayGeometry, GeometryObject } from "../../index.js"; import { CanonicalMaterial } from "../../index.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 * as glmatrix from "gl-matrix"; import AP214StepModel from "../../AP214E3_2010/ap214_step_model.js"; import { AP214SceneBuilder } from "../../AP214E3_2010/ap214_scene_builder.js"; import { AP214GeometryExtraction } from "../../AP214E3_2010/ap214_geometry_extraction.js"; import { AP214Properties } from "./ap214_properties.js"; import { StepHeader } from "../../step/parsing/step_parser.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. Mirrors IfcApiProxyIfc. */ interface Ap214ProxyLoadState { conwaywasm: ConwayGeometry; allTimeStart: number; stepHeader: StepHeader; model: AP214StepModel; scene: AP214SceneBuilder; conwayGeometry: AP214GeometryExtraction; geometryTimeInMs: number; } /** */ export declare class IfcApiProxyAP214 implements IfcApiModelPassthrough { readonly modelID: number; private readonly wasmModule; private readonly settings?; fs?: any; model: [ AP214StepModel, AP214SceneBuilder, Map, FlatMesh ]>, Map, Vector, glmatrix.mat4 ]; conwaywasm: ConwayGeometry; _isCoordinated: boolean; linearScalingFactor: number; identity: number[]; NormalizeMat: glmatrix.mat4; /** * Get the underlying step model for this. * * @return {AP214StepModel} The underlying step model. */ get StepModel(): AP214StepModel; /** * Drop this model's materialised entity/descriptor cache (and lazily * rebuilt vtable data), returning that memory to the JS heap. Entities * rematerialise transparently on next access. */ 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 โ€” see StepModelBase.spillSourceToExternalStore. * * AP214 property access is served from indexes built by a one-time * full-model sweep of synchronous reads, so they are primed here * while the source is still resident; post-spill property reads are * then pure map lookups. (`getAllItemsOfType(_, verbose=true)` still * reads raw lines synchronously and is not supported post-spill.) * * @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 succeeds. Fast no-op while the source is fully resident. * * @param expressID The record's express ID. * @return {Promise} Resolves when resident. */ ensureLineResident(expressID: number): Promise; /** * Contains all the logic and methods regarding properties, psets, qsets, etc. */ properties: AP214Properties; /** * Construct wwih a wasm module. * * @param wasmModule The wasm module. */ constructor(modelID: number, data: Uint8Array, wasmModule: any, settings?: Loadersettings | undefined, precomputed?: Ap214ProxyLoadState); /** * Cooperative construction (conway extension, used by OpenModelAsync): * identical parse/extraction to the constructor path, but the data parse * periodically yields to the event loop so progress UI can repaint โ€” * issue #301 ยง2. Geometry extraction stays synchronous (the AP214 * thunk-tree walk has no flat product loop yet) and reports as a * heartbeat phase. * * @param modelID The model ID being opened. * @param data The STEP data buffer. * @param wasmModule The wasm module. * @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO 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 STEP data buffer. * @param conwaywasm The conway geometry wasm wrapper. * @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO honored). * @return {Ap214ProxyLoadState} Everything the constructor tail needs. */ private static parseAndExtract; /** * Cooperative twin of parseAndExtract: awaits the async data parse so the * event loop can run between progress ticks. * * @param modelID The model ID being opened. * @param data The STEP data buffer. * @param conwaywasm The conway geometry wasm wrapper. * @param settings Loader settings (ON_PROGRESS / ON_MODEL_INFO 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): void; /** * * @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_ap214.d.ts.map