BLENDER: Fix potential stack overflow caused by a DOM object referencing itself.

Add general infrastructure to apply modifiers.
Implement mirror and subdivision modifiers using existing stuff.
Update BlenderDNA with related structures.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@763 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2010-07-07 14:50:19 +00:00
parent 393a08943b
commit d082330cea
30 changed files with 1621 additions and 10305 deletions

View File

@@ -274,12 +274,25 @@ boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
const FileDatabase& db
) const
{
std::map<std::string, ConvertProcPtr>::const_iterator it = converters.find(structure.name);
std::map<std::string, FactoryPair >::const_iterator it = converters.find(structure.name);
if (it == converters.end()) {
return boost::shared_ptr< ElemBase >();
}
return (structure.*((*it).second))(db);
boost::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
(structure.*((*it).second.second))(ret,db);
return ret;
}
// ------------------------------------------------------------------------------------------------
DNA::FactoryPair DNA :: GetBlobToStructureConverter(
const Structure& structure,
const FileDatabase& db
) const
{
std::map<std::string, FactoryPair>::const_iterator it = converters.find(structure.name);
return it == converters.end() ? FactoryPair(NULL,NULL) : (*it).second;
}
// basing on http://www.blender.org/development/architecture/notes-on-sdna/