/* SWWViewer An OpenSceneGraph viewer for pyVolution SWW files. copyright (C) 2004 Geoscience Australia */ #ifndef KEYBOARDEVENTHANDLER_H #define KEYBOARDEVENTHANDLER_H #include #include class KeyboardEventHandler : public osgGA::GUIEventHandler { public: KeyboardEventHandler( int nTimesteps, float tps); virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&); virtual void accept(osgGA::GUIEventHandlerVisitor&) {} virtual bool isPaused(){return _paused;} virtual bool timestepChanged(); virtual bool toggleWireframe(); virtual int getTimestep(){return (unsigned int) _timestep;} virtual void setTime(float time); private: int _direction, _timestep, _ntimesteps; float _tps, _prevtime, _tpsorig; bool _paused, _timestepchanged, _togglewireframe; }; #endif // KEYBOARDEVENTHANDLER_H