Fix bug in IfcHierarchyHelper.addRelatedObject

Noticed that `file.addRelatedObject<IfcSchema::IfcRelDefinesByType>(door_style, door);` was resulting in list with `door` assigned as RelatingObject and `door_style` assigned as RelatedObjects.
This commit is contained in:
Andrej730
2024-02-07 16:56:06 +05:00
parent 4418c1327d
commit 9560e0b3b2
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -453,8 +453,8 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
}
int relating_index = 4;
int related_index = 5;
if (T::Class().name() == "IfcRelContainedInSpatialStructure") {
// IfcRelContainedInSpatialStructure has attributes reversed.
if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of<Schema::IfcRelDefines, T>::value) {
// some classes have attributes reversed.
std::swap(relating_index, related_index);
}
{