From 9a4209c61b9ae2e25835c7cba0ed06ac1ea458c3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 5 Jan 2007 16:48:04 +0000 Subject: [PATCH] Simplified the nameing of updateTraversal etc methods --- include/osgViewer/SimpleViewer | 9 ++++----- include/osgViewer/Viewer | 11 ++++++----- src/osgViewer/SimpleViewer.cpp | 21 ++++++++------------- src/osgViewer/Viewer.cpp | 16 ++++++++-------- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/include/osgViewer/SimpleViewer b/include/osgViewer/SimpleViewer index f5ed4bc4c..b2db9abb0 100644 --- a/include/osgViewer/SimpleViewer +++ b/include/osgViewer/SimpleViewer @@ -63,11 +63,10 @@ class OSGVIEWER_EXPORT SimpleViewer : public virtual osgViewer::GraphicsWindow * Note, no internal makeCurrent() is issued before, or swap buffers called after frame(), these operations are the responsibility of the calling code.*/ virtual void frame(); - virtual void frameAdvance(); - virtual void frameEventTraversal(); - virtual void frameUpdateTraversal(); - virtual void frameCullTraversal(); - virtual void frameDrawTraversal(); + virtual void advance(); + virtual void eventTraversal(); + virtual void updateTraversal(); + virtual void renderingTraversal(); /** Release all OpenGL objects associated with this viewer's scenegraph. Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained.*/ virtual void releaseAllGLObjects(); diff --git a/include/osgViewer/Viewer b/include/osgViewer/Viewer index 895392fed..571743b17 100644 --- a/include/osgViewer/Viewer +++ b/include/osgViewer/Viewer @@ -69,16 +69,17 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View virtual int run(); /** Render a complete new frame. - * Calls frameAdvance(), frameEventTraversal(), frameUpateTraversal(), frameRenderingTraversals(). */ + * Calls advance(), eventTraversal(), updateTraversal(), renderingTraversals(). */ virtual void frame(); - virtual void frameAdvance(); + virtual void advance(); - virtual void frameEventTraversal(); + virtual void eventTraversal(); - virtual void frameUpdateTraversal(); + virtual void updateTraversal(); - virtual void frameRenderingTraversals(); + virtual void renderingTraversals(); + /** Release all OpenGL objects associated with this viewer's scenegraph. Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained.*/ virtual void releaseAllGLObjects(); diff --git a/src/osgViewer/SimpleViewer.cpp b/src/osgViewer/SimpleViewer.cpp index b8823cf89..35a07ea1b 100644 --- a/src/osgViewer/SimpleViewer.cpp +++ b/src/osgViewer/SimpleViewer.cpp @@ -126,14 +126,13 @@ void SimpleViewer::frame() _firstFrame = false; } - frameAdvance(); - frameEventTraversal(); - frameUpdateTraversal(); - frameCullTraversal(); - frameDrawTraversal(); + advance(); + eventTraversal(); + updateTraversal(); + renderingTraversal(); } -void SimpleViewer::frameAdvance() +void SimpleViewer::advance() { _frameStamp->setReferenceTime(osg::Timer::instance()->time_s()); _frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1); @@ -141,7 +140,7 @@ void SimpleViewer::frameAdvance() _sceneView->setFrameStamp(_frameStamp.get()); } -void SimpleViewer::frameEventTraversal() +void SimpleViewer::eventTraversal() { _eventQueue->frame( _frameStamp->getReferenceTime() ); @@ -185,7 +184,7 @@ void SimpleViewer::frameEventTraversal() } } -void SimpleViewer::frameUpdateTraversal() +void SimpleViewer::updateTraversal() { double previousAspectRatio = ( static_cast(_sceneView->getViewport()->width())/ static_cast(_sceneView->getViewport()->height()) ); @@ -245,13 +244,9 @@ void SimpleViewer::frameUpdateTraversal() _sceneView->update(); } -void SimpleViewer::frameCullTraversal() +void SimpleViewer::renderingTraversal() { _sceneView->cull(); -} - -void SimpleViewer::frameDrawTraversal() -{ _sceneView->draw(); if (_databasePager.valid()) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index d530c6f44..5c3cd0257 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -529,14 +529,14 @@ void Viewer::frame() _firstFrame = false; } - frameAdvance(); + advance(); - frameEventTraversal(); - frameUpdateTraversal(); - frameRenderingTraversals(); + eventTraversal(); + updateTraversal(); + renderingTraversals(); } -void Viewer::frameAdvance() +void Viewer::advance() { if (_done) return; @@ -545,7 +545,7 @@ void Viewer::frameAdvance() _scene->frameAdvance(); } -void Viewer::frameEventTraversal() +void Viewer::eventTraversal() { if (_done) return; @@ -802,7 +802,7 @@ void Viewer::frameEventTraversal() } -void Viewer::frameUpdateTraversal() +void Viewer::updateTraversal() { if (_done) return; @@ -816,7 +816,7 @@ void Viewer::frameUpdateTraversal() updateSlaves(); } -void Viewer::frameRenderingTraversals() +void Viewer::renderingTraversals() { // check to see if windows are still valid checkWindowStatus();