From 569fa49796f8d3f08be2a535e3250d167502e7aa Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 22 May 2015 13:13:16 +0000 Subject: [PATCH] Prevent an issue with obtaining precision from sub contexts --- src/ifcgeom/IfcGeomIterator.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h index 64f1d89972..c8edaf3e99 100644 --- a/src/ifcgeom/IfcGeomIterator.h +++ b/src/ifcgeom/IfcGeomIterator.h @@ -192,8 +192,15 @@ namespace IfcGeom { } } + // In case no contexts are identified based on their ContextType, all contexts are + // considered. Note that sub contexts are excluded as they are considered later on. if (filtered_contexts->size() == 0) { - filtered_contexts = contexts; + for (it = contexts->begin(); it != contexts->end(); ++it) { + IfcSchema::IfcGeometricRepresentationContext* context = *it; + if (!context->is(IfcSchema::Type::IfcGeometricRepresentationSubContext)) { + filtered_contexts->push(context); + } + } } for (it = filtered_contexts->begin(); it != filtered_contexts->end(); ++it) {