//================================================================================
/*!
- * \brief fill sub-mehses of groups
+ * \brief fill sub-meshes of groups
*/
//================================================================================
const vector<string>& famNames = g2ff->second;
if ( famNames.empty() ) continue;
std::vector<SubMesh*> famSubMeshes( famNames.size() );
+ int k = 0;
for ( size_t i = 0; i < famNames.size(); ++i )
{
int famID = _fileMesh->getFamilyId( famNames[i].c_str() );
map< int, SubMesh* >::iterator i2f = _famIDs2Sub.find( famID );
- if ( i2f == _famIDs2Sub.end() )
- THROW_IK_EXCEPTION("SauvWriter::fillGroupSubMeshes(): unknown family ID: " << famID);
- famSubMeshes[ i ] = i2f->second;
+ if ( i2f != _famIDs2Sub.end() )
+ {
+ famSubMeshes[ k ] = i2f->second;
+ ++k;
+ }
}
+ // if a family exists but has no element, no submesh has been found for this family
+ // => we have to resize famSubMeshes with the number of submeshes stored
+ if (k != famNames.size())
+ famSubMeshes.resize(k);
SubMesh* grpSubMesh = addSubMesh( groupName, famSubMeshes[0]->_dimRelExt );
grpSubMesh->_subs.swap( famSubMeshes );
}
}
+
//================================================================================
/*!
- * \brief fill sub-mehses of profiles
+ * \brief fill sub-meshes of profiles
*/
//================================================================================