From Stephan Huber, add basic support for CompositeViewer in StatsHandler

This commit is contained in:
Robert Osfield
2007-09-29 11:41:57 +00:00
parent 41ce67600e
commit 4ef1864432
8 changed files with 226 additions and 130 deletions

View File

@@ -175,6 +175,12 @@ class OSGVIEWER_EXPORT View : public osg::View, public osgGA::GUIActionAdapter
virtual void requestRedraw();
virtual void requestContinuousUpdate(bool needed=true);
virtual void requestWarpPointer(float x,float y);
typedef std::vector<osg::Camera*> Cameras;
void getCameras(Cameras& cameras, bool onlyActive=true);
typedef std::vector<osg::GraphicsContext*> Contexts;
void getContexts(Contexts& contexts, bool onlyValid=true);
public:

View File

@@ -180,14 +180,8 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View
osg::Camera* getCameraWithFocus() { return _cameraWithFocus.get(); }
const osg::Camera* getCameraWithFocus() const { return _cameraWithFocus.get(); }
typedef std::vector<osg::GraphicsContext*> Contexts;
void getContexts(Contexts& contexts, bool onlyValid=true);
typedef std::vector<osgViewer::GraphicsWindow*> Windows;
void getWindows(Windows& windows, bool onlyValid=true);
typedef std::vector<osg::Camera*> Cameras;
void getCameras(Cameras& cameras, bool onlyActive=true);
typedef std::vector<OpenThreads::Thread*> Threads;
void getAllThreads(Threads& threads, bool onlyActive=true);

View File

@@ -101,7 +101,7 @@ class OSGVIEWER_EXPORT StatsHandler : public osgGA::GUIEventHandler
protected:
void setUpHUDCamera(osgViewer::Viewer* viewer);
void setUpHUDCamera(osgViewer::View* view);
osg::Geometry* createGeometry(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numBlocks);
@@ -111,7 +111,7 @@ class OSGVIEWER_EXPORT StatsHandler : public osgGA::GUIEventHandler
osg::Node* createCameraStats(const std::string& font, osg::Vec3& pos, float startBlocks, bool aquireGPUStats, float characterSize, osg::Stats* viewerStats, osg::Camera* camera);
void setUpScene(osgViewer::Viewer* viewer);
void setUpScene(osgViewer::View* view);
void updateThreadingModelText();
@@ -125,7 +125,7 @@ class OSGVIEWER_EXPORT StatsHandler : public osgGA::GUIEventHandler
osg::ref_ptr<osg::Switch> _switch;
osgViewer::Viewer::ThreadingModel _threadingModel;
unsigned int _threadingModel;
osg::ref_ptr<osgText::Text> _threadingModelText;
unsigned int _frameRateChildNum;