Fix for empty shape reps

This commit is contained in:
Thomas Krijnen
2014-02-26 10:56:22 +01:00
parent 357357ad78
commit ba7eec2c0b
+3 -1
View File
@@ -572,7 +572,7 @@ std::string IfcGeom::create_brep_data(Ifc2x3::IfcProduct* ifc_product) {
Ifc2x3::IfcProductRepresentation* prod_rep = ifc_product->Representation();
Ifc2x3::IfcRepresentation::list li = prod_rep->Representations();
Ifc2x3::IfcShapeRepresentation* shape_rep;
Ifc2x3::IfcShapeRepresentation* shape_rep = 0;
for (Ifc2x3::IfcRepresentation::it i = li->begin(); i != li->end(); ++i) {
const std::string representation_identifier = (*i)->RepresentationIdentifier();
if ((*i)->is(Ifc2x3::Type::IfcShapeRepresentation) && (representation_identifier == "Body" || representation_identifier == "Facetation")) {
@@ -581,6 +581,8 @@ std::string IfcGeom::create_brep_data(Ifc2x3::IfcProduct* ifc_product) {
}
}
if (!shape_rep) return "";
IfcGeom::IfcRepresentationShapeItems shapes;
if (!IfcGeom::convert_shapes(shape_rep,shapes)) {
return "";