Moved the updating and expiry of the Registry object cache from DatabasePager into osgViewer::Viewer/CompositeViewer.

This commit is contained in:
Robert Osfield
2009-08-05 11:06:53 +00:00
parent 2f3dfc4349
commit df9385ac19
7 changed files with 76 additions and 69 deletions

View File

@@ -1037,27 +1037,18 @@ void CompositeViewer::updateTraversal()
++sitr)
{
Scene* scene = *sitr;
if (scene->getSceneData())
{
_updateVisitor->setImageRequestHandler(scene->getImagePager());
scene->getSceneData()->accept(*_updateVisitor);
}
if (scene->getDatabasePager())
{
// synchronize changes required by the DatabasePager thread to the scene graph
scene->getDatabasePager()->updateSceneGraph(*_frameStamp);
}
if (scene->getImagePager())
{
// synchronize changes required by the DatabasePager thread to the scene graph
scene->getImagePager()->updateSceneGraph(*_frameStamp);
}
scene->updateSceneGraph(*_updateVisitor);
}
// if we have a shared state manager prune any unused entries
if (osgDB::Registry::instance()->getSharedStateManager())
osgDB::Registry::instance()->getSharedStateManager()->prune();
// update the Registry object cache.
osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
osgDB::Registry::instance()->removeExpiredObjectsInCache(*getFrameStamp());
if (_incrementalCompileOperation.valid())
{
// merge subgraphs that have been compiled by the incremental compiler operation.