From f7ce35c5eeb0037943fe4cc4cf908d39051bdb0d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 13 Jul 2007 19:24:50 +0000 Subject: [PATCH] Converted Operations to GraphicsOperations where apporpriate. --- include/osgViewer/View | 2 +- src/osgViewer/Viewer.cpp | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/osgViewer/View b/include/osgViewer/View index 066dff56a..cb3dfe925 100644 --- a/include/osgViewer/View +++ b/include/osgViewer/View @@ -195,7 +195,7 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter EventHandlers _eventHandlers; typedef std::vector< osg::observer_ptr > ObserverNodePath; - ObserverNodePath _coordinateSystemNodePath; + ObserverNodePath _coordinateSystemNodePath; osg::ref_ptr _displaySettings; osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode; diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 8278c2aba..7bd65df9f 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -128,10 +128,10 @@ public: // Draw operation, that does a draw on the scene graph. -struct ViewerRenderingOperation : public osg::Operation, public ViewerQuerySupport +struct ViewerRenderingOperation : public osg::GraphicsOperation, public ViewerQuerySupport { ViewerRenderingOperation(osgUtil::SceneView* sceneView, osgDB::DatabasePager* databasePager, osg::Timer_t startTick): - osg::Operation("Render",true), + osg::GraphicsOperation("Render",true), ViewerQuerySupport(startTick), _sceneView(sceneView), _databasePager(databasePager) @@ -141,7 +141,7 @@ struct ViewerRenderingOperation : public osg::Operation, public ViewerQuerySuppo osg::Camera* getCamera() { return _sceneView->getCamera(); } - virtual void operator () (osg::Object*) + virtual void operator () (osg::GraphicsContext*) { if (!_sceneView) return; @@ -989,19 +989,16 @@ void Viewer::stopThreading() } // Compile operation, that compile OpenGL objects. -struct ViewerCompileOperation : public osg::Operation +struct ViewerCompileOperation : public osg::GraphicsOperation { ViewerCompileOperation(osg::Node* scene): - osg::Operation("Compile",false), + osg::GraphicsOperation("Compile",false), _scene(scene) { } - virtual void operator () (osg::Object* object) + virtual void operator () (osg::GraphicsContext* context) { - osg::GraphicsContext* context = dynamic_cast(object); - if (!context) return; - // OpenThreads::ScopedLock lock(mutex); // osg::notify(osg::NOTICE)<<"Compile "<(object); - if (!context) return; - context->runOperations(); } };