Expand description
INVERSE attributes by name and the entities referencing one (#462).
IfcModel::attribute_by_name resolves an INVERSE name
(IsDefinedBy) through the facade’s reverse index, with the FOR
clause of the release the header declares: IFC2X3’s IsDefinedBy holds
type and property relationships, IFC4’s only property ones beside a
separate IsTypedBy. The value has the declared shape:
- a
SETorBAGinverse,SET [0:1]included (ContainedInStructure,Decomposes), is alistofrefs in ascending id order, empty when nothing references the entity: an optional single inverse is a list of zero or one, never unwrapped; - a non-aggregate inverse (
VoidsElements, IFC2X3’sIfcGroup.IsGroupedBy) is oneref, ornullwhen nothing references the entity; two or more are refused withinvalid-model.
IfcModel::inverse_attribute_names lists the declarations,
IfcModel::inverse_references every entity referencing one with the
attribute index it references through (IfcOpenShell’s get_inverse
with indices), and IfcModel::total_inverses counts the distinct
referrers (get_total_inverses).
The index is built on the first such read and again only after the
model changes, so a host reading many inverses pays one pass. An
INVERSE name holds no slot: a write to one is refused with
inverse-attribute.
Structs§
- Inverse
Attribute Info - One
INVERSEattribute of an entity, as its declared release defines it. - Inverse
Reference - One reference to an entity: who holds it and in which attribute.