Module property_value

Module property_value 

Source
Expand description

Property VALUE resolution: turning a decoded IfcProperty attribute (nominal value, enumerated/list members, complex-property nesting) into the display string + kind + measure tag + candidate list that properties::extract_property wires onto a Property. Split out of properties.rs to keep entity-shape extraction (which pset/property to walk) separate from value-shape resolution (how to stringify one).

ConstantsΒ§

MAX_COMPLEX_PROPERTY_DEPTH πŸ”’
Guards resolve_complex_property_value against a pathological/cyclic HasProperties chain, mirroring the TS MAX_COMPLEX_PROPERTY_DEPTH in packages/parser/src/property-complex-value.ts exactly: real IFC nests IfcComplexProperty at most a couple of levels deep.

FunctionsΒ§

complex_property_truncation_marker πŸ”’
The suffix minted into a complex property’s display value when the depth cap stops the walk with HasProperties members still unread (issue #3972). Byte-identical to complexPropertyTruncationMarker() in packages/parser/src/property-complex-value.ts β€” the two paths feed the same property panel, CSV/parquet export and compare fingerprints, so a divergence here reads as a data difference between server and browser.
fmt_number πŸ”’
Render a number the way JS String(n) would for the canonical value string (integers without a trailing .0, so 200.0 -> β€œ200”).
infer_data_type πŸ”’
The IFC type tag of a typed-wrapper attribute (List([String(type), _])), upper-cased β€” mirrors the WASM inferDataType.
logical_token πŸ”’
Normalise an .ENUM.-style logical/boolean token (dots already stripped to the inner letter by the tokenizer, e.g. Enum("T"); or a bare String).
member_list πŸ”’
Stringified members of a List(...) attribute (the WASM candidate array before joining), or None when the attribute is not a list or every member filters out β€” the display and the values wire field both derive from this, so they can never disagree.
property_reference_label πŸ”’
What an IfcPropertyReferenceValue reads as (#5475): the referenced object’s Name, else its Identification (an external reference, a person), else #<id> so the property still reads as present. Mirrors resolvePropertyReferenceValue in packages/parser/src/property-reference-value.ts.
resolve_complex_property_value πŸ”’
Resolve an IfcComplexProperty’s nested HasProperties (EXPRESS: [Name, Description, UsageName, HasProperties], index 3) into a display value plus a flat values candidate list, recursing into any further nested IfcComplexProperty β€” mirrors resolveComplexPropertyValue (packages/parser/src/property-complex-value.ts) member-for-member:
resolve_single_value πŸ”’
Resolve an IfcPropertySingleValue NominalValue β†’ (value string, kind, data_type), matching parsePropertyValue’s single-value branch exactly.
shared_member_type πŸ”’
The IFC type every member of a list attribute shares (IFCLABEL for (IFCLABEL('X'),IFCLABEL('Y'))), or None when a member is untyped or the types differ. Mirrors the WASM sharedMemberType (#5224).
stringify_member πŸ”’
Stringify one member of an enumerated / list value, mirroring the WASM String(v) / String(v[1]): a typed wrapper List([type, inner]) yields the inner, a scalar yields itself. None for nulls (dropped, like the TS .filter(v => v !== 'null')).
stringify_scalar πŸ”’