From 59d768bcb012beacb2806d47bd122a66e9fc3649 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 19 Oct 2011 12:52:18 +0000 Subject: [PATCH] No longer skips IfcShapeRepresentations if they're linked to an IfcProduct via an IfcProductRepresentation rather than an IfcProductDefinitionShape --- src/ifcgeom/IfcGeomObjects.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ifcgeom/IfcGeomObjects.cpp b/src/ifcgeom/IfcGeomObjects.cpp index b2f1d57d22..ec77eb313c 100644 --- a/src/ifcgeom/IfcGeomObjects.cpp +++ b/src/ifcgeom/IfcGeomObjects.cpp @@ -190,6 +190,17 @@ IfcGeomObjects::IfcGeomObject* _get() { if ( (*it)->is(Ifc2x3::Type::IfcProductDefinitionShape) ) { Ifc2x3::IfcProductDefinitionShape::ptr pds = reinterpret_pointer_cast(*it); entities->push(pds->ShapeOfProduct()); + } else { + // http://buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcrepresentationresource/lexical/ifcproductrepresentation.htm + // IFC2x Edition 3 NOTE Users should not instantiate the entity IfcProductRepresentation from IFC2x Edition 3 onwards. + // It will be changed into an ABSTRACT supertype in future releases of IFC. + + // IfcProductRepresentation also lacks the INVERSE relation to IfcProduct + // Let's find the IfcProducts that reference the IfcProductRepresentation anyway + IfcEntities products = (*it)->entity->getInverse(Ifc2x3::Type::IfcProduct); + for ( IfcEntityList::it it = products->begin(); it != products->end(); ++ it ) { + entities->push(reinterpret_pointer_cast(*it)); + } } } // Does this representation have any IfcProducts?