From 46ee00983b50b9918faddc823f383501ac44770b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 27 Jul 2011 12:17:47 +0000 Subject: [PATCH] IfcGeom: Also consider openings of IfcBuildingElementParts which are decompositions of IfcElements with IfcOpeningElements --- src/ifcparse/IfcGeomObjects.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ifcparse/IfcGeomObjects.cpp b/src/ifcparse/IfcGeomObjects.cpp index 97402dc73a..9039d261c1 100644 --- a/src/ifcparse/IfcGeomObjects.cpp +++ b/src/ifcparse/IfcGeomObjects.cpp @@ -204,6 +204,18 @@ IfcGeomObjects::IfcGeomObject* _get() { Ifc2x3::IfcElement::ptr element = reinterpret_pointer_cast(entity); openings = element->HasOpenings(); } + // Is the IfcElement a decomposition of an IfcElement with any IfcOpeningElements? + if ( entity->is(Ifc2x3::Type::IfcBuildingElementPart ) ) { + Ifc2x3::IfcBuildingElementPart::ptr part = reinterpret_pointer_cast(entity); + Ifc2x3::IfcRelDecomposes::list decomposes = part->Decomposes(); + for ( Ifc2x3::IfcRelDecomposes::it it = decomposes->begin(); it != decomposes->end(); ++ it ) { + Ifc2x3::IfcObjectDefinition::ptr obdef = (*it)->RelatingObject(); + if ( obdef->is(Ifc2x3::Type::IfcElement) ) { + Ifc2x3::IfcElement::ptr element = reinterpret_pointer_cast(obdef); + openings->push(element->HasOpenings()); + } + } + } if ( (openings && openings->Size()) || use_world_coords ) { if ( shape ) delete shape;