# IFC: add workaround to read malformed files that contain IFCSIUNIT elements with the first field not set, which is not allowed by the IFC2X3 specification.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1013 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2011-05-30 14:52:39 +00:00
parent ccd4a9d78d
commit af8533a0bf
1 changed files with 5 additions and 1 deletions

View File

@ -1748,7 +1748,11 @@ template <> size_t GenericFill<IfcNamedUnit>(const DB& db, const LIST& params, I
if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument
const DataType* arg = params[base++];
if (dynamic_cast<const ISDERIVED*>(&*arg)) { in->ObjectHelper<Assimp::IFC::IfcNamedUnit,2>::aux_is_derived[0]=true; break; }
try { GenericConvert( in->Dimensions, *arg, db ); break; }
if (dynamic_cast<const UNSET*>(&*arg)) {
// (hack) allow this - I found some Ifc files which violate the spec here
break;
}
try { GenericConvert( in->Dimensions, *arg, db ); break; }
catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcNamedUnit to be a `IfcDimensionalExponents`")); }
} while(0);
do { // convert the 'UnitType' argument