Added support for heterogenous metadata on the aiNodes.

This commit is contained in:
Frederik Aalund
2014-03-14 14:17:34 +01:00
parent 9af1dfd48d
commit a8401ba377
3 changed files with 174 additions and 55 deletions

View File

@@ -726,16 +726,12 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const IfcProduct& el, Conversion
aiMetadata* data = new aiMetadata();
data->mNumProperties = properties.size();
data->mKeys = new aiString[data->mNumProperties]();
data->mValues = new aiString[data->mNumProperties]();
data->mValues = new aiMetaDataEntry[data->mNumProperties]();
unsigned int index = 0;
BOOST_FOREACH(const Metadata::value_type& kv, properties)
data->Set(index++, kv.first, aiString(kv.second));
unsigned int i = 0;
BOOST_FOREACH(const Metadata::value_type& kv, properties) {
data->mKeys[i].Set(kv.first);
if (kv.second.length() > 0) {
data->mValues[i].Set(kv.second);
}
++i;
}
nd->mMetaData = data;
}
}