mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Fixes to HierarchyHelper #6365
This commit is contained in:
@@ -411,9 +411,9 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
for (typename Schema::IfcRelDefinesByType::list::it i = li->begin(); i != li->end(); ++i) {
|
for (typename Schema::IfcRelDefinesByType::list::it i = li->begin(); i != li->end(); ++i) {
|
||||||
typename Schema::IfcRelDefinesByType* rel = *i;
|
typename Schema::IfcRelDefinesByType* rel = *i;
|
||||||
if (rel->RelatingType() == related_object) {
|
if (rel->RelatingType() == relating_object) {
|
||||||
typename Schema::IfcObject::list::ptr objects = rel->RelatedObjects();
|
typename Schema::IfcObject::list::ptr objects = rel->RelatedObjects();
|
||||||
objects->push((typename Schema::IfcObject*)related_object);
|
objects->push(addEntity(related_object)->template as<typename Schema::IfcObject>());
|
||||||
rel->setRelatedObjects(objects);
|
rel->setRelatedObjects(objects);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@@ -427,8 +427,8 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
|
|||||||
owner_hist = addOwnerHistory();
|
owner_hist = addOwnerHistory();
|
||||||
}
|
}
|
||||||
typename Schema::IfcObject::list::ptr related_objects(new aggregate_of<typename Schema::IfcObject>());
|
typename Schema::IfcObject::list::ptr related_objects(new aggregate_of<typename Schema::IfcObject>());
|
||||||
related_objects->push((typename Schema::IfcObject*)related_object);
|
related_objects->push(related_object->template as<typename Schema::IfcObject>());
|
||||||
typename Schema::IfcRelDefinesByType* t = new typename Schema::IfcRelDefinesByType(IfcParse::IfcGlobalId(), owner_hist, boost::none, boost::none, related_objects, related_object->template as<typename Schema::IfcTypeObject>());
|
typename Schema::IfcRelDefinesByType* t = new typename Schema::IfcRelDefinesByType(IfcParse::IfcGlobalId(), owner_hist, boost::none, boost::none, related_objects, relating_object->template as<typename Schema::IfcTypeObject>());
|
||||||
|
|
||||||
addEntity(t);
|
addEntity(t);
|
||||||
}
|
}
|
||||||
@@ -440,7 +440,7 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
|
|||||||
try {
|
try {
|
||||||
if (get_parent_of_relation(rel) == relating_object) {
|
if (get_parent_of_relation(rel) == relating_object) {
|
||||||
aggregate_of_instance::ptr products = get_children_of_relation(rel);
|
aggregate_of_instance::ptr products = get_children_of_relation(rel);
|
||||||
products->push(related_object);
|
products->push(addEntity(related_object));
|
||||||
set_children_of_relation(rel, products);
|
set_children_of_relation(rel, products);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user