diff --git a/src/ifcparse/IfcHierarchyHelper.h b/src/ifcparse/IfcHierarchyHelper.h index b8ad5d7a21..f5d52b62ce 100644 --- a/src/ifcparse/IfcHierarchyHelper.h +++ b/src/ifcparse/IfcHierarchyHelper.h @@ -78,8 +78,8 @@ public: double xx=1.0, double xy=0.0, double xz=0.0); template - void addRelatedObject(IfcSchema::IfcObjectDefinition* related_object, - IfcSchema::IfcObjectDefinition* relating_object, IfcSchema::IfcOwnerHistory* owner_hist = 0) + void addRelatedObject(IfcSchema::IfcObjectDefinition* relating_object, + IfcSchema::IfcObjectDefinition* related_object, IfcSchema::IfcOwnerHistory* owner_hist = 0) { typename T::list::ptr li = entitiesByType(); bool found = false; @@ -100,9 +100,9 @@ public: if (! owner_hist) { owner_hist = addOwnerHistory(); } - IfcSchema::IfcObjectDefinition::list::ptr relating_objects (new IfcTemplatedEntityList()); - relating_objects->push(relating_object); - T* t = new T(IfcParse::IfcGlobalId(), owner_hist, boost::none, boost::none, related_object, relating_objects); + IfcSchema::IfcObjectDefinition::list::ptr related_objects (new IfcTemplatedEntityList()); + related_objects->push(related_object); + T* t = new T(IfcParse::IfcGlobalId(), owner_hist, boost::none, boost::none, relating_object, related_objects); addEntity(t); } } @@ -174,14 +174,14 @@ private: }; template <> -inline void IfcHierarchyHelper::addRelatedObject (IfcSchema::IfcObjectDefinition* related_object, - IfcSchema::IfcObjectDefinition* relating_object, IfcSchema::IfcOwnerHistory* owner_hist) +inline void IfcHierarchyHelper::addRelatedObject (IfcSchema::IfcObjectDefinition* relating_structure, + IfcSchema::IfcObjectDefinition* related_object, IfcSchema::IfcOwnerHistory* owner_hist) { IfcSchema::IfcRelContainedInSpatialStructure::list::ptr li = entitiesByType(); bool found = false; for (IfcSchema::IfcRelContainedInSpatialStructure::list::it i = li->begin(); i != li->end(); ++i) { IfcSchema::IfcRelContainedInSpatialStructure* rel = *i; - if (rel->RelatingStructure() == relating_object) { + if (rel->RelatingStructure() == relating_structure) { IfcSchema::IfcProduct::list::ptr products = rel->RelatedElements(); products->push((IfcSchema::IfcProduct*)related_object); rel->setRelatedElements(products); @@ -196,10 +196,10 @@ inline void IfcHierarchyHelper::addRelatedObject ()); - relating_objects->push((IfcSchema::IfcProduct*)relating_object); + IfcSchema::IfcProduct::list::ptr related_objects (new IfcTemplatedEntityList()); + related_objects->push((IfcSchema::IfcProduct*)related_object); IfcSchema::IfcRelContainedInSpatialStructure* t = new IfcSchema::IfcRelContainedInSpatialStructure(IfcParse::IfcGlobalId(), owner_hist, - boost::none, boost::none, relating_objects, (IfcSchema::IfcSpatialStructureElement*)related_object); + boost::none, boost::none, related_objects, (IfcSchema::IfcSpatialStructureElement*)relating_structure); addEntity(t); }