/** * Spatial hierarchy builder - builds the project/site/building/storey tree. * * Single source for spatial-hierarchy construction. There are two entry points * over one shared `buildNode`: * - `build(...)` fresh parse: extracts storey elevations from the source * buffer. Throws if there is no IfcProject. * - `buildFromCache` cache restore: no source buffer, so storey elevations * stay empty. Returns undefined if there is no IfcProject. * Both paths get the same cycle guard, aggregate-descendant storey mapping, and * spatial-child promotion, so they cannot drift. */ import type { EntityTable, StringTable, RelationshipGraph, SpatialHierarchy } from '@ifc-lite/data'; import type { EntityRef } from './types.js'; export declare class SpatialHierarchyBuilder { /** * Fresh-parse build. Extracts storey elevations from the source buffer. * Throws if no IfcProject is present. * * @param lengthUnitScale - Scale to convert IFC length values to meters (e.g. 0.001 for millimeters). */ build(entities: EntityTable, relationships: RelationshipGraph, _strings: StringTable, source: Uint8Array, entityIndex: { byId: { get(expressId: number): EntityRef | undefined; }; }, lengthUnitScale?: number): SpatialHierarchy; /** * Cache-restore build. No source buffer, so storey elevations stay empty * (`getStoreyByElevation` returns null). Returns undefined if no IfcProject. */ buildFromCache(entities: EntityTable, relationships: RelationshipGraph): SpatialHierarchy | undefined; private assemble; private buildNode; /** * Extract elevation from an IfcBuildingStorey. Elevation is attribute index 9 * in both IFC2x3 and IFC4 (GlobalId, OwnerHistory, Name, Description, * ObjectType, ObjectPlacement, Representation, LongName, CompositionType, * Elevation). */ private extractElevation; /** * Resolve a storey's elevation from its ObjectPlacement, used as a fallback when * the Elevation attribute is null. Walks * IfcBuildingStorey.ObjectPlacement (IfcLocalPlacement) * -> RelativePlacement (IfcAxis2Placement3D) * -> Location (IfcCartesianPoint).Coordinates[2] * i.e. the storey's Z relative to its parent spatial container, which matches * the semantics of the Elevation attribute and avoids folding in any site-level * georeferencing Z. Returns the raw (unscaled) Z, or undefined when the chain * can't be resolved. */ private extractPlacementElevation; } //# sourceMappingURL=spatial-hierarchy-builder.d.ts.map