@@ -119,7 +119,7 @@ typename V::list::ptr get_related(T* t, F f, G g) {
119119 typename V::list::ptr acc (new typename V::list);
120120 for (typename U::list::it it = li->begin (); it != li->end (); ++it) {
121121 U* u = *it;
122- acc->push ((*u.*g)());
122+ acc->push ((*u.*g)()-> as <V>() );
123123 }
124124 return acc;
125125}
@@ -142,9 +142,15 @@ void descend(IfcProduct* product, ptree& tree) {
142142 }
143143 }
144144
145+ #ifdef USE_IFC2x3
145146 IfcObjectDefinition::list::ptr structures = get_related
146147 <IfcProduct, IfcRelDecomposes, IfcObjectDefinition>
147148 (product, &IfcProduct::IsDecomposedBy, &IfcRelDecomposes::RelatedObjects);
149+ #else
150+ IfcObjectDefinition::list::ptr structures = get_related
151+ <IfcProduct, IfcRelAggregates, IfcObjectDefinition>
152+ (product, &IfcProduct::IsDecomposedBy, &IfcRelAggregates::RelatedObjects);
153+ #endif
148154
149155 for (IfcObjectDefinition::list::it it = structures->begin (); it != structures->end (); ++it) {
150156 IfcObjectDefinition* ob = *it;
@@ -172,9 +178,15 @@ template <>
172178void descend (IfcProject* project, ptree& tree) {
173179 ptree& child = format_entity_instance (project, tree);
174180
181+ #ifdef USE_IFC2x3
175182 IfcObjectDefinition::list::ptr structures = get_related
176183 <IfcProject, IfcRelDecomposes, IfcObjectDefinition>
177184 (project, &IfcProject::IsDecomposedBy, &IfcRelDecomposes::RelatedObjects);
185+ #else
186+ IfcObjectDefinition::list::ptr structures = get_related
187+ <IfcProject, IfcRelAggregates, IfcObjectDefinition>
188+ (project, &IfcProduct::IsDecomposedBy, &IfcRelAggregates::RelatedObjects);
189+ #endif
178190
179191 for (IfcObjectDefinition::list::it it = structures->begin (); it != structures->end (); ++it) {
180192 IfcObjectDefinition* ob = *it;
0 commit comments