From 88f62428045d4d6c1dd338dce7260e892d14ba63 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 13 Dec 2013 16:22:37 -0200 Subject: [PATCH] Allowed to enter booleans as arguments, and removed unused line that cause compilation error --- src/ifcparse/IfcUntypedEntity.cpp | 4 +++- src/ifcparse/IfcUtil.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcparse/IfcUntypedEntity.cpp b/src/ifcparse/IfcUntypedEntity.cpp index 142799a5a5..c570e132d1 100644 --- a/src/ifcparse/IfcUntypedEntity.cpp +++ b/src/ifcparse/IfcUntypedEntity.cpp @@ -71,7 +71,9 @@ void Ifc::IfcUntypedEntity::setArgument(unsigned int i, int v) { IfcUtil::ArgumentType arg_type = Ifc2x3::Type::GetAttributeType(_type,i); if (arg_type == Argument_INT) { writable_entity()->setArgument(i,v); - } else invalid_argument(i,"INT"); + } else if ( (arg_type == Argument_BOOL) && ( (v == 0) || (v == 1) ) ) { + writable_entity()->setArgument(i, (bool) v); + } else invalid_argument(i,"INT"); } void Ifc::IfcUntypedEntity::setArgument(unsigned int i, bool v) { IfcUtil::ArgumentType arg_type = Ifc2x3::Type::GetAttributeType(_type,i); diff --git a/src/ifcparse/IfcUtil.h b/src/ifcparse/IfcUtil.h index f0f26624c2..e70f4f60f0 100644 --- a/src/ifcparse/IfcUtil.h +++ b/src/ifcparse/IfcUtil.h @@ -186,7 +186,7 @@ public: inline void push(SHARED_PTR< IfcTemplatedEntityList > t) { for ( typename T::it it = t->begin(); it != t->end(); ++it ) push(*it); } inline it begin() { return ls.begin(); } inline it end() { return ls.end(); } - inline T operator[] (int i) { return ls[i]; } + //inline T operator[] (int i) { return ls[i]; } inline unsigned int Size() const { return (unsigned int) ls.size(); } IfcEntities generalize() { IfcEntities r (new IfcEntityList());