refactor common code from CompositeViewer::checkNeedToDoFrame() and Viewer::checkNeedToDoFrame() into View

This commit is contained in:
Philippe Renon
2016-06-11 16:58:51 +02:00
parent 15e9484ff2
commit 37ef07ce7e
4 changed files with 25 additions and 26 deletions

View File

@@ -1130,6 +1130,23 @@ void View::removeDevice(osgGA::Device* eventSource)
}
}
bool View::requiresUpdateSceneGraph() const
{
// check if the database pager needs to update the scene
if (getDatabasePager()->requiresUpdateSceneGraph() || getDatabasePager()->getRequestsInProgress()) return true;
// check if there are camera update callbacks
if (_camera->getUpdateCallback()) return true;
// check if there are node update callbacks
if (getSceneData() != 0)
{
if (getSceneData()->getUpdateCallback() || (getSceneData()->getNumChildrenRequiringUpdateTraversal()>0)) return true;
}
return false;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Methods that support Stereo and Keystone correction.