OpenSceneGraph/include/osgProducer/ViewerEventHandler

73 lines
2.3 KiB
Plaintext
Raw Normal View History

/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGPRODUCER_VIEWEREVENTHANDLER
#define OSGPRODUCER_VIEWEREVENTHANDLER 1
#include <osgGA/GUIEventHandler>
#include <osgProducer/Viewer>
namespace osgProducer {
class ViewerEventHandler : public osgGA::GUIEventHandler
{
public:
ViewerEventHandler(OsgCameraGroup* cg);
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa);
virtual void accept(osgGA::GUIEventHandlerVisitor& gehv);
/** Get the keyboard and mouse usage of this manipulator.*/
virtual void getUsage(osg::ApplicationUsage& usage) const;
OsgCameraGroup* getOsgCameraGroup() { return _cg; }
const OsgCameraGroup* getOsgCameraGroup() const { return _cg; }
void setWriteNodeFileName(const std::string& filename) { _writeNodeFileName = filename; }
const std::string& getWriteNodeFileName() const { return _writeNodeFileName; }
void setDisplayHelp(bool displayHelp) { _displayHelp = displayHelp; }
2003-03-27 00:48:29 +08:00
bool getDisplayHelp() const { return _displayHelp; }
2003-03-27 00:48:29 +08:00
enum FrameStatsMode
{
NO_STATS = 0,
FRAME_RATE = 1,
CAMERA_STATS = 2
};
void setFrameStatsMode(FrameStatsMode mode) { _frameStatsMode = mode; }
FrameStatsMode getFrameStatsMode() { return _frameStatsMode; }
protected:
osgProducer::OsgCameraGroup* _cg;
std::string _writeNodeFileName;
2003-03-27 00:48:29 +08:00
bool _displayHelp;
FrameStatsMode _frameStatsMode;
bool _firstTimeTogglingFullScreen;
};
}
#endif