/* 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 void setPaused(bool value){_paused = value;} virtual bool timestepChanged(); virtual bool toggleWireframe(); virtual bool toggleCulling(); virtual bool toggleRecording(); virtual bool togglePlayback(); virtual bool toggleSave(); 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, _toggleculling; bool _togglerecording, _toggleplayback, _togglesave; }; #endif // KEYBOARDEVENTHANDLER_H