Added support for sorting the graphics contexts so that the first context/window

returned from Viewer::getContexts/getWindows will be the left most window on the lowest screen number.

Added ability for StatsHandler and HelpHandler to support end users setting their
Camera's graphics context.
This commit is contained in:
Robert Osfield
2007-04-20 16:17:48 +00:00
parent 6a67b66e8e
commit abd0c7fe67
5 changed files with 73 additions and 11 deletions

View File

@@ -33,6 +33,11 @@ class OSGVIEWER_EXPORT HelpHandler : public osgGA::GUIEventHandler
void setKeyEventTogglesOnScreenHelp(int key) { _keyEventTogglesOnScreenHelp = key; }
int getKeyEventTogglesOnScreenHelp() const { return _keyEventTogglesOnScreenHelp; }
void reset();
osg::Camera* getCamera() { return _camera.get(); }
const osg::Camera* getCamera() const { return _camera.get(); }
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
/** Get the keyboard and mouse usage of this manipulator.*/
@@ -49,6 +54,8 @@ class OSGVIEWER_EXPORT HelpHandler : public osgGA::GUIEventHandler
int _keyEventTogglesOnScreenHelp;
bool _helpEnabled;
bool _initialized;
osg::ref_ptr<osg::Camera> _camera;
osg::ref_ptr<osg::Switch> _switch;

View File

@@ -41,10 +41,15 @@ class OSGVIEWER_EXPORT StatsHandler : public osgGA::GUIEventHandler
void setKeyEventPrintsOutStats(int key) { _keyEventPrintsOutStats = key; }
int getKeyEventPrintsOutStats() const { return _keyEventPrintsOutStats; }
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
double getBlockMultiplier() const { return _blockMultiplier; }
void reset();
osg::Camera* getCamera() { return _camera.get(); }
const osg::Camera* getCamera() const { return _camera.get(); }
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
/** Get the keyboard and mouse usage of this manipulator.*/
virtual void getUsage(osg::ApplicationUsage& usage) const;
@@ -68,7 +73,10 @@ class OSGVIEWER_EXPORT StatsHandler : public osgGA::GUIEventHandler
int _keyEventPrintsOutStats;
int _statsType;
bool _initialized;
osg::ref_ptr<osg::Camera> _camera;
osg::ref_ptr<osg::Switch> _switch;
osgViewer::Viewer::ThreadingModel _threadingModel;