osgDB Wrapper Associates Revision Tagging
This commit is contained in:
committed by
Robert Osfield
parent
dcac0c1611
commit
2ac8379cfc
@@ -905,26 +905,36 @@ osg::ref_ptr<osg::Object> InputStream::readObjectFields( const std::string& clas
|
||||
<< className << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
int inputVersion = getFileVersion(wrapper->getDomain());
|
||||
|
||||
osg::ref_ptr<osg::Object> obj = existingObj ? existingObj : wrapper->createInstance();
|
||||
_identifierMap[id] = obj;
|
||||
if ( obj.valid() )
|
||||
{
|
||||
const StringList& associates = wrapper->getAssociates();
|
||||
for ( StringList::const_iterator itr=associates.begin(); itr!=associates.end(); ++itr )
|
||||
const ObjectWrapper::RevisionAssociateList& associates = wrapper->getAssociates();
|
||||
for ( ObjectWrapper::RevisionAssociateList::const_iterator itr=associates.begin(); itr!=associates.end(); ++itr )
|
||||
{
|
||||
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(*itr);
|
||||
if ( !assocWrapper )
|
||||
if ( itr->_firstVersion <= inputVersion &&
|
||||
inputVersion <= itr->_lastVersion)
|
||||
{
|
||||
OSG_WARN << "InputStream::readObject(): Unsupported associated class "
|
||||
<< *itr << std::endl;
|
||||
continue;
|
||||
}
|
||||
_fields.push_back( assocWrapper->getName() );
|
||||
assocWrapper->read( *this, *obj );
|
||||
if ( getException() ) return NULL;
|
||||
ObjectWrapper* assocWrapper = Registry::instance()->getObjectWrapperManager()->findWrapper(itr->_name);
|
||||
if ( !assocWrapper )
|
||||
{
|
||||
OSG_WARN << "InputStream::readObject(): Unsupported associated class "
|
||||
<< itr->_name << std::endl;
|
||||
continue;
|
||||
}
|
||||
_fields.push_back( assocWrapper->getName() );
|
||||
assocWrapper->read( *this, *obj );
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
_fields.pop_back();
|
||||
_fields.pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* OSG_INFO << "InputStream::readObject():"<<className<<" Ignoring associated class due to version mismatch"
|
||||
<< itr->_name<<"["<<itr->_firstVersion <<","<<itr->_lastVersion <<"]for version "<<inputVersion<< std::endl;*/
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
|
||||
Reference in New Issue
Block a user