Added new areThreadsRunning() method to Viewer and CompositeViewer.

Added removeView(View*) method to CompositeViewer

Added stopping/starting of threads in addView/removeView
This commit is contained in:
Robert Osfield
2007-05-11 19:25:44 +00:00
parent acb2ed177c
commit 1cb4dfbcb5
3 changed files with 40 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ class OSGVIEWER_EXPORT CompositeViewer : public osg::Referenced
virtual ~CompositeViewer();
void addView(osgViewer::View* view);
void removeView(osgViewer::View* view);
osgViewer::View* getView(unsigned i) { return _views[i].get(); }
const osgViewer::View* getView(unsigned i) const { return _views[i].get(); }
@@ -144,6 +145,9 @@ class OSGVIEWER_EXPORT CompositeViewer : public osg::Referenced
/** Get the graphics operation to call on realization of the viewers graphics windows.*/
osg::Operation* getRealizeOperation() { return _realizeOperation.get(); }
/** Return true if viewer threads are running. */
bool areThreadsRunning() const { return _threadsRunning; }
/** Stop any threads begin run by viewer.*/
void stopThreading();
@@ -169,6 +173,8 @@ class OSGVIEWER_EXPORT CompositeViewer : public osg::Referenced
bool _quitEventSetsDone;
ThreadingModel _threadingModel;
bool _threadsRunning;
BarrierPosition _endBarrierPosition;
osg::ref_ptr<osg::BarrierOperation> _startRenderingBarrier;

View File

@@ -151,6 +151,9 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View
/** Set up the threading and processor affinity as per the viewers threading model.*/
void setUpThreading();
/** Return true if viewer threads are running. */
bool areThreadsRunning() const { return _threadsRunning; }
/** Stop any threads begin run by viewer.*/
void stopThreading();